The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Some basics of vB3(mini howto)
Some basics of vB3(mini howto) also some basic php junk the most important thing if you want to make pages based on templates or anything of the such would be to first know how to " connect" to vbulletin, and then learn how to call and eval templates. so lets take a look at the most BASIC page we can do PHP Code:
somthing abit more advanced. suchas calling more than one template, or doing an action it becomes abit more complicated PHP Code:
PHP Code:
if your going to write a script that is ALL actions you should add somthing like this right after the call to gobal.php PHP Code:
Mini Tut by Faranth (with some help from Brad.loo fixing my silly newbie mistakes ) |
#22
|
|||
|
|||
@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! :-) |
#23
|
|||
|
|||
Some more troubleshooting steps it now appears as if the fetch_template does not return any content. It's empty... hmm... HELP!
|
#24
|
||||
|
||||
Quote:
yes $globaltemplates cach's the template do you HAVE a template called main in the database? |
#25
|
|||
|
|||
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? |
#26
|
||||
|
||||
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 |
#27
|
|||
|
|||
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; ? |
#28
|
||||
|
||||
why two lines?
eval('print_output("' . fetch_template('main') . '");'); one simple line, plus this is how its done for all files in vb |
#29
|
|||
|
|||
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... |
#30
|
||||
|
||||
ah yes, actually , if conditions are inlaid php all of the tempaltes are stored in php format to boot
|
#31
|
|||
|
|||
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> PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|