Hi
ich habe schon lange nach so etwas gesucht^^
ich habe es jetzt umgebaut das keine Notiz und der Banner weg ist.
saved.im/mtc0mdqyzmjq/nova.gif
so weit geht das alles nur ich will noch ein paar infos mit rein bringen:
- Last login
- Registriert
- Post Box
- Geburtstagsbox
Ich würde mich über Hilfe freuen...
Hier mal die php
<?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_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);
$scriptlink = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
$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, b.name AS fname
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 border="0" cellpadding="0" cellspacing="0" width="100%">';
$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 height="50" width="30"> <img src="include/images/icons/page.png" /></td>
<td><a style="font-family:Arial; font-size:11px" href="index.php?forum-showposts-'.$row['id'].'-p'.$row['page'].'#'.$row['pid'].'" title="'.$row['date'].'">'.((strlen($row['name'])<30) ? $r['name'] : substr($row['name'],0,15).'...').'</a><br><span style="color:#a3a3a3; font-family:Arial; font-size:10px">'.$r['fname'].'</span></td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>';
}
$row['last_forum'] .= '</table>';
$tpl->set_ar_out($row, 1);
}
$design->footer();
}
?>
und hier mal die htm
<style type="text/css">
<!--
.ueberschrift {
font-size: 24px;
font-weight: bold;
}
.cat {
font-size: 16px;
font-weight: bold;
background-color:#0099FF;
color:#FFFFCC;
border:dashed;
border-color:#0033FF;
border-width:thin;
}
.untercat {
font-size: 13px;
font-weight: normal;
border:dashed;
border-color:#999999;
border-width:thin;
}
.button
{
color: #000000;
font: 10px Verdana;
border-color: #000000;
border-width: 1px;
border-style: solid;
font-weight: none;
text-decoration: none;
background-color: #FFFFFF;
}
.style3 {
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
{EXPLODE}
<form method="post">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="3" height="22"><span style="color:#3d6797; text-decoration:none; font-size:14px"><strong>Hallo {name}</strong></span></td>
</tr>
<tr>
<td colspan="3" height="4" bgcolor="#1e344c"></td>
</tr>
<tr>
<td colspan="3" height="5" bgcolor="#ffffff"></td>
</tr>
<tr>
<td colspan="3" height="18" bgcolor="#1e344c" style="color:#FFFFFF; font-size:10px"> Benutzerinformation</td>
</tr>
<tr>
<td colspan="1" valign="top" height="100" width="50%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="27" width="40%"> Benutzer:</td>
<td height="27" align="right">{name}</td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
<tr>
<td height="27" width="40%"> Letzter Login:</td>
<td height="27" align="right"></td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
<tr>
<td height="27" width="40%"> Registriert:</td>
<td height="27" align="right"></td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
</table></td>
<td width="5"></td>
<td colspan="1" valign="top" height="100"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="27" width="40%"> Newspost:</td>
<td height="27" align="right">{NEWSTOPICS}</td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
<tr>
<td height="27" width="40%"> Newscomments:</td>
<td height="27" align="right">{NEWSPOSTS}</td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
<tr>
<td height="27" width="40%"> Forumtopic:</td>
<td height="27" align="right">{FORUMTOPICS}</td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
<tr>
<td height="27" width="40%"> Forumposts:</td>
<td height="27" align="right">{POSTS}</td>
</tr>
<tr>
<td colspan="2" background="include/images/icons/linie.gif" height="3"></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" height="18" bgcolor="#1e344c" style="color:#FFFFFF; font-size:10px"> Benutzermenü</td>
</tr>
<tr>
<td colspan="3" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="25%" height="100" align="center"><a href="index.php?forum-privmsg"><img src="include/images/usercenter/send.png" border="0" /><br />Postfach ({check_pm})</a></td>
<td width="25%" height="100" align="center"><a href="index.php?user-8"><img src="include/images/usercenter/edit.png" border="0" /><br />Profil Edit</a></td>
<td width="25%" height="100" align="center"><a href="index.php?user-3"><img src="include/images/usercenter/exit.png" border="0" /><br />Logout</a></td>
<td width="25%" height="100" align="center"><a href="index.php?admin"><img src="include/images/usercenter/admin.png" border="0" /><br />Admincenter</a></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="1" height="18" bgcolor="#1e344c" style="color:#FFFFFF; font-size:10px"> Neue Forumbeiträge</td>
<td width="5"></td>
<td colspan="1" height="18" bgcolor="#1e344c" style="color:#FFFFFF; font-size:10px"> Nächsten Geburtstage</td>
</tr>
<tr>
<td valign="top">{last_forum}</td>
<td width="5"></td>
<td valign="top">{geburtstag}</td>
</tr>
</table>
</form>
<span class="style3"><a href="http://ilch-mods.de">© by Ilch-Mods.de @ Hassmann </a></span><br />
*edit....
habe noch mal die geburtstags php mit eingefügt
<?php
//Copyright by Hannes Wunderli
//www.fast-death.com
// v1.2
defined ('main') or die ( 'no direct access' );
//----------------------------------- Einstellungen-----------------------------------
$limit = 3; //wieviele Geburtstage Angezeigt werden sollen.
$recht = -1; //Anzeige Modus 0 = Alle / -1 Alle die mehr als Memberrechte haben usw.
$showavatars = 1; //Wenn 1 werden die Avatare wenn vorhanden angezeigt.
//------------------------------------------------------------------------------------
$count = 0;
$timestamp = time();
$akttime = date('Y-m-d',$timestamp);
function get_gebtage ($datum) {
list($y, $m, $d) = explode('-', $datum);
return ($d.'.'.$m.'.'.$y);
}
# DIE krasse Abfrage :-)... von Manue
$q = "SELECT name, id, avatar,
CASE WHEN ( MONTH(gebdatum) < MONTH(NOW()) ) OR ( MONTH(gebdatum) <= MONTH(NOW()) AND DAYOFMONTH(gebdatum) < DAYOFMONTH(NOW()) ) THEN
gebdatum + INTERVAL (YEAR(NOW()) - YEAR(gebdatum) + 1) YEAR
ELSE
gebdatum + INTERVAL (YEAR(NOW()) - YEAR(gebdatum)) YEAR
END
AS gebtage
FROM prefix_user WHERE gebdatum > 0000-00-00 AND recht <= ".$recht." ORDER BY gebtage LIMIT ".$limit;
$erg = db_query($q);
echo '<table width="100%" cellspacing="0" cellpadding="0">';
$i = 1;
while($row = db_fetch_object($erg)) {
if($akttime == $row->gebtage) {
echo '<tr><td align="center">'.$lang['today'].' '.$lang['had'].' <a class="box" href="index.php?user-details-'.$row->id.'">'.$row->name.'</a><br / >'.$lang['birthday'].'<br / ><img border="0" src="include/images/icons/birthday.gif"></td></tr>';
} else {
$gebtage = get_gebtage ($row->gebtage);
echo '<tr><td align="center"><a class="box" href="index.php?user-details-'.$row->id.'">'.$row->name.'</a> '.$lang['had'].' '.$lang['on'].' '.$gebtage.' '.$lang['birthday'];
if ($showavatars && $row->avatar) {
echo '<br /><img border="0" src="'.$row->avatar.'">';
}
echo "</td></tr>";
}
if ($i<$limit) {
echo '<tr><td> </td></tr>';
}
$i++;
}
echo '</table>';
?>
Zuletzt modifiziert von xCrystalx am 15.11.2010 - 09:36:52