MyBB Community Forums

Full Version: myBB Thread Cloud
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
goughy000 Wrote:does anyone want the code?

can i have codes? its realy be good.
heres the code, you have to adjust the select query to stop it including the forums you dont want it to, i havn't had time to make it do it auto based on user privs.

<?php

/**
 * @author goughy000
 * @copyright 2007
 */

define("IN_MYBB", 1);
require_once "./global.php";
require_once "./inc/class_parser.php";


$latestthreads = $db->query("SELECT * FROM `".TABLE_PREFIX."threads` ORDER BY `lastpost` DESC LIMIT 30");

$highest = 0;

while($thread = $db->fetch_array($latestthreads)){
    if($thread['replies'] > $highest){
        $highest = $thread['replies'];
    }
}

$multiply = ($highest/25)*100;

$db->data_seek($latestthreads,0);

echo "<html><head><title>".$mybb->settings['bbname']." - Thread Cloud</title>";
echo $headerinclude;
echo "</head><body>";
echo $header;

echo "        <table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" class=\"tborder\">
            <tr>
                <td colspan=\"8\" class=\"thead\">

                    <strong>Latest Threads Cloud</strong>
                </td>
            </tr>
<tr>
                <td class=\"trow1\" style=\"text-align: center;\">";



while($thread = $db->fetch_array($latestthreads)){
    $fontsize = ceil((($thread['replies']/25)*$multiply)+10);
    
    
    echo "<a href=\"".$mybb->settings['bburl']."/showthread.php?tid=".$thread['tid']."\"><span style=\"font-size:".$fontsize."px\">".$thread['subject']."</span></a> |\r\n";
}

echo "</td>
</tr>
</table>";

echo $footer;

echo "</body></html>";

?>
You just put this in any .php file? This is cool... Big Grin Never knew this existed.
Can you give full code ?

This codes aren't true
thanks very nice : )
AlpereN Wrote:Can you give full code ?

This codes aren't true

this code is completely full code!!! i copied directly from my cloud.php file that i created.

and yes you can call it anything.php just make sure its in your mybb root.
These codes have a problem because the font is very big
AlpereN Wrote:These codes have a problem because the font is very big

Umm..that's a normal feature of a tag cloud.
Thank you goughy. I like that codes. I'll use them for my new site which is about MyBB but it wont include a forum Smile
AlpereN Wrote:These codes have a problem because the font is very big

thats not a problem with the code, thats a problem with your understanding of a thread cloud. Wink
Pages: 1 2 3