vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Integration with vBulletin - Adding new pages (https://vborg.vbsupport.ru/showthread.php?t=237309)

ultimatearco 03-01-2010 10:00 PM

Adding new pages
 
1 Attachment(s)
----------------
This was moved to articles, in my opinion INCORRECT this is original and by me!
----------------



----------------
Installed! I don't work for nothing; please press installed if you used my addon; I won't support you either if you have a problem then!
----------------

Hello all,
In this tutorial i'm going to show you how to make extra pages
Note:

Go into your Admincp, klick Styles & Templates, klick Style Manager, klick your template that your'e working with, hover your mouse to the dropdown menu and klick, klick Add Template

Give your template a name:
(like gallerytemplate)
and add this code to it:
HTML Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
 <td class="tcat">Tutorials</td>
</tr>
<tr>
 <td class="alt1">
<!-- html code here -->
PUT THE HTML CODE YOU WANT HERE
<!-- end of html code -->
</td>
</tr>
</table>
$footer
</body>
</html>

Search for:
Code:

<!-- html code here -->
and add some stuff like:
HTML Code:

<p>Hello, this is my gallery</p><br>
<img src="yourimages" border="0"></img><br>
<p>^^My favorite picture^^

You can allways do anything else ;)

Now save it, were nothing with that
Now we are going to make the PHP file
Open notepad
add this code in it
PHP Code:

<?php 
 
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE); 
 
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''privacy'); // 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( 
    
'privacytemplate'
); 
 
// pre-cache templates used by specific actions 
$actiontemplates = array( 
 
); 
 
// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php'); 
 
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
 
$navbits = array(); 
$navbits[$parent] = 'name'
 
$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
eval(
'print_output("' fetch_template('templatename') . '");'); 
 
?>

Note: Allways put this on the root directory of the forum otherwise you will have problems with the images
Find:
PHP Code:

define('THIS_SCRIPT''scriptname'); // change this depending on your filename 

Change privacy (keep the ' ') to the name of your file (without .php after it)

Find:
PHP Code:

$navbits[$parent] = 'name'

Change name (keep the ' ') to whatever you want

Find:
PHP Code:

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

Change templatename (keep the ' ') to the template you just made

Save it to whatever you want (Make sure its the same name as in edit 1 (scriptname) and with .php after it)

Upload it to your webserver and your'e done!

If you want it to appear it into your navbar i suggest to:
Use my Navbar Edit mod (for all vB versions) (Manual code changes)
Or to download the double navigation bar mod

ultimatearco 03-02-2010 06:14 PM

V1.0.1 BETA - Pre-release, being tested
V1.5.0 BETA - Bugfixes; PHP should work now!
V1.5.1 BETA - Added functionality for lower versions (3.6.x and higher!)
V2.0.0 BETA - Minor BugFixes; almost out of beta now! Current release

ultimatearco 03-02-2010 06:15 PM

Pm me for any support; I will TRY to help you!

Make sure you READ CORRECTLY, I will not help you if you didn't follow the guide correctly..

If you're getting xhtml errors or PHP errors; check your code.. Please! I will not fix a broken html/php tag for you..

ultimatearco 03-03-2010 02:02 PM

!!Latest update!!

Yeah! Now our script supports PHP, for flexibility, and so on!

Please report bugs..

rootshell-vb 03-14-2010 04:02 PM

Works like a charm :)

KelliH 04-27-2010 01:21 PM

Sweet, thank you for this!

Jaber190 05-07-2010 12:35 PM

thanks man .

ultimatearco 05-29-2010 09:01 AM

No problem guys.. New release

Mr Gixxer 05-29-2010 12:45 PM

Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: navbar in [path]/includes/functions.php on line 3957

Frank Sinatra 05-29-2010 07:31 PM

Thanks a lot, I would consider this very useful, but i remember some members say that including php in a template could be a little unsecure. Is that correct?


All times are GMT. The time now is 07:10 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.01110 seconds
  • Memory Usage 1,757KB
  • 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
  • (2)bbcode_html_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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