![]() |
The fetch_template how do I test to see if the templete exist in PHP
In the following PHP code
I want to test the what the templatecache or the database or both how do it in PHP of the line below. $dummy = fetch_template('groups_index_listbit'); // returns a string echo $dummy; What is actualy being returned here ? string fetch_template (string $templatename); where string $templatename: Name of template to be fetched So How do I debug this and echo the values correctly above here. Note: This works fine here and I can echo the values in the actaul array. echo $groupslist[id]; echo "<br>"; echo $groupslist[groupname]; echo "<br>"; eval('$groupslist .= "' . fetch_template('groups_index_listbit') . '";'); Why does the line above need the . dot operator is it becuse it is a string type being returned ? How does the eval work in the above case in vbullutin please explain. THANKS |
The groups_index_listbit template is a template that will be looped several times. When you add the concatenating assignment operator ('.='), this will allow you to call this template over and over again untill the MySQL query runs out of data.
For example: If you wanted to echo every username in your database, you would create a mysql query telling the database to give you all usersname is the user row. And echo everyname. Heres how we would do this. The $query variable holds the mysql commands. Code:
$query = $db->query_read(" Code:
while ($user = $db->fetch_array($templates)) |
All times are GMT. The time now is 03:51 AM. |
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:
|