wolfear
Hangin' Around

Joined: Apr 19, 2006
Posts: 37
Location: San Antonio,Texas
|
Posted:
Wed Apr 26, 2006 8:19 am |
|
I only did a quick forum search, so if someone else has done this, sorry for the duplicate.
I had to make these changes to enable the Collapsing Forums block to work with my shared users.
I would assume this is only necessary if:
1. Have different $prefix and $user_prefix values in your config.php
2. Share common database amongst all sites and utilizing a "common_users" table.
3. Each site has an independant forum
Around line #72 change:
Code:global $user_prefix, $db, $sitename, $admin, $user, $bgcolor1, $bgcolor2, $textcolor1, $textcolor2;
|
to
Code:global $prefix, $user_prefix, $db, $sitename, $admin, $user, $bgcolor1, $bgcolor2, $textcolor1, $textcolor2;
|
Around line #123 change
Code:$sql = "SELECT config_value FROM ".$user_prefix."_bbconfig WHERE config_name='board_timezone'";
|
to
Code:
$sql = "SELECT config_value FROM ".$prefix."_bbconfig WHERE config_name='board_timezone'";
|
Around line #132 change
Code:$sql = "SELECT user_id, username, user_posts, user_avatar, user_level, rank_title, rank_id FROM ".$user_prefix."_users u LEFT JOIN ".$user_prefix."_bbranks r on u.user_rank=r.rank_id where username NOT IN ($skipTopPostersUserNames) ORDER BY user_posts DESC LIMIT 0,$showTopPostersNum";
|
to
Code:$sql = "SELECT user_id, username, user_posts, user_avatar, user_level, rank_title, rank_id FROM ".$user_prefix."_users u LEFT JOIN ".$prefix."_bbranks r on u.user_rank=r.rank_id where username NOT IN ($skipTopPostersUserNames) ORDER BY user_posts DESC LIMIT 0,$showTopPostersNum";
|
Around line #177 change
Code:$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM " . $user_prefix . "_bbcategories c, " . $user_prefix . "_bbforums f
WHERE f.cat_id = c.cat_id
GROUP BY c.cat_id, c.cat_title, c.cat_order
ORDER BY c.cat_order";
|
to
Code:$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM " . $prefix . "_bbcategories c, " . $prefix . "_bbforums f
WHERE f.cat_id = c.cat_id
GROUP BY c.cat_id, c.cat_title, c.cat_order
ORDER BY c.cat_order";
|
Around line #195 change
Code:$sql = "SELECT * FROM " . $user_prefix . "_bbforums ORDER BY cat_id, forum_order";
|
to
Code:$sql = "SELECT * FROM " . $prefix . "_bbforums ORDER BY cat_id, forum_order";
|
Around line #270 change
Code:$result = $db->sql_query( "SELECT t.topic_id, t.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id, t.topic_status, f.forum_name FROM ".$user_prefix."_bbtopics t,".$user_prefix."_bbforums f WHERE t.forum_id NOT IN($hideTheseForums) AND t.forum_id=f.forum_id ORDER BY t.topic_last_post_id DESC");
|
to
Code:$result = $db->sql_query( "SELECT t.topic_id, t.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id, t.topic_status, f.forum_name FROM ".$prefix."_bbtopics t,".$prefix."_bbforums f WHERE t.forum_id NOT IN($hideTheseForums) AND t.forum_id=f.forum_id ORDER BY t.topic_last_post_id DESC");
|
Around line #278 change
Code: $result1 = $db->sql_query( "SELECT auth_view, auth_read, forum_name, cat_id FROM ".$user_prefix."_bbforums where forum_id = '$forum_id'");
|
to
Code: $result1 = $db->sql_query( "SELECT auth_view, auth_read, forum_name, cat_id FROM ".$prefix."_bbforums where forum_id = '$forum_id'");
|
Around line #295 change
Code:$result5 = $db->sql_query("SELECT cat_title FROM ".$user_prefix."_bbcategories where cat_id='$cat_id'");
|
to
Code:$result5 = $db->sql_query("SELECT cat_title FROM ".$prefix."_bbcategories where cat_id='$cat_id'");
|
Around line #301 change
Code:$result4 = $db->sql_query("SELECT u.username, u.user_id, p.poster_id, FROM_UNIXTIME(p.post_time + $userTimeZone) as post_time FROM ".$user_prefix."_users u, ".$user_prefix."_bbposts p where u.user_id=p.poster_id AND p.post_id='$topic_last_post_id'");
|
to
Code:$result4 = $db->sql_query("SELECT u.username, u.user_id, p.poster_id, FROM_UNIXTIME(p.post_time + $userTimeZone) as post_time FROM ".$user_prefix."_users u, ".$prefix."_bbposts p where u.user_id=p.poster_id AND p.post_id='$topic_last_post_id'");
|
Hope that helps someone |
_________________ Good judgement comes from experience, most of which comes from bad judgement.
chown /usr/beer
unmount /dev/brain |
|