I thought it would be fun to have a "poster cloud" like the word cloud thing that people sometimes have on their blogs. I want to do a word cloud, too, but the posters were easier to start with.
Put the code below in a phpbox block. It will look at the 100 most recent posts on your forum and tally the number of posts within that 100 for each poster. It then prints out the posters' names in random order with the size of the font dependent on the number of posts for that poster. The fun thing is that the "cloud" will change from day to day or even hour to hour and it will encourage people to post so that they can see their names in the cloud.
I replaced spaces in names with a Ã‚Â·
character so that it wouldn't word-wrap in the middle of a username. The +7
is rather arbitrary, but it seemed to me that 8pt font (7 + 1 post) would be just about the smallest size that anyone could be expected to read.
$query = db_query(
ORDER BY posterTime DESC
LIMIT 100", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query))
$count[$row['posterName']] = 0;
$random = array_rand($count, count($count));
echo '<div style="text-align: center">';
foreach ($random as $value)
$fsize = $count[$value] + 7;
$name = str_replace(" ",'Ã‚Â·',$value);
echo '<span style="font-size:' . $fsize . 'pt;">' . $name . '</span> ';
The only drawback is that if you have a prolific poster with a really long name, it might distort your blocks.