[PBNL] Make your Hot Updates Paginated

I so hate calling this script PBNL. It is actually based on Uloki (By: Umakant Patil). But if i call it this way, many people wouldn't underztand what i mean so i gave the title PBNL.

Making your hot updates paginated is the latest requests i have been getting both through PMs and on this topic.

I will like to state that not all requests i receive will attended to. So don't waste your time requesting and requesting.

To use:

First edit your func.php. Change the function myupdates() to:

PHP Code

<?php
function myupdates($limit)
{
    
$updates_per_page 20//The number of updates you want per page
    
$total mysql_fetch_assoc(mysql_query("SELECT count(`id`) AS count FROM `b_updates`"));
    
$total $num["count"];
    
$query mysql_query("SELECT `id`, `prefix`, `title`, `url` FROM `b_updates` ORDER BY `id` DESC LIMIT $updates_per_page");
    
$num mysql_num_rows($query);
    if(
$num==0)
    {
        echo
"<div class='msg'>No updates yet</div>";
    } else {
        echo
"<h3><font color='red'><center>Exclusive Updates</center></font></h3><ul>";
        while(
$uinfo mysql_fetch_array($query))
        {
            
$prefix=$uinfo["prefix"];
            
$title=$uinfo["title"];
            
$url=$uinfo["url"];
            echo
"<li><center>$prefix <a href=$url style='color:#ffffff'>$title</a></center></li>";
        }
        echo
"</ul>";
    }
    echo 
'<div align="center" style="margin:4px;text-align:center">';
    
$page2 $updates_per_page;
    
$page3 $updates_per_page 2;
    echo 
'<span class="currentpage">1</span>';
    if(
$total $page2)
    {
        echo
'<a href="/updates.php?page=2"><span class="pages">2</span></a>';
    }
    if(
$total $page3)
    {
        echo
'<a href="/updates.php?page=3"><span class="pages">3</span></a>';
    }
    echo
'</div>';
}
?>
?>

Then upload the file attached below to your root-folder (which is 'public_html' or 'htdocs' in most cases).

I didn't text this file, so if you applied and it worked, comment below...

Comments

Keep up to date with our latest articles and uploads...