Photo.tpl not loading when viewing image?
|
noborders
Joined: 2004-09-29
Posts: 26 |
Posted: Thu, 2009-10-22 21:22
|
|
I moved the gallery2 and g2data folders from a subdirectory to my web root and also edited the config accordingly and pretty much everything seems to be working. All the thumbnails show up on the main page, and when browing to the albums. But when I click on any thumbnail inside albums, it takes me to a page with no image. The url of the image page looks like www.mysite.com/index.php?q=gallery&g2_itemId=77 I also have this gallery embedded in drupal and the same problem is happening there as well. It used to work fine in both standalone and embedded mode before moving directories.
|
|

Posts: 6136
Looks like you need to redo your rewrite rules for gallery.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
Ok. Here's my .htaccess in gallery2 directory:
RewriteEngine On RewriteBase /gallery2/ RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php RewriteCond %{REQUEST_URI} !/gallery2/main\.php$ RewriteRule . - [L] RewriteCond %{THE_REQUEST} /gallery2/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .) RewriteCond %{REQUEST_URI} !/gallery2/main\.php$ RewriteRule . /gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L] RewriteCond %{THE_REQUEST} /gallery2/v/([^?]+)(\?.|\ .) RewriteCond %{REQUEST_URI} !/gallery2/main\.php$ RewriteRule . /gallery2/main.php?g2_path=%1 [QSA,L]And here's what seems to be the relevant .htaccess from the webroot directory:
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php RewriteCond %{REQUEST_URI} !/index\.php$ RewriteRule . - [L] RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .) RewriteCond %{REQUEST_URI} !/index\.php$ RewriteRule . /gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L] RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .) RewriteCond %{REQUEST_URI} !/index\.php$ RewriteRule . /index.php?q=gallery&g2_path=%1 [QSA,L][Anything obvious?
Posts: 22888
Since album pages work I would suspect that there is something wrong with the photo.tpl , since the page loads but it does not complete.
View the source of a photo page.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 6136
good eye Dave, looks like it kinda abruptly ends ;)
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
I just looked at photo.tpl in the Matrix theme templates and the file itself hasn't changed since when I first installed it.
And since this problem only occurred when I just moved directories, I guess suprsidr was closer with the comment about rewrite rules? Now that I think about it more, the fact that the url for the page is now pointing to http://www.mysite.com/index.php?q=gallery&g2_itemId=77 seems like that is the case?
Posts: 26
Actually, the link to images is more like http://www.nommoogo.org/gallery2/main.php?g2_itemId=68
As for photo.tpl, I looked at the source and compared it to the same file from the gallery2 download, and it appears to be identical. I'm using gallery 2.3. For example, the last 6 line of photo.tpl is
{* Our emergency edit link, if the user removes all blocks containing edit links *} {g->block type="core.EmergencyEditItemLink" class="gbBlock" checkBlocks="sidebar,photo"} </div> </td> </tr> </table>Posts: 26
Ah, you were right, floridave. I thought you meant look at the code in photo.tpl. I just viewed the source on a photo page, and it does indeed abrubtly end like this
What does this mean though since it worked fine before the move? Perhaps the move itself introduced a problem (I used my ftp program to just drag folders into the root directory)? I've already replacing the photo.tpl with the one from gallery2 download but it had no effect.
What do you think could be causing this?
Posts: 26
Update: I just replaced gallery2 files except for of course, .htaccess config.php, login.txt. And that seems to have fixed the problem!
Posts: 22888
My next post would have been:
FAQ: How can I make sure that my installation files are all intact?
But glad you solved the issue.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 26
Well, it appears I spoke too soon. It was all working fine and I proceed to edit album.tpl and photo.tpl in the local templates folder and the problem was back again. Removing the local folder or replacing the default album/photo.tpl files don't seem to change anything either.
I just checked the system check via install/index.php and the only warning it gave was
Gallery file integrity saying themes/matrix/theme.css
Posts: 26
Also, what's weird is that whether I click on a thumbnail in standalone mode or embedded mode, the result is the same. It always goes to the standalone view but photo.tpl doesn't seem to be loading...
I'm beginning to think maybe it has to do with whatever script that is calling photo.tpl?
Posts: 6136
Do you have any acceleration enabled? gallery admin -> performance
Also have you cleared your template cache?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
I don't have any acceleration enabled. I just cleared the cache using http://yourdomain.com/path_to_gallery/lib/support/index.php?cache
and that seems to have fixed the problem. Hope it stays that way.
Posts: 26
Ok, the problem is back. What is really weird is that all that I am doing is editing photo.tpl in the local folder. Then the problem is back. This time clearing the cache didn't even help. I'm stumped.
Posts: 6136
maybe filesystem permissions on your local/photo.tpl
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
ok, do you know what you're supposed to chmod it to?
Also, I don't know if this is related but I'm getting this error when clicking on Themes menu in gallery site admin page:
Error (ERROR_BAD_PATH) : Invalid path: modules/newitems/classes/NewItemsSortOrder.class * in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 171 (GalleryCoreApi::error) * in modules/core/classes/GalleryCoreApi.class at line 161 (GalleryFactoryHelper_simple::newInstance) * in modules/core/classes/GallerySortInterface_1_2.class at line 105 (GalleryCoreApi::newFactoryInstance) * in modules/core/AdminThemes.inc at line 411 (GallerySortInterface_1_2::getAllSortOrders) * in modules/core/SiteAdmin.inc at line 209 (AdminThemesView::loadTemplate) * in modules/core/classes/GalleryView.class at line 293 (SiteAdminView::loadTemplate) * in main.php at line 465 (GalleryView::doLoadTemplate) * in main.php at line 104 * in main.php at line 88Posts: 26
Or perhaps I don't have the right permissions in that directory?
Posts: 6136
Your entire yoursite.com/gallery2 should be 755 except config.php should be 644
and your g2data which should be outside of your web root should be 777
Do you have the newItems module?
make sure modules/newitems/classes/NewItemsSortOrder.class is present and 755
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 26
Yeah, that all checks out.
Yeah, turns out I was missing that module and some others. I guess that happened when I deleted all the gallery2 files and reuploaded them.
It's working for now and I'm not going to touch the templates file for the time being. I'm thinking I don't have the right user permissions in teh web root directory. It's a shared server and it's my friend's website so I'm going to have him edit those same template files and see if that works.
Thanks for all your help.