Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #51  
Old 11-16-2006, 04:17 PM
jaywilliams's Avatar
jaywilliams+ Offline
Team Pixelpost
 
Join Date: Sep 2005
Posts: 1,003
Send a message via AIM to jaywilliams Send a message via MSN to jaywilliams Send a message via Yahoo to jaywilliams Send a message via Skype™ to jaywilliams
Adding the following text to your .htaccess file should do the trick:

Code:
RewriteRule ^archives/([0-9-]+)/(.*)/([0-9]+)$ index.php?x=browse&archivedate=$1&monthname=$2&pagenum=$3

The links would look like this:

/archives/2006-11/November, 2006/1

To modify the links in PixelPost you will need to edit the archives addon.
__________________
Jay Williams | A Different View
Reply With Quote
  #52  
Old 11-16-2006, 06:05 PM
Vallhalla's Avatar
Vallhalla Offline
forum loafer
 
Join Date: Nov 2006
Posts: 3
Hi.. thanks for your help and the quick reply.. unfortunately its not working for me.. when i use the mod_rewrite you wrote, the new link just took me to the main archive page. eg: http://taufiqshariff.com/archives/20...mber,%202006/1 with all the images even if i change the month name, eg:
http://taufiqshariff.com/archives/20...pril,%202006/1

Below is how my .htaccess looks like.

Code:
RewriteEngine on
RewriteRule ^(links|about)/$ index.php?x=$1
RewriteRule ^archives/ index.php?x=browse&pagenum=1
RewriteRule ^archives/page/([0-9]+)$ index.php?x=browse&category=&pagenum=$1
RewriteRule ^archives/([0-9-]+)/(.*)/([0-9]+)$ index.php?x=browse&archivedate=$1&monthname=$2&pagenum=$3
RewriteRule ^comment/([0-9]+)$ index.php?popup=comment&showimage=$1
RewriteRule ^photo/([0-9]+)$ index.php?showimage=$1
RewriteRule ^photo/([0-9]+)/rating/([1-5])$ index.php?showimage=$1&rating=$2
RewriteRule ^thumbnails/latest$ index.php?showthumb=latest&thumbtag=image
RewriteRule ^feed/ index.php?x=rss
I don't have any idea why.
Reply With Quote
  #53  
Old 11-16-2006, 06:24 PM
jaywilliams's Avatar
jaywilliams+ Offline
Team Pixelpost
 
Join Date: Sep 2005
Posts: 1,003
Send a message via AIM to jaywilliams Send a message via MSN to jaywilliams Send a message via Yahoo to jaywilliams Send a message via Skype™ to jaywilliams
This is just a hunch, but try placing the the the code in a little different order.


Like this:
Code:
RewriteRule ^archives/([0-9-]+)/(.*)/([0-9]+)$ index.php?x=browse&archivedate=$1&monthname=$2&pagenum=$3
RewriteRule ^archives/page/([0-9]+)$ index.php?x=browse&category=&pagenum=$1
RewriteRule ^archives/ index.php?x=browse&pagenum=1
Notice that the "archives/" is listed last.
That might solve it.
__________________
Jay Williams | A Different View
Reply With Quote
  #54  
Old 11-16-2006, 06:32 PM
Vallhalla's Avatar
Vallhalla Offline
forum loafer
 
Join Date: Nov 2006
Posts: 3
Hey.. that worked... Thank you very much!
Reply With Quote
  #55  
Old 12-12-2006, 09:28 AM
SweMike Offline
forum loafer
 
Join Date: Dec 2006
Posts: 2
Need some help!

I have testing all tip here for some day and need some more help.

My site at: http://modul101.com

Itīs in swedish and I like swedish words to make sense of the links.

I like a link like this: http://modul101.com/index.php?showimage=65 looks like this: http://modul101.com/bild/65 (this one works when I write the URL in my browser)

And a link like this: http://modul101.com/index.php?x=browse looks like this: http://modul101.com/arkiv (Can write the URL but donīt see any thumbs)

This is the .htaccess, just a test gonna delete som rows later:

