Posts Tagged ‘PunBB’

PunBB forks into FluxBB

Friday, May 9th, 2008
Posted in Web Apps · Tags: ,

Is this a repeat of what happened to Mambo and Joomla!?

Awhile back the rights to PunBB were sold to a company.

Apart from sponsoring the project, they wanted to later down the line offer paid-for web services in relation to PunBB (for example commercial grade PunBB hosting). We decided we liked the idea and sold the rights to the project.

Then a recent switch to a new domain occurred.

Moving the PunBB website under the domain is a way for our benefactors to promote their other services to the PunBB community and to promote PunBB to users of their other services.

Today many of the active developers mentioned they were forking the project into what they call FluxBB.

Some of you may have been wondering about the future of PunBB and the current development team following Rickard’s announcement that he will not be actively involved with PunBB, at least for the time being. … Now that circumstances have changed with the inevitable shift of power within the project, we all feel that we need a degree of control over future development which is no longer possible. We all share a desire to develop software for the benefit of the community and ourselves, without commercial concerns influencing the final product. This is not a condemnation of PunBB’s current owners: we simply feel that this change is necessary so that we as developers can maintain full control over the development process.

It didn’t bother me they had sold the rights to PunBB as long as it remained GPL, but what this split means now, I’m not sure. How many people will now abandon PunBB for FluxBB? A lot depends on how active the FluxBB project becomes and if the new PunBB development takes off.

RSS feeds in PunBB

Saturday, March 8th, 2008
Posted in Web Apps · Tags: ,

These are quick easy hacks to get RSS feeds for each forum on the index.php page and viewforum.php pages.

I covered how to put the main RSS feed on PunBB already.

Open up index.php and after this line

$forum_field = '<h3><a href="viewforum.php?id='.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';

Add this

$forum_field .= '<div class="forum_rss"><a class="rss" href="extern.php?action=active&type=RSS&fid='.$cur_forum['fid'].'"><span>RSS</span></a></div>';/

Now open up viewforum.php and find this line

<h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span></h2>

and modify it to be

<h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?> <a class="rss" href="extern.php?action=active&type=RSS&fid=<?php echo $id /*MODIFIED - RSS*/ ?>"><span>RSS</span></a></span></h2>

And now for the CSS

.forum_rss {float:right;}
a.rss {background:url(../../img/feed.png) no-repeat left; width:16px; height:16px; padding-left:20px;}
a.rss span {display:none;}

Odd and Even Forums and Hot Icons for PunBB

Tuesday, February 12th, 2008
Posted in Web Apps · Tags: ,

PunBB adds classes for odd and even posts, but not for odd and even forum rows. PunBB also adds several classes for icons we can tap into, but there is no way to know if a topic is “hot”. Let’s add a hack that will mark any topic that has more than 25 posts as “hot” and setup odd and even forum rows.

Open up viewforum.php

Find this line

// If there are topics in this forum.
if ($db->num_rows($result))

And add this afterwards

$temp_counter = 0;

Then find this line

// Should we show the "New posts" and/or the multipage links?
if (!empty($subject_new_posts) || !empty($subject_multipage))
$subject .= '  '.(!empty($subject_new_posts) ? $subject_new_posts : '');
$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';

And add this afterwards


Then find this line

<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>

And modify it to be this instead

<tr class="<?php
if ($temp_counter % 2)
echo 'forum_rowodd';
echo 'forum_roweven';
$temp_status = trim($item_status);
if (($cur_topic['num_replies'] > 25) && ($temp_status == '' || $temp_status == 'inew'))
if ($temp_status == '')
echo ' ihot';
echo ' ihot_inew';
else if ($item_status != '')
echo ' '.trim($item_status);

Now for CSS

