Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> GT - Next Gen and Standard
Author Message
hinksta
Worker
Worker


Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Thu Nov 30, 2006 7:37 am Reply with quote

I'm trying to GT a database search module i've made but having problems with the GT'd serch results when it has multipule search words.

modules.php\?name=MySearch&search=([a-zA-Z]*)&page=([0-9]*)
football_news_\\1_page-\\2.html

The first parameter is the search words and works fine with one word but if I have more than one search word I get

football_news.html?search=WORD1%20WORD2&page=2

the original url looks like search=WORD1 WORD2 so I think it's the space but can't figure it out.
 
View user's profile Send private message Visit poster's website
hinksta
PostPosted: Thu Nov 30, 2006 7:50 pm Reply with quote

If I put a space after the Z

modules.php\?name=MySearch&search=([a-zA-Z0-9 ]*)&page=([0-9]*)

I get

football_news_WORD1%20WORD2_page-2.html

Is there a way to replace the %20 with a space?


Last edited by hinksta on Fri Dec 01, 2006 5:36 am; edited 1 time in total 
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Thu Nov 30, 2006 11:19 pm Reply with quote

%20 is a space character. Are you saying its not working as a space?

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
hinksta
PostPosted: Fri Dec 01, 2006 5:34 am Reply with quote

evaders99 wrote:
%20 is a space character. Are you saying its not working as a space?


Yes, maybe I'm not writing the htaccess corectly

RewriteRule ^football_news_([a-zA-Z0-9]*)_page-([0-9]*).html modules.php?name=MySearch&search=$1&page=$2 [L]

I saw in a post by Audioslaved that you should use % , something like ([a-zA-Z0-9%]*) to sort the space but that's not making any difference.
 
hinksta
PostPosted: Fri Dec 01, 2006 7:27 pm Reply with quote

fixed it with $search = str_replace(" ", "-", $search);
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Sat Dec 02, 2006 10:20 am Reply with quote

I would try using the exact same regex that you used in the GT file. Did the following really not work?:

RewriteRule ^football_news_([a-zA-Z0-9 ]*)_page-([0-9]*).html modules.php?name=MySearch&search=$1&page=$2 [L]

Notice the space after the 9.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
hinksta
PostPosted: Sat Dec 02, 2006 10:39 am Reply with quote

No it would not work, but the fix works well, had to do the oposite fix for the $keywords so that pagelinks would work.

It's a cool little module that searches the multiheadlines database allowing me to make perminent gt'd links with dynamic titles using search terms.
 
montego
PostPosted: Sat Dec 02, 2006 10:46 am Reply with quote

that is strange. I could have sworn that I've seen this working (not with your specific module, but the concept). If I get time, I'll check this on one of my sites.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> GT - Next Gen and Standard

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©