Quote:
Originally Posted by N8
^ Thanks.
I also have a question regarding WebQueries:
Inside of:
Query Result Row
Use $WQfield[fieldname] variables to replace returned fields in your HTML code
Is there a way to use conditional statements?
I have a webtemplate set up as basically a global "New thread" page - which grabs a list of forumid's / titles and outputs a list of every forum, with every forum name linking to it's respective newthread.php link.
What I want to do now is be able to show which forums are empty, but can't figure out how to use a conditional statement to do so...
I've tried
Code:
<if condition=" $WQfield[lastpostid] == 0">code here</if>
.. but noticed that it doesn't matter what I put inside of condition="" - whatever is inside still ends up being displayed.
Is this just not builtinto the functionality of WebTemplates or am I doing something wrong? thanks 
|
Webqueries result row section does not support template condiditionals.
You can do what you want by hacking view.php. Find this line:
PHP Code:
@eval("\$birikenrow .= \"".WTgettemplate("$WTWQ[resultrow]", 1, 0)."\";");
and before that use something like this
PHP Code:
if ($WTWQ['qname']=='$WQ_last10threadfromforum2')
{
$WQfield[title] = "If webquery name is $WQ_last10threadfromforum2' this is what all thread titles will be!!";
}
Important: There are 2 of these lines so you should add the hack before BOTH of them.