Exemplo n.º 1
0
		'memberlist.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['members_list'],
		'' => $vbphrase['search']
	);

	$page_templater = vB_Template::create('memberlist_search');
	$page_templater->register('customfields', $customfields);
	$page_templater->register('forumjump', $forumjump);
}

// now spit out the HTML, assuming we got this far with no errors or redirects.

($hook = vBulletinHook::fetch_hook('memberlist_complete')) ? eval($hook) : false;

if (!empty($page_templater))
{
	$navbits = construct_navbits($navbits);
	$navbar = render_navbar_template($navbits);

	$page_templater->register_page_templates();
	$page_templater->register('navbar', $navbar);
	print_output($page_templater->render());
}


/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 32878 $
|| ####################################################################
\*======================================================================*/
?>
Exemplo n.º 2
0
		$usernamecode = vB_Template::create('newpost_usernamecode')->render();

		$navbar = render_navbar_template($navbits);
		$url =& $vbulletin->url;

		($hook = vBulletinHook::fetch_hook('report_form_start')) ? eval($hook) : false;

		$forminfo = $reportobj->set_forminfo($messageinfo);
		$templater = vB_Template::create('reportitem');
			$templater->register_page_templates();
			$templater->register('forminfo', $forminfo);
			$templater->register('navbar', $navbar);
			$templater->register('url', $url);
			$templater->register('usernamecode', $usernamecode);
		print_output($templater->render());
	}

	if ($_POST['do'] == 'sendemail')
	{
		$vbulletin->input->clean_array_gpc('p', array(
			'reason' => TYPE_STR,
		));

		if ($vbulletin->GPC['reason'] == '')
		{
			eval(standard_error(fetch_error('noreason')));
		}

		if ($perform_floodcheck)
		{
Exemplo n.º 3
0
 /**
  * Prints out the queued XML and then exits.
  *
  * @param	boolean	If not using shut down functions, whether to do a full shutdown (session updates, etc) or to just close the DB
  */
 function print_xml($full_shutdown = false)
 {
     if (class_exists('vBulletinHook', false)) {
         ($hook = vBulletinHook::fetch_hook('xml_print_output')) ? eval($hook) : false;
     }
     if (defined('VB_API') and VB_API === true) {
         print_output($this->data);
     }
     //run any registered shutdown functions
     $GLOBALS['vbulletin']->shutdown->shutdown();
     if (defined('NOSHUTDOWNFUNC')) {
         if ($full_shutdown) {
             exec_shut_down();
         } else {
             $this->registry->db->close();
         }
     }
     $this->send_content_type_header();
     if ($this->fetch_send_content_length_header()) {
         // this line is causing problems with mod_gzip/deflate, but is needed for some IIS setups
         $this->send_content_length_header();
     }
     echo $this->fetch_xml();
     exit;
 }
Exemplo n.º 4
0
define('SKIP_WOLPATH', 1);
// Legacy info
// TODO: Load the cms phrasegroup elsewhere
$phrasegroups = array('vbcms');
// Bootstrap to the legacy system
require './includes/class_bootstrap.php';
$bootstrap = new vB_Bootstrap();
$bootstrap->datastore_entries = array('routes');
$bootstrap->bootstrap();
/*MVC Bootstrap=====================================================================*/
// Get the entry time
define('VB_ENTRY_TIME', microtime(true));
// vB core path
define('VB_PATH', realpath(dirname(__FILE__)) . '/');
// The package path
define('VB_PKG_PATH', realpath(VB_PATH . '../packages') . '/');
// Bootstrap the framework
require_once VB_PATH . 'vb.php';
vB::init();
if (defined('VB_API') and VB_API === true) {
    // Force vB::$vbulletin->options['route_requestvar'] to 'r' for API.
    vB::$vbulletin->options['route_requestvar'] = 'r';
}
// Get routed response
print_output(vB_Router::getResponse());
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # SVN: $Revision: 28749 $
|| ####################################################################
\*======================================================================*/
Exemplo n.º 5
0
            } else {
                $get_new_posts[titletrimmed] = $get_new_posts[fullthreadtitle];
            }
            if ($get_new_posts[lastpost] > $vbulletin->userinfo['lastvisit']) {
                $get_new_posts[newpost] = true;
            }
            $get_new_posts[fullusername] = strip_tags($get_new_posts[username]);
            if ($trimusername > 0) {
                $get_new_posts[username] = fetch_trimmed_title($get_new_posts[fullusername], $trimusername);
            } else {
                $get_new_posts[username] = $get_new_posts[fullusername];
            }
            $get_new_posts[musername] = fetch_musername($get_new_posts);
            $get_new_posts_forumtitle = strip_tags($vbulletin->forumcache["{$get_new_posts['forumid']}"]['title_clean']);
            $get_new_posts[fullforumtitle] = strip_tags($get_new_posts_forumtitle);
            if ($vbulletin->options['vietvbbtopstats_bold_remove']) {
                $get_new_posts[musername] = str_replace($vietvbb_afs_bpar, "", $get_new_posts[musername]);
            }
            $get_new_postdate = vbdate($vbulletin->options['vietvbbtopstats_date_format'], $get_new_posts[lastpost]);
            $get_new_posttime = vbdate($vbulletin->options['vietvbbtopstats_time_format'], $get_new_posts[lastpost]);
            $get_new_startdate = vbdate($vbulletin->options['vietvbbtopstats_date_format'], $get_new_posts[dateline]);
            $get_new_starttime = vbdate($vbulletin->options['vietvbbtopstats_time_format'], $get_new_posts[dateline]);
            eval('$vietvbbtopstats_top .= "' . $vbulletin->templatecache['vietvbb_topstats_latest_posts'] . '";');
        }
        if (!$vietvbbtopstats_top) {
            $vietvbbtopstats_top = 'No Result';
        }
        print_output($vietvbbtopstats_top);
        exit;
    }
}
Exemplo n.º 6
0
/**
* Halts execution and redirects to the address specified
*
* If the 'useheaderredirect' option is on, the system will attempt to redirect invisibly using header('Location...
* However, 'useheaderredirect' is overridden by setting $forceredirect to a true value.
*
* @param	string	Redirect message
* @param	string	URL to which to redirect the browser
*/
function standard_redirect($message = '', $forceredirect = false)
{
	global $header, $footer, $headinclude, $headinclude_bottom, $forumjump;
	global $timezone, $vbulletin, $vbphrase;

	static
		$str_find     = array('"',      '<',    '>'),
		$str_replace  = array('&quot;', '&lt;', '&gt;');

	if ($vbulletin->db->explain)
	{
		$totaltime = microtime(true) - TIMESTART;

		$vartext .= "<!-- Page generated in " . vb_number_format($totaltime, 5) . " seconds with " . $vbulletin->db->querycount . " queries -->";

		$querytime = $vbulletin->db->time_total;
		echo "\n<b>Page generated in $totaltime seconds with " . $vbulletin->db->querycount . " queries,\nspending $querytime doing MySQL queries and " . ($totaltime - $querytime) . " doing PHP things.\n\n<hr />Shutdown Queries:</b>" . (defined('NOSHUTDOWNFUNC') ? " <b>DISABLED</b>" : '') . "<hr />\n\n";
		exit;
	}

	if ($vbulletin->options['useheaderredirect'] AND !$forceredirect AND !headers_sent() AND !$vbulletin->GPC['postvars'])
	{
		exec_header_redirect(unhtmlspecialchars($vbulletin->url, true));
	}

	$title = $vbulletin->options['bbtitle'];

	$pagetitle = $title;
	$errormessage = $message;

	$url = unhtmlspecialchars($vbulletin->url, true);
	$url = str_replace(chr(0), '', $url);
	$url = create_full_url($url);
	$url = str_replace($str_find, $str_replace, $url);
	$js_url = addslashes_js($url, '"'); // " has been replaced by &quot;

	$url = preg_replace(
		array('/&#0*59;?/', '/&#x0*3B;?/i', '#;#'),
		'%3B',
		$url
	);
	$url = preg_replace('#&amp%3B#i', '&amp;', $url);

	define('NOPMPOPUP', 1); // No footer here

	require_once(DIR . '/includes/functions_misc.php');
	$postvars = construct_hidden_var_fields(verify_client_string($vbulletin->GPC['postvars']));
	$formfile =& $url;

	($hook = vBulletinHook::fetch_hook('redirect_generic')) ? eval($hook) : false;

	$templater = vB_Template::create('STANDARD_REDIRECT');
		$templater->register('errormessage', $errormessage);
		$templater->register('formfile', $formfile);
		$templater->register('headinclude', $headinclude);
		$templater->register('headinclude_bottom', $headinclude_bottom);
		$templater->register('js_url', $js_url);
		$templater->register('pagetitle', $pagetitle);
		$templater->register('postvars', $postvars);
		$templater->register('url', $url);
	print_output($templater->render());
	exit;
}
Exemplo n.º 7
0
	public function showpage($pagenumber, $perpage, $base, $navbits, $print_output = true)
	{
		global $vbulletin;
		global $show;
		$errors = array();
		($hook = vBulletinHook::fetch_hook('search_before_process')) ? eval($hook) : false;

		$perpage = fetch_perpage($perpage, $this->maxpagesize, $vbulletin->options['searchperpage']);
		$pagenumber = max(intval($pagenumber), 1);

		if (!$this->results)
		{
			eval(standard_error(fetch_error('searchnoresults', $displayCommon), '', false));
		}
		$page_results = $this->results->get_page($pagenumber, $perpage, $this->window);

		if (!$page_results)
		{
			eval(standard_error(fetch_error('searchnoresults', $displayCommon), '', false));
		}
		$criteria = $this->results->get_criteria();
		//When we have better template features, the display strings should be passed as
		//an array to the template and handled there.
		$this->template->register('criteriaDisplay', implode('; ', $criteria->get_display_strings()));
		$this->template->register('displayCommon', $criteria->get_common_words_string());

		$this->render_searchbits($page_results);
		$show['results'] = (bool) count($page_results);

		($hook = vBulletinHook::fetch_hook('search_complete')) ? eval($hook) : false;

		//figure searchtime -- time it took to run the search in seconds
		$this->template->register('searchtime', $this->results->get_searchtime());

		//"searchminutes" in the template is minutes since the search was generated.
		$sincegenerated = floor((TIMENOW - $this->results->get_dateline()) / 60);

		if ($sincegenerated >= 1)
		{
			$this->template->register('searchminutes', $sincegenerated);
			$show['generated'] = true;
		}

		$search['showposts'] = true;

		$pagenav = construct_window_page_nav($pagenumber, $this->window, $perpage,
			$this->results->get_confirmed_count(),	$base);

		$this->template->register('navbar', render_navbar_template(construct_navbits($navbits)));
		$this->template->register('base', $base);
		$startat = ($pagenumber-1) * $perpage;
		$this->template->register('first', $startat + 1);
		$this->template->register('last', $startat + count($page_results));
		$this->template->register('total', $this->results->get_confirmed_count());
		$this->template->register('search', $search);
		$this->template->register('pagenav', $pagenav);
		$this->template->register('show', $show);
		$this->template->register('search_back_url', $criteria->get_url());
		$this->template->register_page_templates();
		
		if ($print_output)
		{
			print_output($this->template->render());
		}
		else
		{
			return $this->template->render();
		}
	}
