Toggle Content

Donations

Donate with PayPal!
Help support Pro_News and become a member of our Sponsors Group
The tip jar is at PayPal, but does not require a PayPal account
Anonyme $ 10.00
macavity $ 115.00
RedGerry £ 50.00
Anonyme $ 10.00
minor $ 20.00

Recommended ISP

Simpler URL's for pagination.

3.3 Forum ONLY: If you've run into a problem, such as an error message, blank page, or similar problem, this is where to look. Post any installation or other problems or questions here, and I and other users will try to help.
Répondre au sujetRépondre au sujet Format imprimable

Simpler URL's for pagination.

Poster Posté le: Sun May 29, 2011 4:48 am

The URI's generated my Pro News for pagination are large and not 100% "useful":

example:

Pro_News/mode=/sid=/cid=/page=2.html

And if you're seeing a category in particular: (Pro_News/cid=2.html)

Pro_News/mode=/sid=0/cid=2/page=2.html

Whats the point of those parameters if they're not useful even for Pro News on those cases?

Well the solution is simple:
/Pro_News/functions.php
line 1979 (V 3.3.26 Revision 3.39)
Find

Code:
pagination('Pro_News&mode='.($is_home ? 'home' : '').'&sid='.$sid.'&cid='.$cid.'&page=', $pages, 1, $page);



and Replace with:

Code:
pagination('Pro_News'.($is_home ? '&mode=home' : '').($sid ? '&sid='.$sid : '').($cid ? '&cid='.$cid :'').'&page=', $pages, 1, $page);



The you'll get shorter URI's:

Pro_News/cid=2/page=2.html (For Category 2)
Pro_News/mode=home/page=2.html (for Home, no category or section defined)

Category and Section parameters are only added to the URL when necessary.



greenday2k please enter your server specs in your user profile! Pleurant ou Très Malheureux

greenday2k
Poster
Poster
 
Messages: 21
Inscrit le: May 18, 2009
Localisation: Bogotá

Re: Simpler URL's for pagination.

Poster Posté le: Tue May 31, 2011 7:00 am

Thanks! Good mod.

Please keep them coming, I'm more than happy to accept and incorporate improvements to Pro_News. I want this to be a community project, that's why it's F/OSS!

Included in 3.3.2.7 - with attribution.

Note to all: If applying greenday2k's fix for yourselves note that you will also need to edit & into & a m p ; (without the spaces) as your browser reduced them to &. There should be 4 occurrences in that line. Without them you may get W3/Tidy warnings.

Thanks again!



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Messages: 1229
Inscrit le: Mar 18, 2006
Link  QR  Share this Format imprimable  facebook   myspace   twitthis  
Show more ...
Montrer les messages depuis:   
Répondre au sujetRépondre au sujet Page 1 sur 1

3.3 Support

Sauter vers:  



Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum
You cannot attach files in this forum
You cannot download files in this forum

Toutes les heures sont au format GMT






layingback Non-Human Terms of Use