nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.

Tag This



.
nukeSEO.com: Forums


 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

msearch results page numbering
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> mSearch
View previous topic :: View next topic  
Author Message
Camber
Newbie
Newbie


Joined: Apr 21, 2007
Posts: 3

PostPosted: Thu Sep 06, 2007 1:23 pm    Post subject: msearch results page numbering Reply with quote

In the index.php of msearch the function that renders up page numbers for the search results has an error. When a search returns more than 5 pages of results it should show something like 1 2 3 4 5...20 and when a user clicks on 5 it should look like 1...3 4 5 6...20 and so on. Instead clicking on 5 renders 2 3 4 5. Does anyone have any ideas how to make this function properly? Here is the current code for this section:

Code:
function showpage($start, $len, $fullen, $func, $pfunc){

  // Display a list of items on a page, using $func to format these
  // items, and $pfunc to show the links to new pages
  global $db;
  function pagenum($ar){
    $c = '';
    if (is_array($ar)){
      foreach($ar as $val){
        $c .= $val.' ';}}
    return $c;}
  $lastpage = 1;
  if ($len > 0){
    for ($x = $start + $len, $i = $start;$i < $x;$i++){
      $content .= $func($i);}
    $page = ($start / $len);
    $pagest = ceil(($fullen / $len));
    if ($page < 2){
      $page = 2;
    } else if ($page > $pagest - 3){
      $page = $pagest -2;
      if ($pagest == 3){
        $page = 2;}}
    $pages = array();
    if ( $fullen > $len){
      for ($x = $fullen / $len, $i = 0;$i < $x;$i++){
        $pages[] = (round($start/$len) != $i ? $pfunc($i*$len, $len) : '<b>'.($i+1).'</b>');}
        $x = 5;
        if ($pagest < 5){
          $x = $pagest;}
        for ($i = 0;$i < $x;$i++){
          $pages2[] = $pages[(($page - 2)+$i)];
          $lastpage = $i;}}}
  $startlen = ($len ? $start/$len : 0);
  return array($content, (round($startlen) > 2 && $pagest > 5 ? $pfunc(0, $len).' '._MSELIPSES.' ' : '').pagenum($pages2).(round($startlen) < $pagest-2 && $pagest > 5 ? ' ... '.$pfunc(($pagest-1)*$len, $len) : ''));}
  
Back to top
View user's profile Send private message
kguske
Site Admin
Site Admin


Joined: May 12, 2005
Posts: 875

PostPosted: Fri Sep 07, 2007 12:47 pm    Post subject: Re: msearch results page numbering Reply with quote

I'm not sure it isn't working as designed because I'm not sure what the intent was... Very Happy

Maybe the thinking was that you might not want to see the previous pages because (presumably) you already saw them?
_________________
  
Back to top
View user's profile Send private message Visit poster's website
kguske
PostPosted: Fri Sep 07, 2007 12:54 pm    Post subject: Re: msearch results page numbering Reply with quote

Sorry! I misunderstood your question. I see what you mean. You really can't see more than 5 pages of results, even though the code suggests that it's possible.

I'm working on the nukeFEED release now, so it may be a little while before I can look into this.
  
Back to top
Camber
PostPosted: Fri Sep 07, 2007 12:57 pm    Post subject: Re: msearch results page numbering Reply with quote

Thank you for the reply! From the coding it appears that pages are meant to be rendered for the entire search result with a sliding list of page numbers. For example a query returning 10 pages of results with the user selecting page five should see something like this:

...2 3 4 5 6...10

When page six is selected it should then look like this:

...3 4 5 6 7...10

and so forth.

The elipses are indicated by _MSELIPSES in line 196 of the index.php. There seems to be a logical or variable error in calculating pages over 5. Currently when a search results in more than five pages slecting page 5 renders:

2 3 4 5

Thanks again for your help.
  
Back to top
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> mSearch All times are GMT - 5 Hours
 
 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 cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group


Page Generation: 0.06 Seconds