joomla/mod_api_40_5/helper.php
<?php
defined( '_JEXEC' ) or die( 'Restricted Access' );
class ModAPIHelper
{
public function getRandomColor() { // return a random color
return sprintf("#%02X%02X%02X",rand(0,255), rand(0,255), rand(0,255));
}
public function getUserName($gastName) { // return user name, $gastName for name of not logged in user
$user = JFactory::getUser();
if ($user->id == 0)
{
return array($gastName, 'keine Infos');
} else {
return array($user->username, 'lastvisit=' . $user->lastvisitDate . ' email=' . $user->email);
}
}
}
?>