Changeset 3
- Timestamp:
- May 5, 2008, 8:33:15 AM (17 years ago)
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
includes/config.sample.php
r1 r3 1 1 <?php 2 2 3 $db_congig['host'] = 'localhost'; 3 $Config = array( 4 'DisplayServerCountPerPage' => 40, 5 'TopServersCount' => 10, 6 ); 7 8 $db_config['host'] = 'localhost'; 4 9 $db_config['user'] = 'root'; 5 10 $db_config['pass'] = ''; -
includes/htmltempl.php
r1 r3 1 <? 1 <?php 2 2 class Html_template 3 3 { … … 15 15 function __construct() 16 16 { 17 ob_start($ compression);17 ob_start($this->compression); 18 18 } 19 19 -
index.php
r1 r3 26 26 $tpl = new Html_template; 27 27 $tpl->global_template = './templates/index.html'; 28 if(!array_key_exists('page', $geted)) $geted['page'] = 'servers'; 28 29 $page_info = $db->query_fetch_assoc('SELECT * FROM `pages` WHERE `page` LIKE "'.$geted['page'].'"'); 29 30 if (empty($page_info)) … … 40 41 $tpl->menu_template = './templates/menu.html'; 41 42 $tpl->output['bg_color'] = '#ffffff'; 42 $db->query('top_online','SELECT `id`, LEFT(`name`, 25) as `name`, CAST(`online_players_sum`/`player_checks` AS UNSIGNED) as online FROM `servers` ORDER BY `online` DESC LIMIT 5');43 $db->query('top_online','SELECT `id`, LEFT(`name`, 25) as `name`, CAST(`online_players_sum`/`player_checks` AS UNSIGNED) as online FROM `servers` ORDER BY `online` DESC LIMIT '.$Config['TopServersCount']); 43 44 $tpl->output['top_online']=''; 44 45 while ($row = $db->strip($db->fetch_assoc('top_online'))) … … 47 48 $tpl->output['top_online_data'].='<li>'.ulink('server/'.$row['id'], $row['name']).' - '.$row['online'].' '.$text['players'].'</li>'; 48 49 } 49 $db->query('top_rating','SELECT `id`, LEFT(`name`, 25) as `name`, `rating_sum`/`ratings` as rating FROM `servers` ORDER BY `rating` DESC LIMIT 5');50 $db->query('top_rating','SELECT `id`, LEFT(`name`, 25) as `name`, `rating_sum`/`ratings` as rating FROM `servers` ORDER BY `rating` DESC LIMIT '.$Config['TopServersCount']); 50 51 $tpl->output['top_rating_data'] = ''; 51 52 while ($row = $db->strip($db->fetch_assoc('top_rating'))) -
lang/en.php
r1 r3 1 1 <?php 2 $text = array ( 3 'top_rating' => '<h3>Top rated servers.</h3>', 4 'top_online' => '<h3Biggest servers.</h3>', 5 'banned' => 'Your account is banned.', 6 'wrong_pass' => 'Wrong password or login.', 7 'loging_ok' => 'Login successful<br />This window will close in few seconds.', 8 'name' => 'Name', 9 'pass' => 'Password', 10 'pass_again' => 'Password again', 11 'pass_ok' => 'Password is correct.', 12 'pass_error' => 'Passwords have to MATCH', 13 'login_ok' => 'This name is correct.', 14 'login_error' => 'This name is already taken.', 15 'no_pass' => 'You have to enter passweord.', 16 'email_ok' => 'Email entered is all right.', 17 'email_wrong' => 'Email entered is in incorrect form.', 18 'email_used' => 'Email you entered is already registred.', 19 'no_login' => 'You have to enter name.', 20 'subject' => 'Registration on WoW Server Status', 21 'email_body' => 'Visit this webpage.<br />', 22 'regiter_success' => 'Check your e-mail for activation code.', 23 'regist_finishing_error' => 'Account not found!', 24 'registr_finished' => ' activated <br /> <a href="'.$config['base_url'].'">Continue by loging in.</a>', 25 'add_server_name_used' => 'Theres already server with that name.', 26 'add_server_not_accept' => 'You have to agree with rules.', 27 'add_server_not_name' =>'You have to fill in Server name.', 28 'add_server_success_msg' => 'Server successfuly added.', 29 'players' => 'Players', 30 'info_owner' => 'Owner', 31 'info_avarage_players' => 'Avearge online players', 32 'info_place' => 'Location', 33 'vote_only' => 'Only registred users can vote, and only one time per server.', 34 'comment_h3' => 'Comments', 35 'no_comments' => 'There are no comments so far.', 36 'added_comment' => 'Comment added', 37 'add_comment'=> 'Add comment', 38 'deny_adding_comments' => 'Only registred users are able to post comments.', 39 'add_comment' => 'Add comment', 40 'server_added_info' => 'Added', 41 'order_by' => 'Sort by', 42 'abroad_servers' => 'Foreign servers', 43 'th_players' => 'Players', 44 'info_servers' =>'Servers', 45 'info_num_of_servers' => 'Number of servers', 46 'info_num_of_comments' => 'Number of comments', 47 'users' => 'Users', 48 'only_logged' => 'Only registred users are able to add servers.\nLog-in, please', 49 'add_server_not_web' => 'You have to fill Server webpages and Registration page in.' 2 $text = array( 3 'top_rating' => '<h3>Top rated servers.</h3>', 4 'top_online' => '<h3>Biggest servers.</h3>', 5 'banned' => 'Your account is banned.', 6 'wrong_pass' => 'Wrong password or login.', 7 'loging_ok' => 'Login successful<br />This window will close in few seconds.', 8 'name' => 'Name', 9 'pass' => 'Password', 10 'pass_again' => 'Password again', 11 'pass_ok' => 'Password is correct.', 12 'pass_error' => 'Passwords have to MATCH', 13 'login_ok' => 'This name is correct.', 14 'login_error' => 'This name is already taken.', 15 'no_pass' => 'You have to enter passweord.', 16 'email_ok' => 'Email entered is all right.', 17 'email_wrong' => 'Email entered is in incorrect form.', 18 'email_used' => 'Email you entered is already registred.', 19 'no_login' => 'You have to enter name.', 20 'subject' => 'Registration on WoW Server Status', 21 'email_body' => 'Visit this webpage.<br />', 22 'regiter_success' => 'Check your e-mail for activation code.', 23 'regist_finishing_error' => 'Account not found!', 24 'registr_finished' => ' activated <br /> <a href="'.$config['base_url'].'">Continue by loging in.</a>', 25 'add_server_name_used' => 'Theres already server with that name.', 26 'add_server_not_accept' => 'You have to agree with rules.', 27 'add_server_not_name' => 'You have to fill in Server name.', 28 'add_server_success_msg' => 'Server successfuly added.', 29 'players' => 'Players', 30 'info_owner' => 'Owner', 31 'info_avarage_players' => 'Avearge online players', 32 'info_place' => 'Location', 33 'vote_only' => 'Only registred users can vote, and only one time per server.', 34 'comment_h3' => 'Comments', 35 'no_comments' => 'There are no comments so far.', 36 'added_comment' => 'Comment added', 37 'add_comment'=> 'Add comment', 38 'deny_adding_comments' => 'Only registred users are able to post comments.', 39 'add_comment' => 'Add comment', 40 'server_added_info' => 'Added', 41 'order_by' => 'Sort by', 42 'abroad_servers' => 'Foreign servers', 43 'th_players' => 'Players', 44 'info_servers' => 'Servers', 45 'info_num_of_servers' => 'Number of servers', 46 'info_num_of_comments' => 'Number of comments', 47 'users' => 'Users', 48 'only_logged' => 'Only registred users are able to add servers.\nLog-in, please', 49 'add_server_not_web' => 'You have to fill Server webpages and Registration page in.' 50 ); 50 51 51 52 53 54 55 );56 52 $text['add_server_h2'] = 'Add server'; 57 53 $text['reg_name_server'] = 'Server name'; … … 67 63 $text['reg_accept_rules'] = 'I agree with these rules.'; 68 64 69 70 65 $dny["Mon"] = "Monday"; 71 72 73 74 75 76 66 $dny["Tue"] = "Tuesday"; 67 $dny["Wed"] = "Wednesday"; 68 $dny["Thu"] = "Thursday"; 69 $dny["Fri"] = "Friday"; 70 $dny["Sat"] = "Saturday"; 71 $dny["Sun"] = "Sunday"; 77 72 78 73 $mesice = array(1=>"January", "February", "March", -
pages/a_servers.php
r1 r3 6 6 $tpl->output['place'] = $text['info_place']; 7 7 8 if(!array_key_exists('order', $_GET)) $_GET['order'] = 0; 8 9 $order_index = (int) $_GET['order']; 9 10 switch ($order_index) … … 57 58 $place = $text['reg_abroad']; 58 59 } 59 $tpl->output['servers_data'] .= '<tr style="overflow: hidden; "class="table center">';60 $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td style="width: 5px;"><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';60 $tpl->output['servers_data'] .= '<tr>'; 61 $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>'; 61 62 $tpl->output['servers_data'] .='<td align="left">'.ulink('server/'.$row['id'], $row['name']).'</td>'; 62 63 $tpl->output['servers_data'] .='<td>'.round($row['rating'],2).'</td>'; -
pages/servers.php
r1 r3 1 1 <?php 2 2 $tpl->output['th_players'] = $text['th_players']; 3 $tpl->output['th_name'] = $text['name'];3 $tpl->output['th_name'] = $text['name']; 4 4 $tpl->output['order_by'] = $text['order_by']; 5 5 $tpl->output['place'] = $text['info_place']; 6 6 7 if(!array_key_exists('order', $_GET)) $_GET['order'] = 0; 7 8 $order_index = (int) $_GET['order']; 8 9 switch ($order_index) 9 10 { 10 11 case 0: $order = ' order by `name` desc '; break; 11 12 case 1: $order = ' order by `rating` desc '; break; … … 15 16 case 5: $order = ' order by `players` desc '; break; 16 17 case 6: $order = ' order by `online` desc '; break; 17 18 } 18 19 $tpl->output['s0'] = ''; 19 20 $tpl->output['s1'] = ''; … … 24 25 $tpl->output['s6'] = ''; 25 26 if (empty($order_index)) 26 27 { 27 28 $tpl->output['s0'] = 'SELECTED'; 28 29 } 29 30 else 30 31 { 31 32 $tpl->output['s'.$order_index] = 'SELECTED'; 32 33 } 33 34 34 35 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`/`online_checks` as `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `place`=1 '.$order, 'p'); 35 $pa->PageSize = 20;36 $pa->PageSize = $Config['DisplayServerCountPerPage']; 36 37 $pa->PageLinksDisplayed = 5; 37 38 $pa->CountCommand = 'select count(*) as Count from `servers` where `place` =1'; … … 39 40 $tpl->output['servers_data'] = ''; 40 41 while ($row = $pa->GetOne()) 42 { 43 switch ($row['xp']) 41 44 { 42 switch ($row['xp'])43 {44 45 case 1: $xp = 'Very low'; break; 45 46 case 2: $xp = 'Low'; break; … … 47 48 case 4: $xp = 'High'; break; 48 49 case 5: $xp = 'Very high'; break; 49 50 if ($row['place'] ==1)51 50 } 51 if ($row['place'] == 1) 52 { 52 53 $place = $text['reg_czech']; 53 54 } 54 55 else 55 56 { 56 57 $place = $text['reg_abroad']; 57 58 $tpl->output['servers_data'] .= '<tr style="overflow: hidden; "class="table center">';59 $tpl->output['servers_data'] .= ($row['wss_partner'] ==1)?'<td style="width: 5px;"><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';58 } 59 $tpl->output['servers_data'] .= '<tr>'; 60 $tpl->output['servers_data'] .= ($row['wss_partner'] == 1)?'<td><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>'; 60 61 $tpl->output['servers_data'] .='<td align="left">'.ulink('server/'.$row['id'], $row['name']).'</td>'; 61 $tpl->output['servers_data'] .='<td>'.round($row['rating'], 2).'</td>';62 $tpl->output['servers_data'] .='<td>'.round($row['rating'], 2).'</td>'; 62 63 $tpl->output['servers_data'] .='<td>'.$row['version'].'</td>'; 63 64 $tpl->output['servers_data'] .='<td>'.$row['type'].'</td>'; -
pages/users.php
r1 r3 34 34 while ($row = $pa->GetOne()) 35 35 { 36 $tpl->output['data'].='<tr class="table"><td>'.print_nick($row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from servers where owner='.$row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from comments where author='.$row['id']).'</td></tr>';36 $tpl->output['data'].='<tr><td align="left">'.print_nick($row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from servers where owner='.$row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from comments where author='.$row['id']).'</td></tr>'; 37 37 } 38 38 ob_start(); -
pages/wss_partners.php
r1 r3 56 56 $place = $text['reg_abroad']; 57 57 } 58 $tpl->output['servers_data'] .= '<tr style="overflow: hidden; "class="table center">';59 $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td style="width: 5px;"><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';58 $tpl->output['servers_data'] .= '<tr>'; 59 $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>'; 60 60 $tpl->output['servers_data'] .='<td align="left">'.ulink('server/'.$row['id'], $row['name']).'</td>'; 61 61 $tpl->output['servers_data'] .='<td>'.round($row['rating'],2).'</td>'; -
scripts/check.php
r1 r3 2 2 require ('../includes/config.php'); 3 3 $db = new tMySql; 4 5 6 7 4 $db->dbServer = $db_config['host']; 5 $db->dbUser = $db_config['user']; 6 $db->dbPassword = $db_config['pass']; 7 $db->dbName = $db_config['name']; 8 8 $db->connect(); 9 9 10 $db->query('del', 'select `id`, `created` from `servers` where (`online`/`online_checks`) <0.8');10 $db->query('del', 'select `id`, `created` from `servers` where (`online`/`online_checks`) < 0.8'); 11 11 while ($row = $db->fetch_assoc('del')) 12 { 13 if (($row['created'] + 3600 * 24 * 3) < time()) 12 14 { 13 if (($row['created']+3600*24*3)<time())14 {15 15 delserver($row['id']); 16 }17 16 } 17 } 18 18 ?> -
templates/a_servers.html
r1 r3 1 1 <h2>{servers_h2}</h2> 2 <div class="table" style="text-align: center; width: 600px">2 <div class="table"> 3 3 <b>{order_by}:</b> <select onchange="location.href='index.php?page=a-servers&order='+this.selectedIndex"> 4 4 <option {s0}>{th_name}</option> … … 11 11 </select> 12 12 </div> 13 <div class="table" style="text-align: center; width: 600px">13 <div class="table"> 14 14 {pager} 15 15 </div> 16 16 17 <table class="table" border="1" style=" width: 600px">18 <tr class="table">17 <table class="table"> 18 <tr> 19 19 <th><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></th> 20 20 <th>{th_name}</th> … … 29 29 </table> 30 30 31 <div class="table" style="text-align: center; width: 600px">31 <div class="table"> 32 32 {pager} 33 33 </div> -
templates/servers.html
r1 r3 1 1 <h2>České servery</h2> 2 <div class="table" style="text-align: center; width: 600px">2 <div class="table"> 3 3 <b>{order_by}:</b> <select onchange="location.href='index.php?page=servers&order='+this.selectedIndex"> 4 4 <option {s0}>{th_name}</option> … … 11 11 </select> 12 12 </div> 13 <div class="table" style="text-align: center; width: 600px">13 <div class="table"> 14 14 {pager} 15 15 </div> 16 16 17 <table class="table" border="1" style=" width: 600px">18 <tr class="table">17 <table class="table"> 18 <tr> 19 19 <th><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></th> 20 20 <th>{th_name}</th> … … 29 29 </table> 30 30 31 <div class="table" style="text-align: center; width: 600px">31 <div class="table" style="text-align: center; width: 500px"> 32 32 {pager} 33 33 </div> -
templates/style/screen2.css
r1 r3 60 60 } 61 61 .box { 62 text-align:left; 63 padding: 20px; 64 background-color: #e6e6e6; 65 border: 1px solid #b8b8b8; 66 width: 272px; 67 margin-bottom: 2px; 62 text-align:left; 63 padding: 20px; 64 background-color: #e6e6e6; 65 border: 1px solid #b8b8b8; 66 width: 272px; 67 margin-bottom: 2px; 68 padding-left: 30px; 69 padding-right: 10px; 68 70 } 69 71 #foot { … … 96 98 border: 1px solid #b8b8b8; 97 99 background: rgb(237,237,237); 98 width: 500px; 99 Border-collapse: collapse; 100 width: 600px; 101 border-collapse: collapse; 102 text-align: center; 103 100 104 } 101 105 102 106 .table td { 103 padding: 5px 15px 5px 15px; 107 border: 1px solid #b8b8b8; 108 padding: 5px 10px 5px 10px; 109 } 110 111 .table th { 112 border: 1px solid #b8b8b8; 113 padding: 2px 5px 2px 5px; 104 114 } 105 115 … … 180 190 background: #ffffff; 181 191 text-align: center; 182 width: 160px; 183 height: 40px; 184 padding: 5px; 192 align: center; 193 _width: 160px; 194 _height: 40px; 195 _padding: 5px; 185 196 margin: 5px auto 5px auto; 186 197 } -
templates/wss_partners.html
r1 r3 1 1 <h2>{wss_partners_h2}</h2> 2 <div class="table" style="text-align: center; width: 600px">2 <div class="table"> 3 3 <b>{order_by}:</b> <select onchange="location.href='index.php?page=wss-partners&order='+this.selectedIndex"> 4 4 <option {s0}>{th_name}</option> … … 11 11 </select> 12 12 </div> 13 <div class="table" style="text-align: center; width: 600px">13 <div class="table"> 14 14 {pager} 15 15 </div> 16 16 17 <table class="table" border="1" style=" width: 600px">18 <tr class="table">17 <table class="table"> 18 <tr> 19 19 <th><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></th> 20 20 <th>{th_name}</th> … … 29 29 </table> 30 30 31 <div class="table" style="text-align: center; width: 600px">31 <div class="table"> 32 32 {pager} 33 33 </div>
Note:
See TracChangeset
for help on using the changeset viewer.