I need to show the category list which stored in database on the sidebar. I tried to write php code in a seperate file and add this php file as a plugin. which is like follows:
php file: forum_leftbar_plugin.php
PHP Code:
<?php
function display_categories() {
$sql = "SELECT blablabla FROM blablabla";
$result = mysql_query($sql);
while($row = mysql_fetch_row($result)) {
$categoryID = $row[0];
$title = $row[1];
print("
<div class='leftsidebutton'>
<a href='#' class='link'>$title</a>
</div>
");
}
}
display_categories();
?>
and this is a plugin which I add into global_start of both Right Column and vBulletin product.
Code:
ob_start();
include(path/to/file/forum_leftbar_plugin.php');
$forum_leftbar_plugin = ob_get_contents();
ob_end_clean();
I actived either one of them at a time, but when I loaded page from ie browser, it gave me this error message: ('null' is null or not an object) And the left bar has been disappeared.
Please help me out here.