Skip to Content Skip to Menu

random user module

  • mihat
  • mihat
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 3
17 years 8 months ago #27400 by mihat
random user module was created by mihat
Hey!

I don't know if this module exists. I've done it by myself. It is not proper module yet. However is a little bit of source code, that you can hack and get it to work.

[code:1]

/**
* @version $Id: mod_randomuser.php 2711 2006-12-15 15:07:22Z
* @copyright Copyright 2006 Miha Trtnik www.nosorog.si All rights reserved.
* @license commercial
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

global $mosConfig_offset, $mosConfig_live_site,
$twidth;

$count = intval( $params->get( 'fotke', 5 ) );

$now = _CURRENT_SERVER_TIME;
$access = !$mainframe->getCfg( 'shownoauth' );
$nullDate = $database->getNullDate();
$title_length = 20;
$short_desc_length = 200;

//mysql_query("SET NAMES 'utf8'"«»);
// select between Content Items, Static Content or both
$sql = "SELECT u.id, u.username, cp.avatar
FROM #__users AS u
LEFT JOIN #__comprofiler AS cp ON cp.id = u.id
WHERE u.block= '0' AND cp.avatarapproved = '1'
ORDER BY RAND() LIMIT 1";
$database->setQuery($sql);
$rows = $database->loadObjectList();
/*foreach($rows as $row) {
echo $row->avatar;
}*/
$avatar = $rows[0]->avatar;
if(empty($avatar))
$avatar = 'components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg';
else
$avatar = 'images/comprofiler/tn'.$avatar;

echo '<a href="component/option,com_comprofiler/task,userProfile/user,'.$rows[0]->id.'/Itemid,27/">'.$rows[0]->username.'</a>';
?>

<br /><a href="component/option,com_comprofiler/task,userProfile/user,<?=$rows[0]->id?>/Itemid,27/"><img src="<?=$avatar;?>" border="0" style="margin:5px;" /></a>
[/code:1]

I hope it will be helpful for someone.

Regards,
mike

Please Log in or Create an account to join the conversation.

  • Slydder
  • Slydder
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
17 years 1 month ago #41485 by Slydder
Replied by Slydder on topic Re:random user module
What exactly should this module/plugin do?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum