Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #1  
Old 03-31-2009, 08:07 PM
elektrik Offline
forum loafer
 
Join Date: Dec 2008
Posts: 10
SEF URLs breaks comment popup for anything but latest photo

Hi everyone,

I'm using my own template (with SEF help from the modifications in theworldin35mm) along with .htaccess (below) to generate nice URLs for my site. But I'm having a problem with comments for any photo that isn't the most recent.

When you visit the site, mysite.com/photoblog/ , you see the most recent photo and the popup comment url (http://mysite.com/photoblog/index.ph...nt&showimage=2) works fine. But when you browse to the previous photo, http://mysite.com/photoblog/p/1 , clicking the comment link doesn't work (404) because the url is rewritten.

In the popup, however, I have links to comments for the next/prev photos and those aren't rewritten (although they should be, and I'm not sure why it's not) and it navigates fine.

How can this be fixed? I've messed with the htaccess to no avail and I've messed with PP's index.php where the <comment_popup> is replaced, but I'm still stuck.

Can anybody help?

If it would help to see a live version, please PM me, as I'm still sorting this out on the site before I take it live.

Much appreciated! THanks for your time!



Code:
Options -Indexes
RewriteEngine On 
RewriteBase /photoblog
RewriteRule ^browse/?$ index.php?x=browse  
RewriteRule ^browse/([1-9][0-9]*)/?$ index.php?x=browse&pagenum=$1
RewriteRule ^browse/category/([1-9][0-9]*)/?$ index.php?x=browse&category=$1
RewriteRule ^browse/category/([1-9][0-9]*)/([1-9][0-9]*)/?$ index.php?x=browse&category=$1&pagenum=$2
RewriteRule ^browse/archive/(19|20)([0-9][0-9])[-](0[1-9]|1[012])/([^/]+)/?$ index.php?x=browse&archivedate=$1$2-$3
RewriteRule ^browse/archive/(19|20)([0-9][0-9])[-](0[1-9]|1[012])/([^/]+)/([1-9][0-9]*)/?$ index.php?x=browse&archivedate=$1$2-$3&pagenum=$4
RewriteRule ^browse/tag/([^/]+)/?$ index.php?x=browse&tag=$1
RewriteRule ^browse/tag/([^/]+)/([1-9][0-9]*)/?$ index.php?x=browse&tag=$1&pagenum=$2
RewriteRule ^comment/submit$ index.php?x=save_comment
RewriteRule ^comment/([0-9]+)$ index.php?popup=comment&showimage=$1
RewriteRule ^(p|photo)/([0-9]+)$ index.php?showimage=$2
RewriteRule ^(p|photo)/([0-9]+)/rating/([1-5])$ index.php?showimage=$2&rating=$3
RewriteRule ^t/latest/?$ index.php?showthumb=latest&thumbtag=image
RewriteRule ^feeds/(rss|atom).xml$ index.php?x=$1
Reply With Quote
  #2  
Old 04-03-2009, 08:45 PM
robackja's Avatar
robackja Offline
pp veteran
 
Join Date: Sep 2008
Location: Tucson, Arizona
Posts: 50
If manually typing in http://mysite.com/photoblog/p/1 gives you a 404 error, than you did not correctly setup mod_rewrite.

Some reason why URL rewrites give 404s
  • Either you messed up the .htaccess file
  • Your webserver (Apache/IIS) doesn't support mod_rewrite
  • Your webserver (Apache/IIS) doesn't support htaccess overrides

And please, provide a real URL, it would be nice to see the error happening in order to solve the issue more quickly and without requiring someone setup the same scenario on there own server.
__________________
The World in 35mm | joeroback.com | roback.cc
Reply With Quote
  #3  
Old 04-04-2009, 03:29 AM
elektrik Offline
forum loafer
 
Join Date: Dec 2008
Posts: 10
Hi Joe,

Sorry about my original description, but viewing the photo doesn't give me a problem, so I know the rewrite works, it's just the popup link.

So I have a live demo of what I'm talking about, using your template. It's at:

http://inthedistance.net/photoblog/

You'll see that the (unstyled) comment popup works for the most recent photo, and the SEF URLs work for browsing. But the comment popup won't work for anything but the latest (ie., anything under the /p/# scheme).

I hope that will help to explain the problem.

I'd really love to get this fixed! Any insight you have would be epic. Thanks so much for checking it out!
Reply With Quote
  #4  
Old 04-04-2009, 06:58 PM
robackja's Avatar
robackja Offline
pp veteran
 
Join Date: Sep 2008
Location: Tucson, Arizona
Posts: 50
Your problem is here

HTML Code:
<a href='index.php?showimage=<IMAGE_ID>' onclick="window.open('index.php?popup=comment&amp;showimage=<IMAGE_ID>','Comments','width=480,height=540,scrollbars=yes,resizable=yes');">Comments (0)</a>
Fix.

HTML Code:
<a href='<SITE_URL>p/<IMAGE_ID>' onclick="window.open('<SITE_URL>comment/<IMAGE_ID>','Comments','width=480,height=540,scrollbars=yes,resizable=yes');">Comments (0)</a>
You need to do similar adjustment in the popup comment template
HTML Code:
<form action="...">...</form>
I updated the htaccess rules on Pixelpost Template Page of The World In 35mm to include a comment/submit rule.

If you are going to use mod_rewrite URLs for pixelpost links, don't mix, some mod_rewrite URLs and some standard PP URLs. It just causes problems. And prefix all URLs with <SITE_URL>, since mod_rewrite URLs make using relative HTML links difficult.
__________________
The World in 35mm | joeroback.com | roback.cc
Reply With Quote
  #5  
Old 04-05-2009, 02:37 AM
elektrik Offline
forum loafer
 
Join Date: Dec 2008
Posts: 10
Joe,

Thanks SO MUCH. That was awesome of you.

I now have consistent URL structure across my template set, and I also had to add a "../" to index.php's replacement of the thumbnail_no_link tag to get the correct path to my thumb for display in the comment popup.

Thanks again for the huge help! Getting very close to launching my site!
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 06:10 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs