Skip to content

Commit

Permalink
General cleanup
Browse files Browse the repository at this point in the history
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
  • Loading branch information
paintballrefjosh committed Feb 10, 2017
1 parent d5d7149 commit 94e3cc7
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 31 deletions.
2 changes: 1 addition & 1 deletion inc/admin/script_files/admin.fplinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'1-News',
'2-Account',
'3-GameGuide',
'4-Interactive',
'4-Workshop',
'5-Media',
'6-Forums',
'7-Community',
Expand Down
17 changes: 14 additions & 3 deletions inc/admin/template_files/admin.chartools.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,22 @@
<center><h2><?php echo $lang['char_list']; ?></h2></center>
<table>
<tr>
<td align='center'> <b><?php echo $lang['realm']; ?>:</b><br />|
<td align='center'> <b><?php echo $lang['realm']; ?>:</b><br />
<?php
$x = 0;
foreach($Realms as $Rlm)
{
echo "<a href=\"javascript:setcookie('cur_selected_realm', '". $Rlm['id'] ."'); window.location.reload();\">";
if($x == 1)
{
$separator = " | ";
}
else
{
$separator = "";
$x = 1;
}

echo $separator . "<a href=\"javascript:setcookie('cur_selected_realm', '". $Rlm['id'] ."'); window.location.reload();\">";
if($user['cur_selected_realm'] == $Rlm['id'])
{
echo "<b><font color=green>".$Rlm['name']."</font></b>";
Expand All @@ -213,7 +224,7 @@
{
echo $Rlm['name'];
}
echo "</a> | ";
echo "</a>";
}
?>
</td>
Expand Down
17 changes: 14 additions & 3 deletions inc/admin/template_files/admin.sendgamemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,23 @@
<h2><center>Send In Game Mail</center></h2>
<table>
<tr>
<td align='center'> <b><?php echo $lang['realm']; ?>:</b><br />|
<td align='center'><b><?php echo $lang['realm']; ?>:</b><br />
<?php
$Realms = getRealmlist('0');
$x = 0;
foreach($Realms as $Rlm)
{
echo "<a href=\"javascript:setcookie('cur_selected_realm', '". $Rlm['id'] ."'); window.location.reload();\">";
if($x == 1)
{
$separator = " | ";
}
else
{
$separator = "";
$x = 1;
}

echo $separator . "<a href=\"javascript:setcookie('cur_selected_realm', '". $Rlm['id'] ."'); window.location.reload();\">";
if($user['cur_selected_realm'] == $Rlm['id'])
{
echo "<b><font color=green>".$Rlm['name']."</font></b>";
Expand All @@ -43,7 +54,7 @@
{
echo $Rlm['name'];
}
echo "</a> | ";
echo "</a>";
}
?>
</td>
Expand Down
11 changes: 7 additions & 4 deletions inc/server/server.chars.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -43,7 +46,7 @@

$cc = 0;

// array´s
// arrays
$query1 = array();

//===== Filter ==========//
Expand Down
5 changes: 2 additions & 3 deletions inc/server/server.playersonline.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/* Original MangosWeb (C) 2007, Sasha, Nafe, TGM, Peec */
/****************************************************************************/

//========================//
if(INCLUDED !== TRUE) {
echo "Not Included!";
exit;
Expand All @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions inc/server/server.statistic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -35,8 +35,6 @@
}

$num_chars += $data[$i];

// echo "data[$i] = ".$data[$i]." - num_chars = $num_chars<br>";
}

//Check if 0 entries to avoid PHP warnings if 0 chars in database.
Expand Down
29 changes: 15 additions & 14 deletions install/sql/full_install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 94e3cc7

Please sign in to comment.