vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   use php without making a plugin (https://vborg.vbsupport.ru/showthread.php?t=197160)

CampinCarl 11-24-2008 10:48 PM

use php without making a plugin
 
I need to be able to use php without having to make a plugin. Using a plugin is impractical and annoying and im trying to code a homepage for my site using a method someone posted before so i can use he header and stuff.

Heres my site
Where it says PHP TESTING i tryed a simple echo "php testing"; but it wouldnt work >:(
thx for help
http://hldevs.com/

Lynne 11-24-2008 10:58 PM

No need to use plugins when it is a totally custom page (as is your case). Perhaps post the code for your page here and we can see what is wrong.

If you look at the page source, you'll see this:
HTML Code:

<td class='alt1'><?php echo "plop"; ?></td>
So, we can see you tried to do something, but if you put that in a template, that is exactly what will happen since you can't put php in a template. You must put php in the php page.

CampinCarl 11-24-2008 11:28 PM

heres the code im using
PHP 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(
    
'hldevs',
);

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

);

// ######################### REQUIRE BACK-END ############################
define('VB_AREA''Forum');
define('CWD''C:/inetpub/vhosts/hldevs.com/httpdocs/forums');
require_once(
CWD '/global.php');
require_once(
CWD '/includes/init.php');

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

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

$navbits construct_navbits($navbits);
eval(
'print_output("' fetch_template('test') . '");');

?>

and the header and stuff is in the test template so i couldnt figure out how to put the php in there

SEOvB 11-24-2008 11:35 PM

Your making a vBulletin powered page driven by a template so you want be able to put php inside your test template. You need to use a different page format.

CampinCarl 11-24-2008 11:44 PM

could you show me how to do that? :)

Lynne 11-25-2008 03:03 AM

You need to have something like this in your php page (what you posted above) after the start of the main script and before the navbits stuff. :
PHP Code:

$testing 'plop'


And then in your template, you would go:
HTML Code:

<td class='alt1'>$testing</td>

CampinCarl 11-25-2008 10:02 PM

oh ok
thanks for your help 8)


All times are GMT. The time now is 05:09 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.01010 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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