vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

Lynne 03-08-2010 08:31 PM

Quote:

Originally Posted by Joseph Witchard (Post 1999590)
I just meant that all the pages in the Admin area have a common theme with each other (the navigation menu on the left, the same colors, same style of buttons, etc.). In the same way, the main forum area has its own theme with its pages (same colors and buttons, etc.). What I was asking is what do you do to get your custom pages to go with the theme of the area they're in. If you're making a page to run in the Admin CP, how do you get it to look similar to the other pages in the Admin CP? If you're making a page for the main forum area, how do you make it where it looks like the rest of your forum pages?

In the case of the forums, using the template system with common templates is what makes the pages look the same. In the case of the admincp, it's a frame, so you don't need to do much to make it look the same.

Joseph Witchard 03-09-2010 12:10 AM

What are the common templates in your example? And do you mean that you have to build an Admin page from scratch? There are no common templates for it?

CoZmicShReddeR 03-09-2010 12:41 AM

Hello Lynne, could you please help meh figure out how to fix inframe page for this setup? I tried but the information is posting above the header...

http://www.cozworld.com/hlstatsx.php

Code:

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'HLstatsX';
echo "<iframe src =\"http://www.cozworld.com/hlxstats/hlstats.php\" frameborder=0 width=100% height=800 scrolling=yes> \n";
echo "</iframe> \n";
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

Here is the actual link http://www.cozworld.com/hlxstats/hlstats.php

Thanks...

Lynne 03-09-2010 01:44 AM

Quote:

Originally Posted by Joseph Witchard (Post 2000140)
What are the common templates in your example? And do you mean that you have to build an Admin page from scratch? There are no common templates for it?

The header, headinclude, footer, and navbar are all used in the test template I posted. You don't have to include them, but if you don't, then you won't get the look of the forums.

This article is really not about the admin cp. The admin cp doesn't use templates at all.

Quote:

Originally Posted by CoZmicShReddeR (Post 2000147)
Hello Lynne, could you please help meh figure out how to fix inframe page for this setup? I tried but the information is posting above the header...

http://www.cozworld.com/hlstatsx.php

Code:

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'HLstatsX';
echo "<iframe src =\"http://www.cozworld.com/hlxstats/hlstats.php\" frameborder=0 width=100% height=800 scrolling=yes> \n";
echo "</iframe> \n";
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

Here is the actual link http://www.cozworld.com/hlxstats/hlstats.php

Thanks...

echo just echos the info wherever the code happens to be called in the page - which is not somewhere in the middle of the template where you want it to go. If you look at my example, output is entered into a variable and the variable is placed in the template where you want the output to go.

CoZmicShReddeR 03-09-2010 07:41 AM

Wow, thanks so much I was going nutz! :)

Joseph Witchard 03-10-2010 02:05 AM

All right then. Thanks, Lynn. Appreciate it:)

Affixxx 03-11-2010 01:24 AM

Hey Lynne,
Whats wrong with using the GENERIC_SHELL?

Heres a function I made that uses it

PHP Code:

function generatePage($pagetitle$navbar$content$template='GENERIC_SHELL')
{
        
//Page Generation Function by Affix
    
$templater vB_Template::create($template);
    
$templater->register_page_templates();
    
$templater->register('navbar'$navbar);
    
$templater->register('pagetitle'$pagetitle);
    
$templater->register('HTML''<br />' $content);
    
print_output($templater->render());


That way all you really need to do is

PHP Code:

$content 'Your Content';
$pagetitle 'Test Content';
$navbits construct_navbits(array('' => 'Test Page'));
$navbar render_navbar_template($navbits);
generatePage($pagetitle$navbar$content); 

Fairly Simple and it will save space in your Database and it uses what vBulletin already provides you.

Joseph Witchard 03-11-2010 02:08 AM

Quote:

Originally Posted by Affixxx (Post 2001258)
Hey Lynne,
Whats wrong with using the GENERIC_SHELL?

Heres a function I made that uses it

PHP Code:

function generatePage($pagetitle$navbar$content$template='GENERIC_SHELL')
{
        
//Page Generation Function by Affix
    
$templater vB_Template::create($template);
    
$templater->register_page_templates();
    
$templater->register('navbar'$navbar);
    
$templater->register('pagetitle'$pagetitle);
    
$templater->register('HTML''<br />' $content);
    
print_output($templater->render());


That way all you really need to do is

PHP Code:

$content 'Your Content';
$pagetitle 'Test Content';
$navbits construct_navbits(array('' => 'Test Page'));
$navbar render_navbar_template($navbits);
generatePage($pagetitle$navbar$content); 

Fairly Simple and it will save space in your Database and it uses what vBulletin already provides you.

Speaking of functions, are you not required to preRegister them as you are with variables?

Lynne 03-11-2010 02:25 AM

The GENERIC_SHELL would be fine. Some people like to fill their template with a bunch of html and would rather type it out in the template rather than assign it all to a variable to be output. You are welcome to put up an article on how to do this using the GENERIC_SHELL - users welcome having options to pick from when they do things.

desi-boy 03-15-2010 07:14 PM

thnxxxx Excellent!

can u help me
how can i add an iframe ( it's A html Page) in this ... i mean in Test.php


All times are GMT. The time now is 09:52 AM.

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.02015 seconds
  • Memory Usage 1,776KB
  • 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_code_printable
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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