|
|
Latest News |
Latest Threads |
|
 |
56.501 Posts & 4.945 Themen in 78 Foren |
|
|
|
 |
Forensuche |
|
Suchbegriff |
Benutzerauswahl |
Ergebnisse anzeigen |
 |
 |
Warstatistik mit Diensträngen ausstatten 10 Beiträge in diesem Thema |
|
|
 |
 |
Geschlossen |
|
|
|
|
 |
|
 |
27.04.2008 - 12:43 Uhr |
|
|
|
Hallo ich wollte gerne Dienstränge einführen je nachdem wieviele Wars derjenige mitgemacht hat kriegt er nen Dienstrang.
Ich habe es mal versucht, so aber es ging nicht.
Kann mir einer sagen wo mein Fehler ist oder nen Verbesserungsvorschlag machen.
Was bei Dienstgrade dazwischen steht ist mein Code!
$count_win gibt nur eine Zahl her wieviel wars gewonnen wurden.
login/User_status.php
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | | PHP-Quelltext
/********************* Warplaner Anfang *********************/
$count_win = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner<result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_lose = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner>result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_draws = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner=result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_result = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_win = $count_win[0];
$count_lose = $count_lose[0];
$count_draws = $count_draws[0];
$count_result = $count_result[0];
$h= $count_win + $count_lose + $count_draw;
$t = @round($count_win*100/$h);
$k = @number_format($count_win*100/$h, 2, ",", ".");
$r = @round($count_lose*100/$h);
$i = @number_format($count_lose*100/$h, 2, ",", ".");
$u = @round($count_draws*100/$h);
$p = @number_format($count_draws*100/$h, 2, ",", ".");
$count_won='<img border="0" src="images/war/won.gif" height="10" width="'.$t.'%" alt="" title="Sieg"> '.$k.'%';
$count_lost='<img border="0" src="images/war/lost.gif" height="10" width="'.$r.'%" alt="" title="Niederlage"> '.$i.'%';
$count_draw='<img border="0" src="images/war/draw.gif" height="10" width="'.$u.'%" alt="" title="Unentschieden"> '.$p.'%';
$result_user=$DB->query("SELECT * FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'");
$user_wins=0;
$user_lost=0;
while($result_ok=$DB->fetch_array($result_user)) {
$user_wins = $user_wins + $result_ok['result_wir'];
$user_lost = $user_lost + $result_ok['result_gegner'];}
$ds = $user_wins + $user_lost;
$mn = @round($user_wins*100/$ds);
$nm = @number_format($user_wins*100/$ds, 2, ",", ".");
$ug = @round($user_lost*100/$ds);
$gu = @number_format($user_lost*100/$ds, 2, ",", ".");
$user_won_in='<img border="0" src="images/war/won.gif" height="10" width="'.$mn.'%" alt="" title="Sieg"> '.$nm.'%';
$user_lost_in='<img border="0" src="images/war/lost.gif" height="10" width="'.$ug.'%" alt="" title="Niederlage"> '.$gu.'%';
if($count_win>0 or $count_lose>0 or $count_draws>0){
eval ("\$infos_war= \"".getTemplate("war/user_stats")."\";");}
$join_count_ok=$DB->fetch_array($DB->query("SELECT count(id) FROM `".$db_tab['war_join_feld']."` WHERE `join_id`='".intval($userinfo['user_id'])."'"));
if($join_count_ok[0]>0)
eval ("\$infos_war.= \"".getTemplate("war/user_join_info_link")."\";");
/********************* Dienstgrade ***********************/
if($count_win>=10){
$dstgrd=="<img src="images/dstgrd/og.gif">
} else if($count_win>=5){
$dstgrd=="<img src="images/dstgrd/g.gif">
} else if($count_win>=0){
$dstgrd=="<img src="images/dstgrd/s.gif">
}
/********************* Dienstgrade ***********************/
/********************* Warplaner Ende ***********************/
| |  |
template/war/user_stats.htm
Hier klicken zum aufklappen | PHP-Quelltext
<tr>
<td class="left" width="20%">Dienstrang</td>
<td class="right" width="5%" align="center">$count_win</td>
<td class="right" width="75%">$dstgrd</td>
</tr>
| |
Ohh Gott ich glaub Webi wird mich langsam hassen ich komm immer nur mit Fragen
und dann immer gleich so viele.
Sry aber die Member würden das gerne haben.
Greetz Chopper
PS: Danke schonmal für eure Hilfe
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von chopper - 27.04.2008 - 14:09 Uhr |
|
|
|
|
|
|
|
 |
|
 |
