PDA

View Full Version : THIS_SCRIPT must be defined in php file (by default all important vBulletin files has


Xencored
04-18-2010, 09:58 PM
1. THIS_SCRIPT must be defined in php file (by default all important vBulletin files has this)
2. Hack options - You must add THIS_SCRIPT value for target page to "Show ChatBox on" setting field
3. Main template called on target page must contain "$cybchatbox" variable

Anyone knows how i can do this
i cant find anything on the vbulletin files

mikey1991
04-18-2010, 11:52 PM
define('THIS_SCRIPT', 'myawesomescriptname');

Xencored
04-19-2010, 09:51 AM
define('THIS_SCRIPT', 'myawesomescriptname');

Thanks alot mate where would add this in the main index.php?
Mike

Lynne
04-19-2010, 01:50 PM
You'd add it sometime after the <?php line.

Xencored
04-19-2010, 03:37 PM
Thanks you two <3

Edit having problems
cant get it to show

define('THIS_SCRIPT', 'cybchatbox');
this code look ok?

Lynne
04-19-2010, 07:39 PM
You'll need to ask that question in the modification thread. I have no idea what the code is so I can't say why it isn't working.

mikey1991
04-20-2010, 10:42 AM
Cyb Chatbox has no file uploads, just a product, so I'm guessing you're trying to make a separate page which is showing cyb chatbox on there?

https://vborg.vbsupport.ru/showthread.php?t=201283&highlight=chatbox

To have ChatBox enabled on desired page:
1. THIS_SCRIPT must be defined in php file (by default all important vBulletin files has this)
2. Hack options - You must add THIS_SCRIPT value for target page to "Show ChatBox on" setting field
3. Main template called on target page must contain "$cybchatbox" variable

I see what you are trying do do...

Right then, using the instructions laid out here; https://vborg.vbsupport.ru/showthread.php?t=62164 - make your new vBulletin page, with the THIS_SCRIPT defined, so your PHP file would probably look liek this <?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'cybchatbox'); // change this depending on your filename

// ################### 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(
'cybchatbox',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

$navbits = array();
$navbits[$parent] = 'Chatbox';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('cybchatbox') . '");');

?>

then make your template, name it "cybchatbox" and put the contents like this

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

$cybchatbox

$footer
</body>
</html>

and you should have a chatbox page on chatbox.php or whatever you named that script