ich hab mal wieder ein Problem und hoffe, dass ihr mir weiterhelfen könnt.
Ich hatte mir vor ein paar Tagen das Modul "benutzercenter1.1" heruntergeladen und installiert. Funktionierte soweit auch alles einwandfrei. Nun gefiel mir die Aufmachung der .htm Datei nicht sonderlich, sodass ich sie ein wenig umgebaut hatte. Dabei dachte ich mir ein paar neue Felder einfließen zu lassen.
Nun hab ich ein paar kleine Probleme bei der Ausgabe bzw. Umsetzung:
- Zum einen möchte ich gern das Avatar anzeigen lassen und hatte einfach zum Test {avatar} in das Feld, in dem es angezeigt werden soll, eingeben. Dadurch wird mir nun der Link zum Bild angezeigt, aber leider nicht das Bild selbst.
- Zum anderen möchte ich gern das Grundrecht des jeweiligen Benutzers anzeigen lassen und hatte dabei ebenfalls zum Test {recht} eingeben, wodurch mir das Grundrecht zwar als Zahl (in meinem Fall -9) dargestellt wird aber nicht als Wort.
- Dann hatte ich ausserdem vor, den Zugang zum Admin Menü in das Benutzercenter einfliessen zu lassen. Den Link hab ich hinbekommen, allerdings würde ich es gern so umsetzen, dass es wie in der login box, nur angezeigt wird, wenn man auch adminrechte hat.
- Ausserdem hat das Benutzercenter die Funktion, dass es die letzten 3 Beiträge aus dem Forum anzeigt. Dies würde ich auch gern für "News", "Umfragen" und "Profilbesucher" umsetzen.
Ich vermute jetzt mal, dass ich in der benutzercenter.php irgendwas zur Umsetzung einbauen muss, aber ich weiss leider nicht was.
Hätte da jemand 'ne Idee, wie ich das umsetzen kann???
- Zu guter Letzt würde ich es gerne umsetzen, dass wenn man sich einloggt automatisch im Benutzercenter landet und nicht erst den Zwischenschritt über den Link dorthin machen muss. Dazu hatte ich auch bereits im Forum gesucht und einiges gefunden, was aber bei mir fraglicherweise nicht funktionierte. Unter anderem einen Beitrag von Mairu, in dem stand, dass in der include/includes/func/user.php was abändern muss. Den Code dazu hatte er auch angegeben, den ich eingesetzt hatte, aber danach der login gar nicht mehr funktionierte.
Ich wäre um jede Hilfe, egal zu welchem Punkt, wirklich dankbar.
Gruß, CiSeN
betroffene Homepage: t-h-c-headquarters.de
edit: Hier sind noch die php und htm Dateien:
htm:
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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | <script type="text/javascript"> function show (member) { if (document.getElementById) { if (document.getElementById(member).style.display == "block") { document.getElementById(member).style.display = "none"; } else { document.getElementById(member).style.display = "block"; } } } </script> {EXPLODE} <form method="post"> <table width="100%" cellpadding="0" cellspacing="0"> <tr><td colspan="2"> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="3"><b>Userinfos</b></th> </tr> <tr> <td class="Cmite">Dein Status</td> <td class="Cnorm" width="40%"> <input id="status1" type="radio" name="status" {_if_{status}=='1'}checked="checked"{/_endif} value="1" /> <label for="status1">Aktiv</label> <input id="status0" type="radio" name="status" {_if_{status}=='0'}checked="checked"{/_endif} value="0" /> <label for="status0">Inaktiv</label> <input type="submit" name="submit" value="Speichern" /> </td> <td class="Cnorm" width="30%" rowspan="7" valign="top" align="center"> <br /> {avatar} <br /><br /> <a href="index.php?user-3"><b><center>Logout</center></b></a> <br /> </td> </tr> <tr> <td class="Cmite">Dein Nickname</td> <td class="Cnorm">{name}</td> </tr> <tr> <td class="Cmite">Dein Rang</td> <td class="Cnorm">{recht}</td> </tr> <tr> <td class="Cmite">Deine Private Messages</td> <td class="Cnorm">{check_pm} Stück ungelesen</td> </tr> <tr> <td class="Cmite">Dein Profil</td> <td class="Cnorm"><a href="index.php?user-details-{id}">Ansehen</a></td> </tr> <tr> <td class="Cmite">Deine Forumbeiträge</td> <td class="Cnorm"><a href="index.php?forum-aeit">Ansehen</a></td> </tr> <tr> <td class="Cmite">Deine Buddies</td> <td class="Cnorm"><a href="index.php?freunde">Who is online?</a></td> </tr> </table> <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="4"><img src="include/images/usercenter/organizer.png" alt="user" width="16" height="16" /> <a href="javascript:show('B')">Desktop</a></th> </tr> </table> <table width="100%" cellpadding="3" cellspacing="1" class="border" id="B" style="display:none"> <tr> <td width="145" height="160" valign="top"> <img src="include/images/usercenter/pm.png" alt="user" width="48" height="48" /> <br /> <strong><u>Private Messages</u></strong> <br /> <br /> <b>· </b><a href="index.php?forum-privmsg">Lesen</a> <br /> <b>· </b><a href="index.php?forum-privmsg-new">Verfassen</a> <br /> <br /> </td> <td width="145" height="160" valign="top"> <img src="include/images/usercenter/news.png" alt="user" width="48" height="48" /> <br /> <strong><u>News</u></strong> <br /> <br /> <b>· </b><a href="index.php?news">Ansehen</a> <br /> <b>· </b><a href="index.php?news-archiv">Archiv</a> <br /> <b>· </b><a href="index.php?news-add">Einsenden</a> <br /> <br /> </td> <td width="145" height="160" valign="top"> <img src="include/images/usercenter/forum.png" alt="user" width="48" height="48" /> <br /> <strong><u>Forum</u></strong> <br /> <br /> <b>· </b><a href="index.php?forum">Eingang</a> <br /> <b>· </b><a href="index.php?forum-augt">Neue Posts</a> <br /> <br /> </td> <td width="145" height="160" valign="top"> <img src="include/images/usercenter/infos.png" alt="user" width="48" height="48" /> <br /> <strong><u>Info Center</u></strong> <br /> <br /> <b>· </b><a href="index.php?kalender">Kalender</a> <br /> <b>· </b><a href="index.php?wars">Matches</a> <br /> <b>· </b><a href="index.php?vote">Umfragen</a> <br /> <br /> </td> </tr> <tr> <td width="145" height="160" valign="top"> <img src="include/images/usercenter/settings.png" alt="user" width="48" height="48" /> <br /> <strong><u>Settings</u></strong> <br /> <br /> <b>· </b><a href="index.php?user-8">Profil bearbeiten</a> <br /> <b>· </b><a href="index.php?map">Wohnort eintragen</a> <br /> <b>· </b>{ADMIN} <br /> <br /> </td> <td width="145" height="160" valign="top"> <img src="include/images/usercenter/support.png" alt="user" width="48" height="48" /> <br /> <strong><u>Support</u></strong> <br /> <br /> <b>· </b><a href="index.php?counterstrikesource">Counter-Strike</a> <br /> <b>· </b><a href="index.php?FAQs">FAQs</a> <br /> <br /> </td> {_if_{showNotiz}=='1'} <td colspan="2" height="160" valign="top"> <center><b><u>Deine Notiz(en)</u> <br /> <br /> (SPEICHERN KLAPPT NOCH NICHT!!!)</b></center> <br /> <textarea cols="40" rows="5" name="notiztext">{notiztext}</textarea> <br /> <center><input type="submit" name="submit" value="Speichern" /></center> </td> {/_endif} </tr> </table> <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="4"><img src="include/images/usercenter/feder.png" alt="user" width="16" height="16" /> <a href="javascript:show('C')">Letzte Beiträge</a></th> </tr> </table> <table width="100%" cellpadding="3" cellspacing="1" class="border" id="C" style="display:none"> <tr> <td width="145" height="160" class="Cmite" valign="top"> <div align="center"> <strong>News:</strong> <br /> <br /> {last_news} </div> <br/> </td> <td width="145" height="160" class="Cmite" valign="top"> <div align="center"> <strong>Forum:</strong> <br /> <br /> {last_forum} </div> <br/> </td> <td width="145" height="160" class="Cmite" valign="top"> <div align="center"> <strong>Umfragen:</strong> </div> <br /> {last_vote} <br/> </td> <td width="145" height="160" class="Cmite" valign="top"> <div align="center"> <strong>Profilbesucher:</strong> </div> <br /> {last_visits} <br /> </td> </tr> </table> <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="4"><img src="include/images/usercenter/flagge.png" alt="user" width="16" height="16" /> <a href="javascript:show('D')">Dein Userbanner</a></th> </tr> </table> <table width="100%" cellpadding="3" cellspacing="1" class="border" id="D" style="display:none"> <tr> {_if_{showBanner}=='1'} <td colspan="4" valign="top"> <center> <br /> <img src="index.php?benutzercenter-banner-{id}" alt="userbanner" /> <br /> <br /> </center> </td> </tr> <tr> <td colspan="4"> <center><strong><u>Html-Code</u></strong></center> <center><textarea readonly="readonly" name="textarea" cols="88" rows="1"><a href="{profillink}"><img src="{imgsrc}" alt="userbanner" /></a></textarea></center> </td> </tr> <tr> <td colspan="4"> <center><strong><u>BB-Code</strong></u></center> <center><textarea readonly="readonly" name="textarea2" cols="88" rows="1">[url={profillink}][img]{imgsrc}[/img][/url]</textarea></center> </td> {/_endif} </tr> </table> </table> </form> |
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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | <?php defined( 'main' ) or die ( 'no direct access' ); $onlinetime = 600; if (!function_exists( 'arrayToDb' )) { function arrayToDb( $table , $ar , $where = '' , $ar2 = array ()) { $mode = empty ( $where ) ? 'INSERT INTO' : 'UPDATE' ; $fields = '' ; foreach ( $ar as $k => $v ) { if (in_array( $k , $ar2 )) { continue ; } $fields .= ", `$k` = " . ( is_null ( $v ) ? 'NULL' : "'$v'" ); } $fields = substr ( $fields , 2); $query = "$mode $table SET $fields $where;" ; if (db_query( $query )) { return true; } else { return false; } } } if ( $menu ->get(1) == 'banner' ) { // Banner anzeigen $uid = intval ( $menu ->get(2)); $abf = "SELECT u.*, IF(u.spezrank>0,r.bez,r2.bez) AS rang, IF(o.uid=u.id, 'Online' , 'Offline' ) AS online FROM prefix_user u LEFT JOIN `prefix_grundrechte` r ON u.recht = r.id LEFT JOIN `prefix_ranks` r ON u.spezrank = r.id AND r.spez = 1 LEFT JOIN `prefix_ranks` r2 ON IF(u.posts=0,1,u.posts) >= r2.min AND r2.spez = 0 LEFT JOIN `prefix_online` o ON u.id = o.uid AND o.uptime > '".date(' Y-m-d H:m:i ', time() - $onlinetime)."' WHERE u.id = { $uid }"; $qry = db_query( $abf ); if (db_num_rows( $qry ) == 0) { $fehler = 'Benutzer nicht gefunden' ; } elseif ( $row = db_fetch_assoc( $qry ) and $row [ 'recht' ] > $allgAr [ 'userbannerrecht' ]) { $fehler = 'Banner für diesen User nicht erlaubt' ; } elseif (! file_exists ( $allgAr [ 'userbannerlink' ])) { $fehler = 'Bannervorlagenbild nicht gefunden' ; } elseif ( $tmp = getimagesize ( $allgAr [ 'userbannerlink' ]) and $tmp [2] != 3) { $fehler = 'Bannervorlagenbild kein PNG' ; } else { $banner = $allgAr [ 'userbannerlink' ]; if ( $row [ 'gebdatum' ] !== "0000-00-00" ) { list( $y , $m , $d ) = explode ( '-' , $row [ 'gebdatum' ]); $gebdatum = "$d.$m.$y" ; $alter = '(' .(( date ( 'Y' ) - $y ) - (( date ( 'm' ) < $m or ( date ( 'm' ) == $m and date ( 'd' ) < $d )) ? 1 : 0)). ')' ; } else { $gebdatum = "n/a" ; $alter = "" ; } if ( empty ( $row [ 'wohnort' ])) { $row [ 'wohnort' ] = 'n/a' ; } if ( $row [ 'geschlecht' ] == 1) { $geschlecht = "Männlich" ; } elseif ( $row [ 'geschlecht' ] == 2) { $geschlecht = "Weiblich" ; } else { $geschlecht = "n/a" ; } $j = date ( 'd.m.Y' , $row [ 'regist' ]); $ll = date ( 'd.m.Y' , $row [ 'llogin' ]); $im = ImageCreateFromPNG( $banner ); $text1 = 'Name: ' . $row [ 'name' ]; $text2 = 'Posts: ' . $row [ 'posts' ]; $text3 = 'Dabei seit: ' . $j ; $text5 = 'Letzer Login: ' . $ll ; $text8 = 'Geschlecht: ' . $geschlecht ; $text7 = 'Wohnort: ' . $row [ 'wohnort' ]; $text4 = 'Rang: ' . $row [ 'rang' ]; $text9 = $row [ 'name' ] . ' ist grade ' . $row [ 'online' ]; $text6 = 'Geburtsdatum: ' . $gebdatum . ' ' . $alter ; $fo = 2; $schwarz = ImageColorAllocate( $im , 0, 0, 0); imagestring ( $im , $fo , 20, 10, $text1 , $schwarz ); imagestring ( $im , $fo , 20, 20, $text2 , $schwarz ); imagestring ( $im , $fo , 20, 30, $text3 , $schwarz ); imagestring ( $im , $fo , 20, 40, $text4 , $schwarz ); imagestring ( $im , $fo , 170, 10, $text5 , $schwarz ); imagestring ( $im , $fo , 170, 20, $text6 , $schwarz ); imagestring ( $im , $fo , 170, 30, $text8 , $schwarz ); imagestring ( $im , $fo , 170, 40, $text7 , $schwarz ); imagestring ( $im , 1, 380, 2, '(c) Ilch-Mods.de' , $schwarz ); } if (! empty ( $fehler )) { $im = imagecreate( strlen ( $fehler )*7, 18); $color = imagecolorallocate( $im , 0, 0, 0); $color = imagecolorallocate( $im , 255, 255, 255); imagestring( $im , 2, 4, 2, $fehler , $color ); } header( "Content-type: image/png" ); ImagePNG( $im ); exit (); } else { //Benutzercenter anzeigen $title = $allgAr [ 'title' ] . ' :: Benutzercenter' ; $hmenu = 'Benutzercenter' ; $design = new design ( $title , $hmenu ); if ( $_SESSION [ 'authid' ] == 0) { $design ->header(); echo 'Bitte logge dich ein!!!' ; } else { $tpl = new tpl( 'benutzercenter' ); $design ->addheader( $tpl ->get(0)); $design ->header(); $row = db_fetch_assoc(db_query( 'SELECT u.*, b.* FROM prefix_user u LEFT JOIN prefix_benutzercenter b ON u.id = b.notizuid WHERE u.id = ' . $_SESSION [ 'authid' ])); if (isset( $_POST [ 'submit' ])) { //Notiztext updaten $update = ! is_null ( $row [ 'notiztext' ]); $row [ 'notiztext' ] = escape( $_POST [ 'notiztext' ], 'textarea' ); if ( $update ) { db_query( "UPDATE `prefix_benutzercenter` SET notiztext = '{$_row['notiztext']}' WHERE notizuid = " . $_SESSION [ 'authid' ]); } else { db_query( "INSERT INTO `prefix_benutzercenter` (notizuid, notiztext) VALUES ({$_SESSION['authid']}, '{$_row['notiztext']}')" ); } //Usertabelle updaten $updateUser = array (); if ( $row [ 'status' ] != $_POST [ 'status' ]) { $row [ 'status' ] = $updateUser [ 'status' ] = escape( $_POST [ 'status' ], 'integer' ); } if ( $row [ 'opt_pm' ] != $_POST [ 'msg' ]) { $row [ 'opt_pm' ] = $updateUser [ 'opt_pm' ] = escape( $_POST [ 'msg' ], 'integer' ); } if ( $row [ 'opt_mail' ] != $_POST [ 'mails' ]) { $row [ 'opt_mail' ] = $updateUser [ 'opt_mail' ] = escape( $_POST [ 'mails' ], 'integer' ); } if (! empty ( $updateUser )) { arrayToDb( 'prefix_user' , $updateUser , 'WHERE id = ' . $_SESSION [ 'authid' ]); } } $erg = db_query( "SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = " . $_SESSION [ 'authid' ]); $row [ 'check_pm' ] = db_result( $erg , 0); $row [ 'profillink' ] = $scriptlink . '?user-details-' . $_SESSION [ 'authid' ]; if ( $allgAr [ 'userhtaccess' ] == 1) { $row [ 'imgsrc' ] = dirname( $scriptlink ) . '/stats-' . $_SESSION [ 'authid' ] . '.png' ; } else { $row [ 'imgsrc' ] = $scriptlink . '?benutzercenter-banner-' . $_SESSION [ 'authid' ]; } $row [ 'sitename' ] = $allgAr [ 'title' ]; $row [ 'showNotiz' ] = $allgAr [ 'usernotiz' ]; $row [ 'showBanner' ] = $allgAr [ 'userbanner' ]; if ( $row [ 'showBanner' ] and $row [ 'recht' ] > $allgAr [ 'userbannerrecht' ]) { $row [ 'showBanner' ] = 0; } $row [ 'colspan' ] = $row [ 'showBanner' ] ? 1 : 3; $anzahl = intval ( $allgAr [ 'userlastforum' ]); $query = "SELECT a.id, a.name, a.rep, c.erst as last, c.id as pid, c.time FROM prefix_topics a LEFT JOIN prefix_forums b ON b.id = a.fid LEFT JOIN prefix_posts c ON c.id = a.last_post_id LEFT JOIN prefix_groupusers vg ON vg.uid = " . $_SESSION['authid'] . " AND vg.gid = b.view LEFT JOIN prefix_groupusers rg ON rg.uid = " . $_SESSION['authid'] . " AND rg.gid = b.reply LEFT JOIN prefix_groupusers sg ON sg.uid = " . $_SESSION['authid'] . " AND sg.gid = b.start WHERE (( " . $_SESSION['authright'] . " <= b.view AND b.view < 1) OR ( " . $_SESSION['authright'] . " <= b.reply AND b.reply < 1) OR ( " . $_SESSION['authright'] . " <= b.start AND b.start < 1) OR vg.fid IS NOT NULL OR rg.fid IS NOT NULL OR sg.fid IS NOT NULL OR -9 >= " . $_SESSION['authright'] . " ) ORDER BY c.time DESC LIMIT 0, $anzahl "; $row [ 'last_forum' ] = '<table>' ; $resultID = db_query( $query ); while ( $r = db_fetch_assoc( $resultID )) { $r [ 'date' ] = date ( 'd.m.y - H:i' , $r [ 'time' ]); $r [ 'page' ] = ceil (( $r [ 'rep' ] + 1) / $allgAr [ 'Fpanz' ]); $row [ 'last_forum' ] .= '<tr><td valign="top"><b> » </b></td><td><a href="?forum-showposts-' . $r [ 'id' ] . '-p' . $r [ 'page' ] . '#' . $r [ 'pid' ] . '" title="' . $r [ 'date' ] . '">' . (( strlen ( $r [ 'name' ]) < 60) ? $r [ 'name' ] : substr ( $r [ 'name' ], 0, 60) . '...' ) . '<br /><span class="smalfont"> von ' . $r [ 'last' ] . '</span></a></td></tr>' ; } $row [ 'last_forum' ] .= '</table>' ; $tpl ->set_ar_out( $row , 1); } $design ->footer(); } ?> |
Zuletzt modifiziert von CiSeN am 19.05.2010 - 06:45:53