27.04.2008 - 13:11 Uhr |
|
|
|
Du hast lediglich einige kleine Bedingungen nicht geschlossen.
Und was die Übersicht angeht .. Naja, ich sag nichts dazu.
Versuch es mal hiermit.
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | | PHP-Quelltext /********************* Warplaner Anfang *********************/
$count_win =$DB->fetch_array($DB->query("SELECT COUNT(id) FROM ".$db_tab['war_result']." WHERE result_gegner<result_wir AND result_user LIKE '%-".intval($userinfo['user_id'])."-%'"));
$count_lose =$DB->fetch_array($DB->query("SELECT COUNT(id) FROM ".$db_tab['war_result']." WHERE result_gegner>result_wir AND result_user LIKE '%-".intval($userinfo['user_id'])."-%'"));
$count_draws =$DB->fetch_array($DB->query("SELECT COUNT(id) FROM ".$db_tab['war_result']." WHERE result_gegner=result_wir AND result_user LIKE '%-".intval($userinfo['user_id'])."-%'"));
$count_result =$DB->fetch_array($DB->query("SELECT COUNT(id) FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".intval($userinfo['user_id'])."-%'"));
$count_win =$count_win[0];
$count_lose =$count_lose[0];
$count_draws =$count_draws[0];
$count_result =$count_result[0];
$user_wins =0;
$user_lost =0;
$h =$count_win + $count_lose + $count_draw;
$t =@round($count_win*100/$h);
$k =@number_format($count_win*100/$h, 2, ",", ".");
$r =@round($count_lose*100/$h);
$i =@number_format($count_lose*100/$h, 2, ",", ".");
$u =@round($count_draws*100/$h);
$p =@number_format($count_draws*100/$h, 2, ",", ".");
$count_won ='<img border="0" src="images/war/won.gif" height="10" width="'.$t.'%" alt="" title="Sieg"> '.$k.'%';
$count_lost ='<img border="0" src="images/war/lost.gif" height="10" width="'.$r.'%" alt="" title="Niederlage"> '.$i.'%';
$count_draw ='<img border="0" src="images/war/draw.gif" height="10" width="'.$u.'%" alt="" title="Unentschieden"> '.$p.'%';
$result_user=$DB->query("SELECT * FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'");
while($result_ok=$DB->fetch_array($result_user)) {
$user_wins=$user_wins + $result_ok['result_wir'];
$user_lost=$user_lost + $result_ok['result_gegner'];
}
$ds =$user_wins + $user_lost;
$mn =@round($user_wins*100/$ds);
$nm =@number_format($user_wins*100/$ds, 2, ",", ".");
$ug =@round($user_lost*100/$ds);
$gu =@number_format($user_lost*100/$ds, 2, ",", ".");
$user_won_in ='<img border="0" src="images/war/won.gif" height="10" width="'.$mn.'%" alt="" title="Sieg"> '.$nm.'%';
$user_lost_in ='<img border="0" src="images/war/lost.gif" height="10" width="'.$ug.'%" alt="" title="Niederlage"> '.$gu.'%';
if ($count_win>0 ||☺ $count_lose>0 || $count_draws>0) eval ("\$infos_war= \"".getTemplate("war/user_stats")."\";");
$join_count_ok=$DB->fetch_array($DB->query("SELECT COUNT(id) FROM ".$db_tab['war_join_feld']." WHERE join_id='".intval($userinfo['user_id'])."'"));
if($join_count_ok[0]>0) eval ("\$infos_war.= \"".getTemplate("war/user_join_info_link")."\";");
/********************* Dienstgrade ***********************/
if ($count_win>=10) $dstgrd=='<img src="images/dstgrd/og.gif">';
elseif($count_win>=5) $dstgrd=='<img src="images/dstgrd/g.gif">';
elseif($count_win>=0) $dstgrd=='<img src="images/dstgrd/s.gif">';
}
/********************* Dienstgrade ***********************/
/********************* Warplaner Ende ***********************/ | |  |
|
|
|
|
|
|
|
 |
|
 |
27.04.2008 - 14:07 Uhr |
|
|
|
|
|
|
 |
|
 |
|
 |
