Also @ Koerner: Übernimm das mal pls in dein Modul ^^
Und für alle die es schnell wollen:
hier die ganze include/includes/func/premium.php mit änderung:
<?php
# Copyright by Florian Koerner
# Support www.ilch.de
defined ('main') or die ( 'no direct access' );
function morecoins ( $uid , $coins ) {
db_query("UPDATE `prefix_user` SET `premium_coins` = premium_coins+".$coins." WHERE `id` LIKE '".$uid."' AND `recht` < '0'");
return mysql_affected_rows();
}
function lesscoins ( $uid , $coins ) {
db_query("UPDATE `prefix_user` SET `premium_coins` = premium_coins-".$coins." WHERE `id` = '".$uid."' AND `premium_coins` >= '".$coins."' AND `recht` < '0'");
return mysql_affected_rows();
}
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 `prefix_user` WHERE `id` = '".$_SESSION['authid']."'"),0);
}
return $_SESSION['premium'];
}
function checkpremium ( $uid = '' ) {
if ( empty ( $uid ) ){
$uid = $_SESSION['authid'];
}
$premium_time = @db_result(db_query("SELECT `premium_time` FROM `prefix_user` WHERE `id` = '".$uid."'"),0);
if ( $premium_time <= time() AND $_SESSION['authid'] == $uid) {
setpremium( false );
}
return $premium_time;
}
function premium_pm ( $uid , $text , $extra = "" ) {
if ( !empty( $text ) ) {
$uname = @db_result(db_query("SELECT `name` FROM `prefix_user` WHERE `id` = '".$uid."'"),0);
$text = str_replace("%%name%%", $uname, $text);
$text = str_replace("%%coins%%", $extra, $text);
$text = str_replace("%%premium%%", $extra, $text);
sendpm (1,$uid,"Informationen über Dein Premium-Konto",$text);
}
}
function is_premium ( $uid = '' ){
if ( empty ( $uid ) ){
$uid = $_SESSION['authid'];
}
if ( checkpremium( $uid ) > time() ) {
return true;
}else{
return false;
}
}
?>