ND DATA ###################### $phrasegroups = array('forum'); $specialtemplates = array(); // ######################### REQUIRE BACK-END ############################ require_once './global.php'; require_once DIR.'/includes/functions_bigthree.php'; // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### if (SLASH_METHOD and strpos($archive_info, '/archive/index.php') === false) { exec_header_redirect($vbulletin->options['bburl'].'/archive/index.php'.$vbulletin->session->vars['sessionurl_q']); } // parse query string $f = 0; $p = 0; $t = 0; $output = ''; $endbit = $vbulletin->input->strip_sessionhash($archive_info); $endbit = str_replace(array('pda=1', 'login=1', '.html'), '', $endbit); $endbit = rtrim($endbit, '&?'); if (SLASH_METHOD) { $endbit = substr(strrchr($endbit, '/'), 1); } elseif (strpos($endbit, '&') !== false) { $endbit = substr(strrchr($endbit, '&'), 1); } if ($endbit != '' and $endbit != 'index.php') { $queryparts = explode('-', $endbit); foreach ($queryparts as $querypart) { if ($lastpart != '') { // can be: // f: forumid // p: pagenumber // t: threadid $$lastpart = $querypart; $lastpart = ''; } else { switch ($querypart) { case 'f': case 'p': case 't': $lastpart = $querypart; break; default: $lastpart = ''; } } } } else { $do = 'index'; } $vbulletin->input->clean_array_gpc('r', array( 'pda' => TYPE_BOOL, 'login' => TYPE_BOOL, 'message' => TYPE_BOOL, )); $vbulletin->input->clean_array_gpc('c', array( COOKIE_PREFIX.'pda' => TYPE_UINT, )); $vbulletin->input->clean_array_gpc('p', array( 'username' => TYPE_STR, 'password' => TYPE_STR, )); // check to see if the person is using a PDA if so we'll sort in ASC // force a redirect afterwards so we dont get problems with search engines if ($t) { $t = intval($t); $querystring = 't-'.$t.iif($p, '-p-'.intval($p)).'.html'; } elseif ($f) { $f = intval($f); $querystring = 'f-'.$f.iif($p, '-p-'.intval($p)).'.html'; } if ($vbulletin->GPC['pda']) { vbsetcookie('pda', '1', 1); $redirect_url = $vbulletin->options['bburl'].'/archive/index.php'; if ($querystring) { $redirect_url .= (SLASH_METHOD ? '/' : '?').$querystring.ARCHIVE_SESSION_URL; } else { $redirect_url .= $vbulletin->session->vars['sessionurl_q']; } exec_header_redirect($redirect_url); } elseif ($vbulletin->GPC[COOKIE_PREFIX.'pda']) { $pda = true; } $title = $vbulletin->options['bbtitle']; if ($vbulletin->userinfo['userid'] == 0 and $vbulletin->GPC['login']) { if (!empty($vbulletin->GPC['username']) and !empty($vbulletin->GPC['password'])) { require_once DIR.'/includes/functions_login.php'; $strikes = verify_strike_status($vbulletin->GPC['username'], true); if ($strikes === false) { // user has got too many wrong passwords $error_message = fetch_error('strikes', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl']); $do = 'error'; } elseif (verify_authentication($vbulletin->GPC['username'], $vbulletin->GPC['password'], '', '', false, true)) { exec_unstrike_user($vbulletin->GPC['username']); $db->query_write('DELETE FROM '.TABLE_PREFIX."session WHERE sessionhash = '".$db->escape_string($vbulletin->session->vars['dbsessionhash'])."'"); $vbulletin->session->vars = $vbulletin->session->fetch_session($vbulletin->userinfo['userid']); /*insert query*/ $db->query_write(' INSERT INTO '.TABLE_PREFIX."session (sessionhash, userid, host, idhash, lastactivity, styleid, loggedin, bypass, useragent) VALUES ('".$db->escape_string($vbulletin->session->vars['sessionhash'])."', ".$vbulletin->session->vars['userid'].", '".$db->escape_string($vbulletin->session->vars['host'])."', '".$db->escape_string($vbulletin->session->vars['idhash'])."', ".TIMENOW.', '.$vbulletin->session->vars['styleid'].', 1, '.iif($logintype === 'cplogin', 1, 0).", '".$db->escape_string($vbulletin->session->vars['useragent'])."') "); $redirect_url = $vbulletin->options['bburl'].'/archive/index.php'; if ($querystring) { $redirect_url .= (SLASH_METHOD ? '/' : '?').$querystring.ARCHIVE_SESSION_URL; } else { $redirect_url .= $vbulletin->session->vars['sessionurl_q']; } exec_header_redirect($redirect_url); } else { // wrong username / password exec_strike_user($vbulletin->userinfo['username']); $error_message = fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'], $strikes); $do = 'error'; } } } if ($do == 'error') { } elseif ($t) { $do = 'thread'; $threadinfo = fetch_threadinfo($t); $foruminfo = fetch_foruminfo($threadinfo['forumid']); $threadinfo['meta_description'] = strip_bbcode(strip_quotes($threadinfo['description']), false, true); $threadinfo['meta_description'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title($threadinfo['meta_description'], 500, false))); $forumperms = $vbulletin->userinfo['forumpermissions'][$foruminfo['forumid']]; if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) or in_coventry($threadinfo['postuserid']) or $threadinfo['isdeleted'] or (!$threadinfo['visible'] and !can_moderate($threadinfo['forumid'], 'canmoderateposts'))) { exit; } verify_forum_password($foruminfo['forumid'], $foruminfo['password']); if (trim($foruminfo['link']) != '') { exec_header_redirect($foruminfo['link'], true); } $title = "$threadinfo[prefix_plain_html] $threadinfo[title] [$vbphrase[archive]] ".($p > 1 ? ' - '.construct_phrase($vbphrase['page_x'], $p) : '')." - $title"; $p = intval($p); $metatags = " "; } elseif ($f) { $do = 'forum'; $forumperms = $vbulletin->userinfo['forumpermissions'][$f]; if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) { exit; } $foruminfo = fetch_foruminfo($f, false); if (trim($foruminfo['link']) != '') { // add session hash to local links if necessary if (preg_match('#^([a-z0-9_]+\.php)(\?.*$)?#i', $foruminfo['link'], $match)) { if ($match[2]) { // we have a ?xyz part, put session url at beginning if necessary $query_string = preg_replace('/([^a-z0-9])(s|sessionhash)=[a-z0-9]{32}(&|&)?/', '\\1', $match[2]); $foruminfo['link'] = $match[1].'?'.$vbulletin->session->vars['sessionurl_js'].substr($query_string, 1); } else { $foruminfo['link'] .= $vbulletin->session->vars['sessionurl_q']; } } exec_header_redirect($foruminfo['link'], true); } verify_forum_password($foruminfo['forumid'], $foruminfo['password']); $title = "$foruminfo[title_clean] [$vbphrase[archive]]".($p > 1 ? ' - '.construct_phrase($vbphrase['page_x'], $p) : '')." - $title"; $p = intval($p); $metatags = "options['keywords']."\" /> 1 ? construct_phrase($vbphrase['page_x'], $p).' ' : '').$foruminfo['description_clean'].'" /> '; } else { $do = 'index'; $metatags = ' '; } ($hook = vBulletinHook::fetch_hook('archive_process_start')) ? eval($hook) : false; if ($pda and $vbulletin->userinfo['userid'] == 0 and $vbulletin->GPC['login'] and $do != 'error') { $do = 'login'; } if ($pda and $vbulletin->userinfo['userid'] > 0 and $vbulletin->GPC['message'] and false) { $do = 'message'; } // ad locations $ad_templates = fetch_ad_templates(array('ad_archive_above_content1', 'ad_archive_above_content2', 'ad_archive_below_content')); $output .= '
$metatags$vbphrase[view_full_version]: '.$vbulletin->options['bbtitle']."
\n"; $output .= '$vbphrase[view_full_version] : $foruminfo[title_clean]
\n$vbphrase[view_full_version] : " .($threadinfo['prefix_plain_html'] ? "$threadinfo[prefix_plain_html] " : '') .'$threadinfo[title]
\n$vbphrase[view_full_version]: '.$vbulletin->options['bbtitle']."
\n"; $output .= '$vbphrase[view_full_version]: '.$vbulletin->options['bbtitle']."
\n"; $output .= '