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 .= '<div id="xo-pagenav">';
            
$prev $this->current $this->perpage;
            if (
$prev >= 0) {
                
$ret .= '<a class="xo-pagarrow" href="' $this->url $prev $this->extra '"><u>&laquo;</u></a> ';
            }
            
$counter 1;
            
$current_page intval(floor(($this->current $this->perpage) / $this->perpage));
            while (
$counter <= $total_pages) {
                if (
$counter == $current_page) {
                    
$ret .= '<strong class="xo-pagact" >(' $counter ')</strong> ';
                } elseif ((
$counter $current_page $offset && $counter $current_page $offset) || $counter == || $counter == $total_pages) {
                    if (
$counter == $total_pages && $current_page $total_pages $offset) {
                        
$ret .= '... ';
                    }
                    
$ret .= '<a class="xo-counterpage" href="' $this->url . (($counter 1) * $this->perpage) . $this->extra '">' $counter '</a> ';
                    if (
$counter == && $current_page $offset) {
                        
$ret .= '... ';
                    }
                }
                
$counter ++;
            }
            
$next $this->current $this->perpage;
            if (
$this->total $next) {
                
$ret .= '<a class="xo-pagarrow" href="' $this->url $next $this->extra '"><u>&raquo;</u></a> ';
            }
            
$ret .= '</div> ';
        }
        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 '<form name="pagenavform">';
            
$ret .= '<select name="pagenavselect" onchange="location=this.options[this.options.selectedIndex].value;">';
            
$counter 1;
            
$current_page intval(floor(($this->current $this->perpage) / $this->perpage));
            while (
$counter <= $total_pages) {
                if (
$counter == $current_page) {
                    
$ret .= '<option value="' $this->url . (($counter 1) * $this->perpage) . $this->extra '" selected="selected">' $counter '</option>';
                } else {
                    
$ret .= '<option value="' $this->url . (($counter 1) * $this->perpage) . $this->extra '">' $counter '</option>';
                }
                
$counter ++;
            }
            
$ret .= '</select>';
            if (
$showbutton) {
                
$ret .= '&nbsp;<input type="submit" value="' _GO '" />';
            }
            
$ret .= '</form>';
        }
        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 '<table><tr>';
            
$prev $this->current $this->perpage;
            if (
$prev >= 0) {
                
$ret .= '<td class="pagneutral"><a href="' $this->url $prev $this->extra '"><</a></td><td><img src="' XOOPS_URL '/images/blank.gif" width="6" alt="" /></td>';
            } else {
                
$ret .= '<td class="pagno"></a></td><td><img src="' XOOPS_URL '/images/blank.gif" width="6" alt="" /></td>';
            }
            
$counter 1;
            
$current_page intval(floor(($this->current $this->perpage) / $this->perpage));
            while (
$counter <= $total_pages) {
                if (
$counter == $current_page) {
                    
$ret .= '<td class="pagact"><strong>' $counter '</strong></td>';
                } elseif ((
$counter $current_page $offset && $counter $current_page $offset) || $counter == || $counter == $total_pages) {
                    if (
$counter == $total_pages && $current_page $total_pages $offset) {
                        
$ret .= '<td class="paginact">...</td>';
                    }
                    
$ret .= '<td class="paginact"><a href="' $this->url . (($counter 1) * $this->perpage) . $this->extra '">' $counter '</a></td>';
                    if (
$counter == && $current_page $offset) {
                        
$ret .= '<td class="paginact">...</td>';
                    }
                }
                
$counter ++;
            }
            
$next $this->current $this->perpage;
            if (
$this->total $next) {
                
$ret .= '<td><img src="' XOOPS_URL '/images/blank.gif" width="6" alt="" /></td><td class="pagneutral"><a href="' $this->url $next $this->extra '">></a></td>';
            } else {
                
$ret .= '<td><img src="' XOOPS_URL '/images/blank.gif" width="6" alt="" /></td><td class="pagno"></td>';
            }
            
$ret .= '</tr></table>';
        }
        return 
$ret;
    }
}

Login

Who's Online

225 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 225


more...

Donat-O-Meter

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

Latest GitHub Commits