query("SELECT * FROM `players` ORDER BY `experience` DESC")->fetch(); $query2 = $SQL->query('SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1;')->fetch(); $housesfree = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=0;')->fetch(); $housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch(); $players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch(); $accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch(); //$banned = $SQL->query('SELECT COUNT(*) FROM `bans` WHERE `id`>0;')->fetch(); $guilds = $SQL->query('SELECT COUNT(*) FROM `guilds` WHERE `id`>0;')->fetch(); ///End Queries /// // top kills - guilds $main_content .= '
Welcome to '.$config['server']['serverName'].'
Last joined us: '.$query2['name'].', player number '.$query2['id'].'. Welcome and wish you a nice game!
Currently, the best player on the server is: '.$query['name'].' ('.urlencode($query['level']).'). Congratulations!
Free Houses: '.$housesfree[0].'
Rented Houses: '.$housesrented[0].'
Accounts in database: '.$accounts[0].'
Players in database: '.$players[0].'
Banned accounts: '.$banned[0].'
Guilds in databese: '.$guilds[0].'
'; if($action == "") { //show tickers if any in database or not blocked (tickers limit = 0) $tickers = $SQL->query('SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 4;'); $number_of_tickers = 0; if(is_object($tickers)) { foreach($tickers as $ticker) { if(is_int($number_of_tickers / 2)) $color = "Odd"; else $color = "Even"; $tickers_to_add .= '
'.date("j M Y", $ticker['date']).' -
'; //if admin show button to delete (hide) ticker if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) { $tickers_to_add .= ''; } $tickers_to_add .= short_text($ticker['text'], 60).'
'; //if admin show button to delete (hide) ticker if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) { $tickers_to_add .= ''; } $tickers_to_add .= $ticker['text'].'
'; $number_of_tickers++; } } if(!empty($tickers_to_add)) { //show table with tickers $news_content .= '
Contentbox headline
'; if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) $news_content .= '
AddTicker

'; //add tickers list $news_content .= $tickers_to_add; //koniec $news_content .= '
'; } } //##################### ADD NEW TICKER ##################### if($action == "newticker") { if($group_id_of_acc_logged >= $config['site']['access_tickers']) { $ticker_text = stripslashes(trim($_POST['new_ticker'])); $ticker_icon = (int) $_POST['icon_id']; if(empty($ticker_text)) { $main_content .= 'You can\'t add empty ticker.'; } else { if(empty($ticker_icon)) { $ticker_icon = 0; } $SQL->query('INSERT INTO '.$SQL->tableName('z_news_tickers').' (date, author, image_id, text, hide_ticker) VALUES ('.$SQL->quote($time).', '.$account_logged->getId().', '.$ticker_icon.', '.$SQL->quote($ticker_text).', 0)'); $main_content .= '

Added new ticker:


'.date("j M Y", $time).' -
'; $main_content .= ''; $main_content .= short_text($ticker_text, 60).'
'; $main_content .= ''; $main_content .= $ticker_text.'

'; } } else { $main_content .= 'You don\'t have admin rights. You can\'t add new ticker.'; } $main_content .= '
'; } //#################### DELETE (HIDE only!) TICKER ############################ if($action == "deleteticker") { if($group_id_of_acc_logged >= $config['site']['access_tickers']) { header("Location: "); $date = (int) $_REQUEST['id']; $SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';'); $main_content .= '
News tickets with date '.date("j F Y, g:i a", $date).' has been deleted.
'; } else { $main_content .= '
You don\'t have admin rights. You can\'t delete tickers.
'; } } if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){$main_content .= 'Add new news';} $zapytanie = $SQL->query("SELECT `z_forum`.`post_topic`, `z_forum`.`author_guid`, `z_forum`.`post_date`, `z_forum`.`post_text`, `z_forum`.`id`, `z_forum`.`replies`, `players`.`name` FROM `z_forum`, `players` WHERE `section` = '1' AND `z_forum`.`id` = `first_post` AND `players`.`id` = `z_forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 6;")->fetchAll(); foreach ($zapytanie as $row) { $BB = array( '/\[b\](.*?)\[\/b\]/is' => '$1', '/\[quote\](.*?)\[\/quote\]/is' => '
$1
', '/\[u\](.*?)\[\/u\]/is' => '$1', '/\[i\](.*?)\[\/i\]/is' => '$1', '/\[url](.*?)\[\/url\]/is' => '$1', '/\[img\](.*?)\[\/img\]/is' => '$1', '/\[player\](.*?)\[\/player\]/is' => '$1', '/\[code\](.*?)\[\/code\]/is' => '
$1
' ); $message = preg_replace(array_keys($BB), array_values($BB), nl2br($row['post_text'])); $main_content .= '
'.date('d.m.y H:i:s', $row['post_date']).' - '.$row['post_topic'].'
'; if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) { $main_content .='
\'\''.$message.'
Posted by '.$row['name'].'

[Delete this news] [Edit this news] Comments: '.$row['replies'].'

'; } else { $main_content .='
'.$message.'
Posted by '.$row['name'].'

Comments: '.$row['replies'].'

'; } $main_content .= '
\'\'
'; } ?>