27.04.2008 - 15:42 Uhr |
|
|
|
Also ich poste dir mal beide komplett die es betrifft da er mir leider immer Fehler produziert.
Ich hoffe jetzt siehst du denn Fehler oder meine Gedankenlücke.
Userinfo.php
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | | PHP-Quelltext <?php
if (getrights($config['member_infoshow'])=="true") {
if (!$_REQUEST['id'] && $USER['id']!=0) $id=$USER['id'];
else $id=$_REQUEST['id'];
$userinfo=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['user']." where user_id='".$id."' LIMIT 1"));
$info_nick=$userinfo['user_nick'];
if ($userinfo['user_bd_day']!=0 && $userinfo['user_bd_month']!=0 && $userinfo['user_bd_year']!=0) {
$info_birthday=$userinfo['user_bd_day'].". ";
$month=$lang['all_month'];
$month=$month[$userinfo['user_bd_month']];
$info_birthday.=$month[1]." ";
$info_birthday.=$userinfo['user_bd_year']." - ".$lang['age'].": ".getAge($userinfo[user_bd_day],$userinfo[user_bd_month],$userinfo[user_bd_year]);
}
else {$info_birthday=$lang['not_specified'];}
if ($userinfo['user_sex']=="w") $info_sex=$lang['female'];
elseif ($userinfo['user_sex']=="m") $info_sex=$lang['male'];
else $info_sex=$lang['not_specified'];
if ($userinfo[user_country]!="") {eval ("\$info_country= \"".getTemplate("member_country_text_".$userinfo[user_country]."")."\";");}
else {$info_country=$lang['not_specified'];}
$info_signin=formattime($userinfo['signin'],'','date');
if ($userinfo['logtime']>0) {$info_logtime=formattime($userinfo['logtime']);}
else {$userinfo_logtime=" - ";}
if ($userinfo[user_status]=="admin") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['admin_female'];} else {$info_userstatus=$lang['admin'];}}
elseif ($userinfo[user_status]=="mod") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['mod_female'];} else {$info_userstatus=$lang['mod'];}}
elseif ($userinfo[user_status]=="member") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['member_female'];} else {$info_userstatus=$lang['member'];}}
elseif ($userinfo[user_status]=="user") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['user_female'];} else {$info_userstatus=$lang['user'];}}
elseif ($userinfo[user_status]=="ban") {$info_userstatus=$lang['banned'];}
if ($userinfo['user_groupid']!=0) {
$group=$DB->fetch_array($DB->query("SELECT usergroup_name FROM ".$db_tab['usergroup']." WHERE usergroup_id='".$userinfo['user_groupid']."' LIMIT 1"));
if (trim($group[0])!='') $info_usergroup=$group[0];
else eval ("\$info_usergroup= \"".getTemplate("userinfo_nousergroup")."\";");
}
else eval ("\$info_usergroup= \"".getTemplate("userinfo_nousergroup")."\";");
if (isonline($userinfo['user_id'])) $info_os=$lang['online'];
else $info_os=$lang['offline'];
$userfields=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['userfields']." WHERE userid='".$userinfo['user_id']."' LIMIT 1"));
$info_extended='';
$getprofilefields=$DB->query("SELECT * FROM ".$db_tab['profilefields']." ORDER by profilefields_order ASC");
while ($profilefields=$DB->fetch_array($getprofilefields)) {
$f="field_".$profilefields['profilefields_id'];
if (($fieldcontent=htmlentities($userfields[$f]))=='') $fieldcontent=$lang['not_specified'];
$fieldname=$profilefields['profilefields_name'];
eval ("\$info_extended.= \"".getTemplate("userinfo_ext")."\";");
}
if ($userinfo[user_emailshow]==1) {
if ($config[member_mailer]==1) {eval ("\$info_email= \"".getTemplate("member_email_textlink2")."\";");}
else {eval ("\$info_email= \"".getTemplate("member_email_textlink")."\";");}
}
else {$info_email=$lang['not_specified'];}
if ($userinfo[user_imoption]==1) {eval ("\$info_im= \"".getTemplate("member_sendim_textlink")."\";");}
else {$info_im=$lang['receiving_not_wanted'];}
if ($userinfo[user_icqid]!=0) {eval ("\$info_icq= \"".getTemplate("member_icq_iconlink_2")."\";");}
else {$info_icq=$lang['not_specified'];}
if ($userinfo[user_aimid]!="") {eval ("\$info_aim= \"".getTemplate("member_aim_textlink")."\";");}
else {$info_aim=$lang['not_specified'];}
if ($userinfo[user_yim]!="") {eval ("\$info_yim= \"".getTemplate("member_yim_textlink")."\";");}
else {$info_yim=$lang['not_specified'];}
if ($userinfo[user_hpage]!="") {
if (ereg("http://",$userinfo[user_hpage])) {$info_link=$userinfo[user_hpage];}
else {$info_link="http://".$userinfo[user_hpage];}
eval ("\$info_hpage= \"".getTemplate("member_hpage_textlink")."\";");
}
else {$info_hpage=$lang['not_specified'];}
eval ("\$info_buddie= \"".getTemplate("member_buddie_textlink")."\";");
if ($userinfo[user_qou]!="") {$info_qoute=$PARSE->parse($userinfo[user_qou], 0, $config[text_ubb], $config[text_smilies], $config[text_images],1);}
else {$info_qoute=$lang['not_specified'];}
if ($userinfo[user_hobby]!="") {$info_hobby=$PARSE->parse($userinfo[user_hobby], 0, $config[text_ubb], $config[text_smilies], $config[text_images],1);}
else {$info_hobby=$lang['not_specified'];}
if ($userinfo[user_sig]!="") {$info_sig=$PARSE->parse($userinfo[user_sig], 0, $config[text_ubb], $config[text_smilies], $config[text_images],1);}
else {$info_sig=$lang['not_specified'];}
/********************* Warplaner Anfang *********************/
$count_win = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner<result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_lose = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner>result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_draws = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner=result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_result = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_win = $count_win[0];
$count_lose = $count_lose[0];
$count_draws = $count_draws[0];
$count_result = $count_result[0];
$h= $count_win + $count_lose + $count_draw;
$t = @round($count_win*100/$h);
$k = @number_format($count_win*100/$h, 2, ",", ".");
$r = @round($count_lose*100/$h);
$i = @number_format($count_lose*100/$h, 2, ",", ".");
$u = @round($count_draws*100/$h);
$p = @number_format($count_draws*100/$h, 2, ",", ".");
$count_won='<img border="0" src="images/war/won.gif" height="10" width="'.$t.'%" alt="" title="Sieg"> '.$k.'%';
$count_lost='<img border="0" src="images/war/lost.gif" height="10" width="'.$r.'%" alt="" title="Niederlage"> '.$i.'%';
$count_draw='<img border="0" src="images/war/draw.gif" height="10" width="'.$u.'%" alt="" title="Unentschieden"> '.$p.'%';
$result_user=$DB->query("SELECT * FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'");
$user_wins=0;
$user_lost=0;
while($result_ok=$DB->fetch_array($result_user)) {
$user_wins = $user_wins + $result_ok['result_wir'];
$user_lost = $user_lost + $result_ok['result_gegner'];}
$ds = $user_wins + $user_lost;
$mn = @round($user_wins*100/$ds);
$nm = @number_format($user_wins*100/$ds, 2, ",", ".");
$ug = @round($user_lost*100/$ds);
$gu = @number_format($user_lost*100/$ds, 2, ",", ".");
$user_won_in='<img border="0" src="images/war/won.gif" height="10" width="'.$mn.'%" alt="" title="Sieg"> '.$nm.'%';
$user_lost_in='<img border="0" src="images/war/lost.gif" height="10" width="'.$ug.'%" alt="" title="Niederlage"> '.$gu.'%';
if($count_win>0 or $count_lose>0 or $count_draws>0){
eval ("\$infos_war= \"".getTemplate("war/user_stats")."\";");}
$join_count_ok=$DB->fetch_array($DB->query("SELECT count(id) FROM `".$db_tab['war_join_feld']."` WHERE `join_id`='".intval($userinfo['user_id'])."'"));
if($join_count_ok[0]>0)
eval ("\$infos_war.= \"".getTemplate("war/user_join_info_link")."\";");
/********************* Dienstgrade ***********************/
if ($count_win>=10) $dstgrd=='<img src="images/dstgrd/og.gif">';
elseif ($count_win>=5) $dstgrd=='<img src="images/dstgrd/g.gif">';
elseif ($count_win>=0) $dstgrd=='<img src="images/dstgrd/s.gif">';
/********************* Dienstgrade ***********************/
/********************* Warplaner Ende ***********************/
if ($config[avatar_eod]!=0) {
if ($userinfo[user_avatar]!="" && @filecheck($config['avatar_path']."/".$userinfo[user_avatar])) {$avatar_dimension[3]=@getimagesize("images/avatar/$userinfo[user_avatar]"); eval ("\$avatar_show= \"".getTemplate("user_avatar_show","")."\";");}
else {$avatar_show=$lang['no_avatar_selected'];}
eval ("\$avatar_eod= \"".getTemplate("userinfo_avatar")."\";");
}
else {eval ("\$avatar_eod= \"".getTemplate("userinfo_avatar_off")."\";");}
if ($config[forum_eod]==1) {
$info_userposts=($userinfo[user_posts]+$userinfo[user_postdelay]);
if ($info_userposts<0) {$info_userposts=0;}
if ($info_userposts>0) {
$posts_per_day=number_format(($info_userposts/(ceil(($time_now-$userinfo['signin'])/86400))),1,",",".");
$threadcount=$DB->fetch_array($DB->query("SELECT COUNT(*) FROM ".$db_tab['forumthread']." WHERE forumthread_autorid='".$userinfo['user_id']."'"));
$info_threadcount=$threadcount[0];
$forumrank=$DB->fetch_array($DB->query("SELECT forumrank_title FROM ".$db_tab['forumrank']." WHERE forumrank_post<='".$info_userposts."' ORDER by forumrank_post DESC"));
$forumrank=$forumrank['forumrank_title'];
$lastpost=$DB->fetch_array($DB->query("SELECT ".$db_tab['forumpost'].".forumpost_threadid, ".$db_tab['forumpost'].".forumpost_id FROM ".$db_tab['forumpost']." LEFT JOIN ".$db_tab['forumthread']." ON ".$db_tab['forumthread'].".forumthread_id=".$db_tab['forumpost'].".forumpost_threadid LEFT JOIN ".$db_tab['forumcat']." ON ".$db_tab['forumcat'].".forumcat_id=".$db_tab['forumthread'].".forumthread_catid WHERE (".sqlrights("".$db_tab['forumcat'].".forumcat_rrights")." OR ".$db_tab['forumcat'].".forumcat_mods LIKE '%-".$user_id."-%' OR ".$db_tab['forumcat'].".forumcat_user LIKE '%-".$user_id."-%') AND ".$db_tab['forumpost'].".forumpost_autorid=".$userinfo['user_id']." ORDER BY ".$db_tab['forumpost'].".forumpost_time DESC LIMIT 1"));
if ($lastpost[0]!="") {
$forumthread=$DB->fetch_array($DB->query("SELECT forumthread_id, forumthread_title, forumthread_catid FROM ".$db_tab['forumthread']." WHERE forumthread_id='".$lastpost['forumpost_threadid']."'"));
$forumcat=$DB->fetch_array($DB->query("SELECT forumcat_id, forumcat_name FROM ".$db_tab['forumcat']." WHERE forumcat_id='".$forumthread['forumthread_catid']."'"));
eval ("\$forumpost_info= \"".getTemplate("userinfo_foruminfo_lastthread")."\";");
}
else {$forumpost_info='-';}
}
else {
$forumrank='-';
$forumpost_info='-';
$info_threadcount='-';
}
eval ("\$foruminfo= \"".getTemplate("userinfo_foruminfo")."\";");
}
else {unset($foruminfo);}
if ($config[member_gbook]==1 && getrights("user")=="true") {eval ("\$info_user_gbook= \"".getTemplate("userinfo_gbook_linkbox")."\";");}
include ("login/inc.nav_user.php");
eval ("\$site_body.= \"".getTemplate("userinfo","")."\";");
}
else {$event=1; include("admin/config/event.php");}
?> | |  |
User_stats.htm
Wenn ich dein Code den du mir zuletzt gepostet hast einfüge sagt er das:
Parse error: syntax error, unexpected ';' in /home/steirer/public_html/login/userinfo.php(134) : eval()'d code on line 1
Oder hab ich nochwas vergessen wenn du noch irgentwas aus dem Code brauchst sag bescheid ich poste den dann.
PS: Er soll nen Dienstgrad Bild ausgeben da wo er bei den Usern die Warstatistik ausgibt.
|
|
|
|
|
|
|
 |
