From 49292f2650ed2c756d17ada3cb62bdd920ecd7c5 Mon Sep 17 00:00:00 2001 From: hecht Date: Sun, 10 Sep 2017 14:48:20 +0000 Subject: [PATCH] adjusted a lot of include files --- ag/include/designfunctions.inc.php | 1 - ag/include/halloffame.inc.php | 4 ++-- ag/include/items.inc.php | 18 +++++++++++++----- ag/include/messagefunctions.inc.php | 6 ++++++ ag/include/tournament.inc.php | 4 ++-- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ag/include/designfunctions.inc.php b/ag/include/designfunctions.inc.php index ce37bb1..89159f2 100644 --- a/ag/include/designfunctions.inc.php +++ b/ag/include/designfunctions.inc.php @@ -8,7 +8,6 @@ include_once(ROOT_PATH.'/include/defines.inc.php'); include_once(ROOT_PATH.'/include/usergroup.inc.php'); -include_once(ROOT_PATH.'/include/config/settings.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php'); include_once(ROOT_PATH.'/include/sqlwrapper.inc.php'); diff --git a/ag/include/halloffame.inc.php b/ag/include/halloffame.inc.php index 54bf16c..2de7bee 100644 --- a/ag/include/halloffame.inc.php +++ b/ag/include/halloffame.inc.php @@ -61,7 +61,7 @@ function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charn } $sql = 'INSERT INTO highscore('.$columns.') values('.$values.')'; -// echo $sql.'
'; + echo $sql.'
'; silent_query($sql); return db_affected_rows() > 0; } @@ -81,4 +81,4 @@ function getHallOfFameEntryCountFull($round = '', $title = '', $userid = '') { return $row[0]; } -?> \ No newline at end of file +?> diff --git a/ag/include/items.inc.php b/ag/include/items.inc.php index 48a7e7f..033fc17 100644 --- a/ag/include/items.inc.php +++ b/ag/include/items.inc.php @@ -102,11 +102,19 @@ function itemEquals($lhs, $rhs) { */ function createItemForUser($item, $user_id, $amount = 1) { $ware_table=array('item' => 'ware', 'sp_item' => 'sp_ware', 'wochen_markt' => 'wochen_ware'); - if ( $ware_table[$item['table_name']] == 'ware' ) { - $ru = $item['s_type']=='Trank'?' ':'1'; - db_query('INSERT ware(user,item_id,ru_mal) values('.$user_id.', '.$item['id'].', \''.$ru.'\')'); - } else { - db_query('INSERT '.$ware_table[$item['table_name']].'(user, item) values('.$user_id.', '.$item['id'].')'); + + $table = $ware_table[$item['table_name']]; + if ($table === NULL) { + $table = $item['table_name']; + } + + for ($i=0;$i<$amount;++$i) { + if ( $table == 'ware' ) { + $ru = $item['s_type']=='Trank'?' ':'1'; + db_query('INSERT ware(user,item_id,ru_mal) values('.$user_id.', '.$item['id'].', \''.$ru.'\')'); + } else { + db_query('INSERT '.$table.'(user, item) values('.$user_id.', '.$item['id'].')'); + } } return db_affected_rows() > 0; } diff --git a/ag/include/messagefunctions.inc.php b/ag/include/messagefunctions.inc.php index 838f1dc..72f0bf9 100644 --- a/ag/include/messagefunctions.inc.php +++ b/ag/include/messagefunctions.inc.php @@ -22,9 +22,15 @@ include_once(ROOT_PATH.'/include/designfunctions.inc.php'); include_once(ROOT_PATH.'/include/bann.inc.php'); include_once(ROOT_PATH.'/include/sqlwrapper.inc.php'); include_once(ROOT_PATH.'/include/random.inc.php'); +include_once(ROOT_PATH.'/include/user.inc.php'); function sendMessage($von, $besitzer, $betreff, $text){ // $betreff = $betreff; + + if (is_numeric($von)) { + $von = getUser($von)['nickname']; + } + $text = urldecode($text); $text = encodeNoHTMLWithBB($text); $betreff = urldecode($betreff); diff --git a/ag/include/tournament.inc.php b/ag/include/tournament.inc.php index 0e5bb66..2b4a768 100644 --- a/ag/include/tournament.inc.php +++ b/ag/include/tournament.inc.php @@ -41,7 +41,7 @@ function runScheduledTournaments() { $day_of_month = date('j'); $sql = 'SELECT id FROM tournament_types WHERE (day_of_week = '.$day_of_week.' OR day_of_week is NULL) AND (day_of_month = '.$day_of_month.' or day_of_month is NULL) AND hour_of_day = '.$hour_of_day.' AND id NOT IN (SELECT type from tournament where ausgewertet = FALSE)'; - echo $sql; + // echo $sql; $qry = db_query($sql); @@ -131,7 +131,7 @@ function retrieveParticipants($tournament_type) { $sql = 'SELECT count(*) as anzahl from chars c where '.$filter_sql; - echo $sql.'
'; + // echo $sql.'
'; $qry = db_query($sql); $row = mysqli_fetch_assoc($qry);