/*style rows*/
tr.forum_rowodd {background-color:#eee;}
tr.forum_rowodd td.tc2, tr.forum_rowodd td.tc3 {background-color:#ddd;}
tr.forum_roweven {background-color:#ccc;}
tr.forum_roweven td.tc2, tr.forum_roweven td.tc3 {background-color:#bbb;}
/*style hot and hot new posts*/
tr.ihot div.icon {background-image:url(../../img/hot.png);}
tr.ihot_inew div.icon {background-image:url(../../img/hot_new.png);}
/*css we used for icons before*/
div.icon {
background-position:center center;
border:0 !important;
/*if you aren't using any images you can use something like this
tr.ihot DIV.icon {BORDER-COLOR: #600 #700 #800 #900}
tr.ihot_inew DIV.inew {BORDER-COLOR: #006 #007 #008 #009}

I updated code the code, since I didn’t like how it was before

More PunBB Styling

Monday, February 4th, 2008
Posted in Web Apps · Tags: ,

Want to style the usertitles in PunBB based on their usertype (as in styling admins, moderators, members and guests)? Open up viewtopic.php and after this line
<div class="postleft">

We are going to modify the DL to this:

<dl class="<?php
if ($user_title == 'Administrator')
echo 'usertype_admin';
else if ($user_title == 'Moderator')
echo 'usertype_mod';
else if ($user_title == 'Member')
echo 'usertype_member';
else if ($user_title == 'Guest')
echo 'usertype_guest';

I added it a little higher than you might of assumed, so you can style the username and avatars if you want also. Its easy to add new types if you have more groups than the standard ones.

Now for more CSS to make PunBB not so boring:

/*styles for the usertype hack*/
dd.usertitle {padding-left:20px; height:16px;}
dl.usertype_admin dd.usertitle {background:url(../img/award_star_gold_3.png) no-repeat left;}
dl.usertype_mod dd.usertitle {background:url(../img/bronze_medal.png) no-repeat left;}
dl.usertype_member dd.usertitle {background:url(../img/vcard.png) no-repeat left;}
dl.usertype_guest dd.usertitle {background:url(../img/status_offline.png) no-repeat left;}
/*style your announcements*/
DIV#announce H2 {BACKGROUND-COLOR:#ffc}
DIV#announce {BORDER-COLOR:#f90 #f90 #f90}
DIV#announce DIV.inbox {BACKGROUND-COLOR:#ffc}
/*style errors*/
DIV#posterror H2 {BACKGROUND-COLOR:#bf3030; color:#ff0;}
DIV#posterror {BORDER-COLOR:#bf3030 #bf3030 #bf3030}
DIV#posterror DIV.inbox {BACKGROUND-COLOR:#592d2d}
#posterror LI STRONG {COLOR:#ff0}
/*style messages (info boxes from punbb)*/
DIV#msg {color:#fff;}
DIV#msg H2 {BACKGROUND-COLOR:#bfbf8f; color:#000;}
DIV#msg {BORDER-COLOR:#bfbf8f #bfbf8f #bfbf8f}
DIV#msg DIV.inbox {BACKGROUND-COLOR:#808060}
DIV#msg a {color:#89d9ff;}
DIV#msg a:hover {color:#b8ffff;}
/*style even row posts, odd posts will get default styling already set to them*/
DIV.roweven, DIV.roweven DIV.postright, DIV.roweven DIV.postfootright {BACKGROUND-COLOR:#c9c}
DIV.roweven DIV.postright, DIV.roweven DIV.postfootright {BORDER-LEFT-COLOR:#dad}
DIV.roweven DIV.postleft, DIV.roweven DIV.postfootleft, DIV.roweven DIV.blockpost LABEL {BACKGROUND-COLOR:#dad;}
DIV.roweven H2 {BACKGROUND-COLOR:#fcc}
DIV.roweven {BORDER-COLOR:#fcc #fcc #fcc}
/*style first post*/
DIV.firstpost, DIV.firstpost DIV.postright, DIV.firstpost DIV.postfootright {BACKGROUND-COLOR:#c96 !important;}
DIV.firstpost DIV.postright, DIV.firstpost DIV.postfootright {BORDER-LEFT-COLOR:#da7 !important}
DIV.firstpost DIV.postleft, DIV.firstpost DIV.postfootleft, DIV.firstpost DIV.blockpost LABEL {BACKGROUND-COLOR:#da7 !important}
DIV.firstpost {BORDER-COLOR:#fc9 #fc9 #fc9 !important}
DIV.firstpost H2 {BACKGROUND-COLOR:#fc9 !important;}
div.firstpost h2 span a, div.firstpost h2 span a:link, div.firstpost h2 span a:visited {color:#ccc !important;}
DIV.firstpost DIV.postright .postmsg {background:url(../../img/firstpost.png) no-repeat top right;}

More Styling for PunBB

Saturday, February 2nd, 2008
Posted in Web Apps · Tags: ,

Here is some more CSS styling for PunBB (Note: I put my images in the img folder):

/*style the forum titles*/
.pun .block H2, .pun .blocktable H2 {background-image:url(../../img/bullet_toggle_minus.gif); background-position:10px 50%; background-repeat:no-repeat;}
/*icons for admin moderation links*/
li.postreport a {background:url(../../img/error.gif) no-repeat left 50%; padding-left:20px;}
li.postdelete a {background:url(../../img/delete.gif) no-repeat left 50%; padding-left:20px;}
li.postedit a {background:url(../../img/pencil.gif) no-repeat left 50%; padding-left:20px;}
li.postquote a {background:url(../../img/comment.gif) no-repeat left 50%; padding-left:20px;}
/*post link*/
.postlink a {background:url(../img/add.gif) no-repeat right 50%; padding-right:20px !important;}

Fixed the CSS for .postlink