|
 |
|
 |
27.04.2008 - 17:12 Uhr |
|
|
|
Sry das ich wieder nachfragen tue aber ich bin wohl zu blöd das zu machen.
Ich habe es jetzt mal eingebaut aber er gibt es nicht aus muss ich noch in einer anderen Datei
was ändern oder noch was beachten.
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | | PHP-Quelltext <?php
if (getrights($config['member_infoshow'])=="true") {
if (!$_REQUEST['id'] && $USER['id']!=0) $id=$USER['id'];
else $id=$_REQUEST['id'];
$userinfo=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['user']." where user_id='".$id."' LIMIT 1"));
$info_nick=$userinfo['user_nick'];
if ($userinfo['user_bd_day']!=0 && $userinfo['user_bd_month']!=0 && $userinfo['user_bd_year']!=0) {
$info_birthday=$userinfo['user_bd_day'].". ";
$month=$lang['all_month'];
$month=$month[$userinfo['user_bd_month']];
$info_birthday.=$month[1]." ";
$info_birthday.=$userinfo['user_bd_year']." - ".$lang['age'].": ".getAge($userinfo[user_bd_day],$userinfo[user_bd_month],$userinfo[user_bd_year]);
}
else {$info_birthday=$lang['not_specified'];}
if ($userinfo['user_sex']=="w") $info_sex=$lang['female'];
elseif ($userinfo['user_sex']=="m") $info_sex=$lang['male'];
else $info_sex=$lang['not_specified'];
if ($userinfo[user_country]!="") {eval ("\$info_country= \"".getTemplate("member_country_text_".$userinfo[user_country]."")."\";");}
else {$info_country=$lang['not_specified'];}
$info_signin=formattime($userinfo['signin'],'','date');
if ($userinfo['logtime']>0) {$info_logtime=formattime($userinfo['logtime']);}
else {$userinfo_logtime=" - ";}
if ($userinfo[user_status]=="admin") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['admin_female'];} else {$info_userstatus=$lang['admin'];}}
elseif ($userinfo[user_status]=="mod") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['mod_female'];} else {$info_userstatus=$lang['mod'];}}
elseif ($userinfo[user_status]=="member") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['member_female'];} else {$info_userstatus=$lang['member'];}}
elseif ($userinfo[user_status]=="user") {if ($userinfo[user_sex]=="w") {$info_userstatus=$lang['user_female'];} else {$info_userstatus=$lang['user'];}}
elseif ($userinfo[user_status]=="ban") {$info_userstatus=$lang['banned'];}
if ($userinfo['user_groupid']!=0) {
$group=$DB->fetch_array($DB->query("SELECT usergroup_name FROM ".$db_tab['usergroup']." WHERE usergroup_id='".$userinfo['user_groupid']."' LIMIT 1"));
if (trim($group[0])!='') $info_usergroup=$group[0];
else eval ("\$info_usergroup= \"".getTemplate("userinfo_nousergroup")."\";");
}
else eval ("\$info_usergroup= \"".getTemplate("userinfo_nousergroup")."\";");
if (isonline($userinfo['user_id'])) $info_os=$lang['online'];
else $info_os=$lang['offline'];
$userfields=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['userfields']." WHERE userid='".$userinfo['user_id']."' LIMIT 1"));
$info_extended='';
$getprofilefields=$DB->query("SELECT * FROM ".$db_tab['profilefields']." ORDER by profilefields_order ASC");
while ($profilefields=$DB->fetch_array($getprofilefields)) {
$f="field_".$profilefields['profilefields_id'];
if (($fieldcontent=htmlentities($userfields[$f]))=='') $fieldcontent=$lang['not_specified'];
$fieldname=$profilefields['profilefields_name'];
eval ("\$info_extended.= \"".getTemplate("userinfo_ext")."\";");
}
if ($userinfo[user_emailshow]==1) {
if ($config[member_mailer]==1) {eval ("\$info_email= \"".getTemplate("member_email_textlink2")."\";");}
else {eval ("\$info_email= \"".getTemplate("member_email_textlink")."\";");}
}
else {$info_email=$lang['not_specified'];}
if ($userinfo[user_imoption]==1) {eval ("\$info_im= \"".getTemplate("member_sendim_textlink")."\";");}
else {$info_im=$lang['receiving_not_wanted'];}
if ($userinfo[user_icqid]!=0) {eval ("\$info_icq= \"".getTemplate("member_icq_iconlink_2")."\";");}
else {$info_icq=$lang['not_specified'];}
if ($userinfo[user_aimid]!="") {eval ("\$info_aim= \"".getTemplate("member_aim_textlink")."\";");}
else {$info_aim=$lang['not_specified'];}
if ($userinfo[user_yim]!="") {eval ("\$info_yim= \"".getTemplate("member_yim_textlink")."\";");}
else {$info_yim=$lang['not_specified'];}
if ($userinfo[user_hpage]!="") {
if (ereg("http://",$userinfo[user_hpage])) {$info_link=$userinfo[user_hpage];}
else {$info_link="http://".$userinfo[user_hpage];}
eval ("\$info_hpage= \"".getTemplate("member_hpage_textlink")."\";");
}
else {$info_hpage=$lang['not_specified'];}
eval ("\$info_buddie= \"".getTemplate("member_buddie_textlink")."\";");
if ($userinfo[user_qou]!="") {$info_qoute=$PARSE->parse($userinfo[user_qou], 0, $config[text_ubb], $config[text_smilies], $config[text_images],1);}
else {$info_qoute=$lang['not_specified'];}
if ($userinfo[user_hobby]!="") {$info_hobby=$PARSE->parse($userinfo[user_hobby], 0, $config[text_ubb], $config[text_smilies], $config[text_images],1);}
else {$info_hobby=$lang['not_specified'];}
if ($userinfo[user_sig]!="") {$info_sig=$PARSE->parse($userinfo[user_sig], 0, $config[text_ubb], $config[text_smilies], $config[text_images],1);}
else {$info_sig=$lang['not_specified'];}
/********************* Warplaner Anfang *********************/
$count_win = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner<result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_lose = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner>result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_draws = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner=result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_result = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_win = $count_win[0];
$dstgrd = $dstgrd[0];
$count_lose = $count_lose[0];
$count_draws = $count_draws[0];
$count_result = $count_result[0];
$h= $count_win + $count_lose + $count_draw;
$t = @round($count_win*100/$h);
$k = @number_format($count_win*100/$h, 2, ",", ".");
$r = @round($count_lose*100/$h);
$i = @number_format($count_lose*100/$h, 2, ",", ".");
$u = @round($count_draws*100/$h);
$p = @number_format($count_draws*100/$h, 2, ",", ".");
$count_won='<img border="0" src="images/war/won.gif" height="10" width="'.$t.'%" alt="" title="Sieg"> '.$k.'%';
$count_lost='<img border="0" src="images/war/lost.gif" height="10" width="'.$r.'%" alt="" title="Niederlage"> '.$i.'%';
$count_draw='<img border="0" src="images/war/draw.gif" height="10" width="'.$u.'%" alt="" title="Unentschieden"> '.$p.'%';
$result_user=$DB->query("SELECT * FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'");
$user_wins=0;
$user_lost=0;
while($result_ok=$DB->fetch_array($result_user)) {
$user_wins = $user_wins + $result_ok['result_wir'];
$user_lost = $user_lost + $result_ok['result_gegner'];}
$ds = $user_wins + $user_lost;
$mn = @round($user_wins*100/$ds);
$nm = @number_format($user_wins*100/$ds, 2, ",", ".");
$ug = @round($user_lost*100/$ds);
$gu = @number_format($user_lost*100/$ds, 2, ",", ".");
$user_won_in='<img border="0" src="images/war/won.gif" height="10" width="'.$mn.'%" alt="" title="Sieg"> '.$nm.'%';
$user_lost_in='<img border="0" src="images/war/lost.gif" height="10" width="'.$ug.'%" alt="" title="Niederlage"> '.$gu.'%';
/********************* Dienstgrade ***********************/
if ($count_win>10) $dstgrd=='<img border="0" src="images/dstgrd/og.gif" height="43" width="100" alt="Obergefreiter">';
elseif ($count_win>5) $dstgrd=='<img border="0" src="images/dstgrd/g.gif" height="43" width="100" alt="Gefreiter">';
elseif ($count_win>0) $dstgrd=='<img border="0" src="images/dstgrd/s.gif" height="43" width="100" alt="Schütze">';
/********************* Dienstgrade ***********************/
if($count_win>0 or $count_lose>0 or $count_draws>0){
eval ("\$infos_war= \"".getTemplate("war/user_stats")."\";");
}
$join_count_ok=$DB->fetch_array($DB->query("SELECT count(id) FROM `".$db_tab['war_join_feld']."` WHERE `join_id`='".intval($userinfo['user_id'])."'"));
if($join_count_ok[0]>0)
eval ("\$infos_war.= \"".getTemplate("war/user_join_info_link")."\";");
/********************* Warplaner Ende ***********************/
if ($config[avatar_eod]!=0) {
if ($userinfo[user_avatar]!="" && @filecheck($config['avatar_path']."/".$userinfo[user_avatar])) {$avatar_dimension[3]=@getimagesize("images/avatar/$userinfo[user_avatar]"); eval ("\$avatar_show= \"".getTemplate("user_avatar_show","")."\";");}
else {$avatar_show=$lang['no_avatar_selected'];}
eval ("\$avatar_eod= \"".getTemplate("userinfo_avatar")."\";");
}
else {eval ("\$avatar_eod= \"".getTemplate("userinfo_avatar_off")."\";");}
if ($config[forum_eod]==1) {
$info_userposts=($userinfo[user_posts]+$userinfo[user_postdelay]);
if ($info_userposts<0) {$info_userposts=0;}
if ($info_userposts>0) {
$posts_per_day=number_format(($info_userposts/(ceil(($time_now-$userinfo['signin'])/86400))),1,",",".");
$threadcount=$DB->fetch_array($DB->query("SELECT COUNT(*) FROM ".$db_tab['forumthread']." WHERE forumthread_autorid='".$userinfo['user_id']."'"));
$info_threadcount=$threadcount[0];
$forumrank=$DB->fetch_array($DB->query("SELECT forumrank_title FROM ".$db_tab['forumrank']." WHERE forumrank_post<='".$info_userposts."' ORDER by forumrank_post DESC"));
$forumrank=$forumrank['forumrank_title'];
$lastpost=$DB->fetch_array($DB->query("SELECT ".$db_tab['forumpost'].".forumpost_threadid, ".$db_tab['forumpost'].".forumpost_id FROM ".$db_tab['forumpost']." LEFT JOIN ".$db_tab['forumthread']." ON ".$db_tab['forumthread'].".forumthread_id=".$db_tab['forumpost'].".forumpost_threadid LEFT JOIN ".$db_tab['forumcat']." ON ".$db_tab['forumcat'].".forumcat_id=".$db_tab['forumthread'].".forumthread_catid WHERE (".sqlrights("".$db_tab['forumcat'].".forumcat_rrights")." OR ".$db_tab['forumcat'].".forumcat_mods LIKE '%-".$user_id."-%' OR ".$db_tab['forumcat'].".forumcat_user LIKE '%-".$user_id."-%') AND ".$db_tab['forumpost'].".forumpost_autorid=".$userinfo['user_id']." ORDER BY ".$db_tab['forumpost'].".forumpost_time DESC LIMIT 1"));
if ($lastpost[0]!="") {
$forumthread=$DB->fetch_array($DB->query("SELECT forumthread_id, forumthread_title, forumthread_catid FROM ".$db_tab['forumthread']." WHERE forumthread_id='".$lastpost['forumpost_threadid']."'"));
$forumcat=$DB->fetch_array($DB->query("SELECT forumcat_id, forumcat_name FROM ".$db_tab['forumcat']." WHERE forumcat_id='".$forumthread['forumthread_catid']."'"));
eval ("\$forumpost_info= \"".getTemplate("userinfo_foruminfo_lastthread")."\";");
}
else {$forumpost_info='-';}
}
else {
$forumrank='-';
$forumpost_info='-';
$info_threadcount='-';
}
eval ("\$foruminfo= \"".getTemplate("userinfo_foruminfo")."\";");
}
else {unset($foruminfo);}
if ($config[member_gbook]==1 && getrights("user")=="true") {eval ("\$info_user_gbook= \"".getTemplate("userinfo_gbook_linkbox")."\";");}
include ("login/inc.nav_user.php");
eval ("\$site_body.= \"".getTemplate("userinfo","")."\";");
}
else {$event=1; include("admin/config/event.php");}
?> | |  |
Sry das ich euch heute das Ohr ab kaue.^^
Nehmt es mir nicht übel.
|
|
|
|
|
|
|
 |
