How to setup Gallery2 (2.3) embeded in PHPGedview
|
slimmehenkie
Joined: 2007-01-03
Posts: 26 |
Posted: Thu, 2009-01-01 09:59
|
|
Hi, To run gallery2 in the PHPGedview (Genealogy program), you might need to modify some files in order to Note: You need to watch the url in your browser to see where your system is finding the module.php Your browser is showing : Modify PGV.PHP (search for $url): function mod_gallery2_load($uid) $user_id=get_user_id($uid); // $uid is the gallery2 user-name, $user_id is the PGV user-id // Rebuild the url, just to be sure we have a clean one Then look for (2 times) the 'g2Uri' => G2EmbedDiscoveryUtilities::normalizeG2Uri($modinfo['Gallery2']['path']), To have gallery working and displaying the pictures, these lines should be commented out by to dashes 'g2Uri' => "/subfolder/modules/gallery2/", In order to see the right pictures and templates, I need to define the BaseUri in CONFIG.PHP to : $gallery->setConfig('galleryBaseUrl', ''); End of mods. Regards, Rick. |
|
| Login or register to post comments |

Posts: 2
I followed the instructions, but get a security violation error when trying to access the gallery. When I hover over the gallery link in PGV, the URL looks like: http://mydomain/module.php?mod=gallery2. Therefore I didn't modify pgv.php and only made the changes you suggested to make in config.php. When I click the gallery link, the browser gets redirected to http://mydomain/main.php?mod=gallery2. Here is what the browser shows as well as the error log:
Security Violation
The action you attempted is not permitted.
Back to the Gallery
Error Detail +
Error (ERROR_BAD_PARAMETER) : Smarty error: The template 'themes/matrix/templates/theme.tpl' does not exist.
* in modules/core/classes/GallerySmarty.class at line 76 (GalleryCoreApi::error)
* in modules/core/classes/GalleryTemplate.class at line 442 (GallerySmarty::trigger_error)
* in ??? at line 0 (GalleryTemplate::resourceGetTemplate)
* in lib/smarty/Smarty.class.php at line 1559
* in lib/smarty/Smarty.class.php at line 1414 (Smarty::_fetch_resource_info)
* in lib/smarty/Smarty.class.php at line 1260 (Smarty::_compile_resource)
* in modules/core/classes/GallerySmarty.class at line 61 (Smarty::fetch)
* in modules/core/classes/GalleryTemplate.class at line 219 (GallerySmarty::fetch)
* in /DOCROOT/main.php at line 521 (GalleryTemplate::fetch)
* in /DOCROOT/main.php at line 104
* in /DOCROOT/main.php at line 88
realpath(/DOCROOT/modules/gallery2/modules/core/classes/../../../) realpath(/DOCROOT/modules/gallery2/) (mysqli): SET NAMES "utf8" (mysqli): update g2_SequenceEventLog set id=LAST_INSERT_ID(id+1); (mysqli): UPDATE g2_EventLogMap SET g_userId=5, g_type='Gallery Error', g_summary='Smarty error: The template \'themes/matrix/templates/theme.tpl\' does not exist.', g_details='Error (ERROR_BAD_PARAMETER) : Smarty error: The template \'themes/matrix/templates/theme.tpl\' does not exist. in modules/core/classes/GallerySmarty.class at line 76 (GalleryCoreApi::error) in modules/core/classes/GalleryTemplate.class at line 442 (GallerySmarty::trigger_error) in ??? at line 0 (GalleryTemplate::resourceGetTemplate) in lib/smarty/Smarty.class.php at line 1559 in lib/smarty/Smarty.class.php at line 1414 (Smarty::_fetch_resource_info) in lib/smarty/Smarty.class.php at line 1260 (Smarty::_compile_resource) in modules/core/classes/GallerySmarty.class at line 61 (Smarty::fetch) in modules/core/classes/GalleryTemplate.class at line 219 (GallerySmarty::fetch) in /DOCROOT/main.php at line 521 (GalleryTemplate::fetch) in /DOCROOT/main.php at line 104 in /DOCROOT/main.php at line 88 Request variables: Array ( [view] => core.ShowItem [itemId] => 7 ) ', g_location='http://mydomain/main.php?mod=gallery2', g_client='undisclosed_ip', g_timestamp=1234533096, g_referer=NULL WHERE g_id=26 (mysqli): INSERT INTO g2_EventLogMap (g_id, g_userId, g_type, g_summary, g_details, g_location, g_client, g_timestamp, g_referer) VALUES (26,5,'Gallery Error','Smarty error: The template \'themes/matrix/templates/theme.tpl\' does not exist.','Error (ERROR_BAD_PARAMETER) : Smarty error: The template \'themes/matrix/templates/theme.tpl\' does not exist. in modules/core/classes/GallerySmarty.class at line 76 (GalleryCoreApi::error) in modules/core/classes/GalleryTemplate.class at line 442 (GallerySmarty::trigger_error) in ??? at line 0 (GalleryTemplate::resourceGetTemplate) in lib/smarty/Smarty.class.php at line 1559 in lib/smarty/Smarty.class.php at line 1414 (Smarty::_fetch_resource_info) in lib/smarty/Smarty.class.php at line 1260 (Smarty::_compile_resource) in modules/core/classes/GallerySmarty.class at line 61 (Smarty::fetch) in modules/core/classes/GalleryTemplate.class at line 219 (GallerySmarty::fetch) in /DOCROOT/main.php at line 521 (GalleryTemplate::fetch) in /DOCROOT/main.php at line 104 in /DOCROOT/main.php at line 88 Request variables: Array ( [view] => core.ShowItem [itemId] => 7 ) ','http://mydomain/main.php?mod=gallery2','undisclosed_ip',1234533096,NULL) (mysqli): ROLLBACK
I'm using PGV 4.2 and gallery 2.3.
Thanks for the help.
Posts: 26
Hi eisenadler,
It looks like a template is missing, part of the matrix theme. Could you verify that the file themes/matrix/templates/theme.tpl is located on your server?
Further more you could find on the following link more details on how to install gallery2 in phpgedview :
http://sourceforge.net/tracker/index.php?func=detail&aid=2485050&group_id=55456&atid=477081
Hope you can solve the problem.
Rick.
Posts: 2
Rick,
Thanks for the link to the files on sourceforge. I got the problem fixed by following the latest readme file there and using the updated code for index.php. One other thing I had to do to get the online installer working was I had to create a symlink from my docroot to modules/gallery2/install. Once I did that, I was able to get it installed and working. Thanks for your help!
Sean
Posts: 26
Dear Sean,
Thanks for your feedback. Glad that thinks worked out for you.
Regards,
Rick.
Posts: 6
Hi! I just installed G2 (2.3) to a phpGedView 4.1.5 site. I made the config.php changes but I saw the right URL so I didn't change pgv.php. When I am not logged in to phpGedView, I can click on the Gallery button and see G2 just fine. If I log in to phpGedView and click on Gallery, I get an http 500 error. Any suggestions?
Thanks!
Posts: 26
Dear Teaguew,
Where this error comes from is unknown to me. It is a internal server error.
Did you also look at the link which is in the message of 3-1-09 ? It is a patch for using gallery in phpgedview.
The patch is based on the latest version of phpgedview but I think it should also work on 4.1.5 as I remember.
If you don't succeed, let me know so we could try to solve this.
Posts: 6
Slimmehenkie,
Thanks. Can you tell me the subject of the message? Also, I'm in the USm so I'm not sure whether 3-1-09 is March 1 or January 3.
Thanks!
Posts: 26
Teaguew,
The message in this forum is at the 3th of January 2009 but here is the link again:
http://sourceforge.net/tracker/index.php?func=detail&aid=2485050&group_id=55456&atid=477081
Keep me posted on your progress.
Rick.
Posts: 6
Thanks! I checked the readme file. I'm mystified. My pgv.php file doesn't have the line
$url = "{$bits['scheme']}://{$bits['host']}/module.php?mod=gallery2{$bits['query']}{$bits['fragment']}";
anywhere in it, and the line
g2Uri' => G2EmbedDiscoveryUtilities::normalizeG2Uri($modinfo['Gallery2']['path']),
only appears once. I forgot I had already seen the readme file and made the change to the one instance of the "g2Uri' =>" that was there.
Posts: 26
Hi Teaguew,
Thats in the new release. On 4.1.5 I used the following configuration:
part of PGV.PHP:
$ret = GalleryEmbed::init(array(
'embedUri' => "/phpgedview/index.php?mod=gallery2",
// 'embedUri' => "{$SERVER_URL}{$sep}index.php?mod=gallery2",
// 'g2Uri' => "/gallery2/",
'g2Uri' => "/phpgedview/modules/gallery2/",
// 'g2Uri' => G2EmbedDiscoveryUtilities::normalizeG2Uri($modinfo['Gallery2']['path']),
Note: the /phpgedview/index.php?mod=gallery2 needs to be determent appending on your configuration. If you installed phpgedview in the root of your website
then it would be /index.php?mod=gallery2 ( the same for the g2Uri)!
In config.php I configured the lines :
$gallery->setConfig('galleryBaseUrl', '');
$gallery->setConfig('baseUri', '');
The gallery2.php in the /modules folder contains:
<?php exit; ?>
[Module]
type = PGV_MOD_SIMPLE
[Gallery2]
; Path to your Gallery install, no trailing seperator please.
path = modules/gallery2
Hope this will get gallery2 on phpgedview 4.1.5 working for you.
Keep me posted.
Rick.
Posts: 6
slimmehenkie
I took another approach ... I upgraded my phpGedView and re-did the mods per the PGV wiki and your instructions. No more 500 error, but now I see this:
An error occurred during the on-the-fly user creation.
Error (ERROR_MISSING_OBJECT)
in modules/core/classes/helpers/GalleryUserHelper_medium.class at line 143 (GalleryCoreApi::error)
in modules/core/classes/GalleryCoreApi.class at line 606 (GalleryUserHelper_medium::fetchUserByUserName)
in pgv.php at line 108 (GalleryCoreApi::fetchUserByUserName)
in index.php at line 39
in index.php at line 34
in /home/heypopan/public_html/familytree/module.php at line 72
Posts: 26
Hi Teaguew,
When you have this error :
An error occurred during the on-the-fly user creation.
Error (ERROR_MISSING_OBJECT)
You could change the method of encryption in PGV.PHP by:
'hashmethod'=>'crypt' -> 'hashmethod'=>'phpass'
This change should solve the problem.
Regards,
Rick.