Exemplo n.º 8
0
/**
 * Display the main search form.
 *
 * @param vB_Legacy_Current_User $user  The current user for the board.
 * @param array $globals The array of "global" GPC items and their type defaults
 * @param array $navbits The navbit array
 * @param array $errors A list of errors to display, used for redisplaying the form on error
 * @param array $searchterms A map of form fields posted by the user.  Used to propogate the
 *		the form when processing fails.
 */
function do_intro($user, $globals, $navbits, $search_type, $errors = array(), $searchterms = array())
{
	global $vbulletin, $vbphrase, $prefs, $searchforumids, $show;

	if ($vbulletin->GPC['search_type']
		OR intval($vbulletin->GPC['searchthreadid'])
		OR (isset($vbulletin->GPC['searchfromtype'])
			and strlen($vbulletin->GPC['searchfromtype']) > 6))
	{
		$template = vB_Template::create('search_common_select_type');
	}
	else
	{
		$template = vB_Template::create('search_common');

		// we only need the list of content types if we're doing the generic
		$template->register('type_options', vB_Search_Searchtools::get_type_options());
		if (!$prefs['type']) $prefs['type'] = array();
		$template->register('selectedtypes', $prefs['type']);
	}

	search_intro_register_prefs($template, $prefs);
	vB_Search_Searchtools::searchIntroRegisterHumanVerify($template);

	//actually render any errors.
	search_intro_register_errors($template, $errors);
	$show['errors'] = !empty($errors);
	$show['tag_option'] = $vbulletin->options['threadtagging'];

	//check to see if we have a preferred type
	$defaulttype = null;

	if ($prefs['type'])
	{
		if (is_array($prefs['type']))
		{
			$defaulttype = $prefs['type'][0];
		}
		else
		{
			$defaulttype = $prefs['type'];
		}
	}

	if ($vbulletin->GPC['contenttypeid'])
	{
		$defaulttype = $vbulletin->GPC['contenttypeid'];
	}

	//If we have nothing else, let's show Posts
	if ($defaulttype == null)
	{
		$defaulttype = vB_Search_Core::get_instance()->get_contenttypeid('vBForum', 'Post');
	}

	//If we have the common type, set to the default
	if ($search_type instanceof vBForum_Search_Type_Common)
	{
		unset($search_type);
		$search_type = vb_Search_Core::get_instance()->get_search_type_from_id($defaulttype);
		$prefs = vB_Search_Searchtools::searchIntroFetchPrefs($user, $defaulttype);
	}

	if ($vbulletin->GPC['search_type'] )
	{
		$template->register('input_search_types', vB_Search_Searchtools::listSearchable('vb_search_params',
			 'search.php', $prefs, $defaulttype));

		if (intval($vbulletin->GPC['contenttypeid']) OR $defaulttype)
		{
			$template->register('search_ui', $search_type->listUi($prefs,
				intval($vbulletin->GPC['contenttypeid']) ?
				$vbulletin->GPC['contenttypeid'] : $defaulttype));
		}
	}
	else if (isset($vbulletin->GPC['searchfromtype'])
		AND strlen($vbulletin->GPC['searchfromtype']) > 6)
	{
		$template->register('input_search_types', vB_Search_Searchtools::listSearchable('vb_search_params',
			 'search.php', $prefs, $defaulttype));
		$search_type = explode(':', $vbulletin->GPC['searchfromtype'], 2);

		if (count($search_type) == 2)
		{
			$search_type = vb_Search_Core::get_instance()->get_search_type($search_type[0], $search_type[1]);
		}
		else if (intval($vbulletin->GPC['contenttypeid']))
		{
			$search_type = vb_Search_Core::get_instance()->get_search_type_from_id($vbulletin->GPC['contenttypeid']);
		}
		if (isset($search_type))
		{
			$template->register('search_ui', $search_type->listUi($prefs,
				$search_type->get_contenttypeid()));
		}
	}

	$template->register('sessionhash', $sessionhash);
	search_intro_register_tagcloud($template);

	if ($vbulletin->debug)
	{
		$show['nocache'] = true;
	}

	// unlink the 'search' part of the navbits
	array_pop($navbits);
	$navbits[''] = $vbphrase['advanced_search'];
	($hook = vBulletinHook::fetch_hook('search_intro')) ? eval($hook) : false;

	//finish off search
	($hook = vBulletinHook::fetch_hook('search_complete')) ? eval($hook) : false;

	$template->register('show', $show);
	$template->register('navbar', render_navbar_template(construct_navbits($navbits)));
	$template->register_page_templates();

	print_output($template->render());
}
Exemplo n.º 9
0
 /**
  * Prints out the queued XML and then exits.
  *
  * @param	boolean	If not using shut down functions, whether to do a full shutdown (session updates, etc) or to just close the DB
  */
 function print_xml($full_shutdown = false)
 {
     if (defined('VB_API') and VB_API === true) {
         print_output($this->data);
     }
     //run any registered shutdown functions
     /** @todo remove this line when vbulletin is removed from the global space */
     $GLOBALS['vbulletin']->shutdown->shutdown();
     if (defined('NOSHUTDOWNFUNC')) {
         if ($full_shutdown) {
             exec_shut_down();
         } else {
             //				$this->registry->db->close();
         }
     }
     $this->send_content_type_header();
     if ($this->fetch_send_content_length_header()) {
         // this line is causing problems with mod_gzip/deflate, but is needed for some IIS setups
         $this->send_content_length_header();
     }
     echo $this->fetch_xml();
     exit;
 }