|
 |
27.04.2008 - 19:39 Uhr |
|
|
|
Juhu es geht und so ein mist Fehler und ich Rätsel da den ganzen Tag.
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | | PHP-Quelltext /********************* Warplaner Anfang *********************/
$count_win = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner<result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_lose = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner>result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_draws = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_gegner=result_wir AND result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_result = $DB->fetch_array($DB->query("SELECT count(id) FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'"));
$count_win = $count_win[0];
$count_lose = $count_lose[0];
$count_draws = $count_draws[0];
$count_result = $count_result[0];
$dstgrd = "0"; //hier war der haken zumindest geht es jetzt so
$h= $count_win + $count_lose + $count_draw;
$t = @round($count_win*100/$h);
$k = @number_format($count_win*100/$h, 2, ",", ".");
$r = @round($count_lose*100/$h);
$i = @number_format($count_lose*100/$h, 2, ",", ".");
$u = @round($count_draws*100/$h);
$p = @number_format($count_draws*100/$h, 2, ",", ".");
$count_won='<img border="0" src="images/war/won.gif" height="10" width="'.$t.'%" alt="" title="Sieg"> '.$k.'%';
$count_lost='<img border="0" src="images/war/lost.gif" height="10" width="'.$r.'%" alt="" title="Niederlage"> '.$i.'%';
$count_draw='<img border="0" src="images/war/draw.gif" height="10" width="'.$u.'%" alt="" title="Unentschieden"> '.$p.'%';
$result_user=$DB->query("SELECT * FROM ".$db_tab['war_result']." WHERE result_user LIKE '%-".addslashes($userinfo['user_id'])."-%'");
$user_wins=0;
$user_lost=0;
/********************* Dienstgrade ***********************/
if ($count_win>=10) {$dstgrd='<img border="0" src="images/dstgrd/og.gif" height="43" width="100" alt="Obergefreiter">';}
elseif ($count_win>=5) {$dstgrd='<img border="0" src="images/dstgrd/g.gif" height="43" width="100" alt="Gefreiter">';}
elseif ($count_win>=0) {$dstgrd='<img border="0" src="images/dstgrd/s.gif" height="43" width="100" alt="Schütze">';}
/********************* Dienstgrade ***********************/
while($result_ok=$DB->fetch_array($result_user)) {
$user_wins = $user_wins + $result_ok['result_wir'];
$user_lost = $user_lost + $result_ok['result_gegner'];}
$ds = $user_wins + $user_lost;
$mn = @round($user_wins*100/$ds);
$nm = @number_format($user_wins*100/$ds, 2, ",", ".");
$ug = @round($user_lost*100/$ds);
$gu = @number_format($user_lost*100/$ds, 2, ",", ".");
$user_won_in='<img border="0" src="images/war/won.gif" height="10" width="'.$mn.'%" alt="" title="Sieg"> '.$nm.'%';
$user_lost_in='<img border="0" src="images/war/lost.gif" height="10" width="'.$ug.'%" alt="" title="Niederlage"> '.$gu.'%';
if($count_win>0 or $count_lose>0 or $count_draws>0){
eval ("\$infos_war= \"".getTemplate("war/user_stats")."\";");
}
$join_count_ok=$DB->fetch_array($DB->query("SELECT count(id) FROM `".$db_tab['war_join_feld']."` WHERE `join_id`='".intval($userinfo['user_id'])."'"));
if($join_count_ok[0]>0)
eval ("\$infos_war.= \"".getTemplate("war/user_join_info_link")."\";");
/********************* Warplaner Ende ***********************/ | |  |
Ich bedanke mich recht herzlich für die gegebene Hilfe.
Kann geclosed werden. Außer ihr habt noch was.
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von chopper - 27.04.2008 - 19:40 Uhr |
|
|
|
|
|
|
|
 |
|
 |
27.04.2008 - 19:54 Uhr |
|
|
|
Auf Wunsch geschlossen

|
|
|
|
|
|
|
 |
|
 |
Geschlossen |
|
|
|
 |
Ähnliche Themen |
|
Es wurden keine ähnlichen Themen gefunden.
|
|
|
|
|
|
|
|
|
|