vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Convert my old PHP pages to vBulletin pages (https://vborg.vbsupport.ru/showthread.php?t=168696)

top end ms 01-25-2008 03:47 AM

Convert my old PHP pages to vBulletin pages
 
I have a php website that uses a lot of MYSQL queries and data manipulation and display. I have no problem coding php in standard php pages, but I can not figure out how to wrap my php pages in the vBulletin style template (user menu, login info, ect ..). I have the 'create custom template' hack working (very basic) .. but I cant figure out the php side of things. I would preffer just coding the pages in a .php file instead of a template with plug-ins.

Please help. Thanks!

Dismounted 01-25-2008 03:58 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>

top end ms 01-25-2008 04:02 AM

Thats the 'hack' I was talking about already having setup. But I cant get php code into it.

--------------- Added [DATE]1201241525[/DATE] at [TIME]1201241525[/TIME] ---------------

I figured it out :)

Code:

<?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') . '";');

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

echo $navbar;

echo 'I AM THE MAN!!!!!!';

echo $footer; ?>
</body>
</html>

One more question tho. How would I get '<if condition="$show['member']">' to read properly from the php page? Should I convert it to a php IF statement .. if ($show['member'] != false) ....

--------------- Added [DATE]1201242875[/DATE] at [TIME]1201242875[/TIME] ---------------

Ok .. actually its not quite 100%. The page title doesnt work :(. Need help executing the variables from the page correctly ..


All times are GMT. The time now is 10:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00976 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete