Current location: Hot Scripts Forums » Programming Languages » PHP » Next Previous navigation problem

Next Previous navigation problem

Reply
  #1 (permalink)  
Old 07-02-09, 11:03 PM
arale arale is offline
Newbie Coder
 
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Question Next Previous navigation problem

Hi,

I get a php function for Next Previous navigation menu like below code. The result, it shows like this

http://img406.imageshack.us/img406/8118/nav1.gif

But I want to add ... between the numbers and change the position of previous, next button like this

http://img391.imageshack.us/img391/4103/nav2k.gif

How to modifly the code below to make it works?

code:
php Code:
PHP Code:
function get_letter_page_nav($letter 'A'$curpage 1$updown 0) {
    
$lastIndex get_last_index($letter);
    
$html '<div class="pagination">';
    
$i 1;
    if (
$curpage == $i) {
        
$is_first ' class="current"';
    } else {
        
$is_first '';
    }
    
$html .= '<a '.$is_first.' href="'.KAY_SITE.'/letter/'.$letter.'" title="Front Page of Letter '.$letter.'">'.$i.'</a>';

    for (
$i 2$i <= $lastIndex$i++) {
        if (
$curpage == $i) {
            
$curstyle ' class="current"';
        } else {
            
$curstyle '';   
        }
        
$html .= '<a '.$curstyle.' href="'.KAY_SITE.'/letter/'.$letter.'/'.$i.'" title="Page '.$i.' of Letter '.$letter.'">'.$i.'</a>';
    }
    
$html .= '';
   
    
$html2 '';
    if (
$curpage == 1) {
        if (
$lastIndex == 1) {
            
$html2 .= '<span class="disabled">&laquo; Previous</span>';
            
$html2 .= '<span class="disabled">Next &raquo;</span>';
        } else {
            
$next_page $curpage 1;
            
$html2 .= '<span class="disabled">&laquo; Previous</span>';
            
$html2 .= "<a href=\"".KAY_SITE."/letter/$letter/$next_page\" title=\"Next Page\">Next &raquo;</a>";
        }
    } elseif (
$curpage == $lastIndex) {
        
$prev_page $curpage 1;
        
$html2 .= "<a href=\"".KAY_SITE."/letter/$letter/$prev_page\" title=\"Previous Page\">&laquo; Previous</a>";
        
$html2 .= '<span class="disabled">Next &raquo;</span>';
    } else {
        
$next_page $curpage 1;
        
$prev_page $curpage 1;
        
$html2 .= "<a href=\"".KAY_SITE."/letter/$letter/$prev_page\" title=\"Previous Page\">&laquo; Previous</a>";
        
$html2 .= "<a href=\"".KAY_SITE."/letter/$letter/$next_page\" title=\"Next Page\">Next &raquo;</a>";
    }
    
$html2 .= '</div>';
   
    if (
$updown) {
        
$html $html2.$html;
    } else {
        
$html $html.$html2;
    }
   
    return 
$html;

thank you for your help,
arale
Attached Images
  
__________________
Zend decode is possible!
www.zendecode.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-03-09, 06:46 PM
Jcbones Jcbones is offline
Coding Addict
 
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 269
Thanks: 3
Thanked 3 Times in 3 Posts
Do you want the navigation to always start with 1, and "x" amount of numbers before last page?

OR,

Do you want "x" amount of numbers before current page, and "x" amount of numbers after current page?

Or,

Do you want "x" amount of numbers before the page, and "x" amount of number before the last page?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Navigation menu problem with Firefox and Chrome. KuJoe CSS 3 04-21-09 02:33 PM
login, roles problem dbrook007 ASP.NET 10 11-10-06 04:42 PM
Form Display Problem neevrap02 Visual Basic 1 09-05-06 06:18 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 10:13 AM
problem with next and previous links abtimoteo Perl 0 01-05-04 02:13 PM


All times are GMT -5. The time now is 11:28 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.