Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #46  
Old 21 Dec 2009, 04:38
nubian nubian is offline
 
Join Date: Nov 2004
Thumbs up

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.
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I used this to fix it...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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...

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to the wrong config.php file.

Thanks for this write up, It helped me quite a bit in understanding more and more about VB.

Last edited by nubian; 21 Dec 2009 at 05:44.
Reply With Quote
  #47  
Old 21 Dec 2009, 06:21
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Originally Posted by nubian View Post
Thank you cellarius for this!
I've even printed this out and read this even while sitting on the throne quite a few times.
Too much information

The option to - Save into a variable for later use in custom template works only after noticing an error in this code.
There's no error in the code. You just changed the name of ine variable, and of course you are free to do so. The variables are just examples, you can name them whatever you want.


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.
The hook is there, if not, you have customized your FORUMHOME template and removed it. Anyway, this also is just an example; it works the same with any given template hook. Plus, I don't know why you think this belongs to the section where I write about preregistering - if you use a template hook, you don't need to preregister.
__________________
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
Reply With Quote
  #48  
Old 21 Dec 2009, 08:19
nubian nubian is offline
 
Join Date: Nov 2004
Originally Posted by cellarius View Post
Too much information
It was a lot better than reading video game manuals.
Originally Posted by cellarius View Post
There's no error in the code. You just changed the name of ine variable, and of course you are free to do so. The variables are just examples, you can name them whatever you want.
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.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 View Post
The hook is there, if not, you have customized your FORUMHOME template and removed it. Anyway, this also is just an example; it works the same with any given template hook. Plus, I don't know why you think this belongs to the section where I write about preregistering - if you use a template hook, you don't need to preregister.
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.
Reply With Quote
  #49  
Old 24 Dec 2009, 18:20
CypherSTL's Avatar
CypherSTL CypherSTL is offline
 
Join Date: Mar 2006
Real name: Patrick
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
MySpace | Consultant | Web and Software Developer | Microsoft Certified Professional

"Wielding power untouched by mortal man."
Reply With Quote
  #50  
Old 24 Dec 2009, 18:41
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by CypherSTL View Post
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
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.)
Reply With Quote
  #51  
Old 28 Dec 2009, 19:46
CypherSTL's Avatar
CypherSTL CypherSTL is offline
 
Join Date: Mar 2006
Real name: Patrick
I still cannot figure out how in the heck to work this new template system.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Works flawlessly. No errors.

However

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Displays absolutely NOTHING.
__________________
MySpace | Consultant | Web and Software Developer | Microsoft Certified Professional

"Wielding power untouched by mortal man."
Reply With Quote
  #52  
Old 29 Dec 2009, 12:46
scarex scarex is offline
 
Join Date: Aug 2006
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?
Reply With Quote
  #53  
Old 30 Dec 2009, 01:51
IR15H IR15H is offline
 
Join Date: Feb 2007
Thanks for the guide

Last edited by IR15H; 02 Jan 2010 at 22:38. Reason: Query moved to it's own thread.
Reply With Quote
  #54  
Old 31 Dec 2009, 14:52
rbc's Avatar
rbc rbc is offline
 
Join Date: Jul 2007
Real name: Peter
Thumbs up

Originally Posted by cellarius View Post
Introduction
~snip~
@ 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
Reply With Quote
  #55  
Old 06 Jan 2010, 02:32
NLP-er's Avatar
NLP-er NLP-er is offline
 
Join Date: Aug 2008
Real name: Michał Podbielski
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.:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 Now check if its working :P

--------------- 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 View Post
I figure out how to solve it:

hook: process_templates_complete

code: $footer .= 'text added to footer';

No idea if was the best solution, but that worked very well.
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 need to use hook parse_templates
__________________
vBulletin Enterprise Translator (vBET) - your forum in 53 languages - get more traffic, users and incomes from AdSense!

Last edited by NLP-er; 06 Jan 2010 at 03:55. Reason: Auto-Merged DoublePost
Reply With Quote
  #56  
Old 07 Jan 2010, 19:22
Sarcoth Sarcoth is offline
 
Join Date: Mar 2006
Real name: Nick
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I tried the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That didn't work though, it seems to be cutting off everything after misc.php. Maybe I need to register the $fid?
Reply With Quote
  #57  
Old 07 Jan 2010, 21:28
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
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
Reply With Quote
  #58  
Old 12 Jan 2010, 08:26
Abe Babe's Avatar
Abe Babe Abe Babe is offline
 
Join Date: Sep 2002
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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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]
Reply With Quote
  #59  
Old 13 Jan 2010, 03:16
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Originally Posted by Abe Babe View Post

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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*)?
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If this does not work, try something like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Of course, if you have really many templates, it might be more elegant to solve this with an array an a nice loop.
And what is the best hook to have this on. I am currently using 'parse_templates'.
Seems fine to me.
__________________
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
Reply With Quote
  #60  
Old 16 Jan 2010, 19:19
Ted S Ted S is offline
 
Join Date: Dec 2003
...
__________________
New features released for Product Review Forums 1.3 (4.0)
Helpful Answers (3.8) (4.0) | Limited Guest Viewing (3.8) (4.0)

Last edited by Ted S; 16 Jan 2010 at 19:29.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:58.

Layout Options | Width: Wide Color: