From 94e3cc7c989b68dae057b63983b52c3352e1ad58 Mon Sep 17 00:00:00 2001 From: paintballrefjosh Date: Thu, 9 Feb 2017 22:46:08 -0600 Subject: [PATCH] General cleanup SQL installation file - Added Server Statistics page - Reordered entries - Removed hard set item ID from insert statements, used NULL instead so DB will auto_increment Server Statistics - Removed unused lines of code - Cleaned up top menu breadcrumb links Players Online - Cleaned up top menu breadcrumb links Admin In Game Email & Character Tools - Cleaned up the way the realm names were listed --- inc/admin/script_files/admin.fplinks.php | 2 +- inc/admin/template_files/admin.chartools.php | 17 +++++++++-- .../template_files/admin.sendgamemail.php | 17 +++++++++-- inc/server/server.chars.php | 11 ++++--- inc/server/server.playersonline.php | 5 ++-- inc/server/server.statistic.php | 4 +-- install/sql/full_install.sql | 29 ++++++++++--------- 7 files changed, 54 insertions(+), 31 deletions(-) diff --git a/inc/admin/script_files/admin.fplinks.php b/inc/admin/script_files/admin.fplinks.php index 39531ea..33c208c 100644 --- a/inc/admin/script_files/admin.fplinks.php +++ b/inc/admin/script_files/admin.fplinks.php @@ -18,7 +18,7 @@ '1-News', '2-Account', '3-GameGuide', - '4-Interactive', + '4-Workshop', '5-Media', '6-Forums', '7-Community', diff --git a/inc/admin/template_files/admin.chartools.php b/inc/admin/template_files/admin.chartools.php index e197ec3..f18dd81 100644 --- a/inc/admin/template_files/admin.chartools.php +++ b/inc/admin/template_files/admin.chartools.php @@ -200,11 +200,22 @@

- diff --git a/inc/admin/template_files/admin.sendgamemail.php b/inc/admin/template_files/admin.sendgamemail.php index 6d100fb..10d630a 100644 --- a/inc/admin/template_files/admin.sendgamemail.php +++ b/inc/admin/template_files/admin.sendgamemail.php @@ -29,12 +29,23 @@

Send In Game Mail

:
| +
:
"; + if($x == 1) + { + $separator = " | "; + } + else + { + $separator = ""; + $x = 1; + } + + echo $separator . ""; if($user['cur_selected_realm'] == $Rlm['id']) { echo "".$Rlm['name'].""; @@ -213,7 +224,7 @@ { echo $Rlm['name']; } - echo " | "; + echo ""; } ?>
- diff --git a/inc/server/server.chars.php b/inc/server/server.chars.php index 9b42e6c..291641d 100644 --- a/inc/server/server.chars.php +++ b/inc/server/server.chars.php @@ -8,13 +8,16 @@ /* Original MangosWeb (C) 2007, Sasha, Nafe, TGM, Peec */ /****************************************************************************/ -//========================// if(INCLUDED !== TRUE) { echo "Not Included!"; exit; } -$pathway_info[] = array('title'=>$lang['Characters'],'link'=>''); -//========================// + +// build top of page navigation breadcrumbs +$realm = $DB->selectRow("SELECT * FROM realmlist WHERE `id`='".$user['cur_selected_realm']."' LIMIT 1"); +$pathway_info[] = array('title' => $lang['Characters'], 'link' => '?p=server&sub=chars'); +$pathway_info[] = array('title' => $realm['name'], 'link' => ''); + // Tell the cache not to cache the file because theres more then 1 page define("CACHE_FILE", FALSE); @@ -43,7 +46,7 @@ $cc = 0; -// array´s +// arrays $query1 = array(); //===== Filter ==========// diff --git a/inc/server/server.playersonline.php b/inc/server/server.playersonline.php index 0057dfb..2666719 100644 --- a/inc/server/server.playersonline.php +++ b/inc/server/server.playersonline.php @@ -8,7 +8,6 @@ /* Original MangosWeb (C) 2007, Sasha, Nafe, TGM, Peec */ /****************************************************************************/ -//========================// if(INCLUDED !== TRUE) { echo "Not Included!"; exit; @@ -22,10 +21,10 @@ redirect("?p=server&sub=playersonline",1); } -// ==================== // +// build top of page navigation breadcrumbs +$realm = $DB->selectRow("SELECT * FROM realmlist WHERE `id`='".$user['cur_selected_realm']."' LIMIT 1"); $pathway_info[] = array('title' => $lang['online_players'], 'link' => '?p=server&sub=playersonline'); $pathway_info[] = array('title' => $realm['name'], 'link' => ''); -// ==================== // // Tell the cache not to cache the file because we want live feeds define("CACHE_FILE", FALSE); diff --git a/inc/server/server.statistic.php b/inc/server/server.statistic.php index f370105..278436e 100644 --- a/inc/server/server.statistic.php +++ b/inc/server/server.statistic.php @@ -12,13 +12,13 @@ echo "Not Included!"; exit; } +// build top of page navigation breadcrumbs $realm = $DB->selectRow("SELECT * FROM realmlist WHERE `id`='".$user['cur_selected_realm']."' LIMIT 1"); $pathway_info[] = array('title' => 'Server Statistics', 'link' => '?p=server&sub=statistic'); $pathway_info[] = array('title' => $realm['name'], 'link' => ''); //initialize $num_chars variable $num_chars = 0; -//$realm_param = get_realm_byid($_COOKIE['cur_selected_realm']);; $rc = $CDB->select("SELECT race, count(race) AS `num` FROM `characters` GROUP BY race"); foreach($rc as $row) @@ -35,8 +35,6 @@ } $num_chars += $data[$i]; - - // echo "data[$i] = ".$data[$i]." - num_chars = $num_chars
"; } //Check if 0 entries to avoid PHP warnings if 0 chars in database. diff --git a/install/sql/full_install.sql b/install/sql/full_install.sql index 5c16bed..3c060c9 100644 --- a/install/sql/full_install.sql +++ b/install/sql/full_install.sql @@ -181,20 +181,21 @@ CREATE TABLE `mw_menu_items` ( -- ---------------------------- -- Records of mw_menu_items -- ---------------------------- -INSERT INTO `mw_menu_items` VALUES ('1', 'News', './', '1', '1', '0', '1'); -INSERT INTO `mw_menu_items` VALUES ('1', 'RSS', 'rss.php', '2', '1', '0', '2'); -INSERT INTO `mw_menu_items` VALUES ('2', 'Register', '?p=account&sub=register', '1', '1', '1', '3'); -INSERT INTO `mw_menu_items` VALUES ('2', 'Admin Panel', '?p=admin', '1', '3', '0', '4'); -INSERT INTO `mw_menu_items` VALUES ('7', 'Vote', '?p=vote', '1', '2', '0', '5'); -INSERT INTO `mw_menu_items` VALUES ('7', 'Shop', '?p=shop', '3', '2', '0', '6'); -INSERT INTO `mw_menu_items` VALUES ('2', 'Manage Account', '?p=account', '2', '2', '0', '7'); -INSERT INTO `mw_menu_items` VALUES ('4', 'Server Characters', '?p=server&sub=chars', '2', '1', '0', '8'); -INSERT INTO `mw_menu_items` VALUES ('4', 'Players Online', '?p=server&sub=playersonline', '3', '1', '0', '9'); -INSERT INTO `mw_menu_items` VALUES ('8', 'FAQ', '?p=support&sub=faq', '1', '1', '0', '10'); -INSERT INTO `mw_menu_items` VALUES ('7', 'Donate', '?p=donate', '2', '2', '0', '11'); -INSERT INTO `mw_menu_items` VALUES ('4', 'Realm Status', '?p=server&sub=realmstatus', '1', '1', '0', '12'); -INSERT INTO `mw_menu_items` VALUES ('2', 'Account Restore', '?p=account&sub=restore', '2', '1', '1', '13'); -INSERT INTO `mw_menu_items` VALUES ('4', 'Top Kills', '?p=server&sub=topkills', '1', '1', '0', '14'); +INSERT INTO `mw_menu_items` VALUES ('1', 'News', './', '1', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('1', 'RSS', 'rss.php', '2', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('2', 'Admin Panel', '?p=admin', '1', '3', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('2', 'Manage Account', '?p=account', '2', '2', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('2', 'Register', '?p=account&sub=register', '3', '1', '1', NULL); +INSERT INTO `mw_menu_items` VALUES ('2', 'Account Restore', '?p=account&sub=restore', '4', '1', '1', NULL); +INSERT INTO `mw_menu_items` VALUES ('4', 'Top Kills', '?p=server&sub=topkills', '1', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('4', 'Characters', '?p=server&sub=chars', '2', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('4', 'Players Online', '?p=server&sub=playersonline', '3', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('4', 'Realm Status', '?p=server&sub=realmstatus', '4', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('4', 'Server Statistics', '?p=server&sub=statistic', '5', '1', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('7', 'Donate', '?p=donate', '1', '2', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('7', 'Vote', '?p=vote', '2', '2', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('7', 'Shop', '?p=shop', '3', '2', '0', NULL); +INSERT INTO `mw_menu_items` VALUES ('8', 'FAQ', '?p=support&sub=faq', '1', '1', '0', NULL); -- ---------------------------- -- Table structure for `mw_news`
:
| +
:
"; + if($x == 1) + { + $separator = " | "; + } + else + { + $separator = ""; + $x = 1; + } + + echo $separator . ""; if($user['cur_selected_realm'] == $Rlm['id']) { echo "".$Rlm['name'].""; @@ -43,7 +54,7 @@ { echo $Rlm['name']; } - echo " | "; + echo ""; } ?>