vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   template driven pages (https://vborg.vbsupport.ru/showthread.php?t=63792)

Allen Mead 09-21-2004 05:21 PM

I take it no-one knows then?

Allen Mead 10-04-2004 06:58 PM

--------------------------------------------------------------------------------

Right, that's it, i still can't get it to work!!! I'll pay for someone to do this for me as long as it's not stupid money. If anyone is interested???

Allen Mead 10-13-2004 07:39 PM

Sorted!! :cool: :cool: Thanks to a guy called David Robinson from Freelancers.net

Well chuffed. You can see a test page here if you're interested http://www.astra-mk2.com/untitled.php

blue_chi 10-13-2004 09:50 PM

Allen,

I am having the same exact problem with my file. Could you please guide me on how to insert my HTML page into it?

Allen Mead 10-14-2004 01:41 AM

Yep no problem blue chi.

This is what has been done with mine:

create your html pages as normal. Then create a template with vbulletin here:

admincp/styles & Templates/Style Manager/Add New Template

call it what you want, mine is html_poloshirts. Copy all the html code into this template.

eg:

PHP Code:

<!-- saved from url=(0022)http://internet.e-mail -->
<!-- saved from url=(0022)http://internet.e-mail -->
<br><table border="0">
  <
tr>
    <
td colspan="3"><font face="Arial, Helvetica, sans-serif"><b><i><img src="Merchandise/Poloshirts/dealer_stripes.gif" width="32" height="18"><font size="5">Astra-mk2.com</font></i><font size="5">
      
Merchandise</font></b></font></td>
  </
tr>
  <
tr>
    <
td colspan="3" height="24">&nbsp;</td>
  </
tr>
  <
tr>
    <
td colspan="3" height="66">
      <
p align="left"><font face="Arial, Helvetica, sans-serif" size="3">We would
        like you to bare in mind that we are not out to make large profits on
        the goods that are forsale
. As <i>Astra-mk2.com</iis <b>not</ba company
        
and is run in Steve's and Allen's spare timeall profits get put back
        into the website to keep it running
.</font></p>
    </
td>
  </
tr>
  <
tr>
    <
td colspan="3" height="35" valign="bottom">
      <
div align="left"><font face="Arial, Helvetica, sans-serif" size="3">The
        following items are available from Astra
-mk2.com.</font></div>
    </
td>
  </
tr>
  <
tr>
    <
td colspan="3">&nbsp;</td>
  </
tr>
  <
tr>
    <
td width="54%" height="81" valign="top">
      <
div align="left"><font face="Arial, Helvetica, sans-serif" size="3">Polo
        Shirts 
Black with the website logo embroidered on the front left breast
        
(your name underneath is optional). Main website sponsor embrodered on
        the back across the shoulders
.</font></div>
    </
td>
    <
td colspan="2" height="268" rowspan="2">
      <
div align="center"><font face="Arial, Helvetica, sans-serif"></font><font face="Arial, Helvetica, sans-serif"><img src="Merchandise/Poloshirts/Polo_shirt_front.jpg" width="269" height="283"></font></div>
    </
td>
  </
tr>
  <
tr>
    <
td width="54%" height="133" valign="top">
      <
p align="left"><font face="Arial, Helvetica, sans-serif" size="3">Polo
        Shirts are available in the following sizes
:-<br>
        
LXL <b>only.<br>
        <
br>
        &
pound;TBA</b> <br>
        
P+&pound;2.00<b><br>
        </
b>Optional Name under logo on front of shirt<b> <br>
        &
pound;1.76</b></font></p>
      </
td>
  </
tr>
  <
tr>
    <
td width="54%" height="273">&nbsp;</td>
    <
td colspan="2" height="273">
      <
div align="center"><img src="Merchandise/Poloshirts/Polo_shirt_back.jpg" width="267" height="266"></div>
    </
td>
  </
tr>
  <
tr>
    <
td width="54%" height="81">&nbsp;</td>
    <
td colspan="2" height="81">
      <
div align="right"><img src="Merchandise/Poloshirts/logo_front.jpg" width="173" height="80"></div>
    </
td>
  </
tr>
  <
tr>
    <
td width="54%">&nbsp;</td>
    <
td width="3%">&nbsp;</td>
    <
td width="43%">&nbsp;</td>
  </
tr>
</
table>

<
br

Create the php file that will reference this new template you created, eg:

untitled.php

PHP Code:

<?php 

// GO TO FORUM DIR 
chdir('./forum'); 

// STANDARD VBULLETIN STUFF 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''script_name');
require_once(
'./global.php'); 

// GENERIC_SHELL VARS 
$pagetitle "Title of Page"
$HTML ""// PIECED TOGETHER IN SCRIPT 

eval('$HTML = "' fetch_template('html_poloshirts') . '";'); 

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

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

Don't forget you will need to change your forum root folder if different to mine and obviously the title page.

You can put this file wherever you want really, doesn't make any difference. Oh, don't forget to upload any images referenced in the new template created. Once done, just replicate for the various pages you want.

blue_chi 10-14-2004 11:19 PM

Thanks so much allen, I managed to get the file show my HTML content. But I was trying to use the PHP include() function, but it doesn't seem to work. Any ideas of how to fix this?

blue_chi 10-14-2004 11:38 PM

OK, I just realised that PHP is not allowed in templates, that's a whole differrent issue then. :S

Mile-O-Phile 11-25-2004 11:26 AM

Quote:

Originally Posted by Jakeman
Code:

<?php

// GO TO FORUM DIR
chdir('/full/path/to/forum/directory');

// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'script_name');
require_once('./global.php');

// GENERIC_SHELL VARS
$pagetitle = "Title of Page";
$HTML = ""; // PIECED TOGETHER IN SCRIPT

eval('$HTML = "' . fetch_template('name of template') . '";');

eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');

?>




I've stripped my version of this code to:

Code:

<?php

// GO TO FORUM DIR
chdir('./forum');

// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
//define('THIS_SCRIPT', 'script_name');
require_once('./global.php');

// GENERIC_SHELL VARS
$pagetitle = "Talk History Test";
$HTML = ""; // PIECED TOGETHER IN SCRIPT

eval('$HTML = "' . $bbuserinfo[username] . '";');
eval('print_output("' . $bbuserinfo[username]. '");');
?>

This is because I only want to get the username from the forum to display on an independent web page. However, it keeps on creating a new HTML page with the user's name. So, I'd like to be able to convert it into a function (called get_form_user() ) that I can call at any time to insert the name into text within my webpages.

Any ideas?

Mile-O-Phile 11-30-2004 02:49 PM

Quote:

Originally Posted by Mile-O-Phile
I've stripped my version of this code to:

Code:

<?php

// GO TO FORUM DIR
chdir('./forum');

// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
//define('THIS_SCRIPT', 'script_name');
require_once('./global.php');

// GENERIC_SHELL VARS
$pagetitle = "Talk History Test";
$HTML = ""; // PIECED TOGETHER IN SCRIPT

eval('$HTML = "' . $bbuserinfo[username] . '";');
eval('print_output("' . $bbuserinfo[username]. '");');
?>

This is because I only want to get the username from the forum to display on an independent web page. However, it keeps on creating a new HTML page with the user's name. So, I'd like to be able to convert it into a function (called get_form_user() ) that I can call at any time to insert the name into text within my webpages.

Any ideas?

*BUMP* :(

Andreas 11-30-2004 02:58 PM

If you just want the username you don't need to load the whole vB backend.
Just check the cookies (bbuserid, bbpassword) and query table user


All times are GMT. The time now is 08:21 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.02150 seconds
  • Memory Usage 1,812KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete