Hello everyone!
I need help solving this problem:
I would like to insert in the home page of appgini (I refer to the page visible before login and not to the visible one once logged in!) the table view of a specific table visible to people not logged in.
Is there a way to customize the hook file and get this result?
Here is a simulation of what I would like to do:
now:
my goal:
Thanks!
Fabiano
Insert the table view of a table on the home page.
Re: Insert the table view of a table on the home page.
Is it something like this you are trying to create?
App HOME PAGE:
I managed this with a small adhoc mod to home.php using an iframe (it would get overwritten unless you make it read only or, as I do, make a saved copy and use file compare after each app generation and copy across the mods again). Plus I add 1 line to header-extras. It seems to work ok in the test I did.
If it's what you are after let me know and I put the details up.
Cheers,
Ron
App HOME PAGE:
I managed this with a small adhoc mod to home.php using an iframe (it would get overwritten unless you make it read only or, as I do, make a saved copy and use file compare after each app generation and copy across the mods again). Plus I add 1 line to header-extras. It seems to work ok in the test I did.
If it's what you are after let me know and I put the details up.
Cheers,
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Insert the table view of a table on the home page.
Yes! That's exactly what I was looking for! I await the details of the code to implement this solution!
Thank you so much!!!
Fabiano
Thank you so much!!!
Fabiano
Re: Insert the table view of a table on the home page.
Ok, this is what I did (there probably is another other coding way)
MOD to header.php
MOD to hooks/header-extras
Naturallly the table in iframe will run within the iframe. You can depending on your needs, choose to show or hide the button for the iframe table view on homepage and/or nav menu.
Hope this does what you need.
Cheers, Ron
MOD to header.php
Code: Select all
<!-- ***** ADD FOLLOWING TO TOP OF HEADER.PHP ***** -->
<style>
body {margin-top:-100px !important;}
<!-- EFFECTIVELY SHIFTS IFRAME UNDER MAIN HEADER adjust -100px to suit
Note if you have 'enable zooming' on your table thumbnail image then edit to suit
making sure pop-up image is not under the showing page header-->
</style>
<style>
footer {display:none;}
<!-- might not be needed, worked with/without in my example test -->
</style>
<!-- ***** NOW ADD IFRAME AT LINE 55 BELOW ***** -->
<?php
if(!isset($Translation)) { @header('Location: index.php'); exit; }
$currDir = dirname(__FILE__);
include_once("{$currDir}/header.php");
@include("{$currDir}/hooks/links-home.php");
/*
Classes of first and other blocks
---------------------------------
For possible classes, refer to the Bootstrap grid columns, panels and buttons documentation:
Grid columns: http://getbootstrap.com/css/#grid
Panels: http://getbootstrap.com/components/#panels
Buttons: http://getbootstrap.com/css/#buttons
*/
$block_classes = array(
'first' => array(
'grid_column' => 'col-sm-6 col-md-4 col-lg-3',
'panel' => 'panel-warning',
'link' => 'btn-warning'
),
'other' => array(
'grid_column' => 'col-sm-6 col-md-4 col-lg-3',
'panel' => 'panel-info',
'link' => 'btn-info'
)
);
?>
<style>
.panel-body-description{
margin-top: 10px;
height: auto;
overflow: auto;
}
.panel-body .btn img{
margin: 0 10px;
max-height: 32px;
}
</style>
<!-- ***** ADD IFRAME IN HERE ***** -->
<iframe src="http://localhost/new_app/table1_view.php" style="border: 0" width="100%" height="700" frameborder="0" scrolling="auto"></iframe>
<div class="clearfix"></div>
<!-- ***** END OF MOD TO THIS FILE: ADJUST src="YOUR FILE LOCATION" and frame height/scrolling etc to suit your needs
Next see mod to /hooks/header.extras that I use to expand width of iframe/table buttons to
fit screen better ***** -->
<?php
// get member info
$mi = getMemberInfo();
Code: Select all
</div><div class="col-lg-12">
Hope this does what you need.
Cheers, Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Insert the table view of a table on the home page.
Thank you!
I will try it soon and i will let you know if it's good fom me!
Cheers!
Fabiano.
I will try it soon and i will let you know if it's good fom me!
Cheers!
Fabiano.
Re: Insert the table view of a table on the home page.
Hi Fabiano,
I can make another suggestion: Let the admin (or even users) decide, on which page they want to start once they have been logged in.
In /hooks/__global.php you find the necessary function: login_ok (see mine below).
I created a new table tbl_startpages (ID_StartpageNum PK, integer; StartpageURL VARCHAR(200)). There are possible starting pages to which the user will be redirected once logged in.
Another new table tbl_usersettings holds the username and the ID_StartpageNum and assigns each user his own startpage.
Now, the users logged in, I read the settings for this user and redirect to that userpage.
tbl_startpages looks like this:
Olaf
I can make another suggestion: Let the admin (or even users) decide, on which page they want to start once they have been logged in.
In /hooks/__global.php you find the necessary function: login_ok (see mine below).
I created a new table tbl_startpages (ID_StartpageNum PK, integer; StartpageURL VARCHAR(200)). There are possible starting pages to which the user will be redirected once logged in.
Another new table tbl_usersettings holds the username and the ID_StartpageNum and assigns each user his own startpage.
Now, the users logged in, I read the settings for this user and redirect to that userpage.
Code: Select all
function login_ok($memberInfo, &$args){
//start redirect to defined startpage
$userpage = sqlValue("Select
tbl_startpages.StartpageURL
From
tbl_startpages Inner Join
tbl_usersettings On tbl_usersettings.ID_StartpageNum = tbl_startpages.ID_StartpageNum
Where
tbl_usersettings.ID_Usersettings = '". makeSafe($memberInfo['username'])."'");
if (isset($userpage) && $userpage != '')
{
return $userpage;
}
else
{
return '';
}
//start redirect to defined startpage
}
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view