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 05-15-2010 06:30 PM

Quote:

Originally Posted by Davidinh (Post 2037441)
how to create multiple template under $_REQUEST[do] Lynne

i tried to get more template (on test.php)
but i don't understand how to make a second template for it

any help !

You just render a different template per do usually:
PHP Code:

if ($_REQUEST['do'] == 'this'){
$templater vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);
print_output($templater->render());
}

if (
$_REQUEST['do'] == 'that'){
$templater vB_Template::create('TEST2');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);
print_output($templater->render());



Davidinh 05-15-2010 08:32 PM

thank you Lynne
in the template "TEST2" it has carry on the head and footer like the template TEST
is it correct ?

Lynne 05-15-2010 09:00 PM

TEST2 would look like whatever you make it to look like. You could even just use the exact same template, TEST, if you have the same variable names and such. I'm just giving an example in my post.

Davidinh 05-15-2010 09:26 PM

i got a second template as you sample. Lynne thanks
but i can put out the info from database (it's blank) it's so complicated to me

Code:

// initialize db content
$view = $db->query_read(
        "SELECT d.*, c.*
        FROM " . TABLE_PREFIX . "doc AS d
        LEFT JOIN " . TABLE_PREFIX . "doc_cat AS c ON (d.id = c.catid)
        WHERE c.catid = '$docid'
");
    while ($viewer = $db->fetch_array($view))
    {
        $title = $viewer['docname'];
        $content = $viewer['document'];
        $describe = $viewer['docdes'];
        $press = vbdate($vbulletin->options['dateformat'], $viewer['postdate']);
// register templates
    $templater = vB_Template::create('TEST_2');
    $templater->register_page_templates();
    $templater->register('docid', $docid);
    $templater->register('viewer', $viewer);
    $templater->register('title', $title);
    $templater->register('content', $content);
    $templater->register('describe', $describe);
    $templater->register('press', $press);
$my_doc_view .= $templater->render();
    }
   
$db->free_result($view);
// start the navbar
$navbits = array();
$navbits['test.php?' . $vbulletin->session->vars['sessionurl_q'] . ""] = "Create Own Page";
$navbits[''] = "Test Viewer";

$templater = vB_Template::create('TEST2');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('my_doc_view', $my_doc_view);
    $templater->register('viewer', $viewer);
    $templater->register('title', $title);
    $templater->register('content', $content);
    $templater->register('describe', $describe);
    $templater->register('press', $press);
    $templater->register('my_cat', $my_cat);
print_output($templater->render());
{

in the template TEST2 (like i do for categories is work fine in the front page)
i insert these line
{vb:raw my_doc_view} (the other template i call TEST_2)
and in the template TEST_2 i tried to point some info that i already register :
{vb:raw title}
{vb:raw content}

then i got a blank view

any idea Lynne

Lynne 05-15-2010 10:44 PM

Quote:

Originally Posted by Davidinh (Post 2037593)
then i got a blank view

any idea Lynne

If you need help getting the queries working and such, then you really need to post in the main forums. I can't go through everyone's code that posts in this thread.

And if you are getting a blank page, it could be that you didn't put the template into the style you are using to view your page.

Davidinh 05-16-2010 10:14 AM

oh okay Lynne, thanks for your time

but the problem it not on the second template page It shows out fine without the info that i try to put out from database
however, sorry about mess up the posting here Lynne

Sincerely,

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

well, finally, i got them all Lynne
thank you for you time

I took the sample from file profile.php of vbb4 and study the way they used the template "USERCP_SHELL" and apply your tutorial

and now my test page it word great
some kind of variable as
Code:

// set shell template name
$shelltemplatename = 'USERCP_SHELL';

then it drops down the # of register template
Just call variable by {vb:raw whatever}

hope this help somebody who likes me :))
Sincerely,

kardus 05-18-2010 03:49 AM

I did this and it works perfectly. Unfortunately it won't work with PHP files that I am trying to include in my custom page. I made a thread about it here: https://vborg.vbsupport.ru/showthread.php?p=2038959

Can Lynne (or anyone?) help me get this working?

Lynne 05-18-2010 02:21 PM

It looks like Cellarius helped you out and you are now up and running. :)

FCS-Webmaster 05-27-2010 08:23 PM

can anyone help me with this one - so I'll be able to convert all my old codes to the new vbulletin system? heres the thread I made with a describtion of my problem

thezman 06-01-2010 10:12 PM

I have a simple question. I want a customer page that displays a table I created in Dreamweaver. Where do I place the html to have it display on my customer page?


All times are GMT. The time now is 10:54 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.02105 seconds
  • Memory Usage 1,754KB
  • 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
  • (1)bbcode_php_printable
  • (2)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