1
RiazShahid
Pagination in Articles modules

Hello,
I am having a site with loads of articles with every article more than 100 pages or so. Articles are scanned images.
In all article modules (like Publisher etc.), the user have to click the next number of page, every time he wants to move to next page.
Is it possible, that user can click on the image to move to next page?
It will help users a lot.
Any help will be appreciated.

Thanks

2
RiazShahid
Re: Pagination in Articles modules

Nobody to respond here?

3
novlang1984
Re: Pagination in Articles modules

See class/pagenav.php, you can choose :
- txt navigation
- img navigation
- dropdown list navigation

/**
     * Create text navigation
     *
     * @param integer $offset
     * @return string
     */
    
function renderNav($offset 4)
    {
        
$ret '';
        if (
$this->total <= $this->perpage) {
            return 
$ret;
        }
        
$total_pages ceil($this->total $this->perpage);
        if (
$total_pages 1) {
            
$ret .= '';
            
$prev $this->current $this->perpage;
            if (
$prev >= 0) {
                
$ret .= '$this->url $prev $this->extra '">« ';
            }
            
$counter 1;
            
$current_page intval(floor(($this->current $this->perpage) / $this->perpage));
            while (
$counter <= $total_pages) {
                if (
$counter == $current_page) {
                    
$ret .= '(' $counter ') ';
                } elseif ((
$counter $current_page $offset && $counter $current_page $offset) || $counter == || $counter == $total_pages) {
                    if (
$counter == $total_pages && $current_page $total_pages $offset) {
                        
$ret .= '... ';
                    }
                    
$ret .= '$this->url . (($counter 1) * $this->perpage) . $this->extra '">' $counter ' ';
                    if (
$counter == && $current_page $offset) {
                        
$ret .= '... ';
                    }
                }
                
$counter ++;
            }
            
$next $this->current $this->perpage;
            if (
$this->total $next) {
                
$ret .= '$this->url $next $this->extra '">» ';
            }
            
$ret .= '
 ';
        }
        return 
$ret;
    }
    
    
/**
     * Create a navigational dropdown list
     *
     * @param boolean $showbutton Show the "Go" button?
     * @return string
     */
    
function renderSelect($showbutton false)
    {
        if (
$this->total $this->perpage) {
            return;
        }
        
$total_pages ceil($this->total $this->perpage);
        
$ret '';
        if (
$total_pages 1) {
            
$ret '';
            
$ret .= '';
            
$counter 1;
            
$current_page intval(floor(($this->current $this->perpage) / $this->perpage));
            while (
$counter <= $total_pages) {
                if (
$counter == $current_page) {
                    
$ret .= '$this->url . (($counter 1) * $this->perpage) . $this->extra '" selected="selected">' $counter '';
                } else {
                    
$ret .= '$this->url . (($counter 1) * $this->perpage) . $this->extra '">' $counter '';
                }
                
$counter ++;
            }
            
$ret .= '';
            if (
$showbutton) {
                
$ret .= _GO '" />';
            }
            
$ret .= '';
        }
        return 
$ret;
    }
    
    
/**
     * Create navigation with images
     *
     * @param integer $offset
     * @return string
     */
    
function renderImageNav($offset 4)
    {
        if (
$this->total $this->perpage) {
            return;
        }
        
$total_pages ceil($this->total $this->perpage);
        
$ret '';
        if (
$total_pages 1) {
            
$ret '';
            
$prev $this->current $this->perpage;
            if (
$prev >= 0) {
                
$ret .= '$this->url $prev $this->extra '"><';
            } else {
                
$ret .= '';
            }
            
$counter 1;
            
$current_page intval(floor(($this->current $this->perpage) / $this->perpage));
            while (
$counter <= $total_pages) {
                if (
$counter == $current_page) {
                    
$ret .= '$counter '';
                } elseif ((
$counter $current_page $offset && $counter $current_page $offset) || $counter == || $counter == $total_pages) {
                    if (
$counter == $total_pages && $current_page $total_pages $offset) {
                        
$ret .= '...';
                    }
                    
$ret .= '$this->url . (($counter 1) * $this->perpage) . $this->extra '">' $counter '';
                    if (
$counter == && $current_page $offset) {
                        
$ret .= '...';
                    }
                }
                
$counter ++;
            }
            
$next $this->current $this->perpage;
            if (
$this->total $next) {
                
$ret .= '
$this->url $next $this->extra '">>';
            } else {
                
$ret .= '
';
            }
            
$ret .= '
XOOPS_URL '/images/blank.gif" width="6" alt="" />XOOPS_URL '/images/blank.gif" width="6" alt="" />XOOPS_URL '/images/blank.gif" width="6" alt="" />XOOPS_URL '/images/blank.gif" width="6" alt="" />
'
;
        }
        return 
$ret;
    }
}

Login

Who's Online

357 user(s) are online (236 user(s) are browsing Support Forums)


Members: 0


Guests: 357


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits