1

Topic: Pagination on PunPortal

I am looking for someone who is interested in adding pagination to the bottom of punportal pages (see: http://reviewstash.com) at the bottom of punportal's index to see previous postings.

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&show_group='.$show_group.'&sort_by='.$sort_by.'&sort_dir='.strtoupper($sort_dir));


?>
<div class="linkst">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>

That's what I got out of the userlist file, however I have no idea where to go from here, so here's my index file.

<?php
 
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';
 
//Set the page title here
$page_title = pun_htmlspecialchars('reviewstash / by the stash, for the stash');

define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT.'header.php';
require_once PUN_ROOT.'include/parser.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

//----------------------------------------------------------------------//

//These are the forums from which the news is retrieved - You may add more forums in the array. Make sure to seperate them with a (,)
$forumids = array(8,6,7);

//This is the overall limit for how many news items will be displayed
$master_limit = '10';

//This is the amount of characters above which truncation will occur
$trunc_chars = '1000';

//----------------------------------------------------------------------//

if ($pun_config['o_index_message_show'] == 1)
{
?>
    <div class="block">
        <h2><span><?php echo pun_htmlspecialchars($pun_config['o_index_message_head']) ?></span></h2>
        <div class="box">
            <div class="inbox">
            <?php echo $pun_config['o_index_message'] ?>
            </div>
        </div>
    </div>
<?php
}
?>
<?php
//----------------------------------------------------------------------//

function close_tags($string)
{
    if (preg_match_all ('/<([a-z]+)[ >]/', $string, $start_tags))
    {
        $start_tags = $start_tags[1];

        if (preg_match_all ('/<\/([a-z]+)>/', $string, $end_tags))
        {
            $complete_tags = array();
            $end_tags = $end_tags[1];

            foreach ($start_tags as $key => $val)
            {
                $posb = array_search ($val, $end_tags);
                if (is_integer ($posb))
                {
                    unset ($end_tags[$posb]);
                }
                else
                {
                    $complete_tags[] = $val;
                }
            }
        }
        else
        {
            $complete_tags = $start_tags;
        }

        $complete_tags = array_reverse ($complete_tags);
        for ($i = 0; $i < count ($complete_tags); $i++)
        {
            $string .= '</' . $complete_tags[$i] . '>';
        }
    }

        // Removes irrelevant tags
    $xhtml_tags = array ('</img>', '</hr>', '</br>');
    $string = str_replace ($xhtml_tags, '', $string);
    return $string;
}

//----------------------------------------------------------------------//

function truncate($string)
{
global $pun_config;
$trunc_chars = '350';
$length = $trunc_chars;
$append = '...';

    if (strlen ($string) <= $length)
    {
        return $string;
    }
    else if ($length > 0)
    {
        preg_match ('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$length.',}\b#U', $string, $matches);
        $string = $matches[0];
        $string = close_tags (preg_replace ('#\s*<[^>]+>?\s*$#', '', $string).$append);
        return $string;
    }
}

$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, u.use_avatar, u.num_posts, u.registered, u.title, p.id AS pid, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id IN ('.implode(',', $forumids).') AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$master_limit) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result))
{
    while($cur_post = $db->fetch_assoc($result))
    {
        echo '<div class="block">';
        if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
        }
        else
        {
            $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="img/noimage.gif" alt=""/></a>';
        }

      $news_message = parse_message($cur_post['message'], $cur_post['hide_smilies']);

        if (pun_strlen($news_message) > $trunc_chars)
        {
            $news_message = truncate($news_message);
            $read_more = ' | <a href="viewtopic.php?id='.$cur_post['id'].'">Read More</a> | ';
        }
        else
        {
            $read_more = ' | ';
        }

        if ($cur_post['num_replies'] != '0')
        {
            $replies = ' <a href="viewtopic.php?id='.$cur_post['id'].'#p'.$cur_post['last_post_id'].'">Replies</a>: '.$cur_post['num_replies'].' ';
        }
        else
        {
            $replies = ' Replies: '.$cur_post['num_replies'].' ';
        }

echo "\t\t\t\t\t\t\t".'<h2><strong><a href="forum.php">Forum</a> » <a href="viewforum.php?id='.$cur_post['forum_id'].'">'.pun_htmlspecialchars($cur_post['forum_name']).'</a>'.'</strong></h2>'."\n";
?>
    <div class="box">
        <div class="inbox">
<ul><li>
<table width="100%" border="0">
    <tr>
        <td style="border: 0px; padding: 0px 10px 7px 7px;"><a class="news_subject" href="viewtopic.php?id=<?php echo $cur_post['id']; ?>"><?php echo $cur_post['subject']; ?></a></td>
    </tr>
</table> 
<table width="100%" border="0">
    <tr>
        <td style="text-align: left; border: 0px; padding-top: 0px;" valign="top"><?php echo $news_message."\n" ?></td>
    </tr>
</table>

    <div style="padding-bottom: 20px;" class="news_footer"><div style="padding: 5px 5px 0px 5px;">

<?php

                if ($cur_post['poster_id'] == $pun_user['id'] || $pun_user['g_id'] < PUN_GUEST){
                echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>'.$read_more.'Views: '.$cur_post['num_views'].' |'.$replies.'</span></span>'."\n\n\n\n";
                echo "\t\t\t\t\t\t\t".'<a href="viewtopic.php?id='.$cur_post['id'].'">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'.'<span style="white-space: nowrap; float:right">'.'<a href="misc.php?report='.$cur_post['pid'].'">'.$lang_topic['Report'].'</a>'.' | <a href="delete.php?id='.$cur_post['pid'].'">'.$lang_topic['Delete'].'</a> | <a href="edit.php?id='.$cur_post['pid'].'">'.$lang_topic['Edit'].'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'">'.'Reply'.'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'&qid='.$cur_post['pid'].'">'.$lang_topic['Quote'].'</a>'.'</span></div></div>'."\n\n\n\n";
            }else{
                echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>'.$read_more.'Views: '.$cur_post['num_views'].' |'.$replies.'</span></span></div></div>'."\n";
}
?>   
</li></ul>
        </div>
    </div>
</div>
<?php
    }
}

require PUN_ROOT.'footer.php';

?>

Re: Pagination on PunPortal

just made this, have no idea if it ill work..

    if (strlen ($string) <= $length)
    {
        return $string;
    }
    else if ($length > 0)
    {
        preg_match ('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$length.',}\b#U', $string, $matches);
        $string = $matches[0];
        $string = close_tags (preg_replace ('#\s*<[^>]+>?\s*$#', '', $string).$append);
        return $string;
    }
}

// Fetch user count
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE forum_id'.('.implode(',', $forumids).')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);
// Determine the user offset (based on $_GET['p'])
$num_pages = ceil($num_users / 10);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
$start_from = 10 * ($p - 1);

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'index.php?'.strtoupper($sort_dir));
 
$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, u.use_avatar, u.num_posts, u.registered, u.title, p.id AS pid, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id IN ('.implode(',', $forumids).') AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$start_from, 10) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());
Sorry. Unactive due to personal life.

3

Re: Pagination on PunPortal

No go, thanks though

Re: Pagination on PunPortal

ok ill install pp on my local and make a worknig on tonight...

Sorry. Unactive due to personal life.

5

Re: Pagination on PunPortal

Matt, why are you using this for the page count? big_smile

$num_pages = ceil($num_users / 10);

Re: Pagination on PunPortal

I justed used the orgianal userlist items and havnt renamed them! well 10, thats how many they want to show?

Sorry. Unactive due to personal life.

7

Re: Pagination on PunPortal

Any progress? I can let you guys into my FTP if you need it.

8

Re: Pagination on PunPortal

Xsdmx: If no-one pops up some working code before then, I'll get a working copy sorted for you sometime during the week.

9

Re: Pagination on PunPortal

Thanks

10

Re: Pagination on PunPortal

works on mine smile

