The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vBindex v3.0.0 RC5 Details »» | |||||||||||||||||||||||||
[high]vBindex v3.0.0 RC5[/high]
I happy to announce the fith release of vBindex for vBulletin 3 here at vBulletin.org and also the first Offical vB3 Hack here . This is the 9th release of vBindex for vB3 and there are few known problems currently. This release works with vB 3.0.0 Gamma, vB 3.0.0 RC1, vB 3.0.0 RC2, vB 3.0.0 RC3, vB 3.0.0 RC4 and vB 3.0.0. [high]Features[/high] The following are the features that are presently avalible in vBindex, those marked [high]*NEW*[/high] have been updated since vBindex 2.1 and those marked [high]*NEW*[/high] have been updated since Pre-RC2 was released and those marked [high]*NEW*[/high] have been added since RC2 and those marked [high]*NEW*[/high] have been added since RC3.
[high]Installation/Upgrade[/high] See the README_1ST.htm file included in the zip for more detailed install instructions and details of where to upload the files. Then point your browser to http://www.mydomain.com/forums/admin/vbiupgrade.php. Changes Since vBindex 3.0.0 RC4 vBindex 3.0.0 RC4 was released about a week ago, RC5 has just a few changes and is expected to be the last release before vBindex 3.0.0. Changes include fixing of an XHTML issue in the custom block templates; admin help system added; ability to restrict the length of shouts. [high]Support[/high] Support will be given here in this thread ONLY. [high]Support *WILL NOT* be given via PM/Email/IM.[/high] [high]************************************************[/high] vBindex is Copyright MMII - MMIV Winter Systems, you may not distribute in part or whole any portion of the source code (apart from in this thread) or any file included in the zip (Unless you are posting a language translation of vbindex_phrases.xml in this thread). Portions Copyright MM - MMIV Jelsoft Enterprises Limited. Both the Jelsoft vBulletin and the Winter Systems vBindex Copyright notice in the footer must stay in place for any page powered by vBindex. [high]************************************************[/high] [high]vBindex is *FREE*, please have the courtesy click install if you use this hack, thank you[/high] RC3 Build 7: 719 RC3 Build 8: 377 RC3 Build 10: 486 RC4 Build 5: 107 RC5 Build 5: 87 Supporters / CoAuthors Show Your Support
|
Comments |
#2042
|
|||
|
|||
oh, in my vbb 3.0.0 it writes "could not find 'vbindex_settings_saved' after i want to save the options with vbioptions.php.
in vbindex.php it states Quote:
|
#2043
|
||||
|
||||
Works GREAT.
I had a few questions though: I was wondering if there was a way I could add a "Home" to the navbar on each style. If anyone knows how, please let me know. Also, how could I replace the "News" section with a template on another page, (Like have the original news page, then like blah.php that has everything that vbindex.php has, but without the News, just link it to another template, basically just html inside it) Heres an example. Code:
-Forums - Usercp - FAQ - Logout- -Users Online- -blah- -Shoutbox- blah content blah content -VBindexCustom1- blah content blah blah -Latest Threads- |
#2044
|
||||
|
||||
Quote:
|
#2045
|
|||
|
|||
Hi all, I want to add this to the bottom of my portal, I guess just above "All times are GMT. The time now is" would be nice, could someone let me know how I would achieve this
Thanks Chet |
#2046
|
||||
|
||||
Olá pessoal
ninguem fala Portugues por aqui ? fiz a instalação do vBindex v3.0.0 RC5 e correu tudo bem (sem erros), mas agora que tenho eu de fazer para vizualizar no meu site as janelas laterais ? |
#2047
|
||||
|
||||
Thank´s ...I love this....
I resolve my problems |
#2048
|
||||
|
||||
Alright, well I edited out some of the news strings in the index.php and called it roster.php, and same with vbioptions.php, which i copied and made it vbioptions2.php. The settings are still set on both, which one = the other. Is there a way I can change the database where vbioptions2 is saved? Heres what I got (not much).
Roster.php HTML Code:
<?php // +--------------------------------------------------------------------+ // | vBindex Version 3.0.0 Release Candidate 5 (UK English) // | Copyright (C) MMII - MMIV Winter Systems // | This file may not be redistributed in whole or significant part. // +--------------------------------------------------------------------+ // | vBindex, File v3.0.21 // |--------------------------------------------------------------------+ // | Support will only be given at Core Forums (http://www.coreforums.net) // | to those who have confirmed they are licenced, or at vBulletin.org // | via the vBindex 3.x thread listed bellow. // +--------------------------------------------------------------------+ // | v1.x Release(s) by el3m3nt: // | (https://vborg.vbsupport.ru/showthread.php?threadid=37021) // | v2.x Release(s) by NTLDR (aka Eldorado): // | (https://vborg.vbsupport.ru/showthread.php?threadid=41916) // | v3.x Release(s) by NTLDR (aka Eldorado): // | (http://www.coreforums.net/forums/showthread.core?threadid=93) // | (https://vborg.vbsupport.ru/showthread.php?threadid=59524) // +--------------------------------------------------------------------+ // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'vbindex'); define('AVATAR_ON_NAVBAR', 1); // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array( 'vbindex' ); // get special data templates from the datastore $specialtemplates = array( 'smiliecache', 'bbcodecache', 'iconcache', 'userstats', 'birthdaycache', 'vbindex_setting', 'vbindex_version', 'vbindex_config' ); // pre-cache templates used by all actions $globaltemplates = array( // global templates 'VBINDEX', 'VBINDEX_SHELL', 'vbindex_side', 'vbindex_header', 'vbindex_footer', 'vbindex_onlineuser', 'vbindex_onlineusers', 'vbindex_pm_popup_script', 'vbindex_navbar', 'vbindex_headinclude', // roster 'vbindex_roster', // latest threads 'vbindex_latestthreads', 'vbindex_latestthreadbit', 'vbindex_centerthreadbit', // shoutbox 'vbindex_shoutbox', 'vbindex_shoutboxbit', // today's events 'vbindex_event', 'vbindex_eventbit', // bbocode 'bbcode_code', 'bbcode_html', 'bbcode_php', 'bbcode_quote', // bithdays 'vbindex_birthdays', // calendar 'vbindex_calendar', 'calendar_smallmonth_day', 'calendar_smallmonth_day_other', 'calendar_smallmonth_header', 'calendar_smallmonth_week', // poll 'vbindex_poll', 'vbindex_poll_option', 'vbindex_poll_result', // custom boxes 'vbindex_customblock_php', // default to 6 to prevent extra queries 'vbindex_customblock_1', 'vbindex_customblock_2', 'vbindex_customblock_3', 'vbindex_customblock_4', 'vbindex_customblock_5', 'vbindex_customblock_6', ); // pre 4.1.0 don't have superglobals, so lets create the // two indexs we're interested in before vB does if (PHP_VERSION < '4.1.0') { $_REQUEST['page'] = &$HTTP_GET_VARS['page']; $_REQUEST['section'] = &$HTTP_GET_VARS['section']; } // pre-cache templates used by specific actions // link the page we're requesting to the do var so that vB3 will // pre-cache the template and save 1 query if (!empty($_REQUEST['page'])) { $_REQUEST['do'] = &$_REQUEST['page']; define('EXTRA_PAGE', true); } // pre cache the phpinc template per extra page. if (!empty($_REQUEST['section'])) { $_REQUEST['do'] = &$_REQUEST['section']; define('EXTRA_PAGE', true); } $actiontemplates = array( $_REQUEST['page'] => array( 'vbindex_extra_'.$_REQUEST['page'] ), $_REQUEST['section'] => array( 'vbindex_extra_'.$_REQUEST['section'], 'vbindex_extra_php_'.$_REQUEST['section'] ) ); if (!defined('EXTRA_PAGE')) { define('EXTRA_PAGE', false); } // ######################### REQUIRE BACK-END ############################ // this contains a few config vars for vBindex to make upgrades easier require_once('./vbiconfig2.php'); if (!defined('SCRIPT_EXTENSION')) { // should the script extension not be defined assume .php define('SCRIPT_EXTENSION', '.php'); } chdir(CHDIR_PATH); require_once('./global'.SCRIPT_EXTENSION); require_once('./includes/functions_bbcodeparse'.SCRIPT_EXTENSION); require_once('./includes/functions_bigthree'.SCRIPT_EXTENSION); require_once('./includes/functions_user'.SCRIPT_EXTENSION); // ######################### vBindex OPTIONS ############################# $vbindex = unserialize($datastore['vbindex_setting']); $vbindex['version'] = $datastore['vbindex_version']; $ext = SCRIPT_EXTENSION; // options bitfields $_VBINDEX['options'] = array( 'vbi_left_col' => 1, 'vbi_right_col' => 2, 'vbi_shownews' => 4, 'vbi_shownewsavatar' => 8, 'vbi_showthreads' => 16, 'vbi_showshoutbox' => 32, 'vbi_both_cols' => 64, 'vbi_wol' => 128, 'vbi_subnews' => 256, 'vbi_subthreads' => 512, 'vbi_subnewposts' => 1024, 'vbi_welcomeav' => 2048, 'vbi_scrollshoutbox' => 4096, 'vbi_allowshoutdelete' => 8192, 'vbi_showcalendar' => 16384, 'vbi_showbirthdays' => 32768, 'vbi_showpoll' => 65536, 'vbi_randompoll' => 131072, 'vbi_disabledshout' => 262144, 'vbi_shownewposts' => 524288, 'vbi_stickynews' => 1048576, 'vbi_24wol' => 2097152, 'vbi_24woluser' => 4194304, 'vbi_ascshout' => 8388608, 'vbi_vbwar' => 16777216, 'vbi_showweekends' => 33554432, //'vbi_newscharlimit' => 67108864, // needs to be added to vbioptions.php, as does $vbindex['newscharlimit'] for the number of chars 'vbi_showcenterthreads' => 134217728, ); // define all the options for on the spot checks foreach($_VBINDEX['options'] AS $option => $bitfield) { define(strtoupper($option), $bitfield); } unset($option, $bitfield); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### // ############################ INIT VARS ############################### // user configured forumids to exclude if (!empty($vbindex['limitfids'])) { $limitfids = array(); $limitfids = explode(',', $vbindex['limitfids']); foreach($limitfids AS $key => $value) { $limitfids["$key"] = intval($value); } } else { $limitfids = array(0); } $globalignore = ''; // global ignore list $globalshoutignore = ''; // global ignore list as used in the shoutbox $shoutignore = ''; // users ignore list as used in the shoutbox $ignorelist = ''; // users ignore list $onlineusers = ''; $previewfield = ''; $previewjoin = ''; $pollbits = ''; $home['subscribedthreads'] = 0; $home['newposts'] = 0; $home['newthreads'] = 0; $avatarcache = array(); // avatar cache, saves 1 query if a avatar is returned from the cache $threadids = array(); $iconcache = unserialize($datastore['iconcache']); // thread icon cache // #################### PROCESS FORUM PERMISSIONS ####################### // fetch the permissions for each forum $forumperms = array(); foreach($forumcache AS $forum) { $forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']); // ## HIDE FORUMS WITHOUT THE CANVIEW OR CANVIEWOTHERS PERMISSION ## if (!($forumperms["$forum[forumid]"] & CANVIEW) || !($forumperms["$forum[forumid]"] & CANVIEWOTHERS)) { // forum pass? || !verify_forum_password($forum['forumid'], $foruminfo['password'], false);) { $limitfids[] = $forum['forumid']; } } unset($forum); // ####################### PROCESS IGNORE LISTS ######################### // ## GLOBAL IGNORE ## if ($Coventry = fetch_coventry('string')) { $globalignore = "AND thread.postuserid NOT IN ($Coventry) "; $globalshoutignore = "AND shoutbox.userid NOT IN ($Coventry)"; } // ## USERS IGNORE ## if (trim($bbuserinfo['ignorelist'])) { $ignorelist = 'AND thread.postuserid NOT IN ('.str_replace(' ', ',', $bbuserinfo['ignorelist']).')'; $shoutignore = 'AND shoutbox.userid NOT IN ('.str_replace(' ', ',', $bbuserinfo['ignorelist']).')'; } // ################ PROCESS SPECIFIC GET/POST ACTIONS ################### // ## START INSERT NEW SHOUT ## if (($vbindex['options'] & VBI_SHOWSHOUTBOX) && trim(!empty($_POST['shout'])) && $bbuserinfo['userid']) { // needed for convert_url_to_bbcode(); require_once('./includes/functions_newpost'.SCRIPT_EXTENSION); // check length of shout if (!empty($vbindex['max_shout_length']) && vbstrlen($_POST['shout']) > $vbindex['max_shout_length']) { eval(print_standard_error('error_vbi_shout_too_long')); } $DB_site->query(" ## INSERT NEW SHOUT ## INSERT INTO ".TABLE_PREFIX."vbindex_shoutbox (shoutid, userid, shout, dateline) VALUES (NULL, '$bbuserinfo[userid]', '".addslashes(convert_url_to_bbcode($_POST['shout']))."', '".TIMENOW."')"); $url = "$_SERVER[PHP_SELF]?$session[sessionurl]"; eval(print_standard_redirect('redirect_vbi_shoutadded')); } // ## START DELETE SHOUT ## if ($_REQUEST['action'] == 'deleteshout') { $shoutid = intval($_REQUEST['shoutid']); if (in_array($bbuserinfo['usergroupid'], $vbindex['global_shout_delete'])) { // global shout delete group so delete it $deleteshout = true; } else { $deleteshout = false; } if (($vbindex['options'] & VBI_ALLOWSHOUTDELETE) && !$deleteshout) { // check user is the shouter $shout = $DB_site->query_first("## DELETE SHOUT ## SELECT userid, shoutid FROM ".TABLE_PREFIX."vbindex_shoutbox WHERE shoutid = '$shoutid'"); if ($shout['userid'] == $bbuserinfo['userid']) { // delete shout as user is shouter $deleteshout = true; } else { $deleteshout = false; // error user isn't shouter eval(print_standard_error('error_vbi_cant_delete_others_shouts')); } } if ($deleteshout === true) { $DB_site->query("DELETE FROM ".TABLE_PREFIX."vbindex_shoutbox WHERE shoutid = '$shoutid'"); $url = "$_SERVER[PHP_SELF]?$session[sessionurl]"; eval(print_standard_redirect('redirect_vbi_shoutdeleted')); } } // #################### GET NEW POSTS/THREAD INFO ####################### if ($bbuserinfo['userid'] > 0 && ($vbindex['options'] & VBI_SHOWNEWPOSTS)) { if (!empty($bbuserinfo['lastvisit'])) { $datecut = $bbuserinfo['lastvisit']; } else { $datecut = TIMENOW - (24 * 60 * 60 * 1); } $getnew = $DB_site->query(" ## GET NEW POSTS / THREADS ## SELECT post.postid, post.threadid ".iif(($vbindex['options'] & VBI_SUBNEWPOSTS) AND $bbuserinfo['userid'], ', NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed')." FROM ".TABLE_PREFIX."post AS post ".iif(($vbindex['options'] & VBI_SUBNEWPOSTS) AND $bbuserinfo['userid'], " LEFT JOIN ".TABLE_PREFIX."subscribethread AS subscribethread ON(subscribethread.threadid = post.threadid AND subscribethread.userid = $bbuserinfo[userid])" )." WHERE dateline >= $datecut AND visible = '1'"); while($new = $DB_site->fetch_array($getnew)) { $home['newposts']++; if (!in_array($new['threadid'], $threadids)) { $home['newthreads']++; $threadids[] = $new['threadid']; if ($new['issubscribed']) { $home['subscribedthreads']++; } } } $home['newposts'] = vb_number_format($home['newposts']); $home['newthreads'] = vb_number_format($home['newthreads']); // memory saving unset($new, $datecut, $threadids); $DB_site->free_result($getnew); } // user statistics $userstats = unserialize($datastore['userstats']); $home['numbermembers'] = vb_number_format($userstats['numbermembers']); $home['newusername'] = $userstats['newusername']; $home['newuserid'] = $userstats['newuserid']; unset($userstats); // ####################### PROCESS vBindex WOL ########################## if ($vbindex['options'] & VBI_WOL) { $online['datecut'] = TIMENOW - $vboptions['cookietimeout']; $buddies = explode(' ', $bbuserinfo['buddylist']); $onlineusers = $DB_site->query(" ## GET ONLINE USERS ## SELECT user.username, (user.options & $_USEROPTIONS[invisible]) AS invisible, user.usergroupid, session.userid, session.lastactivity, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid FROM ".TABLE_PREFIX."session AS session LEFT JOIN ".TABLE_PREFIX."user AS user ON (user.userid = session.userid) WHERE session.lastactivity > $online[datecut] ORDER BY ".iif($permissions['genericpermissions'] & CANSEEHIDDEN, 'invisible ASC, ')."username ASC"); $home['onlinetotal'] = 0; $home['onlineguesttotal'] = 0; $home['onlinemembertotal'] = 0; $done = array(); while($onlineuser = $DB_site->fetch_array($onlineusers)) { if ($onlineuser['userid'] && !$done["$onlineuser[userid]"]) { $done["$onlineuser[userid]"] = true; $home['onlinetotal']++; $home['onlinemembertotal']++; // do invisible users if (($permissions['genericpermissions'] & CANSEEHIDDEN) && $onlineuser['invisible']) { $onlineuser['invisiblemark'] = '*'; } elseif ($onlineuser['invisible']) { $home['onlineguesttotal']++; $home['onlinemembertotal']--; break 1; } // do buddies if (in_array($onlineuser['userid'], $buddies)) { $onlineuser['buddymark'] = '+'; } $onlineuser['musername'] = fetch_musername($onlineuser); eval("\$home[onlineusers] .= \", ".fetch_template('vbindex_onlineuser')."\";"); } elseif ($onlineuser['userid'] == 0) { $home['onlineguesttotal']++; $home['onlinetotal']++; } } if ($vbindex['options'] & VBI_24WOL) { // show users from the last 24 hours $show['last24'] = true; unset($onlineuser); $starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y')); if ($vbindex['options'] & VBI_24WOLUSER) { // show user names and count $show['last24user'] = true; $fetchusers = $DB_site->query(" ## USERS IN PAST 24HRS ## SELECT username, userid, usergroupid, (user.options & $_USEROPTIONS[invisible]) AS invisible, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid FROM ".TABLE_PREFIX."user AS user WHERE lastactivity >= $starttime ORDER BY username ASC "); while($onlineuser = $DB_site->fetch_array($fetchusers)) { $home['last24count']++; $onlineuser['musername'] = fetch_musername($onlineuser); if (($permissions['genericpermissions'] & CANSEEHIDDEN) && $onlineuser['invisible']) { $onlineuser['invisiblemark'] = '*'; } elseif ($onlineuser['invisible']) { $onlineuser['musername'] = ''; $home['last24count']--; } eval("\$home[last24] .= \", ".fetch_template('vbindex_onlineuser')."\";"); } // removed inital comma in online list $home['last24'] = substr($home['last24'], 2); // memory saving unset($user); $DB_site->free_result($fetchusers); } else { // show count only $show['last24user'] = false; $onlinetoday = $DB_site->query_first(" ## USERS IN LAST 24HRS COUNT ## SELECT COUNT(*) AS count FROM ".TABLE_PREFIX."user WHERE lastactivity >= $starttime "); $home['last24count'] = $onlinetoday['count']; } } // removed inital comma in online list $home['onlineusers'] = substr($home['onlineusers'], 2); eval("\$side[onlineusers] .= \"".fetch_template('vbindex_onlineusers')."\";"); // memory saving unset($onlineuser, $done, $online, $buddies); $DB_site->free_result($onlineusers); } // ######################### PROCESS NEWS ############################ // standard news block if (($vbindex['options'] & VBI_SHOWNEWS) && !($vbindex['options'] & VBI_VBWAR) && !EXTRA_PAGE && $_REQUEST['action'] != 'shoutbox') { $getnews = $DB_site->query(" ## GET NEWS ## SELECT thread.*,thread.iconid AS threadiconid, threadpost.pagetext AS pagetext, threadpost.attach AS attachcount, ".iif($vbindex['options'] & VBI_SHOWNEWSAVATAR, 'avatarpath, NOT ISNULL(avatardata) AS customavatar, user.avatarrevision, customavatar.dateline AS customdateline,')." ".iif(($vbindex['options'] & VBI_SUBNEWS) AND $bbuserinfo['userid'], 'NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed,')." IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid FROM ".TABLE_PREFIX."thread AS thread LEFT JOIN ".TABLE_PREFIX."user AS user ON (thread.postuserid = user.userid) LEFT JOIN ".TABLE_PREFIX."post AS threadpost ON (thread.firstpostid = threadpost.postid) LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread') ".iif($vbindex['options'] & VBI_SHOWNEWSAVATAR, ' LEFT JOIN '.TABLE_PREFIX.'customavatar AS customavatar ON (customavatar.userid = user.userid) LEFT JOIN '.TABLE_PREFIX.'avatar AS avatar ON (avatar.avatarid = user.avatarid)' )." ".iif(($vbindex['options'] & VBI_SUBNEWS) AND $bbuserinfo['userid'], " LEFT JOIN ".TABLE_PREFIX."subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = $bbuserinfo[userid])" )." WHERE forumid IN ($vbindex[newsfid]) AND deletionlog.primaryid IS NULL AND forumid NOT IN (".implode(',', $limitfids).") AND thread.open <> 10 AND thread.visible = '1' $globalignore $ignorelist ORDER BY ".iif($vbindex['options'] & VBI_STICKYNEWS, 'thread.sticky DESC,', '')." thread.dateline DESC LIMIT $vbindex[newsposts]"); while($news = $DB_site->fetch_array($getnews)) { $news['title'] = fetch_censored_text($news['title']); $news['time'] = vbdate($vboptions['timeformat'], $news['dateline']); $news['date'] = vbdate($vboptions['dateformat'], $news['dateline'], 1); $news['musername'] = fetch_musername($news, 'displaygroupid', 'postusername'); $news['attachcount'] = vb_number_format($news['attachcount']); $news['replycount'] = vb_number_format($news['replycount']); if ($news['iconid']) { $news['showicon'] = true; $news['threadiconpath'] = &$iconcache["$news[threadiconid]"]['iconpath']; $news['threadicontitle'] = &$iconcache["$news[threadiconid]"]['title']; } elseif (!empty($vboptions['showdeficon'])) { $news['showicon'] = true; $news['threadiconpath'] = $vboptions['showdeficon']; $news['threadicontitle'] = $vbphrase['default']; } // ## CENSOR NEWS AND PARSE vB CODE ## if (!empty($vbindex['newscharlimit']) && (vbstrlen(strip_bbcode($news['pagetext'])) > $vbindex['newscharlimit'])) { $news['pagetext'] = fetch_censored_text(strip_bbcode(parse_bbcode(fetch_trimmed_title($news['pagetext'], $vbindex['newscharlimit']), true, true), $news['forumid'], 1)); $show['readmore'] = true; } else { $news['pagetext'] = fetch_censored_text(parse_bbcode($news['pagetext'], $news['forumid'], 1)); $show['readmore'] = false; } // ## GET POSTERS AVATAR ## $news['avatar'] = false; if ($vbindex['options'] & VBI_SHOWNEWSAVATAR) { if (!isset($avatarcache["$news[postuserid]"])) { if (!empty($news['customavatar'])) { if ($vboptions['usefileavatar']) { $news['avatarurl'] = "$vboptions[avatarurl]/avatar$news[postuserid]_$news[avatarrevision].gif"; } else { $news['avatarurl'] = "$vboptions[bburl]/image".SCRIPT_EXTENSION."?userid=$news[postuserid]&dateline=$news[customdateline]"; } $news['avatar'] = true; $avatarcache["$news[postuserid]"] = $news['avatarurl']; DEVDEBUG("cached avatar for userid $news[postuserid]"); } elseif (!empty($news['avatarpath'])) { $news['avatarurl'] = $vboptions['bburl'].'/'.$news['avatarpath']; $news['avatar'] = true; $avatarcache["$news[postuserid]"] = $news['avatarurl']; DEVDEBUG("cached avatar for userid $news[postuserid]"); } elseif (!empty($vbindex['useravatar'])) { // we have a default av specified $news['avatarurl'] = $vbindex['useravatar']; $avatarcache["$bbuserinfo[userid]"] = $news['avatarurl']; $news['avatar'] = true; } } else { $news['avatar'] = true; $news['avatarurl'] = $avatarcache["$news[postuserid]"]; } } eval("\$home[roster] .= \"".fetch_template('vbindex_roster')."\";"); } // memory saving unset($news); $DB_site->free_result($getnews); } // if vBwar is enabled then show that instead if ((($vbindex['options'] & VBI_VBWAR) && !($vbindex['options'] & VBI_SHOWNEWS)) && !EXTRA_PAGE && $_REQUEST['action'] != 'shoutbox') { require_once('./vnews.php'); } // ######################## CREATE WELCOME BOX ########################### // moved bellow news as it creates the posibility of one less query // if the users avatar has been cached from a news post $showavatar = false; // if we are a member if ($bbuserinfo['userid']) { // show members welcome $showmemberwelcome = true; // ## GET & CACHE AV ## if ($vbindex['options'] & VBI_WELCOMEAV) { if (!isset($avatarcache["$bbuserinfo[userid]"])) { if (trim($vboptions['templateversion']) == '3.0.0 Gamma') { $avatarurl = $vboptions['bburl'].'/'.fetch_avatar_url($bbuserinfo['userid']); } else { if ($vboptions['usefileavatar']) { $avatarurl = "$vboptions[avatarurl]/avatar$bbuserinfo[userid]_$bbuserinfo[avatarrevision].gif"; } else { $avatarurl = $vboptions['bburl']."/image".SCRIPT_EXTENSION."?userid=$bbuserinfo[userid]&dateline=$bbuserinfo[customdateline]"; } } $avatarcache["$bbuserinfo[userid]"] = $avatarurl; DEVDEBUG("cached avatar for userid $bbuserinfo[userid]"); } else { $avatarurl = $avatarcache["$bbuserinfo[userid]"]; } if ($avatarurl != $vboptions['bburl'].'/') { $showavatar = true; } elseif (!empty($vbindex['useravatar'])) { // we have a default av specified $avatarurl = $vbindex['useravatar']; $avatarcache["$bbuserinfo[userid]"] = $avatarurl; $showavatar = true; } } } else { // a guest is viewing if (!empty($vbindex['guestavatar'])) { $avatarurl = $vbindex['guestavatar']; $showavatar = true; $home['welcomemessage'] = construct_phrase($vbphrase['vbi_welcome_guest_message'], $vboptions['bbtitle'], $vboptions['bburl'], SCRIPT_EXTENSION.'?'.$session['sessionurl']); } $showmemberwelcome = false; } // #################### PROCESS LATEST THREADS ####################### if ($vbindex['options'] & VBI_SHOWTHREADS) { if ($vboptions['threadpreview'] > 0) { $previewfield = ', post.pagetext AS preview'; $previewjoin = 'LEFT JOIN '.TABLE_PREFIX.'post AS post ON(post.postid = thread.firstpostid)'; } $getthreads = $DB_site->query(" ## GET LATEST THREADS ## SELECT thread.*,thread.iconid AS threadiconid $previewfield ".iif(($vbindex['options'] & VBI_SUBTHREADS) AND $bbuserinfo['userid'], ', NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed')." ".iif($vbindex['options'] & VBI_SHOWCENTERTHREADS, ',forum.title AS forumtitle')." FROM ".TABLE_PREFIX."thread AS thread LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread') ".iif(($vbindex['options'] & VBI_SUBTHREADS) AND $bbuserinfo['userid'], " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = $bbuserinfo[userid])" )." ".iif($vbindex['options'] & VBI_SHOWCENTERTHREADS, "LEFT JOIN ".TABLE_PREFIX."forum AS forum ON(forum.forumid = thread.forumid)")." $previewjoin WHERE open = '1' AND thread.open <> 10 AND thread.forumid NOT IN (".iif(is_numeric($vbindex['newsfid']), "$vbindex[newsfid],").implode(',', $limitfids).") AND thread.visible = '1' AND deletionlog.primaryid IS NULL $globalignore $ignorelist ORDER BY lastpost DESC LIMIT $vbindex[maxlthreads]"); while($thread = $DB_site->fetch_array($getthreads)) { $threads = true; $thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22)); $thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1); $thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']); $thread['preview'] = preg_replace('#\[quote(=("|"|\'|).*\\2)?\](.*)\[/quote\]#siU', '', $thread['preview']); $thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($thread['preview']), false, true), $vboptions['threadpreview'])); $thread['replycount'] = vb_number_format($thread['replycount']); $thread['views'] = vb_number_format($thread['views']); // thread icon $show['icon'] = false; if ($thread['iconid']) { $show['icon'] = true; $thread['threadiconpath'] = &$iconcache["$thread[threadiconid]"]['iconpath']; $thread['threadicontitle'] = &$iconcache["$thread[threadiconid]"]['title']; } elseif (!empty($vboptions['showdeficon'])) { $show['icon'] = true; $thread['threadiconpath'] = $vboptions['showdeficon']; $thread['threadicontitle'] = $vbphrase['default']; } // show goto new post $show['firstnew'] = false; $bbforumview = fetch_bbarray_cookie('forum_view', $thread['forumid']); if ($bbforumview > $bbuserinfo['lastvisit']) { $lastread = $bbforumview; } else { $lastread = $bbuserinfo['lastvisit']; } if ($thread['lastpost'] > $lastread) { $threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']); if ($thread['lastpost'] > $threadview) { $show['firstnew'] = true; $show['icon'] = false; } } exec_switch_bg(); eval("\$threadbits .= \"".fetch_template('vbindex_latestthreadbit')."\";"); if ($vbindex['options'] & VBI_SHOWCENTERTHREADS) { // prepare center threads block eval("\$centerthreadbits .= \"".fetch_template('vbindex_centerthreadbit')."\";"); } } if ($threads) { eval("\$side[latestthreads] = \"".fetch_template('vbindex_latestthreads')."\";"); } // memory saving unset($thread, $threads); $DB_site->free_result($getthreads); } // ######################### PROCESS POLL ############################### if ($vbindex['options'] & VBI_SHOWPOLL) { // the $pollinfo query here is experimental, to save one query later on I have joined // the pollvote table if the bbuser is registed, this seems to work fine from my testing $pollinfo = $DB_site->query_first(" ## GET POLL ## SELECT thread.pollid, thread.forumid, open, threadid, replycount, question, poll.dateline, options, votes, active, numberoptions, timeout, multiple, voters, pollvote.voteoption, pollvote.userid AS voteuserid FROM ".TABLE_PREFIX."thread AS thread LEFT JOIN ".TABLE_PREFIX."poll AS poll ON (thread.pollid = poll.pollid) LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread') LEFT JOIN ".TABLE_PREFIX."pollvote AS pollvote ON(thread.pollid = pollvote.pollid AND pollvote.userid = $bbuserinfo[userid]) WHERE forumid NOT IN (".implode(',', $limitfids).") AND deletionlog.primaryid IS NULL AND thread.pollid <> 0 AND thread.open <> 10 AND thread.visible = '1' ".iif(strtoupper($vbindex['pollsforumid']) != 'ALL', "AND thread.forumid IN ($vbindex[pollsforumid])")." $globalignore $ignorelist ORDER BY ".iif($vbindex['options'] & VBI_RANDOMPOLL, 'RAND()', 'thread.threadid')." DESC LIMIT 1"); if ($pollinfo['pollid']) { $pollinfo['question'] = fetch_censored_text($pollinfo['question']); $splitoptions = explode('|||', $pollinfo['options']); $splitvotes = explode('|||', $pollinfo['votes']); $showresults = ''; $uservoted = ''; if (!$pollinfo['active'] || !$pollinfo['open'] || ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < TIMENOW && $pollinfo['timeout'])) { // poll closed $showresults = true; } elseif (!($forumperms["$pollinfo[forumid]"] & CANVOTE)) { // user cannot vote on this poll $nopermission = true; } elseif (fetch_bbarray_cookie('poll_voted', $pollinfo['pollid'])) { // cookie shows user has voted $uservoted = true; } elseif ($bbuserinfo['userid'] == $pollinfo['voteuserid'] && !empty($pollinfo['voteoption'])) { // pollinfo query shows user has voted $uservoted = true; } $i = 0; while($i++ < $pollinfo['numberoptions']) { $pollinfo['numbervotes'] += $splitvotes[$i - 1]; } $i = 0; $option = array(); while($i++ < $pollinfo['numberoptions']) { exec_switch_bg(); $option['question'] = fetch_censored_text(parse_bbcode($splitoptions[$i - 1], $pollinfo['forumid'], $pollinfo['allowsmilies'])); $option['votes'] = $splitvotes[$i - 1]; $option['number'] = $i; if ($showresults || $uservoted || $nopermission) { if ($showresults) { $status = $vbphrase['this_poll_is_closed']; } elseif ($uservoted) { $status = $vbphrase['you_have_already_voted_on_this_poll']; } elseif ($nopermission) { $status = $vbphrase['you_may_not_vote_on_this_poll']; } $percent = 0; if ($option['votes']) { $percent = vb_number_format($option['votes'] / $pollinfo['numbervotes'] * 100, 2); } $option['graphicnumber'] = $option['number'] % 6 + 1; $option['barnumber'] = round($percent) * 1.3; $showform = false; eval("\$home[pollbits] .= \"".fetch_template('vbindex_poll_result')."\";"); } elseif ($pollinfo['multiple']) { // mutiple choice poll $multiple = true; $showform = true; eval("\$home[pollbits] .= \"".fetch_template('vbindex_poll_option')."\";"); } else { // single choice poll $multiple = false; $showform = true; eval("\$home[pollbits] .= \"".fetch_template('vbindex_poll_option')."\";"); } } eval("\$side[poll] = \"".fetch_template('vbindex_poll')."\";"); } } // ####################### PROCESS CAlENDAR & EVENTS ########################## if ($vbindex['options'] & VBI_SHOWCALENDAR) { // lets prevent hacking and do our own calendar permissions checking $cpermscache = array(); $calendarcache = array(); // fetch the membergroupids $membergroupids = fetch_membergroupids_array($bbuserinfo); $calendarpermissions = $DB_site->query(" ## CALENDAR PERMS & OPTIONS QUERY (userid: $bbuserinfo[userid], membergroupids: $bbuserinfo[membergroupids]) ## SELECT calendarpermission.usergroupid, calendarpermission.calendarpermissions, calendar.calendarid,calendar.title, calendar.options, calendar.startofweek, displayorder FROM ".TABLE_PREFIX."calendar AS calendar LEFT JOIN ".TABLE_PREFIX."calendarpermission AS calendarpermission ON (calendarpermission.calendarid=calendar.calendarid AND usergroupid IN(".implode(',', $membergroupids).")) ORDER BY displayorder ASC"); while($calendarpermission = $DB_site->fetch_array($calendarpermissions)) { if (!empty($calendarpermission['displayorder'])) { // leave permissions at 0 for calendars that aren't being displayed $cpermscache["$calendarpermission[calendarid]"]["$calendarpermission[usergroupid]"] = intval($calendarpermission['calendarpermissions']); $calendarcache["$calendarpermission[calendarid]"]['title'] = $calendarpermission['title']; $calendarcache["$calendarpermission[calendarid]"]['options'] = $calendarpermission['options']; $calendarcache["$calendarpermission[calendarid]"]['startofweek'] = $calendarpermission['startofweek']; } } // memory saving unset($calendarpermission); $DB_site->free_result($calendarpermissions); // Combine the calendar permissions for all member groups foreach($cpermscache AS $calendarid => $cpermissions) { $user['calendarpermissions']["$calendarid"] = 0; foreach($membergroupids AS $usergroupid) { if (isset($cpermissions["$usergroupid"])) { $bbuserinfo['calendarpermissions']["$calendarid"] |= $cpermissions["$usergroupid"]; } else { $bbuserinfo['calendarpermissions']["$calendarid"] |= $usergroupcache["$usergroupid"]['calendarpermissions']; } } } // require the calendar functions require_once('./includes/functions_calendar'.SCRIPT_EXTENSION); // get the first viewable calendarid $showcalendar = false; foreach ($calendarcache AS $id => $value) { if ($bbuserinfo['calendarpermissions']["$id"] & CANVIEWCALENDAR) { $calendarinfo = array( 'options' => $value['options'], 'title' => $value['title'], 'startofweek' => $value['startofweek'], 'calendarid' => $id ); $startofweek = $value['startofweek']; $calendarid = $id; $showcalendar = true; break; } } if ($showcalendar) { // bbuser has access to a calendar, so lets process it if ($bbuserinfo['startofweek'] > 7 || $bbuserinfo['startofweek'] < 1) { $bbuserinfo['startofweek'] = $calendarinfo['startofweek']; } $today = getdate(TIMENOW - $vboptions['hourdiff']); $today['month'] = $vbphrase[strtolower($today['month'])]; $usertoday = array( 'firstday' => gmdate('w', gmmktime(0, 0, 0, $today['mon'], 1, $today['year'])), 'month' => $today['mon'], 'year' => $today['year'] ); $getoptions = convert_bits_to_array($calendarinfo['options'], $_CALENDAROPTIONS); $calendarinfo = array_merge($calendarinfo, $getoptions); $calendarinfo['showweekends'] = iif($vbindex['options'] & VBI_SHOWWEEKENDS, 1, 0); // events //$eventarray = unserialize($datastore['vbi_eventcache']); //$eventcache = $eventarray["$calendarinfo[calendarid]"]; //unset($eventarray);echo '<pre>';print_r($eventcache);exit; $erange = array( 'frommonth' => $today['mon'], 'fromyear' => $today['year'], 'nextmonth' => $today['mon'], 'nextyear' => $today['year'] ); $eventcache = cache_events($erange); if (is_array($eventcache)) { // only process events if we have an array of them $i = 0; foreach($eventcache AS $event) { if (!($bbuserinfo['calendarpermissions']["$calendarinfo[calendarid]"] & CANVIEWOTHERSEVENT) && $bbuserinfo['userid'] != $event['userid']) { unset($eventcache["$i"]); } $i++; } } $calendarbits = str_replace('calendar'.SCRIPT_EXTENSION, "$vboptions[bburl]/calendar".SCRIPT_EXTENSION, construct_calendar_output($today, $usertoday, $calendarinfo, 0)); eval("\$side[calendar] = \"".fetch_template('vbindex_calendar')."\";"); } else { $side['calendar'] = ''; } } // #################### PROCESS TODAYS BIRTHDAYS ####################### if ($vbindex['options'] & VBI_SHOWBIRTHDAYS) { // birthdays $birthdays = unserialize($datastore['birthdaycache']); $birthdaydate = vbdate('Y-m-d', TIMENOW); if (!is_array($birthdays) || ($birthdaydate != $birthdays['day1'] && $birthdaydate != $birthdays['day2'])) { // update the cache require_once('./includes/functions_databuild'.SCRIPT_EXTENSION); $birthdays = build_birthdays(); DEVDEBUG('Updated Birthday Cache'); } if ($birthdays['day1'] == $birthdaydate && !empty($birthdays['users1'])) { // process day1 $home['birthdaybit'] = str_replace('member'.SCRIPT_EXTENSION.'?u', "$vboptions[bburl]/member".SCRIPT_EXTENSION.'?userid', $birthdays['users1']); eval("\$side[birthdays] = \"".fetch_template('vbindex_birthdays')."\";"); } elseif ($birthdays['day2'] == $birthdaydate && !empty($birthdays['users2'])) { // process day2 $home['birthdaybit'] = str_replace('member'.SCRIPT_EXTENSION.'?u', "$vboptions[bburl]/member".SCRIPT_EXTENSION.'?userid', $birthdays['users2']); eval("\$side[birthdays] = \"".fetch_template('vbindex_birthdays')."\";"); } else { $side['birthdays'] = ''; } unset($birthdays, $birthdaydate); } // ######################## PROCESS SHOUTBOX ############################ if ($vbindex['options'] & VBI_SHOWSHOUTBOX) { if ($_REQUEST['action'] == 'shoutbox') { $pagenumber = intval($_REQUEST['pagenumber']); $perpage = intval($_REQUEST['perpage']); $mainpage = true; $total = $DB_site->query_first("## COUNT SHOUTS ## SELECT COUNT(*) AS shouts FROM ".TABLE_PREFIX."vbindex_shoutbox WHERE 1 = 1 $globalshoutignore $shoutignore"); // set defaults sanitize_pageresults($total['shouts'], $pagenumber, $perpage, 100, 25); $limitlower = ($pagenumber - 1) * $perpage+1; $limitupper = ($pagenumber) * $perpage; $counter = 0; if ($limitupper > $total['shouts']) { $limitupper = $total['shouts']; if ($limitlower > $total['shouts']) { $limitlower = $total['shouts']-$perpage; } } if ($limitlower <= 0) { $limitlower = 1; } // limit for mysql query when full page is selected $limit = ($limitlower - 1).", $perpage"; $navarray = array( '' => 'Shoutbox' ); $navbits = construct_navbits($navarray); $pagenav = str_replace('&page=', '&pagenumber=', construct_page_nav($total['shouts'], "$_SERVER[PHP_SELF]?$session[sessionurl]action=shoutbox&perpage=$perpage")); } else { // limit for mysql query when only side box is show $limit = $vbindex['maxshouts']; $pagenav = ''; } $getshouts = $DB_site->query(" ## GET SHOUTS ## SELECT user.username, user.userid, shoutbox.shoutid, shoutbox.shout, shoutbox.dateline, IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid FROM ".TABLE_PREFIX."vbindex_shoutbox AS shoutbox LEFT JOIN ".TABLE_PREFIX."user AS user USING (userid) WHERE 1 = 1 $globalshoutignore $shoutignore ORDER BY shoutbox.dateline DESC LIMIT $limit"); $i = 0; while ($shout = $DB_site->fetch_array($getshouts)) { $i++; $shouts = true; $shout['shout'] = fetch_censored_text(parse_bbcode($shout['shout'])); // lets word wrap the shouts to prevent an expanded column if (!empty($vbindex['shout_wrap_length'])) { $shout['shout'] = preg_replace("#([^\n\r ?&./<>\"\\-\[\]]{".$vbindex['shout_wrap_length'].'})#i', "\\1 ", $shout['shout']); } $shout['musername'] = fetch_musername($shout); $shout['date'] = vbdate($vboptions['dateformat'], $shout['dateline'], 1); $shout['time'] = vbdate($vboptions['timeformat'], $shout['dateline']); exec_switch_bg(); if (in_array($bbuserinfo['usergroupid'], $vbindex['global_shout_delete']) || (($vbindex['options'] & VBI_ALLOWSHOUTDELETE) && $shout['userid'] == $bbuserinfo['userid'])) { $shoutdelete = true; } else { $shoutdelete = false; } // prevent the side box showing more than the defined number of shouts // if we are viewing the full page one if ($i <= $vbindex['maxshouts']) { if ($vbindex['options'] & VBI_ASCSHOUT) { // asc order eval("\$sbox[$shout[timestamp]] .= \"".fetch_template('vbindex_shoutboxbit')."\";"); } else { // default desc order eval("\$shoutbox[shoutbits] .= \"".fetch_template('vbindex_shoutboxbit')."\";"); } } if ($_REQUEST['action'] == 'shoutbox') { eval("\$shoutbox[main_shoutbits] .= \"".fetch_template('vbindex_shoutboxbit')."\";"); } } if (($vbindex['options'] & VBI_ASCSHOUT) && is_array($sbox)) { // asc sort krsort($sbox); foreach($sbox AS $sarea) { $shoutbox['shoutbits'] .= $sarea; } } if ($bbuserinfo['userid'] || ($vbindex['options'] & VBI_DISABLEDSHOUT)) { exec_switch_bg(); if (!$bbuserinfo['userid']) { $shoutbox['postdisabled'] = true; } else { $shoutbox['postdisabled'] = false; } $shoutbox['postshout'] = true; } else { $shoutbox['postshout'] = false; } if ($shouts || $shoutbox['postshout']) { if ($_REQUEST['action'] == 'shoutbox') { $main = true; eval("\$home[news] .= \"".fetch_template('vbindex_shoutbox')."\";"); $pagenav = ''; $main = false; eval("\$side[shoutbox] .= \"".fetch_template('vbindex_shoutbox')."\";"); } else { $main = false; eval("\$side[shoutbox] .= \"".fetch_template('vbindex_shoutbox')."\";"); } } // memory saving unset($shout, $sbox, $sarea); $DB_site->free_result($getshouts); } // ############################################################################# // unset vB's default template vars, do this at the end so any standard error // or redirect calls still have the vars for use in the templates. unset($header, $footer, $navbar, $headinclude); // ####################### GENERATE SIDE BAR ########################## // ## CUSTOM BLOCKS if (!empty($vbindex['customboxes'])) { for($box = 1; $box <= $vbindex['customboxes']; $box++) { $collapseobj_vbindex_customblock = $vbcollapse['collapseobj_vbindex_customblock'.$box]; $collapseimg_vbindex_customblock = $vbcollapse['collapseimg_vbindex_customblock'.$box]; if (!is_demo_mode()) { @ob_start(); eval(fetch_template('vbindex_customblock_php', -1, 0)); // this is the var to use in the template for the dynamic content $contvar = 'box'.$box.'_php'; $$contvar = @ob_get_contents(); @ob_end_clean(); } eval("\$side[customblock_".$box."] .= \"".fetch_template("vbindex_customblock_{$box}")."\";"); } } // ## LEFT if (($vbindex['options'] & VBI_BOTH_COLS) || ($vbindex['options'] & VBI_LEFT_COL)) { for($box = 1; $box < ($vbindex['totalboxes'] + 1 + $vbindex['customboxes']); $box++) { $leftright = $vbindex["left_{$box}"]; $home['left']["$box"] = $side["$leftright"]; } foreach($home['left'] AS $box => $content) { $home['leftblocks'] .= $content; } } // ## RIGHT if (($vbindex['options'] & VBI_BOTH_COLS) || ($vbindex['options'] & VBI_RIGHT_COL)) { for($box = 1; $box < ($vbindex['totalboxes'] + 1 + $vbindex['customboxes']); $box++) { $leftright = $vbindex["right_{$box}"]; $home['right']["$box"] = $side["$leftright"]; } foreach($home['right'] AS $box => $content) { $home['rightblocks'] .= $content; } } if ($vbindex['options'] & VBI_BOTH_COLS) { $currentside = 'left'; eval("\$home[leftside] = \"".fetch_template('vbindex_side')."\";"); $currentside = 'right'; eval("\$home[rightside] = \"".fetch_template('vbindex_side')."\";"); } elseif ($vbindex['options'] & VBI_LEFT_COL) { $currentside = 'left'; eval("\$home[leftside] = \"".fetch_template('vbindex_side')."\";"); } elseif ($vbindex['options'] & VBI_RIGHT_COL) { $currentside = 'right'; eval("\$home[rightside] = \"".fetch_template('vbindex_side')."\";"); } // #################### EVAL GLOBAL TEMPLATES ####################### $vbphrase['copyright'] = construct_phrase($vbphrase['vbi_copyright'], $vboptions['templateversion'], $vbindex['version']); eval("\$home[footer] = \"".fetch_template('vbindex_footer')."\";"); $footer = &$home['footer']; eval("\$home[header] = \"".fetch_template('vbindex_header')."\";"); $header = &$home['header']; eval("\$headinclude = \"".fetch_template('vbindex_headinclude')."\";"); $home['headinclude'] = &$headinclude; $home['footer'] = str_replace('cron'.SCRIPT_EXTENSION, "$vboptions[bburl]/cron".SCRIPT_EXTENSION, $home['footer']); // ## PM POPUP if ($shownewpm) { eval("\$home[footer] = \"".fetch_template('vbindex_pm_popup_script')."\";"); } $navbits = array('', $vboptions['hometitle']); $navbits = construct_navbits($navbits); eval("\$home[navbar] = \"".fetch_template('vbindex_navbar')."\";"); eval($datastore['vbindex_config']); if (trim($vboptions['templateversion']) != '3.0.0 Gamma') { $headinclude = str_replace('link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css', 'link rel="stylesheet" type="text/css" href="'.$vboptions['bburl'].'/clientscript/vbulletin_css', $headinclude); } // #################### SELECT OUTPUT TEMPLATE ####################### if (!EXTRA_PAGE) { eval("print_output(\"".fetch_template('VBINDEX')."\");"); } elseif (!empty($_REQUEST['page'])) { eval("\$home[content] = \"".fetch_template("vbindex_extra_{$_REQUEST[page]}")."\";"); eval("print_output(\"".fetch_template('VBINDEX_SHELL')."\");"); } elseif (!empty($_REQUEST['section'])) { // we're using a PHP special extra page, so lets parse the PHP Include if (!is_demo_mode()) { @ob_start(); eval(fetch_template("vbindex_extra_php_{$_REQUEST[section]}", -1, 0)); // this is the var to use in the template for the dynamic content $php_output = @ob_get_contents(); @ob_end_clean(); } eval("\$home[content] = \"".fetch_template("vbindex_extra_{$_REQUEST[section]}")."\";"); eval("print_output(\"".fetch_template('VBINDEX_SHELL')."\");"); } ?> |
#2049
|
||||
|
||||
vbioptions2.php
HTML Code:
<?php // +--------------------------------------------------------------------+ // | vBindex Version 3.0.0 Release Candidate 5 (UK English) // | Copyright (C) MMII - MMIV Winter Systems // +--------------------------------------------------------------------+ // | vbioptions.php, v3.0.4 // |--------------------------------------------------------------------+ // | Support will only be given at Core Forums (http://www.coreforums.net) // | to those who have confirmed they are licenced, or at vBulletin.org // | via the vBindex 3.x thread listed bellow. // +--------------------------------------------------------------------+ // | v1.x Release(s) by el3m3nt: // | (https://vborg.vbsupport.ru/showthread.php?threadid=37021) // | v2.x Release(s) by NTLDR (aka Eldorado): // | (https://vborg.vbsupport.ru/showthread.php?threadid=41916) // | v3.x Release(s) by NTLDR (aka Eldorado): // | (http://www.coreforums.net/forums/showthread.core?threadid=93) // | (https://vborg.vbsupport.ru/showthread.php?threadid=59524) // +--------------------------------------------------------------------+ // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array( 'vbindex_cp' ); $specialtemplates = array( 'vbindex_setting' ); // ########################## REQUIRE BACK-END ############################ if (@file_exists('../vbiconfig.php')) { require_once('../vbiconfig.php'); $configpath = '../vbiconfig.php'; } elseif (@file_exists('../../vbiconfig.php')) { $configpath = '../../vbiconfig.php'; require_once('../../vbiconfig.php'); } if (!defined('SCRIPT_EXTENSION')) { // vbiconfig.php couldn't be found, assume .php extension define('SCRIPT_EXTENSION', '.php'); } require_once('./global'.SCRIPT_EXTENSION); // ############################# LOG ACTION ############################### log_admin_action(); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['vbindex_options']); if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'edit'; } $vbindex = unserialize($datastore['vbindex_setting']); // ###################### Start edit ####################### if ($_REQUEST['do'] == 'edit') { print_form_header('vbioptions', 'update'); $coloptions = array( '0' => $vbphrase['neither'], '1' => $vbphrase['left'], '2 ' => $vbphrase['right'], '64' => $vbphrase['both'] ); if ($vbindex['options'] & 1) { $col = 1; } elseif ($vbindex['options'] & 2) { $col = 2; } elseif ($vbindex['options'] & 64) { $col = 64; } $colnames = array( '0' => $vbphrase['leave_unused'], 'latestthreads' => $vbphrase['latest_threads'], 'onlineusers' => $vbphrase['online_users'], 'shoutbox' => $vbphrase['shoutbox'], 'calendar' => $vbphrase['calendar'], 'birthdays' => $vbphrase['birthdays'], 'poll' => $vbphrase['poll'] ); for($box = 1; $box <= $vbindex['customboxes']; $box++) { $colnames["customblock_$box"] = construct_phrase($vbphrase['custom_block_x'], $box); } $totalboxes = 6; // side options print_table_header($vbphrase['side_columns']); print_select_row($vbphrase['columns_to_show'], 'vbi_bit[cols]', $coloptions, $col); print_input_row($vbphrase['number_of_custom_blocks'], 'vbi_int[customboxes]', $vbindex['customboxes'], 1, 2); construct_hidden_code('vbi[totalboxes]', $totalboxes); // left for($box = 1; $box < ($totalboxes + 1 + $vbindex['customboxes']); $box++) { print_select_row(construct_phrase($vbphrase['x_box_x'], $vbphrase['left'], $box), "vbi[left_{$box}]", $colnames, $vbindex["left_{$box}"]); } // right for($box = 1; $box < ($totalboxes + 1 + $vbindex['customboxes']); $box++) { print_select_row(construct_phrase($vbphrase['x_box_x'], $vbphrase['right'], $box), "vbi[right_{$box}]", $colnames, $vbindex["right_{$box}"]); } print_table_break(); // news print_table_header($vbphrase['news']); print_checkbox_row($vbphrase['news_enabled'], 'vbi_bit[shownews]', iif($vbindex['options'] & 4, 1, 0), 4); print_checkbox_row($vbphrase['enable_vbwar'], 'vbi_bit[vbwar]', iif($vbindex['options'] & 16777216, 1, 0), 16777216); print_checkbox_row($vbphrase['news_posters_avatar'], 'vbi_bit[shownewsavatar]', iif($vbindex['options'] & 8, 1, 0), 8); print_input_row($vbphrase['news_forumid'], 'vbi[newsfid]', $vbindex['newsfid']); print_input_row($vbphrase['news_posts_to_show'], 'vbi_int[newsposts]', $vbindex['newsposts']); print_input_row($vbphrase['news_chars_to_show'], 'vbi_int[newscharlimit]', $vbindex['newscharlimit']); print_checkbox_row($vbphrase['show_subscribed_icon'], 'vbi_bit[subnews]', iif($vbindex['options'] & 256, 1, 0), 256); print_checkbox_row($vbphrase['show_sticky_news_threads'], 'vbi_bit[stickynews]', iif($vbindex['options'] & 1048576, 1, 0), 1048576); print_table_break(); // latest threads print_table_header($vbphrase['latest_threads']); print_checkbox_row($vbphrase['latest_threads_enabled'], 'vbi_bit[showthreads]', iif($vbindex['options'] & 16, 1, 0), 16); print_checkbox_row($vbphrase['enable_center_threads'], 'vbi_bit[showcenterthreads]', iif($vbindex['options'] & 134217728, 1, 0), 134217728); print_input_row($vbphrase['recent_threads_to_show'], 'vbi_int[maxlthreads]', $vbindex['maxlthreads']); print_checkbox_row($vbphrase['show_subscribed_icon'], 'vbi_bit[subthreads]', iif($vbindex['options'] & 512, 1, 0), 512); print_table_break(); // poll print_table_header($vbphrase['poll']); print_checkbox_row($vbphrase['poll_enabled'], 'vbi_bit[pollnews]', iif($vbindex['options'] & 65536, 1, 0), 65536); print_checkbox_row($vbphrase['random_poll_enabled'], 'vbi_bit[randompoll]', iif($vbindex['options'] & 131072, 1, 0), 131072); print_input_row($vbphrase['poll_forumid'], 'vbi[pollsforumid]', $vbindex['pollsforumid']); print_table_break(); // shoutbox print_table_header($vbphrase['shoutbox']); print_checkbox_row($vbphrase['shoutbox_enabled'], 'vbi_bit[showshoutbox]', iif($vbindex['options'] & 32, 1, 0), 32); print_input_row($vbphrase['shouts_to_show'], 'vbi_int[maxshouts]', $vbindex['maxshouts']); print_checkbox_row($vbphrase['asc_order_shoutbox'], 'vbi_bit[ascshout]', iif($vbindex['options'] & 8388608, 1, 0), 8388608); print_input_row($vbphrase['shout_wrap_length'], 'vbi_int[shout_wrap_length]', $vbindex['shout_wrap_length']); print_input_row($vbphrase['max_shout_length'], 'vbi_int[max_shout_length]', $vbindex['max_shout_length']); print_checkbox_row($vbphrase['scrollable_shoutbox'], 'vbi_bit[shoutbox_type]', iif($vbindex['options'] & 4096, 1, 0), 4096); print_checkbox_row($vbphrase['shoutbox_showdisabled'], 'vbi_bit[shoutbox_postdisabled]', iif($vbindex['options'] & 262144, 1, 0), 262144); print_checkbox_row($vbphrase['shout_deletion'], 'vbi_bit[member_shout_delete]', iif($vbindex['options'] & 8192, 1, 0), 8192); // implode the global shout deletion groups into $vbindex['membergroupids'] so that print_memebergroup_row will check the usergroup boxes if (is_array($vbindex['global_shout_delete'])) { $vbindex['membergroupids'] = implode(',', $vbindex['global_shout_delete']); } else { $vbindex['membergroupids'] = array(0); } print_membergroup_row($vbphrase['global_shout_delete'], 'vbi_ug[global_shout_delete]', 0, $vbindex); // add 0 to the above array so that the foreach in the update allways has an array to create construct_hidden_code('vbi_ug[global_shout_delete][]', '0'); print_table_break(); // welcome box print_table_header($vbphrase['welcome_box']); print_checkbox_row($vbphrase['enable_new_posts'],'vbi_bit[shownewposts]', iif($vbindex['options'] & 524288, 1, 0), 524288); print_checkbox_row($vbphrase['show_users_avatar'], 'vbi_bit[showwavatar]', iif($vbindex['options'] & 2048, 1, 0), 2048); print_input_row($vbphrase['default_guest_avatar'], 'vbi[guestavatar]', $vbindex['guestavatar']); print_input_row($vbphrase['default_user_avatar'], 'vbi[useravatar]', $vbindex['useravatar']); print_checkbox_row($vbphrase['new_subscribed_threads'], 'vbi_bit[subnewposts]', iif($vbindex['options'] & 1024, 1, 0), 1024); print_table_break(); // calendar print_table_header($vbphrase['calendar']); print_checkbox_row($vbphrase['enable_calendar'], 'vbi_bit[showcalendar]', iif($vbindex['options'] & 16384, 1, 0), 16384); print_checkbox_row($vbphrase['enable_todays_birthdays'], 'vbi_bit[showbirthdays]', iif($vbindex['options'] & 32768, 1, 0), 32768); print_checkbox_row($vbphrase['show_weekends'], 'vbi_bit[showweekends]', iif($vbindex['options'] & 33554432, 1, 0), 33554432); print_table_break(); // wol print_table_header($vbphrase['whos_online']); print_checkbox_row($vbphrase['enable_online_users'], 'vbi_bit[wol]', iif($vbindex['options'] & 128, 1, 0), 128); print_checkbox_row($vbphrase['enable_online_today'], 'vbi_bit[24wol]', iif($vbindex['options'] & 2097152, 1, 0), 2097152); print_checkbox_row($vbphrase['enable_online_today_usernames'], 'vbi_bit[24woluser]', iif($vbindex['options'] & 4194304, 1, 0), 4194304); print_table_break(); // misc print_table_header($vbphrase['misc']); print_input_row($vbphrase['exclude_forumids'], 'vbi[limitfids]', $vbindex['limitfids']); print_table_break(); // save options row print_submit_row($vbphrase['save']); } // ###################### Start insert ####################### if ($_POST['do'] == 'update') { $_vbindex = array(); $_vbindex['options'] = 0; // process bitfield options foreach($_POST['vbi_bit'] AS $value) { $_vbindex['options'] += intval($value); } unset($key, $value); // process int vals foreach($_POST['vbi_int'] AS $key => $value) { $_vbindex["$key"] = intval($value); } unset($key, $value); // process string vals foreach($_POST['vbi'] AS $key => $value) { $_vbindex["$key"] = trim($value); } unset($key, $value); // process usergroup options $is_array = false; foreach($_POST['vbi_ug'] AS $key => $array) { foreach($array AS $value) { if (intval($value) != 0) { $_vbindex["$key"][] = intval($value); $is_array = true; } elseif (!$is_array) { $_vbindex["$key"] = array(); } } } unset($key, $value, $array, $is_array); $DB_site->query("UPDATE ".TABLE_PREFIX."datastore SET data = '".addslashes(serialize($_vbindex))."' WHERE title = 'vbindex_setting'"); define('CP_REDIRECT', 'vbioptions'.SCRIPT_EXTENSION.'?do=edit'); print_stop_message('vbindex_settings_saved'); if ($debug) { echo '<pre>'; print_r($_vbindex); echo '</pre>'; } } print_cp_footer(); ?> |
#2050
|
||||
|
||||
I installed this great hack earlier today. Nice work, thanks!
I clicked the install button. I have a few very minor things that I would like to fix: 1.) From the admin cpanel the Forum home page link at top of page has been changed. Which the link is from my computer, I just not sure which template to edit & where? or why? Code:
file:///C|/DOCUME%7E1/64/LOCALS%7E1/index.php? Any help with these minor things would be great! Great stuff!!!! Thanks, dreck |
#2051
|
|||
|
|||
Plz someone help me. :disappointed:
I've been at this basic problem for a while now... Most links on my front page (navbar/login) is missing the /forums part of the url and therefore dont work. What do I need to edit for this? Thank you. |
#2052
|
|||
|
|||
I've replaced the path to the forums as per instructions;
define('CHDIR_PATH', '/path/to/forums/'); to... define('CHDIR_PATH', '/home/zeno/domains/floridastreetscene.com/public_html/forums'); |
#2053
|
|||
|
|||
can i install this portal system on vb 3.0.3?
|
#2054
|
||||
|
||||
Yes you can
|
#2055
|
|||
|
|||
Quote:
Can someone help me out here? |
#2056
|
||||
|
||||
I wouldn't think your language pack would make any difference. Can you give a link to your forum and vbindex page?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|