include/boxes/random_member.php:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
# Rendom Member Box Scroller
# by OloX THX @ Mairu ;)
defined ('main') or die ( 'no direct access' );
$limit = $allgAr['rmbox_limit'];
$teamid = $allgAr['rmbox_teamid'];
$bgcolor = $allgAr['rmbox_bgcolor'];
$bodercolor = $allgAr['rmbox_bodercolor'];
$width = $allgAr['rmbox_width'];
$height = $allgAr['rmbox_height'];
echo '<script src="include/includes/js/member_scroller.js" type="text/javascript"></script>';
echo '<style type="text/css">
#marqueecontainer {
position: relative;
width: '.$width.';
height: '.$height.';
background-color: '.$bgcolor.';
overflow: hidden;
border: 1px solid '.$bodercolor.';
padding: 2px; }
</style>';
echo '<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">';
if($allgAr['rmbox_teamid'] == 0) {
$sql = db_query("SELECT id as userid,name,avatar,staat,gebdatum,wohnort FROM prefix_user WHERE 1 ORDER BY rand() LIMIT $limit");
} else {
$sql = db_query("SELECT b.uid as userid,a.name,a.avatar,a.staat,a.gebdatum,a.wohnort FROM prefix_groupusers b INNER JOIN prefix_user a ON b.uid = a.id WHERE b.gid = $teamid ORDER BY rand() LIMIT $limit");
}
while ($r = db_fetch_object($sql)) {
if(!empty($r->wohnort)){
$wohnort = $r->wohnort;
} else {
$wohnort = 'n/a';
}
if(!empty($r->staat)){
$staat = '<img src="include/images/flags/'.$r->staat.'" border="0" alt="'.$r->staat.'" title="'.$r->staat.'" />';
} else {
$staat = 'n/a';
}
$avatar = '';
if ( file_exists($r->avatar)) {
$avatar = '<img height="100" width="100" src="'.$r->avatar.'" border="0" alt="'.$r->name.'" title="'.$r->name.'" />';
} else {
$avatar = '<img src="include/images/avatars/wurstegal.jpg" border="0" alt="'.$r->name.'" title="'.$r->name.'" />';
}
if($r->gebdatum !== "0000-00-00"){
$gebdatum = date('d.m.Y',strtotime($r->gebdatum));
$tag = date('d',strtotime($r->gebdatum));
$monat = date('m',strtotime($r->gebdatum));
$jahr = date('Y',strtotime($r->gebdatum));
$jetzt = mktime(0,0,0,date("m"),date("d"),date("Y"));
$geburtstag = mktime(0,0,0,$monat,$tag,$jahr);
$alter = "(".intval(($jetzt - $geburtstag) / (3600 * 24 * 365)).")";
} else {
$gebdatum = '';
$alter = '';
}
echo '<div align="center">'.$avatar.'</div><div align="center">'.$staat.' <a href="index.php?user-details-'.$r->userid.'">'.$r->name.'</a> '.$alter.' '.$wohnort.'</a></div><br></br>';
}
echo '</div></div>';
?>