$page sets how many you want on a page, you ill need to change the master limit to how many pages you want * $perpage so you dont get just one page...

<?php
 
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';
 
//Set the page title here
$page_title = pun_htmlspecialchars('reviewstash / by the stash, for the stash');

define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT.'header.php';
require_once PUN_ROOT.'include/parser.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

//----------------------------------------------------------------------//

//These are the forums from which the news is retrieved - You may add more forums in the array. Make sure to seperate them with a (,)
$forumids = array(1);

//How many items on a page \\ Created by Utchin
$perpage= 2;

//This is the overall limit for how many news items will be displayed
$master_limit = '10';

//This is the amount of characters above which truncation will occur
$trunc_chars = '1000';

//----------------------------------------------------------------------//

if ($pun_config['o_index_message_show'] == 1)
{
?>
    <div class="block">
        <h2><span><?php echo pun_htmlspecialchars($pun_config['o_index_message_head']) ?></span></h2>
        <div class="box">
            <div class="inbox">
            <?php echo $pun_config['o_index_message'] ?>
            </div>
        </div>
    </div>
<?php
}
?>
<?php
//----------------------------------------------------------------------//

function close_tags($string)
{
    if (preg_match_all ('/<([a-z]+)[ >]/', $string, $start_tags))
    {
        $start_tags = $start_tags[1];

        if (preg_match_all ('/<\/([a-z]+)>/', $string, $end_tags))
        {
            $complete_tags = array();
            $end_tags = $end_tags[1];

            foreach ($start_tags as $key => $val)
            {
                $posb = array_search ($val, $end_tags);
                if (is_integer ($posb))
                {
                    unset ($end_tags[$posb]);
                }
                else
                {
                    $complete_tags[] = $val;
                }
            }
        }
        else
        {
            $complete_tags = $start_tags;
        }

        $complete_tags = array_reverse ($complete_tags);
        for ($i = 0; $i < count ($complete_tags); $i++)
        {
            $string .= '</' . $complete_tags[$i] . '>';
        }
    }

        // Removes irrelevant tags
    $xhtml_tags = array ('</img>', '</hr>', '</br>');
    $string = str_replace ($xhtml_tags, '', $string);
    return $string;
}

//----------------------------------------------------------------------//

function truncate($string)
{
global $pun_config;
$trunc_chars = '350';
$length = $trunc_chars;
$append = '...';

    if (strlen ($string) <= $length)
    {
        return $string;
    }
    else if ($length > 0)
    {
        preg_match ('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$length.',}\b#U', $string, $matches);
        $string = $matches[0];
        $string = close_tags (preg_replace ('#\s*<[^>]+>?\s*$#', '', $string).$append);
        return $string;
    }
}


// Fetch user count
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE forum_id =('.implode(',', $forumids).') ') or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);
// Determine the user offset (based on $_GET['p'])
$num_pages = ceil($num_users / $perpage);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
$start_from = $perpage * ($p - 1);

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'index.php?'.strtoupper($sort_dir));
?>
<div class="linkst">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>
<?php

