This is sweet. I like it the way it is. I don't see a need to add anything more.
476 2007-07-25 21:43
Re: 'all discussions' or 'forums' listing (16 replies, posted in Feature requests)
477 2007-07-25 00:58
Re: 'all discussions' or 'forums' listing (16 replies, posted in Feature requests)
When are you going to release it?
478 2007-07-23 01:06
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I am on MSN now..9:06pm Sunday
479 2007-07-22 23:20
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
yes, that's what I meant.
480 2007-07-22 21:04
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
with this mod it is best to install the Frontpage mod which is available on http://punres.org wiki. It is very simple to setup.
Bingiman
481 2007-07-22 11:33
Re: home page (1 replies, posted in PunBB 1.2 discussion)
482 2007-07-15 23:06
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Please refer to this post:
483 2007-07-14 01:37
Re: Latest Topics on Frontpage (22 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I managed to use the code from this mod: http://www.punres.org/viewtopic.php?pid=18346#p18346 and I got this thing working perfectly now. Here is my code:
<?php
showRecent(10); // Set amount of posts to be displayed here
function showRecent($show=5) {
global $lang_common, $db, $pun_config, $db_prefix;
$order_by = 't.last_post';
$forum_sql = '';
//$show = isset($_GET['show']) ? intval($_GET['show']) : 5;
//if ($show < 1 || $show > 50) $show = 5;
$trunc_len = 15; // Set amount of text to be displayed in subject.
// Fetch $show topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
echo '<div class="block"><h2><span>Recent 10 Posts</span></h2>';
echo '<div class="box"><div class="inbox"><dl>';
while ($cur_topic = $db->fetch_assoc($result)) {
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
$subject_truncated = pun_htmlspecialchars($cur_topic['subject']);
echo '<dd><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.substr($cur_topic['subject'], 0, $trunc_len).'</a>...</dd>'."\n";
}
echo '</dl></div></div></div>';
return;
}
484 2007-07-09 00:53
Re: Setting the image path based on user style (14 replies, posted in General discussion)
I used the following and it works great!
/* display blog indicators */
dd.icon_dot,
dd.icon_dot_red,
dd.icon_dot_blue,
dd.icon_dot_green {
padding-left: 7px
}
Thank you!
Bingiman
485 2007-07-09 00:00
Re: Setting the image path based on user style (14 replies, posted in General discussion)
I actually used 2 . For some reason padding has no effect on it at all. You can see it on http://shednotes.com under the blog menu.
Thanks Paul
486 2007-07-08 22:30
Re: Setting the image path based on user style (14 replies, posted in General discussion)
I used the following and it seemed to work fine:
.icon_dot {
color: #EDEFF4;
background-position: 0% 65%;
background-repeat: no-repeat;
background-image: url('../../img/Aphrodite/blog_icon_dot.gif');
padding: 0px;
}
487 2007-07-08 22:13
Re: Setting the image path based on user style (14 replies, posted in General discussion)
I tried but nothing seems to line up as far as the images go.
488 2007-07-08 21:13
Re: Setting the image path based on user style (14 replies, posted in General discussion)
ok, thanks Paul. I will go try that now.
489 2007-07-08 21:08
Re: Setting the image path based on user style (14 replies, posted in General discussion)
I am just showing you the original code before I tried the above. I did try the code above and it doesn't work. I replaced all the img paths with the one posted here and it doesn't work.
490 2007-07-08 21:01
Re: Setting the image path based on user style (14 replies, posted in General discussion)
I am using it inside include/user/blogmenu.php and it doesn't work. Here is the script.
<?php
/*********************************************************************
start output of the left block
*********************************************************************/
require PUN_ROOT.'lang/'.$pun_user['language'].'/blog.php';
if ($bid > 0 || $cid > 0 || $cat_id > 0 || $pop > 0 || $lat > 0 || $comm > 0)
{
?>
<?php
}
?>
<div class="block">
<h2 class="block2"><span><?php echo $lang_blog['Blogs menu'] ?></span></h2>
<div class="box">
<div class="inbox"><dl>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="blogs.php"><?php echo $lang_blog['User blogs'] ?></a></dd>
<?php
if (!$pun_user['is_guest'])
{
?>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="blogs.php?bid=<?php echo $pun_user['id'] ?>"><?php echo $lang_blog['View mine'] ?></a></dd>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="blogs.php?uid=<?php echo $pun_user['id'] ?>"><?php echo $lang_blog['Create'] ?></a></dd>
<?php
}
if ($pun_user['is_guest'])
{
$result = $db->query('SELECT cat_id FROM '.$db->prefix.'blog_perms WHERE post_cat=1 AND group_id=3') or error('Unable to fetch blog info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
?>
<dd><a href="blogs.php?uid=<?php echo $pun_user['id'] ?>">Create New Blog</a></dd>
<?php
}
}
?>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="blogs.php?lat=1"><?php echo $lang_blog['Latest'] ?></a></dd>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="blogs.php?pop=1"><?php echo $lang_blog['Most viewed'] ?></a></dd>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="blogs.php?comm=1">Most Commented</a></dd>
<dd><img style="vertical-align: middle;" src="img/blog_icon_dot.gif" alt="" /> <a href="userlist.php?bloggers"><?php echo $lang_blog['Blogger list'] ?></a></dd>
</dl><hr />
<dl>
<dt><span class="blogcats"><?php echo $lang_blog['Categories'] ?></span></dt>
<?php
$result = $db->query('SELECT c.* FROM '.$db->prefix.'blog_categories AS c LEFT JOIN '.$db->prefix.'blog_perms AS p ON (p.cat_id=c.id AND p.group_id='.$pun_user['g_id'].') WHERE p.read_cat IS NULL OR p.read_cat=1 ORDER BY c.num_blogs DESC') or error('Unable to fetch blog info', __FILE__, __LINE__, $db->error());
while ($cat = $db->fetch_assoc($result))
{
?>
<dd><img style="vertical-align: middle;" src="img/blog_icon_redarrow.gif" alt="" /> <a href="blogs.php?cat_id=<?php echo $cat['id'] ?>"><?php echo pun_htmlspecialchars($cat['categories']) ?> - <?php echo $cat['num_blogs'] ?></a></dd>
<?php
}
?>
</dl><hr />
<dl>
<dt><span class="bloglatest"><?php echo $lang_blog['Latest'] ?></span></dt>
<?php
//$result = $db->query('SELECT * FROM '.$db->prefix.'blogs ORDER BY id DESC LIMIT 0 , 10') or error('Unable to fetch blog info', __FILE__, __LINE__, $db->error());
$result = $db->query('SELECT b.* FROM '.$db->prefix.'blogs AS b LEFT JOIN '.$db->prefix.'blog_perms AS p ON (p.cat_id=b.cat_id AND p.group_id='.$pun_user['g_id'].') WHERE p.read_cat IS NULL OR p.read_cat=1 ORDER BY b.id DESC LIMIT 0 , 10') or error('Unable to fetch blog info', __FILE__, __LINE__, $db->error());
while ($cur_blog = $db->fetch_assoc($result))
{
?>
<dd><img style="vertical-align: middle;" src="img/blog_icon_bluearrow.gif" alt="" /> <a href="blogs.php?cid=<?php echo $cur_blog['id'] ?>&c_id=<?php echo $cur_blog['id'] ?>" title="<?php echo $cur_blog['heading'] ?>"><?php echo substr($cur_blog['heading'],0 ,15) ?>...</a></dd>
<?php
}
?>
</dl><hr />
<dl>
<dt><span class="bloglatest_bloggers"><?php echo $lang_blog['Latest bloggers'] ?></span></dt>
<?php
$result = $db->query('SELECT DISTINCT poster, poster_id FROM '.$db->prefix.'blogs') or error('Unable to fetch blog info', __FILE__, __LINE__, $db->error());
while ($blogger = $db->fetch_assoc($result))
{
?>
<dd><img style="vertical-align: middle;" src="img/blog_icon_greenarrow.gif" alt="" /> <a href="blogs.php?bid=<?php echo $blogger['poster_id'] ?>"><?php echo pun_htmlspecialchars($blogger['poster']) ?></a></dd>
<?php
}
?> </dl>
</div>
</div>
</div>
491 2007-07-08 20:08
Re: Setting the image path based on user style (14 replies, posted in General discussion)
That actualyl doesn't work for me. This is what I am using.
<img style="vertical-align: middle;" src="'.$pun_config[o_base_url].'/img/'.$pun_user['style'].'/blog_icon_dot.gif">
493 2007-07-08 02:58
Topic: Aphrodite Theme (3 replies, posted in PunBB 1.2 show off)
Just thought I would show you guys a new theme that I ported for use with punBB. It is a phpBB Theme called Aphrodite made by phpBBStyles.com
Here is the link to my site. It is the default theme.
http://shednotes.com
Cheers!
Bingiman
494 2007-07-08 01:17
Topic: Setting the image path based on user style (14 replies, posted in General discussion)
I am trying to figure out how I can add an image for example this works in viewtopic
<img src="img/'.$pun_user['style'].'/buttons/btn_icon_email.png">
but the same image path does not work in any other file for me. I am trying to get it to work on a file that resides in my include/user folder. Can someone please tell me what it is I need to add to make it work.
Thanks
Bingiman
495 2007-07-06 17:24
Re: Importing a database into mega punbb (4 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Why not install Mega Pun and then import your existing tables into it?
496 2007-07-05 21:07
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Here is my completed version of the news index.php file. This one has all of the problems fixed as far as the Edit, Quote and Delete functions go. Thanks to soonotes
<?php
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
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
$forumids = array(1,3);
//This is the overall limit for how many news items will be displayed
$master_limit = '5';
//This is the amount of characters above which truncation will occur
$trunc_chars = '350';
//----------------------------------------------------------------------//
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 title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' 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 title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' 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 title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' 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="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_post['id'].'">Read More</a> | ';
}
else
{
$read_more = ' | ';
}
if ($cur_post['num_replies'] != '0')
{
$replies = ' <a href="'.$pun_config['o_base_url'].'/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 align="left" style="white-space: nowrap; width: 9em; padding-left: 7px; padding-top: 6px; padding-bottom: 30px; border: 0px;" valign="top"><?php echo $user_avatar ?></td>
<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';
?>
There were also changes to the news footer area so I have posted the classes that must reside in your stylesheet_cs.css file below:
/* News Links on index page */
.news_subject {
background-color: inherit;
color: #A8B055;
font: 1.6em/1.7em Georgia, "Times New Roman", serif;
text-decoration:none;
}
a.news_subject:hover {
background-color: inherit;
color: #ECA205;
text-decoration: none;
border-bottom:1px dotted #ECA205
}
.news_footer {
background-color: #1D2435;
color: inherit;
border-top: 1px solid #313A50;
border-left: 1px solid #313A50;
border-bottom: 1px solid #313A50;
border-right: 1px solid #313A50;
}
.byuser {
font-weight: normal;
color: #A58B02;
background-color: inherit
}
.user {
font-weight: normal;
color: #6C695D;
background-color: inherit
}
.poster {background-color: inherit; color: #8E94A3 }
a.poster {background-color: inherit; text-decoration: none; color: #8E94A3 }
a.poster:visited {background-color: inherit; text-decoration: none; color: #8E94A3 }
a.poster:hover {background-color: inherit; color: #FFFFFF; text-decoration: none; border-bottom: 1px solid #6C7283 }
497 2007-07-03 23:45
Re: 12 year old Filip mastering joggling with a ball (2 replies, posted in General discussion)
Totally amazing! That kid will make a name for himself one day. I say...hmm...next 2 world cups.
498 2007-07-03 19:14
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
<?php
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
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
$forumids = array(1,3);
//This is the overall limit for how many news items will be displayed
$master_limit = '5';
//This is the amount of characters above which truncation will occur
$trunc_chars = '350';
//----------------------------------------------------------------------//
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
}
?>
<div style="padding-bottom: 15px;padding-top: 8px;">
<?php
include('mod_active_topics.php');
?></div>
<?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.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 title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' 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 title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' 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 title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' 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="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_post['id'].'">Read More</a> | ';
}
else
{
$read_more = ' | ';
}
if ($cur_post['num_replies'] != '0')
{
$replies = ' <a href="'.$pun_config['o_base_url'].'/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 align="left" style="white-space: nowrap; width: 8em; padding-left: 7px; padding-top: 6px; padding-bottom: 30px; border: 0px;" valign="top"><?php echo $user_avatar ?></td>
<td style="text-align: left; border: 0px; padding-top: 0px;" valign="top"><?php echo $news_message."\n" ?></td>
</tr>
</table>
<table class="news_footer" width="100%">
<tr>
<td>
<?php
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";
if ($cur_post['poster_id'] == $pun_user['id'] || $pun_user['g_id'] < PUN_GUEST)
{
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['id'].'">'.$lang_topic['Report'].'</a>'.' | <a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a> | <a href="edit.php?id='.$cur_post['id'].'">'.$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['id'].'">'.$lang_topic['Quote'].'</a>'.'</span>'."\n\n\n\n";
}
?>
</td>
</tr>
</table>
</li></ul>
</div>
</div>
</div>
<?php
}
}
?>
<div style="text-align: center;">Theme Designed by: Shedrock - <a onclick="window.open(this.href); return false;" href="http://shednotes.com">shednotes.com</a></div>
<br/>
<?php
require PUN_ROOT.'footer.php';
?>
499 2007-07-03 18:09
Re: New frontpage index mod! (188 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Something is wrong with this mod. There just has to be. I still have this problem where I am at post #15 but when I click on the main page to either "Edit", "Quote" or "Delete" the actual post it takes me to a completely different post. I do not have this issue while in viewtopic. I've asked soonotes to have a look at it for me so hopefully it can get resolved.
I think it is not reading the total amount of post in the different forums so the post count on the index is incorrect.
500 2007-07-03 16:26
Re: Problem when I view IP address (6 replies, posted in PunBB 1.2 troubleshooting)
Actually, I found the problem. It is the <include recenttopics.inc.php> that file is causing the error. I just haven't updated the site yet. I was just doing some mods to the whole site. Anyway, I don't have a solution to the above mentioned problem. I posted the code above but I am lost as to why it is causing these errors.