PDA

View Full Version : Please help me to edit this code!


v123shine
10-25-2012, 03:55 PM
I want to create my own vBulletin page, i using below code.

1. I create a new file, let's say test.php and add the following code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // 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(
'TEST',
);

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

);

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

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

$navbits = array();
$navbits[$parent] = 'Test Page';

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

?>


Now i Add New Template from style manager --- Template name: TEST --- and paste the following line:


$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions</title>
</head>
<body>
$header
<br>
<!-- Custom Code Start Here -->
Start the code...
<!-- / Custom Code Ends here -->
$footer
</body>
</html>


When i run the url >> http://www.site.com/test.php

I got this error : [B]Content Encoding Error

When i disable GZIP HTML Output the url work well.

How to disable GZIP HTML Output only in test.php

Please help me!

Thank you

kh99
10-25-2012, 04:09 PM
I think your problem may be that you have a space at the very beginning of test.php, before the <?php.

Max Taxable
10-25-2012, 04:12 PM
Yep that's what I see too. Use TextEdit or some other proper editor for PHP files, not just standard notepad or wordpad.

v123shine
10-25-2012, 04:49 PM
Thank you so much kh99 and Max Taxable for help me :)

problem solved