| Registered User
Join Date: Dec 2005
Posts: 7
|
<?php
//
// vBulletin Integration header file
//
// If PhotoPost has an odd background color or squished width, you will need to edit
// vbulletin's default "header" style input box / template and change "{pagebgcolor}"
// and "{tablewidth}" (near the bottom) to your preferred background color and table
// width, respectively.
//
require "config-int.php";
$vboptions = array();
unset($vbuserid);
if ( VB3_INTEGRATION == "on" ) {
if ( THIS_SCRIPT == "comments" && VB3_ENHANCEDINT == "on" ) {
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
//$phrasegroups = array('threadmanage', 'posting', 'PhotoPost_PopUp');
$phrasegroups = array('threadmanage', 'posting');
// get special data templates from the datastore
$specialtemplates = array(
'smiliecache',
'bbcodecache',
'attachmentcache'
);
// pre-cache templates used by all actions
$globaltemplates = array(
'newpost_attachment',
'newpost_attachmentbit',
'newthread'
);
}
elseif ( THIS_SCRIPT == "showphoto" && VB3_ENHANCEDINT == "on" ) {
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('posting', 'postbit', 'showthread');
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array();
}
else {
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array();
}
chdir($vbpath);
require("./global.php");
if ( isset($bbuserinfo['userid']) ) {
$vbuserid = $bbuserinfo['userid'];
define( "VB35", 'off' );
}
else {
// vB3.5.2 uses $vbulletin
$vbuserid = $vbulletin->userinfo[userid];
$vboptions[bburl] = $vbulletin->options[bburl];
$vboptions[forumhome] = $vbulletin->options[forumhome];
$vboptions['storecssasfile'] = $vbulletin->options['storecssasfile'];
$vboptions['avatarenabled'] = $vbulletin->options['avatarenabled'];
$vboptions['usefileavatar'] = $vbulletin->options['usefileavatar'];
$vboptions[avatarurl] = $vbulletin->options['avatarurl'];
define( "VB35", 'on' );
}
eval('$navbar = "' . fetch_template('navbar') . '";');
$headinclude = process_replacement_vars($headinclude);
$header = process_replacement_vars($header);
$navbar = process_replacement_vars($navbar);
$vbheader = "$stylevar[htmldoctype]
<html dir=\"$stylevar[textdirection]\" lang=\"$stylevar[languagecode]\">
<head>
$headinclude";
if ( VB35 == "off" )
require_once('./includes/functions_showthread.php');
else
require_once('./includes/class_postbit.php');
if ( THIS_SCRIPT == "comments" && VB3_ENHANCEDINT == "on" && VB3_COMMWYSIWYG == "on" ) {
require_once('./includes/functions_newpost.php');
require_once('./includes/functions_editor.php');
require_once('./includes/functions_bigthree.php');
//require_once('./includes/functions_wysiwyg.php');
$textareacols = fetch_textarea_width();
if ( !isset($_POST['WYSIWYG_HTML']) ) {
$editorid = construct_edit_toolbar('{ppcode}', 0, 0, 1);
if ( VB35 == "on" ) {
$messagearea = str_replace( "\"client", "\"". $vbulletin->options['bburl'] ."/client", $messagearea );
$messagearea = str_replace( "\"images", "\"". $vbulletin->options['bburl'] ."/images", $messagearea );
}
else {
$messagearea = str_replace( "\"client", "\"$vboptions[bburl]/client", $messagearea );
$messagearea = str_replace( "\"images", "\"$vboptions[bburl]/images", $messagearea );
}
}
if ( VB35 == "off" ) {
$body = "<body onload=\"editInit();\">";
}
else {
$body = "<body>";
}
$vbheader .= <<<VBHEADER
{ppheader}
</head>
$body
$header
$navbar
<div align="center">
VBHEADER;
}
elseif ( (THIS_SCRIPT == "showphoto" && VB3_ENHANCEDINT == "on") ||
(THIS_SCRIPT == "comments" && VB3_ENHANCEDINT == "on") ||
(THIS_SCRIPT == "search" && VB3_ENHANCEDINT == "on") ||
(THIS_SCRIPT == "comshow" && VB3_ENHANCEDINT == "on") ||
(THIS_SCRIPT == "showmembers" && VB3_ENHANCEDINT == "on") ) {
// We need these functions, too...
require_once('./includes/functions_newpost.php');
require_once('./includes/functions_editor.php');
$istyles_js = construct_editor_styles_js();
$vbheader .= <<<VBHEADER
<!-- set up CSS for the editor -->
<link rel="stylesheet" type="text/css" href="$vboptions[bburl]/clientscript/vbulletin_editor.css" />
<style type="text/css">
<!--
#vBulletin_editor {
background: {$istyles[pi_button_normal][0]};
padding: $stylevar[cellpadding]px;
}
#controlbar, .controlbar {
background: {$istyles[pi_button_normal][0]};
}
.imagebutton {
background: {$istyles[pi_button_normal][0]};
color: {$istyles[pi_button_normal][1]};
padding: {$istyles[pi_button_normal][2]};
border: {$istyles[pi_button_normal][3]};
}
-->
</style>
{ppheader}
</head>
<body>
$header
$navbar
<div align="center">
VBHEADER;
}
else {
$vbheader .= <<<VBHEADER
{ppheader}
</head>
<body>
$header
$navbar
<div align="center">
VBHEADER;
}
$headvars = array( "\"clientscript", "url(images/", "\"search", "\"profile", "\"#usercp", "\"private", "\"member",
"\"subscription", "\"online", "\"misc", "\"forumdisplay", "action=\"login", "\"faq", "\"register",
"\"{$vboptions[forumhome]}.php", "\"#usercptools", "\"usercp.php", "\"login.php", "'misc.php",
"\"calendar.php", "\"images/misc", "\"admincp.php" );
$headrepl = array( "\"{$vboptions['bburl']}/clientscript", "url({$vboptions['bburl']}/images/", "\"{$vboptions['bburl']}/search",
"\"{$vboptions['bburl']}/profile", "\"{$vboptions['bburl']}/#usercp", "\"{$vboptions['bburl']}/private",
"\"{$vboptions['bburl']}/member", "\"{$vboptions['bburl']}/subscription", "\"{$vboptions['bburl']}/online",
"\"{$vboptions['bburl']}/misc", "\"{$vboptions['bburl']}/forumdisplay", "action=\"{$vboptions['bburl']}/login",
"\"{$vboptions['bburl']}/faq", "\"{$vboptions['bburl']}/register",
"\"{$vboptions['bburl']}/{$vboptions[forumhome]}.php", "\"{$vboptions['bburl']}/#usercptools",
"\"{$vboptions['bburl']}/usercp.php", "\"{$vboptions['bburl']}/login.php", "'{$vboptions['bburl']}/misc.php",
"\"{$vboptions['bburl']}/calendar.php", "\"{$vboptions['bburl']}/images/misc", "\"{$vboptions['bburl']}/admincp.php" );
$vbheader = str_replace( $headvars, $headrepl, $vbheader );
eval('$vbfooter = "' . fetch_template('footer') . '";');
$vbfooter = process_replacement_vars($vbfooter);
$vbfooter = "</div>$vbfooter";
$footvars = array("\"$admincpdir", "\"$modcpdir", "\"archive", "\"sendmessage.php");
$footrepl = array("\"{$vboptions['bburl']}/$admincpdir","\"{$vboptions['bburl']}/$modcpdir","\"{$vboptions['bburl']}/archive", "\"{$vboptions['bburl']}/sendmessage.php");
$vbfooter = str_replace( $footvars, $footrepl, $vbfooter );
// One header with no navbar or such
$vbnoheader = <<<VBHEADER
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$styleinclude
$headinclude
{ppheader}
</head>
<body>
<div align="center">
VBHEADER;
$vbnoheader = str_replace( $headvars, $headrepl, $vbnoheader );
}
//
// VB2 CODE
//
if ( VB2_INTEGRATION == "on" ) {
chdir($vbpath);
require("global.php");
ob_start();
eval("dooutput(\"".gettemplate('headinclude')."\",0);");
$bodytag="<body>";
echo dovars($bodytag,0);
$vbheader="<head>";
$vbheader.=ob_get_contents();
$vbheader.="{ppheader}</head>";
ob_end_clean();
ob_start();
eval("dooutput(\"".gettemplate('header')."\",0);");
$vbheader.=ob_get_contents();
ob_end_clean();
ob_start();
eval("dooutput(\"".gettemplate('footer')."\",0);");
$vbfooter=ob_get_contents();
ob_end_clean();
chdir($pppath);
}
// vBPortal Integration
// If you want to include the vBPortal header, footer, and left menu, remove
// the "//" slashes from the beginning of the 16 lines of code below, and change
// "/home/public_html/vbportal" to your actual path to vbportal's main directory,
// and change "/home/public_html/photopost" to your actual path to PhotoPost's
// directory. This will override the default header and footer variables set in the
// PhotoPost admin panel.
if ( VBP2_INTEGRATION == "on" ) {
chdir($vbportal . "/");
require("mainfile.php");
$index = 0;
global $Pmenu,$Pheader;
$Pheader="P_themeheader";
$Pmenu="P_thememenu_photopost";
require("header.php");
$vbheader = ob_get_contents();
ob_end_clean();
ob_start();
require("footer.php");
$vbfooter = ob_get_contents();
ob_end_clean();
chdir($pppath . "/");
}
?>
|