![]() |
|
Article Options |
#46
|
||||||||||||
|
||||||||||||
![]()
Thank you cellarius for this!
I've even printed this out and read this even while sitting on the throne quite a few times. I got some of the options working for a custom about us page. The option to - Output template directly - custom pages works just great for VB4. The option to - Save into a variable for later use in custom template works only after noticing an error in this code. In VB4 This resulted in a blank white page.
I used this to fix it...
Then sure enough it worked! Then option to - Save into an array and preregister to use in an existing/stock template. Unfortunately I was unable to get this working. I could not locate the template hook "forumhome_wgo_pos2" in VB4. As for Caching Templates, I didn't see any templates in red on because it this doesn't work on server that is ran locally. I've managed to get this working on an actual server. EDIT: I does work locally in my testing environment, I added...
to the wrong config.php file. ![]() Thanks for this write up, It helped me quite a bit in understanding more and more about VB. No members have liked this post.
Last edited by nubian; 21 Dec 2009 at 05:44. |
#47
|
||||
|
||||
Originally Posted by nubian
Too much information ![]()
![]()
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again. http://www.roma-antiqua.de No members have liked this post.
|
#48
|
||||
|
||||
It was a lot better than reading video game manuals.
![]()
Originally Posted by cellarius
Yes, I'm aware of changing the variables to anything I want.![]()
At first I was using your example to familiarize myself on how things work.
The code above gave me a blank page because the var $mytemplate_rendered = $templater->render(); did not match second argument in the register function. $templater->register('my_template_rendered', $my_template_rendered); So I changed this: $templater->register('my_template_rendered', $my_template_rendered); to: $templater->register('my_template_rendered', $mytemplate_rendered); And everything worked fine.
Originally Posted by cellarius
Pardon my ignorance since I'm still in developing stages of learning the functionality of how vb operates.![]()
My guess is that I'm not fully understanding this particular option. I've tried this on a clean install and was unable to locate this hook or maybe I'm just looking in the wrong place for it. Additional guidance will very much be appreciated if you don't mind? As for your last statement, I didn't not combine all of these options into one. I created separate custom pages for each option just to see the results of each option listed. The only one I had difficult understanding was the template hook option. No members have liked this post.
|
#49
|
||||
|
||||
Alright. I can get it to display just straight templates, that used to use just eval('print_output')...........
How would I go about displaying this:
__________________
MySpace | Consultant | Web and Software Developer | Microsoft Certified Professional "Wielding power untouched by mortal man."
No members have liked this post.
|
#50
|
||||||||
|
||||||||
Originally Posted by CypherSTL
![]()
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#51
|
||||||||
|
||||||||
I still cannot figure out how in the heck to work this new template system.
Works flawlessly. No errors. However
Displays absolutely NOTHING.
__________________
MySpace | Consultant | Web and Software Developer | Microsoft Certified Professional "Wielding power untouched by mortal man."
No members have liked this post.
|
#52
|
|||
|
|||
Thanks for this guide, at the beginning I was totally confused about this new system.
On the other hand, is there a system to preregister a var in all templates with a single call? No members have liked this post.
|
#53
|
|||
|
|||
Thanks for the guide
![]() No members have liked this post.
Last edited by IR15H; 02 Jan 2010 at 22:38. Reason: Query moved to it's own thread. |
#54
|
||||
|
||||
![]()
@ cellarius
Absolutly a great introduction how things now working on VB4. It answere`s many questions to me now. I just wanne thank you cellarius for this. btw. many thanks to Lynne who also allways help out. i`m absolutly new to stuff like "vb" or "php" but with your "helping hand`s" alot of work is possible to do for me too. Sorry about my englisch, its not "my one" ![]() Thanks again an enjoy the hollydays ...... if there some ........
__________________
rbc No members have liked this post.
|
#55
|
||||
|
||||
I have question:
How to change content of existing template inside of plugin? I'm remaking my mod for vB4. I'm adding there flags to header of footer. In vB3 version I simply change insides of template using templatecache. I.e.:
I was using it in global_start hook, but it doesn't work anymore - $vbulletin->templatecache['footer'] is empty and have no impact on footer. How to change this line of code to make it working in vB4? EDIT: Ok - I already found it here ![]() --------------- Added 06 Jan 2010 at 02:49 --------------- Other question: In vB3 my mod have possibility to put additional data in custom place - so user just manually adds variable into required template and he has flags where he put it. How to do this in vB4 where variables have to be preregistered????... --------------- Added 06 Jan 2010 at 02:55 ---------------
Originally Posted by testebr
This will work only for few templates. The question is how to make it work for any template like with $vbulletin->templatecache solution in vB3.![]()
Also this solution is working on already parsed template - I need fresh one, not parsed yet. Anyone have idea how to do that? EDIT Ok I have it ![]()
__________________
vBulletin Enterprise Translator (vBET) - your forum in 53 languages - get more traffic, users and incomes from AdSense! No members have liked this post.
Last edited by NLP-er; 06 Jan 2010 at 03:55. Reason: Auto-Merged DoublePost |
#56
|
||||||||
|
||||||||
Awesome guide. It has helped me move forward a bit, but I still don't have it all down yet. If anyone has this down pat, I'd be interested in some more tutorials that show old 3.x code and then below shows the 4.x code. This way I can test myself and see how well I have it down.
In the meantime though, is the new rendering needed for redirects? For example:
I tried the following:
That didn't work though, it seems to be cutting off everything after misc.php. Maybe I need to register the $fid? No members have liked this post.
|
#57
|
||||
|
||||
No, standard redirects and errors still work the old way. If you want to know something like that, just look one up in the original vB4 php files.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again. http://www.roma-antiqua.de No members have liked this post.
|
#58
|
||||
|
||||
I have a template that I need to insert into multiple pre-existing templates (I add some additional graphics/formatting to the header and footer of most tables ... and my CSS skills aren't good enough to achieve what I'm trying to do through CSS alone, so I need to add old HTML table coding). I do it this way so that if I want to make changes, I don't have to change lots of different templates. After a bit of struggling, I have managed to get the following code running.
I have two questions. Is there any way to preRegister for more than one pre-existing template (or a global registration), or do I have to create Plugins for every page I want to add this to (*groan*)? And what is the best hook to have this on. I am currently using 'parse_templates'. The other unusual thing I'm finding happening is if I include my template in postbit_legacy, it will show on the first post, but not on the posts after that. Thanks in advance...
__________________
~* Sephiroth / Final Fantasy / Oddworld / Cloverfield Fan *~
[Advent Children.net] [Dirge of Cerberus.net] [Compilation Network] [Oddworld-Web] [Oddworld Forums] No members have liked this post.
|
#59
|
||||||||||||
|
||||||||||||
Originally Posted by Abe Babe
Just calling the preregister method as often as you need it might not work in this case, since the method clears the variable. So trying to simply preregister it again might not be feasible. Anyway, try this:![]()
If this does not work, try something like this:
Of course, if you have really many templates, it might be more elegant to solve this with an array an a nice loop.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again. http://www.roma-antiqua.de No members have liked this post.
|
#60
|
|||
|
|||
...
__________________
New features released for Product Review Forums 1.3 (4.0) Helpful Answers (3.8) (4.0) | Limited Guest Viewing (3.8) (4.0) No members have liked this post.
Last edited by Ted S; 16 Jan 2010 at 19:29. |
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 01:03.