Exemplo n.º 1
0
	foreach ($datastore_fetch AS $value)
	{
		$new_datastore_fetch[] = substr($value, 1, -1);
	}
}

$vbulletin->datastore->fetch($new_datastore_fetch);
unset($datastore_fetch, $new_datastore_fetch);

// #############################################################################
// Parse the friendly uri for the current request
if (defined('FRIENDLY_URL_LINK'))
{
	require_once(CWD . '/includes/class_friendly_url.php');

	$friendly = vB_Friendly_Url::fetchLibrary($vbulletin, FRIENDLY_URL_LINK . '|nosession');

	if ($vbulletin->input->friendly_uri = $friendly->get_uri())
	{
		// don't resolve the wolpath
		define('SKIP_WOLPATH', 1);
	}
}

// #############################################################################
// do a callback to modify any variables that might need modifying based on HTTP input
// eg: doing a conditional redirect based on a $goto value or $vbulletin->noheader must be set
if (function_exists('exec_postvar_call_back'))
{
	exec_postvar_call_back();
}
Exemplo n.º 2
0
}
if ($show['guestview']) {
    // facebook options
    if (is_facebookenabled()) {
        // display publish to Facebook checkbox in quick editor?
        $fbpublishcheckbox = construct_fbpublishcheckbox();
    }
    // display the like button for this thread?
    $fblikebutton = construct_fblikebutton();
}
// Record thread as viewed.
if ($vbulletin->options['who_read']) {
    mark_content_read('vBForum_Thread', $thread['threadid'], 'view');
}
($hook = vBulletinHook::fetch_hook('showthread_complete')) ? eval($hook) : false;
$thread_url = vB_Friendly_Url::fetchLibrary($vbulletin, 'thread|js', $threadinfo, array('pagenumber' => $vbulletin->GPC['pagenumber']))->get_url();
// #############################################################################
// output page
$templater = vB_Template::create('SHOWTHREAD');
$templater->register_page_templates();
$templater->register('pagenumbers', fetch_start_end_total_array($vbulletin->GPC['pagenumber'], $perpage, $totalposts));
$templater->register('totalposts', $totalposts);
$templater->register('activeusers', $activeusers);
$templater->register('ad_location', $ad_location);
$templater->register('bookmarksites', $bookmarksites);
$templater->register('editorid', $editorid);
$templater->register('FIRSTPOSTID', $FIRSTPOSTID);
$templater->register('firstunread', $firstunread);
$templater->register('forumjump', $forumjump);
$templater->register('forumrules', $forumrules);
$templater->register('gobutton', $gobutton);
Exemplo n.º 3
0
/**
* Verifies that we are at the proper canonical seo url based on admin settings
*
* @param	string	Type of link, 'thread', etc
* @param	array		Specific information relevant to the page being linked to, $threadinfo, etc
* @param	array		Other information relevant to the page being linked to
* @param	string	Override the default $linkinfo[userid] with $linkinfo[$primaryid]
* @param	string	Override the default $linkinfo[title] with $linkinfo[$primarytitle]
*/
function verify_seo_url($link, $linkinfo, $pageinfo = null, $primaryid = null, $primarytitle = null)
{
	global $vbulletin;

	require_once(DIR . '/includes/class_friendly_url.php');

	// Check we have something to compare
	if (empty($linkinfo) OR !isset($vbulletin->input->friendly_uri))
	{
		return;
	}

	// Redirect if the current request is not canonical
	$canonical = vB_Friendly_Url::fetchLibrary($vbulletin, $link . '|nosession', $linkinfo, $pageinfo, $primaryid, $primarytitle);
	$canonical->redirect_canonical_url($vbulletin->input->friendly_uri);


	// Set the WOLPATH
	$url = $canonical->get_url(FRIENDLY_URL_OFF);
	$vbulletin->session->set('location', $url);
	define('WOLPATH', $vbulletin->input->strip_sessionhash($url));
}
Exemplo n.º 4
0
                    $vbulletin->GPC['postvars'] = '';
                }
            } else {
                $vbulletin->GPC['postvars'] = '';
            }
        }
        // workaround IIS cookie+location header bug
        $forceredirect = strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false;
        print_standard_redirect('forumpasswordcorrect', true, $forceredirect);
    } else {
        require_once DIR . '/includes/functions_misc.php';
        $vbulletin->GPC['url'] = str_replace('&', '&', $vbulletin->GPC['url']);
        $postvars = construct_post_vars_html() . '<input type="hidden" name="securitytoken" value="' . $vbulletin->userinfo['securitytoken'] . '" />';
        //use the basic link here.  I'm not sure how the advanced link will play with the postvars in the form.
        require_once DIR . '/includes/class_friendly_url.php';
        $forumlink = vB_Friendly_Url::fetchLibrary($vbulletin, 'forum|nosession', $foruminfo, array('do' => 'doenterpwd'));
        $forumlink = $forumlink->get_url(FRIENDLY_URL_OFF);
        // TODO; Convert 'forumpasswordincorrect' to vB4 style
        eval(standard_error(fetch_error('forumpasswordincorrect', $vbulletin->session->vars['sessionhash'], htmlspecialchars_uni($vbulletin->GPC['url']), $foruminfo['forumid'], $postvars, 10, 1, $forumlink)));
    }
}
// ###### END SPECIAL PATHS
// These $_REQUEST values will get used in the sort template so they are assigned to normal variables
$perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT);
$pagenumber = $vbulletin->input->clean_gpc('r', 'pagenumber', TYPE_UINT);
$daysprune = $vbulletin->input->clean_gpc('r', 'daysprune', TYPE_INT);
$sortfield = $vbulletin->input->clean_gpc('r', 'sortfield', TYPE_STR);
$sortorder = $vbulletin->input->clean_gpc('r', 'sortorder', TYPE_STR);
// get permission to view forum
$_permsgetter_ = 'forumdisplay';
$forumperms = fetch_permissions($foruminfo['forumid']);
Exemplo n.º 5
0
function verify_subdirectory_url($prefix, $scriptid = null)
{
    global $vbulletin;
    if (!$prefix) {
        return;
    }
    // Never redirect a post
    // unless we're in debug mode and we wan't to error out on the bad urls
    // unless again its ajax... we're relying on the old urls for ajax because
    // a) it doesn't matter, users and search engines one see them and b) getting the
    // url logic into javascript is difficult.
    if ('GET' != $_SERVER['REQUEST_METHOD'] and (!(defined('DEV_REDIRECT_404') and DEV_REDIRECT_404) or $vbulletin->GPC['ajax'])) {
        return;
    }
    if (defined('FRIENDLY_URL_LINK')) {
        $friendly = vB_Friendly_Url::fetchLibrary($vbulletin, FRIENDLY_URL_LINK . '|nosession');
        if (vB_Friendly_Url::getMethodUsed() == FRIENDLY_URL_REWRITE) {
            $scriptid = $friendly->getRewriteSegment();
        } else {
            $scriptid = $friendly->getScript();
        }
    } else {
        if (is_null($scriptid)) {
            $scriptid = THIS_SCRIPT;
        }
    }
    $pos = strrpos(VB_URL_CLEAN, '/' . $scriptid);
    if ($pos === false) {
        //if we don't know what this url is, then lets not try to mess with it.
        //this came up with the situation where the main index.php is set to forum
        //but the forums have been moved to a subdirectory.  Doesn't make much sense
        //but we should handle it gracefully.
        return;
    }
    $base_part = substr(VB_URL_CLEAN, 0, $pos);
    $script_part = substr(VB_URL_CLEAN, $pos + 1);
    if (!preg_match('#' . preg_quote($prefix) . '$#', $base_part)) {
        //force the old urls to 404 for testing purposes
        if (defined('DEV_REDIRECT_404') and DEV_REDIRECT_404) {
            //dev only, no need to phrase the error.
            header("HTTP/1.0 404 Not Found");
            standard_error("old style url found, shouldn't get here");
        } else {
            $url = $prefix . '/' . $script_part;
            // redirect to the correct url
            exec_header_redirect($url, 301);
        }
    }
}
Exemplo n.º 6
0
        log_moderator_action($pictureinfo, 'social_group_picture_x_in_y_removed', array(fetch_trimmed_title($pictureinfo['caption'], 50), $group['name']));
    }
    ($hook = vBulletinHook::fetch_hook('group_picture_delete')) ? eval($hook) : false;
    if ($groupdm->fetch_field('picturecount')) {
        $vbulletin->url = fetch_seo_url('group', $group, array('do' => 'grouppictures'));
    } else {
        $vbulletin->url = fetch_seo_url('group', $group);
    }
    unset($groupdm);
    print_standard_redirect('picture_removed_from_group');
}
// #######################################################################
if ($_REQUEST['do'] == 'removepicture') {
    $vbulletin->input->clean_array_gpc('r', array('attachmentid' => TYPE_UINT));
    $confirmdo = 'doremovepicture';
    $confirmaction = vB_Friendly_Url::fetchLibrary($vbulletin, 'group|nosession', $group, array('do' => $confirmdo));
    $confirmaction = $confirmaction->get_url(FRIENDLY_URL_OFF);
    $title_phrase = $vbphrase['remove_picture_from_group'];
    $question_phrase = construct_phrase($vbphrase['confirm_remove_picture_group_x'], $group['name']);
    $navbits = array(fetch_seo_url('grouphome', array()) => $vbphrase['social_groups'], fetch_seo_url('groupcategory', $group) => $group['categoryname'], fetch_seo_url('group', $group) => $group['name'], '' => $vbphrase['remove_picture_from_group']);
    $page_templater = vB_Template::create('socialgroups_confirm');
    $page_templater->register('confirmaction', $confirmaction);
    $page_templater->register('confirmdo', $confirmdo);
    $page_templater->register('extratext', $extratext);
    $page_templater->register('group', $group);
    $page_templater->register('pictureinfo', $pictureinfo);
    $page_templater->register('question_phrase', $question_phrase);
    $page_templater->register('title_phrase', $title_phrase);
    $page_templater->register('url', $url);
}
// #######################################################################
     $ajaxout = '';
     while ($thread = $db->fetch_array($result)) {
         $thread['ftitle'] =& $vbulletin->forumcache[$thread['forumid']]['title'];
         $thread['detailtime'] = vbdate('h:m:i A', $thread['lastpost']);
         //--Get mUsername
         $postuser = $vbulletin->db->query_first("SELECT usergroupid,displaygroupid,username FROM " . TABLE_PREFIX . "user WHERE userid = '{$thread['lastposterid']}' LIMIT 1");
         //$thread['musername'] = str_replace(array('<b>','</b>'),'',fetch_musername($postuser));
         $thread['musername'] = fetch_musername($postuser);
         if ($forumids == 'mypost' && $thread['lastposterid'] == $vbulletin->userinfo['userid']) {
             $poster = array('username' => $thread['susername'], 'usergroupid' => $vbulletin->userinfo['usergroupid']);
             $thread['susername'] = fetch_musername($poster);
         }
         $page = ceil(($thread['replycount'] + 1) / $vbulletin->options['maxposts']);
         $thread['link'] = vB_Friendly_Url::fetchLibrary($vbulletin, 'thread', $thread, array('page' => $page))->get_url();
         $thread['flink'] = vB_Friendly_Url::fetchLibrary($vbulletin, 'forum', $vbulletin->forumcache[$thread['forumid']], null)->get_url();
         $thread['ulink'] = vB_Friendly_Url::fetchLibrary($vbulletin, 'member', array('userid' => $thread['lastposterid'], 'username' => $thread['lastposter']), null)->get_url();
         $tem->register('thread', $thread);
         $ajaxout .= $tem->render();
     }
     $db->free_result($result);
     //--Save to cache
     if ($vbulletin->options['vtlai_topx_cachesystem'] == 1) {
         $f = @fopen($cachefilename, 'w+');
         if ($f) {
             fwrite($f, serialize(array('exptime' => time() + intval($vbulletin->options['vtlai_topx_cachetime']), 'content' => $ajaxout)));
             fclose($f);
         }
     }
     //--
     print_output($ajaxout);
 }