$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, u.use_avatar, u.num_posts, u.registered, u.title, p.id AS pid, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id IN ('.implode(',', $forumids).') AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$start_from.', '.$perpage) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result))
{
    while($cur_post = $db->fetch_assoc($result))
    {
        echo '<div class="block">';
        if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
        }
        else
        {
            $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="img/noimage.gif" alt=""/></a>';
        }

      $news_message = parse_message($cur_post['message'], $cur_post['hide_smilies']);

        if (pun_strlen($news_message) > $trunc_chars)
        {
            $news_message = truncate($news_message);
            $read_more = ' | <a href="viewtopic.php?id='.$cur_post['id'].'">Read More</a> | ';
        }
        else
        {
            $read_more = ' | ';
        }

        if ($cur_post['num_replies'] != '0')
        {
            $replies = ' <a href="viewtopic.php?id='.$cur_post['id'].'#p'.$cur_post['last_post_id'].'">Replies</a>: '.$cur_post['num_replies'].' ';
        }
        else
        {
            $replies = ' Replies: '.$cur_post['num_replies'].' ';
        }

echo "\t\t\t\t\t\t\t".'<h2><strong><a href="forum.php">Forum</a> » <a href="viewforum.php?id='.$cur_post['forum_id'].'">'.pun_htmlspecialchars($cur_post['forum_name']).'</a>'.'</strong></h2>'."\n";
?>
    <div class="box">
        <div class="inbox">
<ul><li>
<table width="100%" border="0">
    <tr>
        <td style="border: 0px; padding: 0px 10px 7px 7px;"><a class="news_subject" href="viewtopic.php?id=<?php echo $cur_post['id']; ?>"><?php echo $cur_post['subject']; ?></a></td>
    </tr>
</table> 
<table width="100%" border="0">
    <tr>
        <td style="text-align: left; border: 0px; padding-top: 0px;" valign="top"><?php echo $news_message."\n" ?></td>
    </tr>
</table>

    <div style="padding-bottom: 20px;" class="news_footer"><div style="padding: 5px 5px 0px 5px;">

<?php

                if ($cur_post['poster_id'] == $pun_user['id'] || $pun_user['g_id'] < PUN_GUEST){
                echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>'.$read_more.'Views: '.$cur_post['num_views'].' |'.$replies.'</span></span>'."\n\n\n\n";
                echo "\t\t\t\t\t\t\t".'<a href="viewtopic.php?id='.$cur_post['id'].'">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'.'<span style="white-space: nowrap; float:right">'.'<a href="misc.php?report='.$cur_post['pid'].'">'.$lang_topic['Report'].'</a>'.' | <a href="delete.php?id='.$cur_post['pid'].'">'.$lang_topic['Delete'].'</a> | <a href="edit.php?id='.$cur_post['pid'].'">'.$lang_topic['Edit'].'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'">'.'Reply'.'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'&qid='.$cur_post['pid'].'">'.$lang_topic['Quote'].'</a>'.'</span></div></div>'."\n\n\n\n";
            }else{
                echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>'.$read_more.'Views: '.$cur_post['num_views'].' |'.$replies.'</span></span></div></div>'."\n";
}
?>   
</li></ul>
        </div>
    </div>
</div>
<?php
    }
}

require PUN_ROOT.'footer.php';

?>
Sorry. Unactive due to personal life.

11

Re: Pagination on PunPortal

So close. Now, how do you have multiple forumids?

$forumids = array(1);
doing
$forumids = array(1,2,3);
results in an error

12

Re: Pagination on PunPortal

Also, how would you place the "pages: 1,2,3" at the bottom of the index page?
Thanks

13

Re: Pagination on PunPortal

hmm not too sure why that woudnt work, but if you change it to "or" insted of "," it seems to work (maby MattF can help me out)

// Fetch user count
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE forum_id =('.implode(' or', $forumids).') ') or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);

and put this where you want the page's to show.

<div class="linkst">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>
Sorry. Unactive due to personal life.

14

Re: Pagination on PunPortal

Change:

WHERE forum_id =(

to:

WHERE forum_id IN (

15

Re: Pagination on PunPortal

There doesn't seem to be any actual place within the file that allows the page links to show DIRECTLY at the bottom, only within each box, and at the top.

16 (edited by MattF 2008-02-11 18:30)

Re: Pagination on PunPortal

<?php
    }
}

?>

[Put the pagination links code here]

<?php

require PUN_ROOT.'footer.php';

?>

17

Re: Pagination on PunPortal

That did the trick, thanks. One last thing, how would I go about removing the footer from the index only, yet still keep everything formated correctly? When I remove the "require: footer.php" I get an improperly formated page. Thanks.

18

Re: Pagination on PunPortal

You'd have to modify footer.php, or make a second stripped down version of it. Not really worth the hassle, to be honest, unless you *really* do want to get rid of the footer.

19

Re: Pagination on PunPortal

Doesn't seem worth it. Thanks for the help.