Exemplo n.º 10
0
 public function process()
 {
     global $show;
     vB::$vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT, 'sortby' => TYPE_NOHTML, 'time' => TYPE_NOHTML, 'show' => TYPE_NOHTML, 'ajax' => TYPE_BOOL, 'mindateline' => TYPE_UNIXTIME, 'maxdateline' => TYPE_UNIXTIME, 'minscore' => TYPE_NUM, 'minid' => TYPE_STR, 'maxid' => TYPE_STR));
     $selected = array();
     $filters = array();
     $activitybits = '';
     /* I did not have time to make the filter options more dynamic. I wanted to base the presented filter options on the unqiue section contents of the
      * activity stream datastore.  You will have to use the provided hooks to get your filter items in.
      */
     $show['as_blog'] = vB::$vbulletin->products['vbblog'];
     $show['as_cms'] = vB::$vbulletin->products['vbcms'];
     $show['as_socialgroup'] = (vB::$vbulletin->options['socnet'] & vB::$vbulletin->bf_misc_socnet['enable_groups'] and vB::$vbulletin->userinfo['permissions']['socialgrouppermissions'] & vB::$vbulletin->bf_ugp_socialgrouppermissions['canviewgroups']);
     switch (vB::$vbulletin->GPC['sortby']) {
         case 'popular':
             $filters['sortby'] = $this->vbphrase['popular'];
             $this->orderby = 'score DESC, dateline DESC';
             break;
         default:
             // recent
             vB::$vbulletin->GPC['sortby'] = 'recent';
             if (vB::$vbulletin->GPC['maxdateline']) {
                 $this->getnew = true;
                 $this->orderby = 'dateline ASC';
             } else {
                 $this->getnew = false;
                 $this->orderby = 'dateline DESC';
             }
     }
     switch (vB::$vbulletin->GPC['show']) {
         case 'photos':
             if (vB::$vbulletin->GPC['sortby'] != 'popular') {
                 if (!defined('VB_API') or VB_API !== true) {
                     $this->setGroupBy('date');
                 }
             }
             $this->setWhereFilter('type', 'photo');
             $filters['show'] = $this->vbphrase['photos'];
             break;
         case 'forum':
             $this->setWhereFilter('section', 'forum');
             $filters['show'] = $this->vbphrase['forums'];
             break;
         case 'cms':
             if ($show['as_cms']) {
                 $this->setWhereFilter('section', 'cms');
                 $filters['show'] = $this->vbphrase['articles'];
             } else {
                 vB::$vbulletin->GPC['show'] = 'all';
             }
             break;
         case 'blog':
             if ($show['as_blog']) {
                 $this->setWhereFilter('section', 'blog');
                 $filters['show'] = $this->vbphrase['blogs'];
             } else {
                 vB::$vbulletin->GPC['show'] = 'all';
             }
             break;
         case 'socialgroup':
             $this->setWhereFilter('section', 'socialgroup');
             $filters['show'] = $this->vbphrase['social_groups'];
             break;
         default:
             // all
             vB::$vbulletin->GPC['show'] = 'all';
     }
     switch (vB::$vbulletin->GPC['time']) {
         case 'today':
             $this->setWhereFilter('maxdateline', TIMENOW - 24 * 60 * 60);
             $filters['time'] = $this->vbphrase['last_24_hours'];
             break;
         case 'week':
             $this->setWhereFilter('maxdateline', TIMENOW - 7 * 24 * 60 * 60);
             $filters['time'] = $this->vbphrase['last_7_days'];
             break;
         case 'month':
             $this->setWhereFilter('maxdateline', TIMENOW - 30 * 24 * 60 * 60);
             $filters['time'] = $this->vbphrase['last_30_days'];
             break;
         default:
             // anytime
             vB::$vbulletin->GPC['time'] = 'anytime';
     }
     $selected = array(vB::$vbulletin->GPC['time'] => ' class="selected" ', vB::$vbulletin->GPC['show'] => ' class="selected" ', vB::$vbulletin->GPC['sortby'] => ' class="selected" ');
     $unselected = array('popular' => ' class="unselected" ', 'recent' => ' class="unselected" ', 'anytime' => ' class="unselected" ', 'today' => ' class="unselected" ', 'week' => ' class="unselected" ', 'month' => ' class="unselected" ', 'all' => ' class="unselected" ', 'photos' => ' class="unselected" ', 'forum' => ' class="unselected" ', 'cms' => ' class="unselected" ', 'blog' => ' class="unselected" ', 'socialgroup' => ' class="unselected" ', 'on' => ' class="unselected" ', 'off' => ' class="unselected" ');
     $unselected = array_diff_key($unselected, $selected);
     ($hook = vBulletinHook::fetch_hook($this->hook_beforefetch)) ? eval($hook) : false;
     $arguments = array('sortby' => array('show=' . vB::$vbulletin->GPC['show'], 'time=' . vB::$vbulletin->GPC['time']), 'time' => array('show=' . vB::$vbulletin->GPC['show'], 'sortby=' . vB::$vbulletin->GPC['sortby']), 'show' => array('time=' . vB::$vbulletin->GPC['time'], 'sortby=' . vB::$vbulletin->GPC['sortby']));
     foreach ($arguments as $key => $values) {
         $arguments[$key] = implode("&amp;", $values);
     }
     $filter = array();
     foreach ($filters as $type => $string) {
         $filter[] = array('phrase' => $string, 'arguments' => $arguments[$type]);
     }
     $show['filterbar'] = !empty($filter);
     if (!vB::$vbulletin->GPC['pagenumber']) {
         vB::$vbulletin->GPC['pagenumber'] = 1;
     }
     $moreactivity = array('type' => vB::$vbulletin->GPC['type'], 'page' => vB::$vbulletin->GPC['pagenumber'] + 1);
     $this->setPage(vB::$vbulletin->GPC['pagenumber'], vB::$vbulletin->options['as_perpage']);
     if (vB::$vbulletin->GPC['ajax']) {
         $this->processExclusions(vB::$vbulletin->GPC['sortby']);
         $result = $this->fetchStream(vB::$vbulletin->GPC['sortby']);
         $this->processAjax($result);
     } else {
         $result = $this->fetchStream(vB::$vbulletin->GPC['sortby']);
         $actdata = array('mindateline' => $result['mindateline'], 'maxdateline' => $result['maxdateline'], 'minscore' => $result['minscore'], 'minid' => $result['minid'], 'maxid' => $result['maxid'], 'count' => $result['count'], 'totalcount' => $result['totalcount'], 'perpage' => $result['perpage'], 'time' => vB::$vbulletin->GPC['time'], 'show' => vB::$vbulletin->GPC['show'], 'sortby' => vB::$vbulletin->GPC['sortby'], 'refresh' => $this->refresh);
         $show['noactivity'] = false;
         $show['nomoreresults'] = false;
         $show['moreactivity'] = false;
         if ($result['totalcount'] == 0) {
             $show['noactivity'] = true;
         } else {
             if ($result['totalcount'] < $result['perpage']) {
                 $show['nomoreresults'] = true;
             } else {
                 $show['moreactivity'] = true;
             }
         }
         foreach ($result['bits'] as $bit) {
             $activitybits .= $bit;
         }
         $navbits = construct_navbits(array(vB::$vbulletin->options['forumhome'] . '.php?' . vB::$vbulletin->session->vars['sessionurl'] => $this->vbphrase['home'], '' => $this->vbphrase['activity_stream']));
         $navbar = render_navbar_template($navbits);
         $templater = vB_Template::create('activitystream_home');
         $templater->register_page_templates();
         $templater->register('selected', $selected);
         $templater->register('unselected', $unselected);
         $templater->register('activitybits', $activitybits);
         $templater->register('arguments', $arguments);
         $templater->register('filter', $filter);
         $templater->register('actdata', $actdata);
         $templater->register('navbar', $navbar);
         $templater->register('template_hook', $template_hook);
         print_output($templater->render());
     }
 }
