Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
bizarre12
Newbie
Newbie



Joined: Mar 15, 2008
Posts: 4

PostPosted: Sat Aug 09, 2008 3:48 pm Reply with quote

I'm trying to rewrite let's say

"(?<!/)modules.php\?name=modules.php?name=News&new_topic=4"',

to some subject like

'this_subject',

the same with topic=5/6/7
and different rewrite to each "topic"

but it doesn't work,
Itried to do it in GT-Topics, and GT-News

the reason for that is that i want to have normal name in url bar than

article-topic 1/2/3/4/


what am i doing wrote?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Aug 10, 2008 10:44 am Reply with quote

ShortLinks can only tap the links using information from the links themselves. The link you posted, for example, does not have the subject in it, so it can't be tapped the way you wish. You would have to modify News and Topics module index.php to add the subject onto the URL... then you might be able to tap it.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Tue Aug 12, 2008 3:57 am Reply with quote

.. and then you would have to be very careful that no subject was used again unless you add something unique to the tap like the $sid
 
View user's profile Send private message
xiketuan
Newbie
Newbie



Joined: Nov 11, 2008
Posts: 18

PostPosted: Wed Nov 12, 2008 3:36 am Reply with quote

shortalink can convert to :
Code:
RewriteRule ^article-([0-9]*)-([a-z]*)-([0-9]*)-([0-9]*).html modules.php?name=News&file=article&sid=$1&mode=$2&order=$3&thold=$4 [L]


replay to :
Code:
RewriteRule ^article/([0-9]*)/([a-z]*)/([0-9]*)/([0-9]*) modules.php?name=News&file=article&sid=$1&mode=$2&order=$3&thold=$4 [L]


preview error :
The webpage cannot be found
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Wed Nov 12, 2008 4:52 am Reply with quote

You also need to match those changes in in ShortLinks/GT-News.php
 
View user's profile Send private message
xiketuan
Newbie
Newbie



Joined: Nov 11, 2008
Posts: 18

PostPosted: Sat Nov 15, 2008 12:07 pm Reply with quote

file GT-News.php :
$urlin = array(
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)&amp;page=([0-9]*)"', ..........);

$urlout = array(
'article-category\\1-page\\2.html',

file : .htaccess :
Code:
RewriteRule ^article-category([0-9]*)-page([0-9]*).html modules.php?name=News&op=viewcat&catid=$1&page=$2 [L]


i want use : category/2/1 , hep
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sat Nov 15, 2008 12:18 pm Reply with quote

With all due respect, what you are asking for is a bespoke solution and is way beyond support.
You could possibly re-write 'viewcat' so it was 'category' but this may impact other things.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Nov 16, 2008 10:03 am Reply with quote

If you are going to be hacking code to this extent, I would suggest picking up some good books on PHP, MySQL, and something on regular expressions.

A web site admin just has to learn these things in order to be effective.

Re-coding ShortLinks for you from the '-' to '/' is not something I have time to do for you and quite frankly, it is not that difficult of a thing to do. Have you even given it a try?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch