how to render avatar to custom page??
any idea? |
I am trying to update a field I added to the thread table from a set of plugins that will be called whenever a post is edited or a new thread created. There is nothing to display. If the current post contains an image or an attachment, I want to copy the postid to my new field.
I think I need to preregister the node in the $thread array, but I am not sure how to do that. Can I freely reference an existing array in the preregister method? Here is the code I have now. The commented line is what I would expect the eventual sql statement to be. Code:
if (!$thread['thumbpostid']) //there is no thumbpost defined |
I'm currently working on an old vb addon to make it compatible to vb4.
Maybe somebody can help me with this following line: PHP Code:
PHP Code:
Thanks in advance. :) |
I think you just need something like this:
PHP Code:
since the eval has been moved in to the vB_Template class. But if the template requires any variables, they now have to be registered. So it's likely you need something like: PHP Code:
|
Thanks for your help.
That was exactly what i was looking for. :) |
I should probably mention just in case, you don't have to register *every* variable because some standard vb ones are automatically registered, like bbuserinfo, style, show, vboptions, etc.
|
I have to admit, this is going a bit beyond my scope of knowledge and I'm a bit lost.
I'm trying to place the same rotating banner ads in 4.2.2 that I currently use in 3.8.7 I've been told I need to register the templates and have been directed to this thread. I am certain the answer is here however I'm not grasping it. I currently run in house advertising via a table in the header that calls to plugins using the PHP random feature like this: In Table in header: Quote:
Quote:
Any help would be appreciated. |
At the end of that plugin, you need to register that variable for use in the header template.
PHP Code:
|
Just so I have this right before trying it and turning my vB install in to Pong game, in the Plug In PHP Code box I add that to the end like this:
PHP Code:
PHP Code:
|
Did you try it? You really should have a test site set up so you can try this stuff before doing it on a live site.
|
I do have a test site up with a separate database and vB install on it for testing prior to trying anything on my live forum.
You'll have to excuse my manner of asking follow up questions, when I can't get something to work I tend to ask questions in the form of clarification of what I am doing assuming I have made an error rather than saying 'that didn't work'. It seems more respectful of those trying to help. The comment about roasting my vB install is mostly comedy however I did manage to do something to my test install when I first tried to make the ad banners work that killed it and required a wipe and reinstall. So far I have not been able to get the random banners to display, all I have gotten is the header code displaying above the title. I have placed the header code in various places within the header template and have placed the registration code at the very end of the plug in as above and tried it as the second line of the plug in. All with the same results, I can only assume that I am missing a step somewhere. |
I couldn't tell from your post whether you were asking for help or not. But, I did just notice that you have the variable entered wrong in your template (that's what happens when you look at vB3 and vB4 and vB5 sites all the time!). It's
{vb:raw random_banner11['$random_number11']} And, I didn't notice you had two variables - you need to register each of them. |
The first post shows you how to register a variable here:
PHP Code:
|
Quote:
|
Hi,
I understand above all things. I just wanted to know that, {vb:raw user.username} above code I found in template 'header'. From where this header template gets object 'user' and how it can able to access it property. I am interested know where this vBulletin variable like 'user' stored and in which php file? Can any one help me to understand this? Thanks!!!! |
Quote:
|
Any suggestion why the code below does not works as expected?
PHP Code:
EDIT: What I was adding in the templates is: {vb:raw mybanners} |
I would use hook parse_templates. You say you've tried "many different templates", do you mean other hean 'header'? Of course you know, but double check that you put {vb:raw mybanners} in the same template that you preRegister() to.
|
Quote:
--------------- Added [DATE]1422806090[/DATE] at [TIME]1422806090[/TIME] --------------- Quote:
|
hock process_templates_complete
PHP Code:
|
I think using member_build_blocks_start is much better than member_complete as it allows you to access function preRegister of vB_Template class.
|
JUst a quick question
Playing with 4.2.2 Tried using the $templater but no dice but (Sorted) BUT !!!! eval does work ? is this right ? PHP Code:
|
Quote:
Code:
$templater = vB_Template::create('testtest'); |
Help me please! What I`m do wrong?...
I trying show some info on showthread page. ----------------------------------------------------------------- PHP Code:
HTML Code:
<template name="rightside_on_showthread" templatetype="template" date="1337106668" username="taravasya" version="1.0.0"><![CDATA[ And so on SHOWTHREAD template I adding: HTML Code:
{vb:raw rightside_on_showthread} But with no luck ((( In place in what I was want to add my info I have white space(without my div class="rightsideinfo" in inspector of page). But in debug info, I have not cached template rightside_on_showthread. UPDATE ------------------------------------- I was thinking if I take vars into my own template, then I don`t need to use vB_Template:: preRegister for add my template in showthread. But I was wrong...)) |
PHP Code:
|
Thanks, Lynne! Actually I wrote in a previous message, that I understood my mistake, but your variant helped me to make my code more succinctly! Thanks!
|
Another problem(((
In hook showthread_similarthreadbit I add next code: PHP Code:
This hook added in showthread.php on 1978. I was thinking, if this hook placed in a while cycle, I will have all results from this cycle. But no.... :( |
Hi
my plugin load in "showthread_complete" and it's code is: PHP Code:
Code:
<meta property="og:title" content="{vb:raw pagetitle} - page {vb:raw pagenumber} of {vb:raw totalpages} pages" /> I need to point out that I can not load the plugin in the "parse_template". Because the page number and other variable is not recognized in "parse_template". and why "{vb:rawphrase thread.title}" not work in my template? |
All times are GMT. The time now is 12:01 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|