View Full Version : Add pages
Goomzee
04-07-2008, 04:13 AM
i add php page it;s not working plz help me what i am doing wrong
here is a Link
http://www.mknexusonline.com/content/mkgames/test.php
i also post there (https://vborg.vbsupport.ru/showthread.php?p=1484380#post1484380)but nobody replay
Dismounted
04-07-2008, 05:09 AM
What code are you using?
Bradley_Wint
04-07-2008, 05:57 AM
try this one instead.
https://vborg.vbsupport.ru/showthread.php?t=62164&highlight=new+page
Lynne
04-07-2008, 03:17 PM
In order for us to help, you need to post your code. Post the php code and the template.
Goomzee
04-07-2008, 05:27 PM
i used same that code copy paste
https://vborg.vbsupport.ru/showthread.php?t=62164&highlight=new+page
this below code for my test.php
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### 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') . '");');
?>
and this is my Template code
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Title</td>
</tr>
<tr>
<td class="alt1">Text</td>
</tr>
</table>
$footer
</body>
</html>
Lynne
04-07-2008, 07:12 PM
Is this page located in the same directory as all your other vbulletin files? And are the permissions set correctly (644 I think)? And is the template named "TEST" (all caps)?
Goomzee
04-08-2008, 04:16 AM
Is this page located in the same directory as all your other vbulletin files? And are the permissions set correctly (644 I think)? And is the template named "TEST" (all caps)?
well my forums address is
www.mknexusonline.com/forums/ and where as i want add this page here
http://www.mknexusonline.com/content/mkgames/test.php and i did not add forums/ vb files on this path http://www.mknexusonline.com/content/mkgames/test.php and yes and Template name is TEST in all caps
Lynne
04-08-2008, 02:21 PM
Well, you can't call global.php in your page that way since you are in a different directory now. So, you need to change directories, and then call global.php. Add something like this before your global call:
chdir('/full/path/to/your/site/forums');
Goomzee
04-08-2008, 05:08 PM
Well, you can't call global.php in your page that way since you are in a different directory now. So, you need to change directories, and then call global.php. Add something like this before your global call:
chdir('/full/path/to/your/site/forums');
can u plz tell me which directory should i copy or need to change directories can you plz tell me in brief or step by step i really appricate to you
Lynne
04-08-2008, 07:01 PM
I just told you want to do. You need to put that line before the call to your global.php page and put in the path to where to find that file. I don't know what the full path to your site is, so I can't tell you anymore than that.
Bradley_Wint
04-08-2008, 11:54 PM
I have attached a file called path.php...upload it to your forum directory...go to the your forum url now and /path.php...(e.g. www.site.com/forum/path.php ) ...now this file will list the server path to that directory...
e.g.
/full/path/to/your/site/forum
now copy that path to the section where you are gonna call the global.php file.
Goomzee
04-09-2008, 03:54 AM
thankx i find my path but now when i edit forums/global.php file then where i add my site path i mean to say which line or i just add path any where in global.php
Dismounted
04-09-2008, 05:43 AM
YOU DON'T EDIT GLOBAL.PHP.
Edit your custom PHP file, placing the change directory code above the call to global.php.
Goomzee
04-09-2008, 08:25 AM
OMG it's very hard it;s really not working after i change TEST.php
this is my old TESt.php coding
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### 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') . '");');
?>
after add Path
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### 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('./home/mkne/public_html/content/mkgames/ ');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$navbits = array();
$navbits[$parent] = 'Test Page';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
?>
Dismounted
04-09-2008, 08:58 AM
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### 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 ############################
chdir('/home/mkne/public_html/content/mkgames');
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') . '");');
?>
Also, please use the PHP BB Code tags, it is much better on the eyes.
Goomzee
04-10-2008, 03:54 AM
thankx it's work but now it;s show error too
http://www.mknexusonline.com/content/mkgames/test.php
Bradley_Wint
04-10-2008, 04:44 AM
Edit - Ok see your links are a bit messed up now...
Goomzee
04-10-2008, 05:20 AM
what i edit TEst.php or something else
Dismounted
04-10-2008, 05:36 AM
I don't see anything wrong with the page...
Bradley_Wint
04-10-2008, 05:47 AM
I don't see anything wrong with the page...Same thing I though but click on the links (e.g. hierarchy, bottom, etc) ...you will see all of them have taken on the /content/mkgames address ....but the forum is really 2 levels above in another folder called "forums"
Dismounted
04-10-2008, 05:59 AM
In headinclude:
<base href="http://www.mknexusonline.com/forums" />
Goomzee
04-10-2008, 08:21 AM
i added my that Code in my headinclude but Navbar is not working and 2nd error is still show me in attachment and most important thing after this line
<base href="http://www.mknexusonline.com/forums" />
my forums links Path are change so remove this line from headinclude
[QUOTE]<base href="http://www.mknexusonline.com/forums" />
<meta http-equiv="Content-Type" content="text/html; charset=$stylevar[charset]" />
<meta name="generator" content="vBulletin $vboptions[templateversion]" />
<if condition="$show['threadinfo']">
<meta name="keywords" content="$threadinfo[title], $vboptions[keywords]" />
<meta name="description" content="<if condition="$pagenumber>1"><phrase 1="$pagenumber">$vbphrase[page_x]</phrase>-</if>$threadinfo[title] $foruminfo[title_clean]" />
<else />
<if condition="$show['foruminfo']">
<meta name="keywords" content="$foruminfo[title_clean], $vboptions[keywords]" />
<meta name="description" content="<if condition="$pagenumber>1"><phrase 1="$pagenumber">$vbphrase[page_x]</phrase>-</if>$foruminfo[description_clean]" />
<else />
<meta name="keywords" content="$vboptions[keywords]" />
<meta name="description" content="$vboptions[description]" />
</if>
</if>
<!-- CSS Stylesheet -->
$style[css]
<if condition="is_browser('opera') AND !is_browser('opera', '8.0.1')">
<style type="text/css">
ul, ol { padding-left:20px; }
</style>
</if>
<!-- / CSS Stylesheet -->
<script type="text/javascript">
<!--
var SESSIONURL = "$session[sessionurl_js]";
var IMGDIR_MISC = "$stylevar[imgdir_misc]";
var vb_disable_ajax = parseInt("$vboptions[disable_ajax]", 10);
// -->
</script>
<script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script>
<if condition="$show['popups']"><script type="text/javascript" src="clientscript/vbulletin_menu.js?v=$vboptions[simpleversion]"></script></if>
<if condition="$vboptions['externalrss']">
<link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] RSS Feed" href="external.php?type=RSS2" />
<if condition="$show['foruminfo'] OR $show['threadinfo']">
<link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] - $foruminfo[title_clean] - RSS Feed" href="external.php?type=RSS2&forumids=$foruminfo[forumid]" />
</if>
</if>
Dismounted
04-10-2008, 10:56 AM
my forums links Path are change so remove this line from headinclude
Didn't you want them changed to the correct paths?
Goomzee
04-10-2008, 05:28 PM
Didn't you want them changed to the correct paths?
which path i change again i don;t understand what are you saying
Goomzee
04-12-2008, 07:10 AM
Please help this which path your talking about
maxpain
04-25-2008, 04:13 AM
The file named "cron.php" needs to have the correct path as well
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.