![]() |
Code help
......
|
Is this code *you* wrote? And if not, do you have permission from the author to post it? If not, you may NOT post it here.
|
Quote:
Look around and see if it's anywhere on this board or anywhere else unless I posted it. If you can assist then I would be very happy. |
Most likely what you need to change are the templates and the syntax to render the templates. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
Quote:
Code:
|
You also need to change the template syntax as noted in the article here:
Quote:
|
Quote:
|
They are variables. So, instead of $my_variable, you would use {vb:raw my_variable}
|
Quote:
--------------- Added [DATE]1263084199[/DATE] at [TIME]1263084199[/TIME] --------------- I tried all that I can. It's not working. can someone make the edits needed for me and post it here please? --------------- Added [DATE]1263084258[/DATE] at [TIME]1263084258[/TIME] --------------- Quote:
|
In the code given above, I see lots of variables used in the template that are not registered, like $pbstyle, $pbthreadid, $pbthreadtitle etc. Basically none of the variables you use in the template are registered. Please read the tutorial Lynne linked you to again, especially the part about "Save into a variable for later use in custom template".
For $threadid for example, you need to register the variable for your bigblock template and for your smallblock template: PHP Code:
Now you can call $threadid in your template pb_latestthreads_bigblock by inserting {vb:raw threadid}. To be able to call the variable you saved the template into ($pblatest_bigblock) in your pb_latestthreads_area template, you again need to register it: Your code there: PHP Code:
IT would look something like that: PHP Code:
Basically: - bigblock template: register every variable you want to use inside this template, save into variable - smallblock template: register every variable you want to use inside this template, save into variable - area template: register every variable you want to use inside this template, including the variables you saved bigblock and smallblock templates into; save area template into variable, then preregister this variable for use in existing template |
Thanks cellarius for your reply. I think I may have to hire a programmer for this.
|
Thx a lot Cellarius!
Just a little correction. Code should looks like this: PHP Code:
|
And what should be corrected in your version of the code? The only thing you changed is the name of the variable, which you lowercased and inserted some underscores. Of course, you can name your variables whatever you want within the limits given by php. But there is no rule, not even a convention in php to use only lowercase variable names and add underscores, so why should using the camelcase variable names the original poster came up with be incorrect?
|
The var in vB_Template::create and $templatevalues should be the same and without string ($)
|
You're correct with the $, that is indeed a typo I missed. Thanks for pointing this out. But the vars in the method call and the array do not have to be the same by any means. The first one is the name of the template that's being called, the second one the variable that can be accessed later on. It can make sense to name them the same, but that's not mandatory. In my code I was using the template names and variables the original poster was using. This was not my choice, but I stuck to it to make things not even more difficult.
|
Just a note to solboy. I initially had a problem understanding the new template rendering system. I spent time going over numerous mods and over cellarius' thread on the subject. I actually keep a handy print out of that thread which I still look over often. I now feel comfort in the "new way" and it is easy to learn via trial and error. If something isn't working, register another variable. Now, it looks so simple to me...except for a couple problems I'm still having. :)
|
@ cellarius,
Can you help me with this? https://vborg.vbsupport.ru/showthread.php?t=236031 I cant handle auto template editing :( |
All times are GMT. The time now is 06:11 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|