Quote:
Originally Posted by Logician
I think webtemplate "priv_privatemessages" is a good starter to see how this is used. Its phpinclude field says:
PHP Code:
$pm_number = intval($_GET['pm_number']);
if ($pm_number <= 0)
{
$pm_number = 30;
}
First line here is the important one and it tells webtemplates hack to know variable "$pm_number" as the GET value of 'pm_number' which comes through the URL.
So when you use an URL like
http://www.myboard.com/forum/view.ph...s&pm_number=50
the value of $pm_number in the webtemplate will be 50. Then you can use it directly in your webquery just like I did in the webquery named "$WQ_priv_privatemessages".
Hope this clarifies better?
|
It solves the issue
I have another question, which came also from
Quote:
Originally Posted by leitel
I am trying to format the output so that ONLY IF there is a 'dept', it will print out.
I tried putting code in the query output area as well as at the main page template.
Code:
$WQfield[name]<br/>
<if condition="$WQfield['dept']">
$WQfield[dept]<br/>
</if>
Thanks! 
|
Or ony way/solution to $WQfield in a query result? Simple SQL does not solve my issued, let me present an example:
PHP Code:
$query = "
SELECT category_id, name, parent_id
FROM categories
ORDER BY category_id, parent_id";
This query produces a list of categories & subcategories sorted. But I would like to format each row of the query depending on the result. For example:
PHP Code:
if ($row->parent_id > 0) //means it is a SUBcategory
{ echo "Subcategory: "; } else { echo "-- "; }
I see, that there is a post query php code available and hope I can solve it somehow. Idea sharing is of the great help for me
BTW: I see in your documentation .doc file, that the is somewhere bigger help file for queries. Where is it exactly?
Regards
Tom