Hier Die range.php hoffe mir kann jemand helfen
<?php
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :Ränge';
$hmenu = 'Ränge';
$design = new design ( $title , $hmenu );
$design->header();
$cl='Cmite';
$tpl = new tpl ( 'range.htm' );
$tpl->out(0);
$sql="SELECT bez, min FROM `xic_ranks` WHERE spez=0 ORDER BY min";
$result=db_query($sql);
for($i=0;$i<db_num_rows($result);$i++){
$ergebnis[$i]=db_fetch_assoc($result);
}
$ergebnis[28]['recht']='Clanleader';
$ergebnis[28]['rz']=-9;
$ergebnis[27]['recht']='CoClanleader';
$ergebnis[27]['rz']=-8;
$ergebnis[26]['recht']='Clanrat';
$ergebnis[26]['rz']=-7;
$ergebnis[25]['recht']='Squadleader';
$ergebnis[25]['rz']=-6;
$ergebnis[24]['recht']='Cosquadleader';
$ergebnis[24]['rz']=-5;
for ($i=0;$i<count($ergebnis);$i++){
if($i<=6){
if($i%2){$cl='Cnorm';} else {$cl='Cmite';}
$ar['PIC1'].='<td class="'.$cl.'" align="center"><a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$ergebnis[$i]['bez'].'</u></b><br><br>\'+
\'<b>Posts or Points:</b> '.$ergebnis[$i]['min'].'<br>\');"onmouseout="return nd();">
'.rangbildforum($ergebnis[$i]['min']).'</a></td>';
}
elseif($i>6 AND $i<=13){
if($i%2){$cl='Cmite';} else {$cl='Cnorm';}
if($_SESSION['authid']==0){$posts=0;$cpoints=0;$verwarn=0;}else{
$posts=@db_result(db_query("SELECT posts FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$cpoints=@db_result(db_query("SELECT cpoints FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$verwarn=@db_result(db_query("SELECT fwarn FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$vpoints=rangcount($_SESSION['authid'],$posts,$cpoints,$verwarn);
$haken = "<img src=include/images/points/haken.gif border=0>";
if((100/$ergebnis[$i]['min']*$vpoints)>100){$prozent1 = 100;}else{$prozent1 = (100/$ergebnis[$i]['min']*$vpoints);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$ergebnis[$i]['min']." Posts/Points";
}
$ar['PIC2'].='<td class="'.$cl.'" align="center"><a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$ergebnis[$i]['bez'].'</u></b><br><br>\'+
\'<b>Posts or Points:</b> '.$ergebnis[$i]['min'].'\'+
\''.$balken1.'\');"onmouseout="return nd();">
'.rangbildforum($ergebnis[$i]['min']).'</a></td>';
}
elseif($i>13 AND $i<=20){
if($i%2){$cl='Cnorm';} else {$cl='Cmite';}
if($_SESSION['authid']==0){$posts=0;$cpoints=0;$verwarn=0;}else{
$posts=@db_result(db_query("SELECT posts FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$cpoints=@db_result(db_query("SELECT cpoints FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$verwarn=@db_result(db_query("SELECT fwarn FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$vpoints=rangcount($_SESSION['authid'],$posts,$cpoints,$verwarn);
$haken = "<img src=include/images/points/haken.gif border=0>";
if((100/$ergebnis[$i]['min']*$vpoints)>100){$prozent1 = 100;}else{$prozent1 = (100/$ergebnis[$i]['min']*$vpoints);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$ergebnis[$i]['min']." Posts/Points";
}
$ar['PIC3'].='<td class="'.$cl.'" align="center"><a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$ergebnis[$i]['bez'].'</u></b><br><br>\'+
\'<b>Posts or Points:</b> '.$ergebnis[$i]['min'].'\'+
\''.$balken1.'\');"onmouseout="return nd();">
'.rangbildforum($ergebnis[$i]['min']).'</a></td>';
}
elseif($i>20 AND $i<=23){
if($i%2){$cl='Cmite';} else {$cl='Cnorm';}
if($_SESSION['authid']==0){$posts=0;$cpoints=0;$verwarn=0;}else{
$posts=@db_result(db_query("SELECT posts FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$cpoints=@db_result(db_query("SELECT cpoints FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$verwarn=@db_result(db_query("SELECT fwarn FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$vpoints=rangcount($_SESSION['authid'],$posts,$cpoints,$verwarn);
$haken = "<img src=include/images/points/haken.gif border=0>";
if((100/$ergebnis[$i]['min']*$vpoints)>100){$prozent1 = 100;}else{$prozent1 = (100/$ergebnis[$i]['min']*$vpoints);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$ergebnis[$i]['min']." Posts/Points";
}
$ar['PIC4'].='<td class="'.$cl.'" align="center"><a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$ergebnis[$i]['bez'].'</u></b><br><br>\'+
\'<b>Posts or Points:</b> '.$ergebnis[$i]['min'].'\'+
\''.$balken1.'\');"onmouseout="return nd();">
'.rangbildforum($ergebnis[$i]['min']).'</a></td>';
}
elseif($i>23 AND $i<=27){
if($i%2){$cl='Cmite';} else {$cl='Cnorm';}
if($_SESSION['authid']==0){$posts=0;$cpoints=0;$verwarn=0;}else{
$posts=@db_result(db_query("SELECT posts FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$cpoints=@db_result(db_query("SELECT cpoints FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$verwarn=@db_result(db_query("SELECT fwarn FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$vpoints=rangcount($_SESSION['authid'],$posts,$cpoints,$verwarn);
$haken = "<img src=include/images/points/haken.gif border=0>";
$kreuz = "<img src=include/images/points/kreuz.gif border=0>";
if((100/$ergebnis[$i]['min']*$vpoints)>100){$prozent1 = 100;}else{$prozent1 = (100/$ergebnis[$i]['min']*$vpoints);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$ergebnis[$i]['min']." Posts/Points";
}
if($_SESSION['authright']<=$ergebnis[$i]['rz']){$recht = $haken;} else{$recht = $kreuz;}
$ar['PIC4'].='<td class="'.$cl.'" align="center"><a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$ergebnis[$i]['bez'].'</u></b><br><br>\'+
\'<b>Posts or Points:</b> '.$ergebnis[$i]['min'].'\'+
\''.$balken1.'\'+
\'<br>\'+
\'<b>or be a '.$ergebnis[$i]['recht'].$recht.'</b>\');"onmouseout="return nd();">
'.rangbildforum($ergebnis[$i]['min']).'</a></td>';
}
elseif($i>27 AND $i<=28){
if($i%2){$cl='Cnorm';} else {$cl='Cmite';}
if($_SESSION['authid']==0){$posts=0;$cpoints=0;$verwarn=0;}else{
$posts=@db_result(db_query("SELECT posts FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$cpoints=@db_result(db_query("SELECT cpoints FROM xic_user WHERE id = ".$_SESSION['authid']),0);
$verwarn=@db_result(db_query("SELECT fwarn FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$vpoints=rangcount($_SESSION['authid'],$posts,$cpoints,$verwarn);
$haken = "<img src=include/images/points/haken.gif border=0>";
$kreuz = "<img src=include/images/points/kreuz.gif border=0>";
if((100/$ergebnis[$i]['min']*$vpoints)>100){$prozent1 = 100;}else{$prozent1 = (100/$ergebnis[$i]['min']*$vpoints);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$ergebnis[$i]['min']." Posts/Points";
}
if($_SESSION['authright']==$ergebnis[$i]['rz']){$recht = $haken;} else{$recht = $kreuz;}
$ar['PIC5'].='<td class="'.$cl.'" align="center"><a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$ergebnis[$i]['bez'].'</u></b><br><br>\'+
\'<b>Posts or Points:</b> '.$ergebnis[$i]['min'].'\'+
\''.$balken1.'\'+
\'<br>\'+
\'<b>or be a '.$ergebnis[$i]['recht'].$recht.'</b>\');"onmouseout="return nd();">
'.rangbildforum($ergebnis[$i]['min']).'</a></td>';
}
}
$tpl->set_ar_out($ar,1);
$tpl->out(2);
function dzem($stufe){
$req[1]='1 Jahr';
$req[2]='2 Jahre';
$req[3]='3 Jahre';
$a='<a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>Dienstzeitmedallie</u></b><br><br>\'+
\'<b>Requirement</b><br>\'+
\'<li>'.$req[$stufe].' im Clan\');" onmouseout="return nd();">
<img src="include/images/medals/1s'.$stufe.'.gif" alt="Stufe'.$stufe.'" border="0"></a>';
return $a;
}
function fzem($stufe){
//Bezeichnung
$bezeichnung = "Forum Service";
//Voraussetzung
$req[1]='50';
$req[2]='100';
$req[3]='500';
//---------------------
if($_SESSION['authid']==0){$posts=0;}else{
$posts=@db_result(db_query("SELECT posts FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$haken = "<img src=include/images/points/haken.gif border=0>";
//---------------------
if($dataimage == NULL){$image = 0;}else{$image = 1;}
if($dataimage == NULL){$name = "No";}else{$name = "";}
if((100/$req[$stufe]*$posts)>100){$prozent1 = 100;}else{$prozent1 = (100/$req[$stufe]*$posts);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$req[$stufe]." Forenposts";
}
$a='<a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$bezeichnung.' Medal</u></b><br><br>\'+
\'<b>Requirement</b><br>\'+
\'<li>'.$req[$stufe].' Posts im Forum\'+
\''.$balken1.'<br>\');" onmouseout="return nd();">
<img src="include/images/medals/2s'.$stufe.'.gif" alt="Stufe'.$stufe.'" border="0"></a>';
return $a;
}
function wzem($stufe){
//Bezeichnung
$bezeichnung = "Bonus Service";
//Voraussetzung
$req[1]='200';
$req[2]='500';
$req[3]='1000';
//---------------------
if($_SESSION['authid']==0){$posts=0;}else{
$posts=@db_result(db_query("SELECT cpoints FROM xic_user WHERE id = ".$_SESSION['authid']),0);
}
$haken = "<img src=include/images/points/haken.gif border=0>";
//---------------------
if($dataimage == NULL){$image = 0;}else{$image = 1;}
if($dataimage == NULL){$name = "No";}else{$name = "";}
if((100/$req[$stufe]*$posts)>100){$prozent1 = 100;}else{$prozent1 = (100/$req[$stufe]*$posts);}
if($prozent1 == 100)
{
$balken1 = $haken;
}
else
{
$balken1 = "<table class=tablepop width=100 cellspacing=0 cellpadding=0><td width=100><img src=include/images/points/balken2x.gif height=6 width=".$prozent1."></td></table>".number_format($prozent1,2,".","")."% of ".$req[$stufe]." Comunitypoints";
}
$a='<a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$bezeichnung.' Medal</u></b><br><br>\'+
\'<b>Requirement</b><br>\'+
\'<li>'.$req[$stufe].' Bonuspoints\'+
\''.$balken1.'<br>\');" onmouseout="return nd();">
<img src="include/images/medals/3s'.$stufe.'.gif" alt="Stufe'.$stufe.'" border="0"></a>';
return $a;
}
function cmem($stufe){
//Bezeichnung
$bezeichnung = "Clan Service";
$a='<a href="javascript:void(0);" onmouseover="return overlib(\'<b><u>'.$bezeichnung.' Medal</u></b><br><br>\'+
\'<b>Requirement</b><br>\'+
\'<li>Besondere Leistungen für den Clan\');" onmouseout="return nd();">
<img src="include/images/medals/4s'.$stufe.'.gif" alt="Stufe'.$stufe.'" border="0"></a>';
return $a;
}
$dze1=dzem(1);
$dze2=dzem(2);
$dze3=dzem(3);
$fze1=fzem(1);
$fze2=fzem(2);
$fze3=fzem(3);
$wze1=wzem(1);
$wze2=wzem(2);
$wze3=wzem(3);
$cme=cmem(1);
$ar2 = array (
'dze1'=>$dze1,
'dze2'=>$dze2,
'dze3'=>$dze3,
'fze1'=>$fze1,
'fze2'=>$fze2,
'fze3'=>$fze3,
'wze1'=>$wze1,
'wze2'=>$wze2,
'wze3'=>$wze3,
'cme' =>$cme
);
$tpl->set_ar_out($ar2,3);
$tpl->out(4);
$design->footer();
?>
Zuletzt modifiziert von oink am 23.11.2011 - 11:21:14