Archive for the ‘Web Apps’ Category

A Customizable Tag Cloud For WordPress

Tuesday, August 26th, 2008
Posted in Web Apps · Tags: ,

If you’ve tried using wp_tag_cloud() as an array, you’ve noticed that all it really does is give you a string, which isn’t useful. The only way I could figure out how to get the tags to where I can format them how I want was to call get_tags() in wp-includes/category.php. You can also pass arguments to it to sort it differently. Take a look at get_terms() in wp-includes/taxonomy.php to get an idea of what you can do.

Here is a hack I put together that will output your tags as a unordered list (UL) with the total number of times the tag is used in parenthesis. You can place this code in sidebar.php

$tag_array = get_tags('orderby=count&order=DESC&number=15');
$tag_total = count($tag_array);
echo '<ul>';
for ($x = 0; $x < $tag_total; $x++)
{
echo '<li>';
echo '<a href="' . get_option('home') . '/tag/' . $tag_array[$x]->slug . '/" rel="tag">';
echo $tag_array[$x]->name;
echo '</a>';
echo ' (' . $tag_array[$x]->count . ') ';
echo '</li>';
}
echo '</ul>';

PunBB forks into FluxBB

Friday, May 9th, 2008
Posted in PunBB · 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 informer.com 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.

Last Modified Posts in WordPress

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

Want to show the last posts you updated in WordPress? This shows the posts you went back and updated or modified, which is different than your recent posts.


<?php
query_posts('showposts=10&orderby=modified&order=DESC');
if (have_posts())
{
echo '<h3>Last Modified Posts</h3>';
echo '<ul>' . "\n";
while (have_posts()) : the_post();
echo '<li>';
echo '<a href="' . get_permalink() . '">' . the_title('','', false) . '</a>';
echo '</li>' . "\n";
endwhile;
echo '</ul>';
}
?>

RSS feeds in PunBB

Saturday, March 8th, 2008
Posted in PunBB · 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 PunBB · 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

$temp_counter++;

Then find this line

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

And modify it to be this instead

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

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 {
float:left;
display:block;
width:28px;
height:25px;
background-repeat:no-repeat;
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