2013-08-05, 08:03 PM
Alright so I installed this plugin called latest thread, where the title of the latest threads rotate at the top, but I also have two private sections on my forum and i don't want the threads from those sections to show up on it... is there a way to do this?
<?php
/* latest threads to be placed on index page */
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
// Plugin hook
$plugins->add_hook("index_end", "latestthreads");
// Plugin info
function latestthreads_info()
{
return array(
"name" => "latest threads",
"description" => "to add latest threads on index",
"website" => "...",
"author" => "...",
"authorsite" => "...",
"version" => "1.0",
"guid" => "",
"compatibility" => "1*"
);
}
// Run plugin
function latestthreads()
{
global $mybb, $db, $latestthreads;
$max = 10;
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY
$latestthreads = '<marquee scrollamount=3>';
while($result = $db->fetch_array($query))
{
$latestthreads .= " <a href=\"showthread.php?tid={$result['tid']}\">".htmlspecialchars_uni($result['subject'])."</a>";
$latestthreads .= " ";
}
$latestthreads .= '</marquee>';
return $latestthreads;
}
?>
<?php
/* latest threads to be placed on index page */
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
// Plugin hook
$plugins->add_hook("index_end", "latestthreads");
// Plugin info
function latestthreads_info()
{
return array(
"name" => "latest threads",
"description" => "to add latest threads on index",
"website" => "...",
"author" => "...",
"authorsite" => "...",
"version" => "1.0",
"guid" => "",
"compatibility" => "1*"
);
}
// Run plugin
function latestthreads()
{
global $mybb, $db, $latestthreads;
$max = 10;
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY
tid
DESC LIMIT $max"); $latestthreads = '<marquee scrollamount=3>';
while($result = $db->fetch_array($query))
{
$latestthreads .= " <a href=\"showthread.php?tid={$result['tid']}\">".htmlspecialchars_uni($result['subject'])."</a>";
$latestthreads .= " ";
}
$latestthreads .= '</marquee>';
return $latestthreads;
}
?>