PHP Code:
<IfModule mod_rewrite.c>
RewriteBase /
Options -Indexes
RewriteEngine on
RewriteRule 
^(browse|about|arkiv)$ index.php?x=$1&pagenum=1
RewriteRule 
^browse/([0-9]+)$ index.php?x=browse&category=&pagenum=$1
RewriteRule 
^browse/category/([0-9]+)/([0-9]+)$ index.php?x=browse&category=$1&pagenum=$2
RewriteRule 
^arkiv/category/([0-9]+)$ index.php?x=browse&category=$1&pagenum=1
RewriteRule 
^arkiv/([0-9]+)$ index.php?x=browse&category=&pagenum=$1
RewriteRule 
^arkiv/category/([0-9]+)/([0-9]+)$ index.php?x=browse&category=$1&pagenum=$2
RewriteRule 
^browse/category/([0-9]+)$ index.php?x=browse&category=$1&pagenum=1
RewriteRule 
^comment/([0-9]+)$ index.php?popup=comment&showimage=$1
RewriteRule 
^comment/submitindex.php?x=save_comment
RewriteRule 
^bild/([0-9]+)$ index.php?showimage=$1
RewriteRule 
^bild/([0-9]+)/rating/([1-5])$ index.php?showimage=$1&rating=$2
RewriteRule 
^bild/fil/(.+)$ /images/$1
RewriteRule 
^thumbnails/latestindex.php?showthumb=latest&thumbtag=image
RewriteRule 
^feeds/(rss|atom).xmlindex.php?x=$1
RewriteRule 
^browse/archive/(.*)/([0-9]+)$ index.php?x=browse&archivedate=$1&pagenum=$2
RewriteRule 
^browse/archive/(.*)$ index.php?x=browse&archivedate=$1&pagenum=1
RewriteRule 
^arkiv/archive/(.*)/([0-9]+)$ index.php?x=browse&archivedate=$1&pagenum=$2
RewriteRule 
^arkiv/archive/(.*)$ index.php?x=browse&archivedate=$1&pagenum=1
RewriteRule 
^bild/(.*)$ index.php?photoslug=$1
</IfModule
Can someone give some help whit the changes in the index-file?
I have done some changes but need more to make everything work ok.

My changes:
Browse should be Arkiv
About should be Info

Excuse me my spelling and bad english...

Last edited by SweMike; 12-12-2006 at 10:15 AM. Reason: More info
Reply With Quote
  #56  
Old 12-12-2006, 09:08 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Try to change:
Quote:
RewriteRule ^(browse|about|arkiv)$ index.php?x=$1&pagenum=1
to:
Quote:
RewriteRule ^arkiv([/]?)$ index.php?x=browse&pagenum=1
RewriteRule ^info([/]?)$ index.php?x=about
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #57  
Old 12-13-2006, 03:15 AM
SweMike Offline
forum loafer
 
Join Date: Dec 2006
Posts: 2
EDIT!

Got the links at the main page works, changed both index.php and the template-image.php

If anybody have some info what to change to make the browse page links look the same, please drop a line. (Browse = http://modul101.com/arkiv )
It must be a some change of the code in index.php I belive?
Something with the >THUMBNAILS> tag???

Site: http://modul101.com

Last edited by SweMike; 12-13-2006 at 07:42 PM. Reason: More info
Reply With Quote
  #58  
Old 12-23-2006, 02:01 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Ok, I am trying to get
www.sitename.com/index.php?x=browse
and
www.sitename.com/index.php?x=about

to display like

www.sitename.com/browse
and
www.sitename.com/about

I have the following in my .htaccess file,
Code:
RewriteEngine On

# Post Slug Addon
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1
RewriteRule ^(browse|about)$ index.php?x=$1&pagenum=1
and changed my browse and about links to /browse and /about in my templates.

When I click either of these links it brings up a blank page with the following words typed on it:
Coming Soon! Nothing to show. No image to show here!

What am I doing wrong here? I am using the POST SLUG addon. Is this messing with it? I don't understand modRewrite at all!
Reply With Quote
  #59  
Old 12-23-2006, 02:06 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
This is interesting.

I switched the order of the rewrite rules
to
Code:
RewriteEngine On

RewriteRule ^(browse|about)$ index.php?x=$1&pagenum=1
# Post Slug Addon
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1
and now it works!

Why does it make a difference? can someone explain to me why when this:
RewriteRule ^(browse|about)$ index.php?x=$1&pagenum=1
is placed bellow this:
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1

It does not work but if revered it functions as it would.
Reply With Quote
  #60  
Old 12-23-2006, 03:59 AM
jaywilliams's Avatar
jaywilliams+ Offline
Team Pixelpost
 
Join Date: Sep 2005
Posts: 1,003
Send a message via AIM to jaywilliams Send a message via MSN to jaywilliams Send a message via Yahoo to jaywilliams Send a message via Skype™ to jaywilliams
Quote:
Originally Posted by dwilkinsjr View Post
can someone explain to me why when this:
RewriteRule ^(browse|about)$ index.php?x=$1&pagenum=1
is placed bellow this:
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1

It does not work but if revered it functions as it would.
Believe it or not, it makes perfect sense. I'll try my best to explain it.

When you uses mod_rewrite it starts with the first rule and progresses to the last one. The rule ([a-z0-9-]+) means any page that uses the letters a through z as well as numbers and hyphens would return true. Both "browse" and "about" fit in that category. So it would get a match and try to load the page "index.php?photoslug=about". And as you can see, that page doesn't exist.

But if the rule (browse|about) is first, and the page you are trying to load is "about", that rule will return true, skipping any further rules. It will then try to load the page "index.php?x=about&pagenum=1", which would be correct.

Hopefully that explains it for you. If not, let me know and I will try again. :-)
__________________
Jay Williams | A Different View
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 04:57 PM.

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