funchat/forumplugins/forumsnav.php
2025-06-02 22:38:25 +02:00

57 lines
1.7 KiB
PHP

<?php
/**
* MyBB 1.4
* Copyright © 2008 MyBB Group, All Rights Reserved
*
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*
* $Id: hello.php 4304 2009-01-02 01:11:56Z chris $
*/
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
require_once MYBB_ROOT.'inc/functions_forumlist.php';
$plugins->add_hook("global_start", 'forumnav');
//include "cache.class.php";
function forumsnav_info()
{
/**
* Array of information about the plugin.
* name: The name of the plugin
* description: Description of what the plugin does
* website: The website the plugin is maintained at (Optional)
* author: The name of the author of the plugin
* authorsite: The URL to the website of the author (Optional)
* version: The version number of the plugin
* guid: Unique ID issued by the MyBB Mods site for version checking
* compatibility: A CSV list of MyBB versions supported. Ex, "121,123", "12*". Wildcards supported.
*/
return array(
"name" => "Forum Nav",
"description" => "Nav of forums in the header",
"website" => "http://funch.at",
"author" => "genuineparts",
"authorsite" => "http://funch.at",
"version" => "1.3",
"guid" => "",
"compatibility" => "*"
);
}
function forumnav()
{
global $forumsnav,$mybb, $db;
$sql="SELECT * FROM `".$db->table_prefix."forums` WHERE `type`='f' AND active != 0 AND `pid` != 13 ORDER BY `pid`,`disporder`";
$result=$db->query($sql);
while($row=$db->fetch_array($result)){
$forum .= '<li><a href="/forum/forum-'.$row['fid'].'.html">'.$row['name'].'</a></li>';
}
$forumsnav=$forum;
}
?>