PDA

View Full Version : Question about - [How-To] vBulletin API Basics: Creating Custom Pages & Misc.


Gamelobby
05-08-2009, 12:12 AM
From - https://vborg.vbsupport.ru/showthread.php?t=98009

<?php

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

// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.

define('THIS_SCRIPT', 'test');

// #################### 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(
// change the lines below to the list of actual templates used in the script
'test_mytesttemplate1',
'test_mytesttemplate22',
);

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

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

// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $headinclude);

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

$navbits = array();
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'Test Page';

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

// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' . fetch_template('test_mytesttemplate1') . '");');

?>

Why do these things have to be so confusing..!!??

The first thing it says to do is: Read through the code above and change what's commented with "// change this...".

So look at the very first one..
Now this is THE FIRST thing it tells you to do.. // change the line below to the actual filename without ".php" extention.
So where is the "something.php" that they want you to change that is in the line below..??



Maybe im missing something here, but IF NOT why bother with any of these "helpful threads" if you need a coder to do it for you anyway..!!?? :erm: :mad:


.

notrious
05-08-2009, 12:15 AM
Easy stuff try this ..


https://vborg.vbsupport.ru/showthread.php?t=62164

RLShare
05-08-2009, 12:29 AM
You see all that code you just pasted up? That is called PHP code, you are supposed to save it in a text file with whatever name you want but with a .php extension.. .So "somefile.php" would be an example of the name you COULD give the file YOU are creating with THAT CODE. So you would replace the 'test' part in that line with 'somefile' if the name of the file YOU created is 'somefile.php'.

And there is no need to be obnoxious in your post.

Gamelobby
05-10-2009, 02:11 AM
Easy stuff try this ..

https://vborg.vbsupport.ru/showthread.php?t=62164
Thats exactly what im talking about & the exact same thread i linked to about this....?
But i guess thanks for trying. (without reading my post)



You see all that code you just pasted up? That is called PHP code, you are supposed to save it in a text file with whatever name you want but with a .php extension.. .So "somefile.php" would be an example of the name you COULD give the file YOU are creating with THAT CODE. So you would replace the 'test' part in that line with 'somefile' if the name of the file YOU created is 'somefile.php'.

And there is no need to be obnoxious in your post.

Yea i know, i have made a few other .php pages, but the VERY first thing this asks is what was confusing. im actually not going to retype my first post, but if you read what i wrote you'll see the confusion in it.

Honestly i appreciate the attempt to help, but i was very irritated when i first posted this, i still stand behind what i worte.. it is confusing. but i was being obnoxious becasue it is written in a confusing way. and when you are new to this it just makes things worse.

My whole reason for posting is not because im confused about how to make that code work. (i have used it before) I am trying to figure out how to make it work for something different. Which i have posted already elsewhere.

Thanks (you can close this, im not mad anymore. :D)