Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Incorrect Search Links

 
Reply to topic    Forum Index » Bugs and errors View previous topic
View next topic
Incorrect Search Links
Author Message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Incorrect Search Links Reply with quote
So I was playing with the search and I found out that when you add pagination to the search pages it generates links like this:



http://www.scodal.com/search-products.php?skip=10



But it needs to show up like this:



http://www.scodal.com/search-products.php?do=search&search=shirt&skip=10



How can I achieve this?

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Nov 10, 2006 1:14 pm View user's profile Send private message Visit poster's website AIM Address
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Is there no fix? I checked and this happens on all sites of mine that use the search function regardless of txtsql or mysql database. Is it perhaps because it uses the same next, previous, and {pages} links as any other page? It doesn't code in the search parts into the URL? How can I create new tags just for the search area or edit the code and put that in place. I tried tweaking it but I keep messing it up.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Mon Nov 13, 2006 6:11 am View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Open inc/show.news.php and add this to the link generation codes:

Code:
'.($_GET['search'] ? '&do=search&search='.$_GET['search'] : '').'




For example, change this:

Code:
$pages .= '<a href="'.$PHP_SELF.'?skip='.$pages_skip.'">'.$j.'</a> ';




to this:

Code:
$pages .= '<a href="'.$PHP_SELF.'?skip='.$pages_skip.''.($_GET['search'] ? '&do=search&search='.$_GET['search'] : '').'">'.$j.'</a> ';

Mon Nov 13, 2006 11:48 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
it seemed to make no difference ;( that doesn't make sense though. i see what you did with the code and it looks like it should work perfect. do you think iframes might break it?

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Mon Nov 13, 2006 8:43 pm View user's profile Send private message Visit poster's website AIM Address
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
I was going to write how I couldn't figure it out but I did. I didn't realize I had to change it so many times. So I changed all 4 of the spots you mentioned then I had to change it here too:



Code:
//----------------------------------

// Previous link

//----------------------------------

if ($skip){

   $prev_next_msg = preg_replace('/\[prev-link\](.*?)\[\/prev-link\]/si', '<a href="'.$PHP_SELF.'?skip='.($skip - $number).''.($_GET['search'] ? '&do=search&search='.$_GET['search'] : '').'">\\1</a>', $prev_next_msg);

} else {

   $prev_next_msg = preg_replace('/\[prev-link\](.*?)\[\/prev-link\]/si', '', $prev_next_msg);

   $no_prev = true;

}




Code:
//----------------------------------

// Next link

//----------------------------------

if ($skip + $number < $count){

   $prev_next_msg = preg_replace('/\[next-link\](.*?)\[\/next-link\]/si', '<a href="'.$PHP_SELF.'?skip='.($skip + $number).''.($_GET['search'] ? '&do=search&search='.$_GET['search'] : '').'">\\1</a>', $prev_next_msg);

} else {

   $prev_next_msg = preg_replace('/\[next-link\](.*?)\[\/next-link\]/si', '', $prev_next_msg);

   $no_next = true;

}



$prev_next_msg = run_filters('prev-next-msg', $prev_next_msg);



if (!$no_prev or !$no_next){

   echo $prev_next_msg;

}




It works perfect everywhere. You are awesome. Very Happy

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Thu Nov 16, 2006 10:55 am View user's profile Send private message Visit poster's website AIM Address
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Modified show.news.php file! ;) Reply with quote
I figured since I was having trouble with the search pagination... well then most people that are trying to use it probably are too. Maybe not.. but just in case.. I zipped my modified working file and included a short 'readme.txt' file with it. This should help you guys get it fixed and working faster than trying to do the coding yourself.



Big thanks to FI-DD (as usual) Laughing



search-pagination.zip
 Description:
Basically, replace show.news.php with your old one.

Download
 Filename:  search-pagination.zip
 Filesize:  3.3 KB
 Downloaded:  126 Time(s)


_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Sat Dec 16, 2006 9:05 pm View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:    
Reply to topic    Forum Index » Bugs and errors All times are GMT + 1 Hour
Page 1 of 1

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



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.