Introduction
I just purchased new vBulletin blog and as always its very well coded but I guess when I any forum owner buys vBulletin blog his
aim is not to create an individual blog but make it Global Blog for the forums. At least I had such a requirement and so here is
an hack to do it. I am posting it here because I have not seen any hacks for the blog.
Background
I have created it such that every one has access to only categories created by me i.e. userid = 1 and if you would like this to
be different from 1 make changes accordingly in the code changes below.
First import the product using Admin CP > Plugins& Products > Manage Products > Add Import product . Also this involves
additional code as well as template changes and so I would list them here.
File : /includes/blog_functions.php
Find
PHP Code:
$cats = $vbulletin->db->query_read_slave("
SELECT blog_category.*
FROM " . TABLE_PREFIX . "blog_category AS blog_category
WHERE userid = $userid
ORDER BY displayorder
"
PHP Code:
$cats = $vbulletin->db->query_read_slave("
SELECT blog_category.*
FROM " . TABLE_PREFIX . "blog_category AS blog_category
WHERE userid = 1
ORDER BY displayorder
"
PHP Code:
function &build_overview_sidebar($month = 0, $year = 0)
{
global $vbulletin, $show, $stylevar, $vbphrase, $vbcollapse;
PHP Code:
function &build_overview_sidebar($month = 0, $year = 0)
{
global $vbulletin, $show, $stylevar, $vbphrase, $vbcollapse, $sidebar;
Find
PHP Code:
else if (!empty($_REQUEST['userid']) OR !empty($_REQUEST['u']) OR !empty($_REQUEST['username']))
PHP Code:
else if (!empty($_REQUEST['userid']) OR !empty($_REQUEST['u']) OR !empty($_REQUEST['username']) OR !empty($_REQUEST['blogcategoryid']))
PHP Code:
OR !empty($_REQUEST['blogcategoryid'])
HTML Code:
<if condition="$sidebar['categorybits']"> <div class="tborder" style="margin-top:$stylevar[cellpadding]px; padding:$stylevar[cellspacing]px"> <div class="thead" style="padding:$stylevar[cellpadding]px"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('blog_categories')"><img id="collapseimg_blog_categories" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_blog_categories].gif" alt="" border="0" /></a> $vbphrase[blog_categories] </div> <div class="alt1 smallfont" style="padding:$stylevar[cellpadding]px; margin-top:$stylevar[cellspacing]px; $vbcollapse[collapseobj_blog_categories]" id="collapseobj_blog_categories"> <ul style="list-style:none; padding:0px; margin:0px">$sidebar[categorybits]</ul> </div> </div> </if>
File : blog_usercp.php
Find
PHP Code:
if ($_POST['do'] == 'updatecat')
{
PHP Code:
// Edit the user id to the userid who should be able to create the categories. This is same id for which you are fetching the categories
if($vbulletin->userinfo['userid'] != 1)
{
print_no_permission();
}