Exemplo n.º 11
0
<?php

error_reporting(E_ALL);
function __autoload($name)
{
    require_once "classes/{$name}.php";
}
require_once 'functions.php';
// initializing variables
$g['weburl'] = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
$g['webdir'] = dirname($_SERVER['PHP_SELF']);
if (!isset($_GET['dir'])) {
    $_GET['dir'] = '';
}
$g['base_path'] = "presentation/{$_GET['dir']}/";
find_path();
parse_presentation();
print_output();
Exemplo n.º 12
0
/**
* Halts execution and redirects to the address specified
*
* If the 'useheaderredirect' option is on, the system will attempt to redirect invisibly using header('Location...
* However, 'useheaderredirect' is overridden by setting $forceredirect to a true value.
*
* @param	string	Redirect message
* @param	string	URL to which to redirect the browser
* @param	bool	Force bypass of domain whitelist check
*/
function standard_redirect($message = '', $forceredirect = false, $bypasswhitelist = false)
{
    global $header, $footer, $headinclude, $headinclude_bottom, $forumjump;
    global $timezone, $vbulletin, $vbphrase;
    static $str_find = array('"', '<', '>'), $str_replace = array('&quot;', '&lt;', '&gt;');
    if ($vbulletin->db->explain) {
        $totaltime = microtime(true) - TIMESTART;
        $vartext .= "<!-- Page generated in " . vb_number_format($totaltime, 5) . " seconds with " . $vbulletin->db->querycount . " queries -->";
        $querytime = $vbulletin->db->time_total;
        echo "\n<b>Page generated in {$totaltime} seconds with " . $vbulletin->db->querycount . " queries,\nspending {$querytime} doing MySQL queries and " . ($totaltime - $querytime) . " doing PHP things.\n\n<hr />Shutdown Queries:</b>" . (defined('NOSHUTDOWNFUNC') ? " <b>DISABLED</b>" : '') . "<hr />\n\n";
        exit;
    }
    if ($vbulletin->url and !$bypasswhitelist and !$vbulletin->options['redirect_whitelist_disable']) {
        $foundurl = false;
        if ($urlinfo = $vbulletin->input->parse_url($vbulletin->url)) {
            if (!$urlinfo['scheme']) {
                // url is made full in exec_header_redirect which stops a url from being redirected to, say "www.php.net" (no http://)
                $foundurl = true;
            } else {
                $whitelist = array();
                if ($vbulletin->options['redirect_whitelist']) {
                    $whitelist = explode("\n", trim($vbulletin->options['redirect_whitelist']));
                }
                // Add $bburl to the whitelist
                $bburlinfo = $vbulletin->input->parse_url($vbulletin->options['bburl']);
                $bburl = "{$bburlinfo['scheme']}://{$bburlinfo['host']}";
                array_unshift($whitelist, $bburl);
                // if the "realurl" of this request does not equal $bburl, add it as well..
                $realurl = VB_URL_SCHEME . '://' . VB_URL_HOST;
                if (strtolower($bburl) != strtolower($realurl)) {
                    array_unshift($whitelist, $realurl);
                }
                foreach (array('vbblog', 'vbforum', 'vbcms') as $value) {
                    if ($vbulletin->options[$value . '_url']) {
                        array_unshift($whitelist, $vbulletin->options[$value . '_url']);
                    }
                }
                $vburl = strtolower($vbulletin->url);
                foreach ($whitelist as $url) {
                    $url = trim($url);
                    if ($vburl == strtolower($url) or strpos($vburl, strtolower($url) . '/', 0) === 0) {
                        $foundurl = true;
                        break;
                    }
                }
            }
        }
        if (!$foundurl) {
            eval(standard_error(fetch_error('invalid_redirect_url_x', $vbulletin->url)));
        }
    }
    if ($vbulletin->options['useheaderredirect'] and !$forceredirect and !headers_sent() and !$vbulletin->GPC['postvars'] and !VB_API) {
        exec_header_redirect(unhtmlspecialchars($vbulletin->url, true));
    }
    $title = $vbulletin->options['bbtitle'];
    $pagetitle = $title;
    $errormessage = $message;
    $url = unhtmlspecialchars($vbulletin->url, true);
    $url = str_replace(chr(0), '', $url);
    $url = create_full_url($url);
    $url = str_replace($str_find, $str_replace, $url);
    $js_url = addslashes_js($url, '"');
    // " has been replaced by &quot;
    $url = preg_replace(array('/&#0*59;?/', '/&#x0*3B;?/i', '#;#'), '%3B', $url);
    $url = preg_replace('#&amp%3B#i', '&amp;', $url);
    define('NOPMPOPUP', 1);
    // No footer here
    require_once DIR . '/includes/functions_misc.php';
    $postvars = construct_hidden_var_fields(verify_client_string($vbulletin->GPC['postvars']));
    $formfile =& $url;
    ($hook = vBulletinHook::fetch_hook('redirect_generic')) ? eval($hook) : false;
    $templater = vB_Template::create('STANDARD_REDIRECT');
    $templater->register('errormessage', $errormessage);
    $templater->register('formfile', $formfile);
    $templater->register('headinclude', $headinclude);
    $templater->register('headinclude_bottom', $headinclude_bottom);
    $templater->register('js_url', $js_url);
    $templater->register('pagetitle', $pagetitle);
    $templater->register('postvars', $postvars);
    $templater->register('url', $url);
    print_output($templater->render());
    exit;
}
Exemplo n.º 13
0
$payment_data->client_phone = '79859202808';
$payment_data->description = 'Тест платежа';
$payment_data->payment_system = 'TEST';
$payment_data->client_ip = $_SERVER['REMOTE_ADDR'];
/* Пример использования */
// Создаем объект мерчант-класса SP
$sp = new MySimplePayMerchant();
$out = $sp->get_ps_list(100);
print_output("Разрешенные платежные системы", $out);
// Запрос на создание платежа
$out = $sp->direct_payment($payment_data);
print_output("Информация об адресе для переадресации пользователя", $out);
// Получаем ссылку на платежную страницу
$payment_link = $out['sp_redirect_url'];
// Выводим ссылку
echo '<a href="' . $payment_link . '" target="_blank">Переход на платежную страницу</a>';
// Запрос данных о созданном платеже
$out = $sp->get_order_status_by_order_id(1001);
print_output("Информация о созданном платеже", $out);
/**
 * Функция для выдачи данных результата на страницу
 * @param type $header
 * @param type $array
 */
function print_output($header, $array)
{
    echo "<h1>{$header}</h1>";
    echo "<pre>";
    print_r($array);
    echo "</pre>";
}
        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);
    }
}
Exemplo n.º 15
0
?>
 seconds">
                API load time
              </div>
              <div class="progress-bar progress-bar-primary" role="progressbar" aria-valuenow="<?php 
echo $remainperc;
?>
" aria-valuemin="0" aria-valuemax="100" style="width: <?php 
echo $remainperc;
?>
%;">
                PHP time
              </div>
            </div>
            <pre><?php 
print_output($outputformat, $data);
?>
</pre>
        </div>
    </div>
</div>
<!-- Modal -->
<div class="modal fade" id="aboutModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><i class="fa fa-info-circle"></i> About</h4>
      </div>
      <div class="modal-body">
        <div class="row">