Posted By

localhorst on 02/09/08


Tagged

debug PHPWCMS Replacementtags


Versions (?)

Print Siteinfo


 / Published in: PHP
 

Use {SITE_INFO} in your template to print actual category ID / article ID and processing time

  1. <?php
  2.  
  3. // Siteinfo in footer
  4. if( ! (strpos($content["all"],'{SITE_INFO}')===false)) {
  5.  
  6. $siteinfo = "";
  7. $siteinfo .= "Kategorie ID: ".$content["cat_id"]." | ";
  8. $siteinfo .= "Artikel ID: ".$content["article_id"]." | ";
  9. $siteinfo .= (function_exists('memory_get_usage'))?"Memory ".round(memory_get_usage()/1024/1024, 2)."MB | ":" | ";
  10. list($usec, $sec) = explode(' ', microtime());
  11. $siteinfo .= "Time: ".number_format(1000*($usec + $sec - $phpwcms_rendering_start), 3)." ms";
  12. $siteinfo = "<div style=\"color:#fff;margin-top:0.45em;text-align:center;\">".$siteinfo."</div>";
  13.  
  14. $content["all"] = str_replace('{SITE_INFO}', $siteinfo, $content["all"]);
  15. }
  16.  
  17. ?>

Report this snippet  

You need to login to post a comment.