Kleine Frage nur.. kann ich die Anzahl der Comments eines Users in seinem Profil anzeigen lassen und wenn ja, wie?
Zuletzt modifiziert von LittleBIGFan am 04.05.2010 - 15:08:04
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
1 | $row['koms'] = db_count_query("SELECT COUNT(id) FROM `prefix_koms` WHERE uid = ".$uid.""); |
1 | $row['koms'] = db_count_query('SELECT COUNT(id) FROM `prefix_koms` WHERE name="'.$row['name'].'"'); |
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 | <?php # Copyright by: Manuel Staechele # Support: www.ilch.de function get_last_user_wars( $userid , $game ){ $s = '' ; $q = db_query( "SELECT `wid` FROM `prefix_warmember` WHERE uid = '" . $userid . "' AND aktion = '1' ORDER BY wid DESC LIMIT 20" ); if (db_num_rows( $q ) > 0 ) { $wids = array (); while ( $row = db_fetch_object( $q )) { $wids [] = $row ->wid; } $wids = implode( ', ' , $wids ); } if ( ! empty ( $wids ) ) { $erg = db_query("SELECT id, gegner, tag, wlp, land, owp, opp FROM prefix_wars WHERE id IN ( $wids ) AND status = '3' AND game = '".$game."' "); if (db_num_rows( $erg ) > 0 ) { while ( $r = db_fetch_assoc( $erg )) { if ( $class == 'Cmite' ) { $class = 'Cnorm' ; } else { $class = 'Cmite' ; } $r [ 'tag' ] = ( empty ( $r [ 'tag' ]) ? $r [ 'gegner' ] : $r [ 'tag' ] ); if ( $r [ 'wlp' ] == 1) { $bild = 'include/images/icons/win.gif' ; $color = '#558e3d' ; } elseif ( $r [ 'wlp' ] == 2) { $bild = 'include/images/icons/los.gif' ; $color = '#a91d1d' ; } elseif ( $r [ 'wlp' ] == 3) { $bild = 'include/images/icons/pad.gif' ; $color = '#f0770d' ; } $s .= '<td class="' . $class . '" width="1%"><img src="' . $bild . '" alt="" / ></td><td class="' . $class . '" width="99%"><div style="width:80%; float:left"><img src="include/images/flags/' . $r [ 'land' ]. '" alt="' . $r [ 'land' ]. '"/> <a href="index.php?wars-more-' . $r [ 'id' ]. '">' . $r [ 'tag' ]. '</a></div><div style="float:left; text-align:right; color:' . $color . '; width:20%;">' . $r [ 'owp' ]. ':' . $r [ 'opp' ]. '</div></td></tr>' ; } } else { $s .= '<td class="Cmite" width="10%">Keine Wars</td>' ; } } else { $s .= '<td class="Cmite" width="10%">Keine Wars</td>' ; } return ( $s ); } $uid = $menu ->get(2); $abf = 'SELECT * FROM prefix_user WHERE id = "' . $uid . '"' ; $erg = db_query( $abf ); $row = db_fetch_assoc( $erg ); $avatar = '' ; if ( file_exists ( $row [ 'avatar' ])) { $avatar = '<img src="' . $row [ 'avatar' ]. '" border="0">' ; } $row [ 'koms' ] = db_count_query( 'SELECT COUNT(id) FROM `prefix_koms` WHERE name="' . $row [ 'name' ]. '"' ); $regsek = mktime ( 0,0,0, date ( 'm' ), date ( 'd' ), date ( 'Y' ) ) - $row [ 'regist' ]; $regday = round ( $regsek / 86400); $postpday = ( $regday == 0 ? 0 : round ( $row [ 'posts' ] / $regday , 2 ) ); if ( empty ( $row [ 'xfire' ])) { $xfire_online = '' ; $xfire_onlinet = '' ;} else { if ( $allgAr [ 'xfire_online' ] == '1' ){ $xfire_online = '<img src="http://de.miniprofile.xfire.com/bg/co/type/3/' . $row [ 'xfire' ]. '.png" />' ; } else { $xfire_online = '' ; } if ( $allgAr [ 'xfire_online' ] == '1' ){ $xfire_onlinet = 'X-Fire' ; } else { $xfire_onlinet = '' ; } } $ar = array ( 'NAME' => $row [ 'name' ], 'JOINED' => date ( 'd M Y' , $row [ 'regist' ]), 'LASTAK' => date ( 'd M Y - H:i' , $row [ 'llogin' ]), 'POSTS' => $row [ 'posts' ], 'postpday' => $postpday , 'RANG' => userrang ( $row [ 'posts' ], $uid ), 'AVATA' => $avatar , 'UID' => $uid , 'XFIRE' => $xfire_online , 'XFIREt' => $xfire_onlinet , ); $title = $allgAr [ 'title' ]. ' :: Users :: Details von ' . $row [ 'name' ]; $hmenu = $extented_forum_menu . '<a class="smalfont" href="index.php?user">Users</a><b> » </b> Details von ' . $row [ 'name' ]. $extented_forum_menu_sufix ; $design = new design ( $title , $hmenu , 1); $design ->header(); $tpl = new tpl ( 'user/userdetails' ); $l = profilefields_show ( $uid ); $ar [ 'rowspan' ] = 4 + substr_count( $l , '<tr><td class="' ); $ar [ 'profilefields' ] = $l ; $tpl ->set_ar_out( $ar ,0); $tpl ->set_out( 'BF2' , get_last_user_wars( $uid , 'BF2' ),1); $tpl ->set_out( 'BFBC2' , get_last_user_wars( $uid , 'BFBC2' ),2); $tpl ->set_out( 'CoD4' , get_last_user_wars( $uid , 'CoD4' ),3); $tpl ->set_out( 'MW2' , get_last_user_wars( $uid , 'MW2' ),4); $tpl ->set_out( 'MoH' , get_last_user_wars( $uid , 'MoH' ),5); $design ->footer(); ?> |
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 | <a href="javascript:history.back(1)"><b>«</b> {_lang_back}</a> <br /> <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="3"><b>{_lang_detailsfrom} {NAME}</b></th> </tr><tr> <td class="Cmite" width="30%">{_lang_nickname}</td> <td class="Cnorm" width="40%">{NAME}</td> <td class="Cnorm" width="30%" rowspan="{rowspan}" valign="top" align="center"> <br /> {AVATA} <br /> <br /> {XFIREt} <br /> {XFIRE} <br /> <br /> <font class="smalfont">{RANG}</font> <br /> <br /><a href="javascript:void(0)" onclick="javascript:chatWith({UID},'{NAME}')">Messenger</a> </td> </tr><tr> <td class="Cmite">{_lang_lastactivity}</td> <td class="Cnorm">{LASTAK}</td> </tr><tr> <td class="Cmite">{_lang_comments}</td> <td class="Cnorm">{koms}</td> </tr><tr> <td class="Cmite">{_lang_posts2}</td> <td class="Cnorm">{POSTS}, {_lang_perday}: {postpday}</td> {profilefields} </table> <br /> {EXPLODE} <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2"> Battlefield2 Wars von {NAME}</b></th></tr><tr> {BF2} </tr></table> {EXPLODE} <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2"> Battlefield Bad Company 2 Wars von {NAME}</b></th></tr><tr> {BFBC2} </tr></table> {EXPLODE} <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2"> Call of Duyt 4 Wars von {NAME}</b></th></tr><tr> {CoD4} </tr></table> {EXPLODE} <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2"> Modern Warefare 2 Wars von {NAME}</b></th></tr><tr> {MW2} </tr></table> {EXPLODE} <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2"> Medal of Honor Wars von {NAME}</b></th></tr><tr> {MoH} </tr></table> <br /> <a href="javascript:history.back(1)"><b>«</b> {_lang_back}</a> |
1 2 3 | $ar = array ( 'koms' => $row [ 'koms' ], ); |
Geschlossen | ||
![]() |
Zurück zu Allgemein |