AtomoS Posted December 1, 2010 Posted December 1, 2010 Hello! here you can ask me writing some scripts for your lineage2 web :o Quote
0 picassooo Posted December 1, 2010 Posted December 1, 2010 you have all status "comunity" for freya in php ? Quote
0 AtomoS Posted December 1, 2010 Author Posted December 1, 2010 picassooo, sorry.. but what about are you speaking? i don`t understand what you want.. Quote
0 [Geo]Sky Posted December 1, 2010 Posted December 1, 2010 Give Me Little Script For Dle, Online Players :D Quote
0 AtomoS Posted December 1, 2010 Author Posted December 1, 2010 [Geo]Sky, $this-catch(); 1. you should create */engine/inc/server_status.php with this content: <?php if(!defined('DATALIFEENGINE')) die ("Hacking attempt!"); # ===================================================== # lineage2 server_status v.0.1b # author: atomos, special for maxcheters.com # ===================================================== // connecting mysql class $_db = new db; // configs for gamea and login servers $_config = array( 'login_ip' => 'localhost', 'login_port' => '80', 'game_ip' => 'localhost', 'game_port' => '80', 'game_dbhost' => 'localhost', 'game_dbname' => 'l2j', 'game_dbuser' => 'root', 'game_dbpass' => 'root', ); // online players if($_db->query_online("SELECT * FROM characters WHERE online = '1' AND accesslevel = '0'") != false) { $status_online = $_db->num_rows(); } else { $status_online = 0; } // checking login/game servers for online/offline if(fsockopen($_config['login_ip'], $_config['login_port'], $errno, $errstr, 1) >= 1) { $tpl->set('{status_login}', 'online'); } else { $tpl->set('{status_login}', 'offline'); } if(fsockopen($_config['game_ip'], $_config['game_port'], $errno, $errstr, 1) >= 1) { $tpl->set('{status_game}', 'online'); } else { $tpl->set('{status_game}', 'offline'); } $tpl->set('{status_online}', $status_online); $_db->close(); ?> 2. Make include in */engine/init.php, before ?> in the end of the page.. add require_once ROOT_DIR . '/engine/inc/server_status.php'; 3. Modify you mysql class: open */engine/classes/mysql.class.php and add new one after function query: function query_online($query, $show_error = true) { global $_config; if(!$this->db_id) $this->connect($_config['game_dbuser'], $_config['game_dbpass'], $_config['game_dbname'], $_config['game_host']); if(!($this->query_id = mysql_query($this->db_id, $query) )) { $this->mysql_error = mysql_error($this->db_id); $this->mysql_error_num = mysql_errno($this->db_id); } $this->query_num ++; return $this->query_id; } 4. add some html in you current main.tpl: Login: <font class="server_{status_login}">{status_login}</font> Game: <font class="server_{status_game}">{status_game}</font> Online: <font class="server_{status_game}">{status_online}</font> 4. last one. css part: .server_online {text-transform: capitalize; color: green;} .server_offline {text-transform: capitalize; color: red;} Quote
0 [Geo]Sky Posted December 1, 2010 Posted December 1, 2010 axaxa :D :D GJ GJ man Tnx [Rus] Sagol Paren Prekrasna ia gruzin, sviazis mne PM :) Quote
Question
AtomoS
Hello! here you can ask me writing some scripts for your lineage2 web :o
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.