1 (edited by Tubby 2006-12-19 06:13)

Topic: Pun Page Links

Well, I have been trying to set up something similar to what vbulletin has. What it is is basically showing you where you are in bold and linking back to previous pages. Its jsut like the new feature that i have noticed in 1.3 and well im curious to know if it would be better to do this through include/functions.php and set it up as an array rather than setting the entire thing up in header.php and placing variable identifications through out different files.

Here is the code that iam working with:

// START SUBST - <pun_page_links>
    ob_start();
    
$page = isset($page) ? $page : NULL;
?>
<?php
if ($page == 'viewforum' || $page == 'moderate')
{
?>
<div id="pagelinks">
<a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_board_title'] ?></a>         » <?php echo '<strong>'.pun_htmlspecialchars($cur_forum['forum_name']).'</strong>'; ?>
</div>
<?
} else if ($page == 'viewtopic')
{ 
?>
<div id="pagelinks">
<a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_board_title'] ?></a>     » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a> » <strong><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></strong>
</div>
<?
} else if ($page == 'post')
{
?>
<div id="pagelinks">
<a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_board_title'] ?></a> » <strong><?php echo $cur_posting['forum_name'] ?></strong>
</div>
<?
} else if ($page == 'edit')
{
?>
<div id="pagelinks">
<a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_board_title'] ?></a> » <a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo $cur_post['forum_name'] ?></a> » <strong><?php echo $cur_post['subject'] ?></strong>
</div>
<?
} else if ($page == 'index')
{
?>
<div id="pagelinks">
 » <strong><?php echo $pun_config['o_board_title'] ?></strong>
</div>
<?
} else if ($page == '')
{
?>
<div id="pagelinks">
<a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_board_title'] ?></a> » <strong><?php echo $page_title ?></strong>
</div>
<?
}
?>
<?php

    $tpl_temp = trim(ob_get_contents());
    $tpl_main = str_replace('<pun_page_links>', $tpl_temp, $tpl_main);
    ob_end_clean();
// END SUBST - <pun_page_links>

you can view a small demo here if youd like: http://www.fatal-gfx.com