vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Some basics of vB3(mini howto) (https://vborg.vbsupport.ru/showthread.php?t=59939)

rrottman 01-11-2004 08:00 PM

@Faranth:
Additionally, you say that

$globaltemplates = array('main');

is for caching templates? How does this work? To me it appears as if you just declare a local array? The fetch_template function in functions.php does not reference any var named $globaltemplates. Could you possibly explain why you init this array in the page?

And I'm still not getting the template :-(

THANKS FOR BEING PATIENT WITH ME! :-)

rrottman 01-11-2004 08:03 PM

Some more troubleshooting steps it now appears as if the fetch_template does not return any content. It's empty... hmm... HELP!

Zachery 01-11-2004 08:14 PM

Quote:

Originally Posted by rrottman
Some more troubleshooting steps it now appears as if the fetch_template does not return any content. It's empty... hmm... HELP!

sorry ive been working on stuff, you can wait more than 3 min for a nother post too ;D

yes $globaltemplates cach's the template

do you HAVE a template called main in the database?

rrottman 01-11-2004 08:22 PM

Faranth, my capitalized "help" was in no way ment to offend you in any way. It's just I was in such a despair...

Do I have a template called "main"... honestly, I don't know. Maybe. Is there any standard template, comming with the clean default vB3 RC2 install I could test instead?

And: I understood that you were saying that the $globaltemplates array is done to cache templates but I don't know how it does so. Is there a GLOBAL variable named $globaltemplates in the vB system? I mean, if I put this statement at the top of my script, all it does is create an array with a single string value but how does this "instruct" vb to cache a template?

Zachery 01-11-2004 08:25 PM

lol thats most lily your problem you dont have another tempalte atm lol ^^


make a new template called main and add anything you like to it :)

rrottman 01-11-2004 08:29 PM

And one more question, Faranth (sorry, knowing that you're online is just too attractive.. :-) ):

Why do I have to use eval(...). Couldn't I just do a

$output = fetch_template(...);
echo $output;

?

Zachery 01-11-2004 08:31 PM

why two lines?

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

one simple line, plus this is how its done for all files in vb

rrottman 01-11-2004 08:34 PM

Hmm. I see. I might not have asked my question the right way. (I'm not a native English speaker. Sorry again.)

I was wondering why to use the eval() at all?
Why not:

echo fetch_template("FORUMHOME");

but instead:

eval('echo "'.fetch_template(...).'");');

So my main question was: Why do we use eval here? Is it, because templates might contain php code, too? or vars?

(Btw.: You were right with the "main" template. If I replace it with e.g. FORUMHOME, it works great.)

I still do not understand how the declaration of the local variable $globaltemplates helps caching...

Zachery 01-11-2004 08:35 PM

ah yes, actually , if conditions are inlaid php :) all of the tempaltes are stored in php format to boot

VodkaFish 01-12-2004 08:35 PM

If I slap your (longer) example into a blank .php page and use the shell_blank as my template (unchanged); I get an "object expected" error when the page tries to run this script:
Code:

<script type="text/javascript">
<!--
        // Main vBulletin Javascript Initialization
        vBulletin_init();
//-->
</script>

* The page I wrote was in a different directory, so I used this:
PHP Code:

chdir("../forums"); 



All times are GMT. The time now is 11:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01194 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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