1
Gombunan
How to show load time and DB queries to admins and mods only
  • 2005/5/14 8:22

  • Gombunan

  • Just popping in

  • Posts: 30

  • Since: 2005/5/14


Hello,

I am implementing the load time and DB queries on my page as decribed here:

https://xoops.org/modules/smartfaq/faq.php?faqid=303

I want to show the information to the site admins or moderators only, and it'll be invisible to guests and members.


I tried

<{if $xoops_isadmin = 1 || $xoops_ismoderators = 1}>
<{php}>
echo round(($GLOBALS['xoopsLogger']->dumpTime()), 3)." Seconds | ".count($GLOBALS['xoopsLogger']->queries)." Queries";
<{/php}>

</{/if}>

But that didn't work. I am a begginner in PHP too btw.

Anybody can help? Many thanks?

2
Gombunan
Re: How to show load time and DB queries to admins and mods only
  • 2005/5/16 7:41

  • Gombunan

  • Just popping in

  • Posts: 30

  • Since: 2005/5/14


Anybody please? May be I posted in the wrong forum, sorry I am new here.

3
Mithrandir
Re: How to show load time and DB queries to admins and mods only

you need to use two = - and $xoops_ismoderators doesn't exist.

So
<{if $xoops_isadmin == 1}>
<{
php}>
echo 
round(($GLOBALS['xoopsLogger']->dumpTime()), 3)." Seconds | ".count($GLOBALS['xoopsLogger']->queries)." Queries";
<{/
php}>

</{/if}>

4
Gombunan
Re: How to show load time and DB queries to admins and mods only
  • 2005/5/16 14:49

  • Gombunan

  • Just popping in

  • Posts: 30

  • Since: 2005/5/14


Mithrandir,

btw, there's an extra forward slash </{/if}> in the code snippet which causes an error.

Anyway, thank you very much! It works like a charm now.

This is my first attempt into a full fledge CMS to manage my website. After checking around, I like XOOPS the most. I find it to be fast, secure, has many excellent modules, has very nice themes, highly customizable, and low learning curve.

Keep up the good work!