PDA

View Full Version : Custom Pages


ep13
03-07-2007, 07:57 PM
how do i add make custom pages?

yes i've searched but theres that much on search for the keywords i cant find it ..

harmor19
03-07-2007, 08:00 PM
This is the easiest https://vborg.vbsupport.ru/showthread.php?t=124749
Here's a tutorial https://vborg.vbsupport.ru/showthread.php?t=98009

cashpath
04-07-2007, 08:41 PM
Will plugins be enabled when making a page that way?

ragtek
04-07-2007, 09:10 PM
no
both things have nothing to do with the pluginsystem
just this part needs it:
Adding Custom Online Locations in https://vborg.vbsupport.ru/showthread.php?t=98009

cashpath
04-07-2007, 09:23 PM
So.. How would I call a plugin (already in place) to work on a custom page?

ragtek
04-07-2007, 09:48 PM
i think you mean something different that i understand*g*

so you have a plugin witch you want to have on your custom site too?
what plugin is it?

cashpath
04-07-2007, 10:09 PM
vbmicrostats

Logikos
04-07-2007, 11:09 PM
vbmicrostats will more then likely be inherited into your new page, as long as your page is calling the global.php file.

cashpath
04-07-2007, 11:14 PM
Well my page calls global and doesn't show microstats, but it is a stand alone php page wrapped in the header and footer of VB, I didn't use the template way of adding the page. Will that change it?

Logikos
04-07-2007, 11:28 PM
vBMircostates uses the footer template AFAIK to display the stats. So if your not calling the $footer variable in your code, then vBM won't be displayed.

cashpath
04-07-2007, 11:37 PM
I am calling the footer template...

Microstats shows up in the source code like this

<!-- {microstats} -->

Logikos
04-07-2007, 11:43 PM
If your using the vBulletin templates system, then it should show. I know vBM using code along these lines:


$output = str_replace('<!-- {microstats} -->', $microstats, $output);




Which should be replacing <!-- {microstats} --> with the stats. I would suggest asking TECK in his hack thread?

cashpath
04-07-2007, 11:47 PM
It shows up right on all pages except my custom ones...

I'm lost.. I guess I just wait for TECK

ragtek
04-08-2007, 06:41 AM
how does your templatecode look like?

cashpath
04-08-2007, 01:21 PM
I'm not using a template I'm just using a php page and including the VB stuff into it..

I'm going to test converting one of my pages to this way of doing it and see if the microstats work then.

ragtek
04-08-2007, 03:05 PM
what?
now i don't understand^^

cashpath
04-08-2007, 03:25 PM
I have a php page..

With this at the top


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

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

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

);

// ######################### REQUIRE BACK-END ############################
require_once($_SERVER["DOCUMENT_ROOT"].'/forum/global.php');

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

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


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


And this at the bottom


<?=$footer?>


I do not have custom templates for the page the page contains all the html out put in it.. all I did was wrap my php files I already had in VB code to make the forum header navbar and footer display aroudn the page.

ragtek
04-08-2007, 03:50 PM
wtf

have you a template called 'LEAGUE' ?
if not why you made this: $globaltemplates = array(
'LEAGUE',
);
and what is between head and footer?

and use the shell_blank for your output!

$html.="bla blasdasd";
for (......................)
{
$html.=$bladad.'<br />';
}
or whatever
so it will be in the template and you will have no probs with the footer

cashpath
04-08-2007, 04:02 PM
wtf

have you a template called 'LEAGUE' ?
if not why you made this: $globaltemplates = array(
'LEAGUE',
);

No I don't... I guess because I'm still learning and I was using a tutorial from here to integrate my pages to my board.

and what is between head and footer?

a LOT of php code on most of the pages.

and use the shell_blank for your output!

$html.="bla blasdasd";
for (......................)
{
$html.=$bladad.'<br />';
}
or whatever
so it will be in the template and you will have no probs with the footer

Sorry I'm lost (my fault, not yours.. I just really have no clue.. (new to this))

Logikos
04-08-2007, 05:12 PM
shell_blank is a template in vBulletin and serves as a shell for a full page template if you need to create one.

ragtek
04-08-2007, 05:25 PM
new to php too or just to vbulletin?*g*

<?

define('THIS_SCRIPT', 'imp');

$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array(
'GENERIC_SHELL',
'impressum'
);
$actiontemplates = array();
$pagetitle="Impressum";
require_once('./global.php');

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$HTML = "' . fetch_template('impressum') . '";');


eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
?>
helps this more?

so everything you want to show on your site you put into the $HTML variable

cashpath
04-08-2007, 05:57 PM
I am new to PHP too... STill have a long way to go..

I uploaded one of my scripts here...

https://vborg.vbsupport.ru/showthread.php?p=1222720&highlight=vbmicrostats#post1222720

Could you show me what I would need to do with that to make it work? (including instructions for making any templates I need to make)

I think once I go through how to do it once in detail I will be able to convert any of my scripts.

ragtek
04-09-2007, 07:14 AM
https://vborg.vbsupport.ru/forumdisplay.php?f=187 ^^

1. no more define('NO_REGISTER_GLOBALS', 1); needed said andreas
2. have no time to make your script
look at the first link
there are many tuts

cashpath
04-09-2007, 04:38 PM
Thanks for the help..

Finally got it working.