I have an existing dynamic website that I hope to replace the existing backup end with a Appgini app. The existing dynamic website has 23 pages, with each page having it's own image folder. Appgini stores all images in the 'baseUploadPath' specified in the config.php file.
How can I specify a specific image folder for each of the pages/tables in Appgini? Really need for this to happen so [lease help!
Thanks,
TD
Specify image folder for specific page
Re: Specify image folder for specific page
Hi,
I did not try this, but I think if you use the hooks/header-extras.php you could overwrite the default path $Translation['ImageFolder'] with one for your table. So check on which table you are currently working on and set $Translation['ImageFolder'] to the appropiate folder.
I did not try this, but I think if you use the hooks/header-extras.php you could overwrite the default path $Translation['ImageFolder'] with one for your table. So check on which table you are currently working on and set $Translation['ImageFolder'] to the appropiate folder.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Specify image folder for specific page
Thank you pbottcher for trying to help. Over the last couple of days I have tried many things and learned some things. I am using Appgini Pro Edition, version 5.97, revision 1142 to create my webapp.
In this version of Appgini, the path for the images folder in pulled from the config.php file, specifically the property (?) 'baseUploadPath'. I know this because I manually edited the value of 'baseUploadPath' and it changed where the images were saved to.
I tried the following to determine when the config.php file was read: I opened the config.php file in Notepad++, then opened my webapp and started the process of uploading a new image. At the point where you select the image and click the OPEN button, I changed the config.php to show a different path than the one the webapp opended with and the image was saved to the new location, once I clicked the OPEN button. So it appears the config.php file is read as part of the INSERT event.
I have tried adding this to the /hooks/header-extrs.php file:
Didn't work.
Next I tried adding the same thing to the /hooks/duck-season-2015.php in the INIT section and then in the BEFORE INSERT event section:
Didn't work.
The only thing that half way worked was I created the file adsisc.php:
Then I added this code at the end of config.php:
This worked but what I really would like is to set the value of $fdr in the BEFORE INSERT event in the /hooks/duck-season-2015.php file. I tried doing this:
and
and finally modifiy adsisc.php:
Did not work, seems the value of $fdr never makes the trip to config.php via adsisc.php.
So, I am sure I have missed something and I am hoping you guys can help me figure this out'
TD
In this version of Appgini, the path for the images folder in pulled from the config.php file, specifically the property (?) 'baseUploadPath'. I know this because I manually edited the value of 'baseUploadPath' and it changed where the images were saved to.
I tried the following to determine when the config.php file was read: I opened the config.php file in Notepad++, then opened my webapp and started the process of uploading a new image. At the point where you select the image and click the OPEN button, I changed the config.php to show a different path than the one the webapp opended with and the image was saved to the new location, once I clicked the OPEN button. So it appears the config.php file is read as part of the INSERT event.
I have tried adding this to the /hooks/header-extrs.php file:
Code: Select all
<?php
$adminConfig['baseUploadPath'] = './images/gallery/duck-season-2015';
?>
Next I tried adding the same thing to the /hooks/duck-season-2015.php in the INIT section and then in the BEFORE INSERT event section:
Code: Select all
<?php
$adminConfig['baseUploadPath'] = './images/gallery/duck-season-2015';
?>
The only thing that half way worked was I created the file adsisc.php:
Code: Select all
<?php
global $fdr;
$fdr = './images/gallery/';
?>
Code: Select all
include_once "adsisc.php";
$adminConfig['baseUploadPath'] = $fdr;
This worked but what I really would like is to set the value of $fdr in the BEFORE INSERT event in the /hooks/duck-season-2015.php file. I tried doing this:
Code: Select all
function duck_season_2015_init(&$options, $memberInfo, &$args) {
include_once 'adsisc.php';
return TRUE;
}
Code: Select all
function duck_season_2015_before_insert(&$data, $memberInfo, &$args) {
$fdr = './images/gallery';
return TRUE;
}
Code: Select all
<?php
global $fdr;
?>
So, I am sure I have missed something and I am hoping you guys can help me figure this out'
TD