1) { if(dirname($_SERVER['PHP_SELF'])<>"\\" && dirname($_SERVER['PHP_SELF'])<>'.') $dir = addSingleSlash(dirname($_SERVER['PHP_SELF'])); header ("Location: http://".addSingleSlash($_SERVER['HTTP_HOST']).$dir."install.php"); exit(); } die('Bitte f�hren Sie install.php aus und l�schen Sie die Datei anschlie�end.'); } require_once('global.inc.php'); //Sprachdatei einbinden insertLangFile("index.php"); insertLangFile("message.php"); //Benutzerinformationen $result = $db->query("SELECT userid,username,points,posts,lastlogout,failedlogins,warningcount FROM ".$db_tblpre."user WHERE sessionid = '".session_id()."' LIMIT 1"); //Gastbenutzer zur festgelegten Homepage weiterleiten if($_global['cur_user']['isguest'] || $db->num_rows($result)==0){ header("location: ".get_baseconfig('global_guest_homepage')); } $tmpl = new Template('tmpl/index.htm'); $db->fetch_row($row,$result); $userid = $row['userid']; $username = $row['username']; $points = $row['points']; $posts = $row['posts']; $tmpl->assign('points',$points); $tmpl->assign('posts',$posts); $tmpl->assign('username',$username); $tmpl->assign('warningcount',$row['warningcount']); //User Level $lvlname = getusertitel($userid,$lvlimg); $tmpl->assign('lvlname',$lvlname); $tmpl->assign('lvlimg',$lvlimg); //Zeitpunkt des letzten Einloggens $lastlogout = $row['lastlogout']; if ($lastlogout > 0) $lastvisit = getTimeString($lastlogout); else $lastvisit = "-"; //evtl. Failed Login anzeigen if($row['failedlogins'] > 0) $tmpl->assign('failedlogins',insertText('failedlogins')." ".$row['failedlogins']); else $tmpl->assign('failedlogins',""); //User die Online sind anzeigen $result = $db->query("SELECT user.username FROM ".$db_tblpre."user user LEFT JOIN ".$db_tblpre."user_setting setting ON (setting.name='visible') LEFT JOIN ".$db_tblpre."user_setting_value value ON (value.settingid = setting.settingid AND value.userid = user.userid) WHERE (user.sessionid <> '' AND value.value=1)"); $num_rows = $db->num_rows($result); while($db->fetch_row($row,$result)){ $tmpl->append('onlineuser',$row); } $tmpl->assign('useranzahl', $num_rows); //Neue PMs $result = $db->query("SELECT * FROM `".$db_tblpre."privatemessage` WHERE `userid` = '$userid' AND `time` > '$lastlogout' AND `wasread` = '0'"); $num_rows = $db->num_rows($result); $tmpl->assign('newpms',$num_rows); $tmpl->assign('lastvisit',$lastvisit); $time = time(); //aktuelles Jahr $jahr = strftime("%Y",$time); //aktueller Monat $monat = number_length(strftime("%m",$time),2); //Heutiger Tag $tag = number_length(strftime("%d",$time),2); $heute = $jahr."-".$monat."-".$tag; //Geburtstage heute $result = $db->query("SELECT username FROM ".$db_tblpre."user WHERE birthday LIKE '%-$monat-$tag'"); $num_rows = $db->num_rows(); if($num_rows<>0){ $showbirthday=1; while($db->fetch_row($row,$result)){ $tmpl->append('todaybirth',$row); } } //die n�chsten 3 Geburtstage $result = $db->query("SELECT username, YEAR(NOW())-YEAR(birthday) AS age, YEAR(birthday) AS jahr, MONTH(birthday) AS monat, DAYOFMONTH(birthday) AS tag FROM ".$db_tblpre."user WHERE birthday NOT LIKE '0000-00-00' AND DAYOFYEAR(birthday) >= DAYOFYEAR(NOW()) ORDER BY DAYOFYEAR(birthday) LIMIT 3"); $num_rows = $db->num_rows(); for($i=0;$i<$num_rows;$i++) { $db->row_seek($i,$result); $db->fetch_row($row,$result); $tmpl->append('nextbirth',$row); }//end for //Aufgaben if(chk_permission('access_admincenter_filebase')||chk_permission('moderate_filebase')) { //Anzahl der nicht freigeschalteten Dateien $db->query("SELECT COUNT(fileid) As count FROM ".$db_tblpre."filebase WHERE active = 0"); $db->fetch_row($row); $count = $row['count']; $tmpl->assign('lockedfilecount',$count); } //Tools $tmpl->assign('lastlogoutstamp',$_global['cur_user']['lastlogout']); //Prozentbalken f�r Speicherplatzbelegung der PM Dateianh�nge $diskspace = get_baseconfig('privatemessage_attachment_diskspace'); $tmpl->assign('privatemessage_attachment_diskspace',formatsize($diskspace)); $maxFileSize = get_baseconfig('privatemessage_attachment_maxfilesize'); $tmpl->assign('privatemessage_attachment_maxfilesize',formatsize($maxFileSize)); $usedSpace = $db->fetch_first_field("SELECT SUM(filesize) AS usedspace FROM ".$db_tblpre. "privatemessage_attachment WHERE userid = '".get_userid()."' OR idhash='$idhash'"); if($usedSpace==0) $usedSpace = 0; $tmpl->assign('privatemessage_attachment_diskspace_used',formatsize($usedSpace)); //Grafik f�r Speicherplatzbelegung if($diskspace<>0){ $percent = intval((100/$diskspace)*$usedSpace); } else { $percent = 0; } $tmpl->assign('percent_picture_space','percent'); //wieviele Nachrichten hat der Benutzer gespeichert (in allen Ordnern) $result = $db->query("SELECT COUNT(messageid) AS count FROM `".$db_tblpre."privatemessage` WHERE `userid` = '$userid'"); $db->fetch_row($row,$result); $allPmCount = $row['count']; //Maximale Anzahl von Nachrichten die der Benutzer speichern darf $pmmax = get_baseconfig("privatemessage_maxnumber"); if($pmmax<>0){ $percent = intval((100/$pmmax)*$allPmCount); } else { $percent = 0; } if($percent>=100) { $tmpl->assign('pmspacefull',true); }elseif($percent>90) { $tmpl->assign('pmspacewarning',true); } //Ordnername if($folderid == 0) $foldername = insertText('pminbox'); else if ($folderid == -1) $foldername = insertText('pmoutbox'); else { $foldername = $db->fetch_first_field("SELECT name FROM ".$db_tblpre."privatemessage_folder WHERE folderid = '$folderid' LIMIT 1"); } $tmpl->assign('foldername',$foldername); $tmpl->assign('folderid',$folderid); $tmpl->assign('allpmcount',$allPmCount); $tmpl->assign('pmmax',$pmmax); $tmpl->assign('percent',$percent); $tmpl->assign('percent_picture_count','percent'); $tmpl->output(); ?>