4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: ch€ri{Bi}˛ on March 06, 2006, 09:53:32 PM
-
hi,
i saw the answer to my question in the old forum but i don't find it here for the moment...
So, how can i show the entire list of tags?
i mean, i want to display in one page all (existing) tags for a template like this:
{header}
{sitename}
{title}
{thumbnail}
{image}
...
...
{footer}
Thanks for your answers.
-
the list of tags depends on the php site, where the tags were registered.
there are only some few tags e.g. in sessions.php and page_header which were in every site,
when the mentioned sites are included.
-
the list of tags depends on the php site, where the tags were registered.
there are only some few tags e.g. in sessions.php and page_header which were in every site,
when the mentioned sites are included.
yeah! you're right but i remember there was a small (and simple) piece of code which shows all registered tags for a particular page.
i.e: when you launch details.php it shows all registered tags for this page... :wink:
:?: :?: :?:
-
ok, it's easy.
on the site, you wish to display all registered tags insert before
include(ROOT_PATH.'includes/page_footer.php');
this
foreach($site_template->val_cache as $key => $value) {
echo "key $key -- value $value <br>";
}
Note:
some of the tags are already registered as parsed templates.
Instead of this
echo "key $key -- value $value <br>";
you can also use
echo "key $key <br>";
then only the registered var names will be shown.
-
OH YES ! it works like a charm :wink:
i ask for this because it's useful :
1) to users who want to make their own template
2) to understand why a tag works (or not :arrow: debug) and how it works...
3) to optimize code for developpers...
So, to show all existing tags only when you want to debug (actually while displaying queries :arrow: you can activate it in includes/constants.php ) , here is the code that i put in includes/page_footer.php to make it works on all pages, just after :
if (defined("PRINT_QUERIES") && PRINT_QUERIES == 1) {
echo implode('<br><br>', $site_db->query_array);
add :
$i = 0;
printf("%s","\n<center><table border='0' width='75%' class='bordertable'><tr><td class='head1'><table border='0' cellspacing='1' cellpadding='3'><tr><td align='center' valign='middle' class='head1'> # </td><td class='head1' align='center' valign='middle'> key </td><td class='head1' align='center' valign='middle'> value </td></tr>");
foreach($site_template->val_cache as $key => $value) {
$row_bg_number = ($i++ % 2 == 0) ? 1 : 2;
printf("%s","<tr class=\"imagerow".$row_bg_number."\"><td align='center' valign='middle'> ".$i." </td><td align='center' valign='middle'> ");
printf("{%s}", $key);
printf("%s"," </td><td align='center' valign='middle'> ".$value." </td></tr>");
}
printf("%s","</table></td></tr></table></center>\n");
Thank you very much IcEcReaM for your quick help!
Best regards.
-
no problem.
2) to understand why a tag works (or not Arrow debug) and how it works...
to check more easily if you have set everything alright it might be better to use "echo" to output the values,
instead of controlling the wholen customized template when it's very large.
Sometimes it's also useful to use an debugger for php like DBG.