<?php
# Copyright by Manuel Staechele
# Support www.ilch.de
defined ('main') or die ( 'no direct access' );
$tpl = new tpl ( 'user/boxen_login.htm' );
if ( loggedin() ) {
if ( user_has_admin_right($menu,false) ) {
$downs = '';
if (has_right(-8,'archiv-downloads') and $downs = db_count_query('SELECT COUNT(*) FROM prefix_downloads WHERE cat = -1') > 0) {
$downs = "$downs Downloads freizuschalten";
}
$admin = '<a class="box" href="admin.php?admin" target="ali">'.$lang['adminarea'].'</a><br />'.$downs;
} else {
$admin = '';
}
$tpl->set ( 'ADMIN', $admin );
if ( $allgAr['Fpmf'] == 1 ) {
$erg = db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = ".$_SESSION['authid']);
$check_pm = db_result($erg,0);
$nachrichten_link = '<a class="box" href="index.php?forum-privmsg">'.$lang['messages'].'</a> ('.$check_pm.')<br>';
} else {
$nachrichten_link = '';
}
$abf = 'SELECT id, name, avatar, opt_login_sound FROM prefix_user WHERE name = "'.$_SESSION['authname'].'"';
$erg = db_query($abf);
$row = db_fetch_object($erg);
if ( file_exists($row->avatars)) {
$avatar = '<br><img src="'.$row->avatars.'" border="0"><br>';
}else{
$avatars = '';
}
if ( $_COOKIE['soundplayed']!="1" AND $row->opt_login_sound=="1" ) {
mt_srand((double)microtime()*10000000);
$anfang = '1'; // Anfangsdatei (1.mp3)
$ende = '7'; // Letzte Datei mit der höchsten Nummer (20.mp3)
$file = mt_rand($anfang, $ende);
$pfad = 'include/usersounds/'.$file;
if(file_exists($pfad.'.mp3'))
$src = $pfad.'.mp3';
else
$src = $pfad.'.wav';
echo '<embed src="'.$src.'" hidden="true" loop="false" autostart="true" height="0" width="0">';
setcookie("soundplayed","1");
}
$tpl->set ( 'ID' , $row->id );
$tpl->set ( 'AVATAR' , $avatar );
$tpl->set ( 'SID' , session_id() );
$tpl->set ( 'NACHRICHTEN' , $nachrichten_link );
$tpl->set ( 'NAME', $_SESSION['authname'] );
$tpl->set ( 'POPUP', check_for_pm_popup() );
$tpl->out (0);
} else {
if (empty($_POST['login_name'])) { $_POST['login_name'] = 'Nickname'; }
if (empty($_POST['login_pw'])) { $_POST['login_pw'] = 'ääääääää'; }
$regist = '';
if ( $allgAr['forum_regist'] == 1 ) {
$regist = ' <a href="index.php?user-regist">Regist</a>';
}
$tpl->set_ar_out ( array ( 'regist' => $regist, 'wdlink' => '?'.$allgAr['smodul'], 'PASS' => $_POST['login_pw'], 'NAME' => $_POST['login_name'] ) , 1 );
}
unset($tpl);
?>
$row['opt_login_sound']=="1" kommt es darauf was in dem var gespeichert wird, denke aber das es 1 oder 0 ist
das müßte dann so funktionieren von der auswertung
Zuletzt modifiziert von Mairu am 10.04.2009 - 09:47:38