Zuerst solltest Du in die
Datenbank einen Eintrag
einfügen:
INSERT INTO `prefix_config` (`schl`, `typ`, `kat`, `frage`, `wert`) VALUES ('premium_gfx', 's', 'PremiumACC Einstellungen', 'Standard Design für Premium-Accounts', 'ilchClan');
ACHTUNG: Bitte den PREFIX ersetzen.
Nun öffne die
include/admin/allg.php und füge
nach:
# funktionen fuer listen
folgenden Code ein:
function admin_allg_premium_gfx ( $ak ) {
$gfx = '';
$o = opendir('include/designs');
while ($ver = readdir ($o)) {
if ($ver != "." AND $ver != ".." AND is_dir('include/designs/'.$ver) ) {
if ($ver == $ak) {
$sel = ' selected';
} else {
$sel = '';
}
$gfx .= '<option'.$sel.'>'.$ver.'</option>';
}
}
closedir($o);
return ( $gfx );
}
In der selben Datei nach oder vor:
$gfx = admin_allg_gfx( $allgAr['gfx'] );
folgenden Code einsetzen:
$premium_gfx = admin_allg_premium_gfx( $allgAr['premium_gfx'] );
Speichere die Datei, schließe diese und
öffne include/includes/func/user.php und
ersetze:
function user_login_check () {
bis
$_SESSION['authgrp'] = array();
$_SESSION['authmod'] = array();
$_SESSION['authsess'] = session_und_cookie_name();
}
durch:
function user_login_check () {
global $allgAr;
if ( isset ($_POST['user_login_sub']) AND isset ($_POST['name']) AND isset ($_POST['pass']) ) {
debug ('posts vorhanden');
$name = escape_nickname($_POST['name']);
if ($name != $_POST['name'] OR strlen($_POST['name']) > 15) {
return false;
}
$erg = db_query("SELECT name,id,recht,pass,llogin,premium_time FROM xic_user WHERE name = BINARY '".$name."'");
if ( db_num_rows($erg) == 1 ) {
debug ('user gefunden');
$row = db_fetch_assoc($erg);
if ( $row['pass'] == md5($_POST['pass']) ) {
debug ('passwort stimmt ... '.$row['name']);
if ( $row['premium_time'] >= time() ) {
if ( $row['recht'] > $allgAr['premium_right'] ){
$row['recht'] = $allgAr['premium_right'];
}
$_SESSION['premium'] = true;
} else {
$_SESSION['premium'] = false;
}
$_SESSION['authname'] = $row['name'];
$_SESSION['authid'] = $row['id'];
$_SESSION['authright'] = $row['recht'];
$_SESSION['lastlogin'] = $row['llogin'];
$_SESSION['authsess'] = session_und_cookie_name();
// Design ändern per PA, jedoch nicht, wenn nicht Standard-Design
if ( is_premium() == true AND $allgAr['gfx'] == $_SESSION['authgfx'] ){
$_SESSION['authgfx'] = $allgAr['premium_gfx'];
}
db_query("UPDATE xic_online SET uid = ".$_SESSION['authid']." WHERE sid = '".session_id()."'");
setcookie($_SESSION['authsess'], $row['id'].'='.$row['pass'] , time() + 31104000, "/" );
user_set_grps_and_modules();
return (true);
}
}
global $menu;
$menu->set_url (0, 'user');
$menu->set_url (1, 'login');
}
return ( false );
}
function user_auto_login_check () {
global $allgAr;
$cn = session_und_cookie_name();
$dat = explode('=',$_COOKIE[$cn]);
$id = $pw = 0;
if (isset($dat[0])) { $id = escape($dat[0], 'integer'); }
if (isset($dat[1])) { $pw = $dat[1]; }
debug (' pw ' . $pw );
debug (' id ' . $id );
$erg = db_query("SELECT name,id,recht,pass,llogin,premium_time FROM xic_user WHERE id = ".$id);
if (db_num_rows($erg) == 1) {
debug ('benutzer gefunden');
$row = db_fetch_assoc($erg);
if ($row['pass'] == $pw) {
debug ('passwoerter stimmen');
debug ($row['name']);
if ( $row['premium_time'] >= time() ) {
if ( $row['recht'] > $allgAr['premium_right'] ){
$row['recht'] = $allgAr['premium_right'];
}
$_SESSION['premium'] = true;
} else {
$_SESSION['premium'] = false;
}
$_SESSION['authname'] = $row['name'];
$_SESSION['authid'] = $row['id'];
$_SESSION['authright'] = $row['recht'];
$_SESSION['lastlogin'] = $row['llogin'];
$_SESSION['authsess'] = $cn;
// Design ändern per PA, jedoch nicht, wenn nicht Standard-Design
if ( is_premium() == true AND $allgAr['gfx'] == $_SESSION['authgfx'] ){
$_SESSION['authgfx'] = $allgAr['premium_gfx'];
}
db_query("UPDATE xic_online SET uid = ".$_SESSION['authid']." WHERE sid = '".session_id()."'");
setcookie($cn, $row['id'].'='.$row['pass'], time() + 31104000, "/" );
return (true);
}
}
user_logout ();
return (false);
}
function user_set_guest_vars() {
global $allgAr;
if ( $allgAr['premium_gfx'] == $_SESSION['authgfx'] ){
$_SESSION['authgfx'] = $allgAr['gfx'];
}
$_SESSION['premium'] = false;
$_SESSION['authname'] = 'Gast';
$_SESSION['authid'] = 0;
$_SESSION['authright'] = 0;
$_SESSION['lastlogin'] = time();
$_SESSION['authgrp'] = array();
$_SESSION['authmod'] = array();
$_SESSION['authsess'] = session_und_cookie_name();
}
Speicher und schließe die Datei und
öffne include/includes/func/premium.php und
ersetze:
function setpremium ( $status = true ) {
global $allgAr;
$_SESSION['premium'] = $status;
if ( $status == true AND $_SESSION['authright'] > $allgAr['premium_right']) {
$_SESSION['authright'] = $allgAr['premium_right'];
} else if ( $status == false ){
$_SESSION['authright'] = @db_result(db_query("SELECT `recht` FROM `xic_user` WHERE `id` = '".$_SESSION['authid']."'"),0);
}
return $_SESSION['premium'];
}
durch:
function setpremium ( $status = true ) {
global $allgAr;
$_SESSION['premium'] = $status;
if ( $status == true AND $_SESSION['authright'] > $allgAr['premium_right']) {
$_SESSION['authright'] = $allgAr['premium_right'];
$_SESSION['authgfx'] = $allgAr['premium_gfx'];
} else if ( $status == false ){
$_SESSION['authright'] = @db_result(db_query("SELECT `recht` FROM `xic_user` WHERE `id` = '".$_SESSION['authid']."'"),0);
$_SESSION['authgfx'] = $allgAr['gfx'];
}else{
$_SESSION['authgfx'] = $allgAr['premium_gfx'];
}
return $_SESSION['premium'];
}
Speichere auch diese Datei und lade alle Dateien wieder hoch. Nun kannst Du im Adminbereich das Design für Premium-Accounts einstellen.