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)

Adem GEN? 11-28-2009 04:13 PM

This does not exist
PHP Code:

$templater->register('pagetitle''Test Page'); 


I want to show here is a variable
Example:
PHP Code:

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'My Page Title';

$adem 'Hello World'

HTML - template test
HTML Code:

    <h2 class="blockhead">Title</h2>
    <div class="blockbody">
      <div class="blockrow">



        Text


{vb:raw adem}



      </div>
    </div>

Does not appear on the page

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

First message changed?

I have to add the following for $adem variable is?

$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('adem', $adem);
print_output($templater->render());

Lynne 11-28-2009 05:16 PM

Quote:

Originally Posted by AdemGEN? (Post 1922108)
I have to add the following for $adem variable is?

$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('adem', $adem);
print_output($templater->render());

Yes, you must register any variable you plan to use in your template.

Adem GEN? 11-28-2009 06:13 PM

Thank you very
Now okay

BBR-APBT 11-28-2009 11:26 PM

How to show Whats going on Box on this new page?

Lynne 11-29-2009 02:06 AM

Quote:

Originally Posted by BBR-APBT (Post 1922252)
How to show Whats going on Box on this new page?

I don't know, that article hasn't been updated. I would think the instructions are pretty much the same though.

willy888 12-03-2009 01:36 PM

Thanks I use this article its very helphull for me
Can we add a widjet with a collum in the new page ?

Dave-ahfb 12-10-2009 01:57 PM

Ok I have tried every which way from sunday to understand how to be able to use this with a certain group of my scripts with no luck. Keep in mind any responses may have to be "dumbed down" ;)

Here is an example of how these scripts are set up.

page is originally called as such
PHP Code:

testpage.php?sub=gen_form 

testpage.php would contain code
PHP Code:

<?php
include_once('/path/to/test.class.php');
$gen_test = new test_gen;
?>

as well as

PHP Code:

<?php 

if($_GET['sub'] == 'gen_form')
{    
    
$gen_test->gen_test_form(); 
}
if(
$_POST['sub'] == 'Generate Test')
{
    
$gen_test->gen_test();
}
if(
$_POST['sub'] == 'Preview Test')
{
    
$gen_test->preview_test();
}

?>

Of course all of the true scripting is located at /path/to/test.class.php

can anybody be of help? I am hoping with an example I can finish the rest of my scripts which are similar and maybe get a better understranding so that I may do my other scripts which are different.

muratmunich 12-15-2009 09:46 AM

And what if i have more than 10 Variables in a Template?
Do i have to register each variable ?

PHP Code:

$templater->register('your_variable'$your_variable);
$templater->register('your_variable2'$your_variable2);
$templater->register('your_variable3'$your_variable3);
.
.
$templater->register('your_variable10'$your_variable10); 

Does this way loose Performance (Many Class calls) ?
Or is there a Array ?

In my opinion the old way was more easier than this !

ragtek 12-15-2009 10:03 AM

You could put all youre variables into an array. Then you have only to register the arrayvariable.

Lynne 12-15-2009 03:27 PM

Quote:

Originally Posted by ragtek (Post 1931039)
You could put all youre variables into an array. Then you have only to register the arrayvariable.

Yep, that is what I did to a few of my mods. I had $variable1 and $variable2 and $variable3, etc. and just through them all into an array - $myarray['variable1'] and $myarray['variable2'] and $myarray['variable3'], etc. Then I just registered $myarray.


All times are GMT. The time now is 10:57 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.02094 seconds
  • Memory Usage 1,753KB
  • 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_html_printable
  • (6)bbcode_php_printable
  • (3)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