1
rickh
Get modulename/page title with PHP
  • 2005/12/15 0:13

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


I'm trying to add a few lines to the XOOPS php-code to get some usage statistics. I want to write the date/time, IP-adress, username and modulename to a text file (and then simply analyse is with Excel). In the FAQ i've read how to get the username (https://xoops.org/modules/smartfaq/faq.php?faqid=255). It is:

$uname = $xoopsUser->getVar('uname');

Now I try to get the modulename (the same as shown in the page title) on the same manner. I've tried something like:

$dir = $xoopsModule->getVar('name');

but that won't work. Can someone tell me how to do this? I know there are Smarty tags like <{pagetitle}> (or something like that), but i'm editing directly into the php-code, so it seems not to work.

2
LazyBadger
Re: Get modulename/page title with PHP

DISCLAIMER!
{
I don't write code for XOOPS, I know nothing about XOOPS API
}


First iterration
function getmodulename()
{
global $module_handler;
$mod = module_handler->getByDirname('somename');
if( !$mod || !$mod->getVar('isactive') )
{
return false;
}
$this->modname = $mod->getVar('name');
return $mod;
}
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

Login

Who's Online

121 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 121


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits