Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 12-02-2008, 09:33 AM
robackja's Avatar
robackja Offline
pp veteran
 
Join Date: Sep 2008
Location: Tucson, Arizona
Posts: 50
paged archive + mod_rewrite support

Ok, I hacked up paged_archive.php for full mod_rewrite support. Modified version reads a variable $cfgrow['mod_rewrite'], if true, produces mod_rewrite friendly URLs, if false, produces previous URLs.

Available as part of my pixelpost template at http://joeroback.com/downloads

It would be nice to get a mod_rewrite option in the main admin options page that could set $cfgrow['mod_rewrite'], but i don't have to time to hack that up tonight... soon I will though. Right now $cfgrow['mod_rewrite'] is just hard coded at the top of paged_archive.php.

Need these following RewriteRules in your htaccess or apache config:

Code:
RewriteRule ^(about|downloads)/?$ index.php?x=$1
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])/monthname/([^/]+)/?$ index.php?x=browse&archivedate=$1$2-$3&monthname=$4
RewriteRule ^browse/archive/(19|20)([0-9][0-9])[-](0[1-9]|1[012])/monthname/([^/]+)/([1-9][0-9]*)/?$ index.php?x=browse&archivedate=$1$2-$3&monthname=$4&pagenum=$5
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
__________________
The World in 35mm | joeroback.com | roback.cc
Reply With Quote
  #2  
Old 12-03-2008, 04:49 AM
robackja's Avatar
robackja Offline
pp veteran
 
Join Date: Sep 2008
Location: Tucson, Arizona
Posts: 50
http://www.pixelpost.org/extend/addo...th-modrewrite/
__________________
The World in 35mm | joeroback.com | roback.cc
Reply With Quote
  #3  
Old 01-14-2009, 06:13 PM
Kev Offline
forum loafer
 
Join Date: Jan 2009
Posts: 5
Quote:
//---------------------------- Making thumbs row

// for each record ...
while(list($id,$title,$name) = mysql_fetch_row($query))
{
// from the thumbnail row. This could be build by tables too.
$title = pullout($title);
$title = htmlspecialchars($title,ENT_QUOTES);
$thumbnail = ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$name;
$thumbnail_extra = getimagesize($thumbnail);
$local_width = $thumbnail_extra['0'];
$local_height = $thumbnail_extra['1'];
$thumb_output .= "<a href='{$cfgrow['siteurl']}" . (($mod_rewrite_urls) ? "p/$id" : "index.php?showimage=$id") . "'><img src='{$cfgrow['siteurl']}".$thumbnail."' alt='".$title."' title='".$title."' width='".$local_width."' height='".$local_height."' class='thumbnails' /></a>";
} //end while
// initialize page counter
$pagecounter=0;
how can i change the "p/&id" to "/$title", cause just like that ..it doesn't work!
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 12:11 PM.

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