diff --git a/public/.htaccess b/public/.htaccess index 1caaddc0..9750f3bb 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,3 +1,4 @@ +ErrorDocument 404 /index.php?page=error&action=404 RedirectMatch 404 /templates(/|$) RedirectMatch 404 /include(/|$) RedirectMatch 404 /.git(/|$) diff --git a/public/include/pages/error.inc.php b/public/include/pages/error.inc.php new file mode 100644 index 00000000..aecab054 --- /dev/null +++ b/public/include/pages/error.inc.php @@ -0,0 +1,9 @@ +assign("CONTENT", "default.tpl"); +?> diff --git a/public/include/pages/error/404.inc.php b/public/include/pages/error/404.inc.php new file mode 100644 index 00000000..aecab054 --- /dev/null +++ b/public/include/pages/error/404.inc.php @@ -0,0 +1,9 @@ +assign("CONTENT", "default.tpl"); +?> diff --git a/public/index.php b/public/index.php index f8ccb438..db94059e 100644 --- a/public/index.php +++ b/public/index.php @@ -51,7 +51,13 @@ if (is_dir(INCLUDE_DIR . '/pages/')) { } // Set a default action here if no page has been requested -$page = isset($_REQUEST['page']) && isset($arrPages[$_REQUEST['page']]) ? $_REQUEST['page'] : 'home'; +if (isset($_REQUEST['page']) && isset($arrPages[$_REQUEST['page']])) { + $page = $_REQUEST['page']; +} else if (isset($_REQUEST['page']) && ! isset($arrPages[$_REQUEST['page']])) { + $page = 'error'; +} else { + $page = 'home'; +} // Create our pages array from existing files if (is_dir(INCLUDE_DIR . '/pages/' . $page)) { diff --git a/public/templates/mmcFE/error/404/default.tpl b/public/templates/mmcFE/error/404/default.tpl new file mode 100644 index 00000000..a951eb30 --- /dev/null +++ b/public/templates/mmcFE/error/404/default.tpl @@ -0,0 +1,3 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="{$GLOBAL.website.name}" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"} +

The page you requested was not found.

+{include file="global/block_footer.tpl"} diff --git a/public/templates/mmcFE/error/default.tpl b/public/templates/mmcFE/error/default.tpl new file mode 100644 index 00000000..a951eb30 --- /dev/null +++ b/public/templates/mmcFE/error/default.tpl @@ -0,0 +1,3 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="{$GLOBAL.website.name}" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"} +

The page you requested was not found.

+{include file="global/block_footer.tpl"} diff --git a/public/templates/mmcFE/global/login.tpl b/public/templates/mmcFE/global/login.tpl index 363f403e..9df043a0 100644 --- a/public/templates/mmcFE/global/login.tpl +++ b/public/templates/mmcFE/global/login.tpl @@ -1,4 +1,4 @@ -{include file="global/block_header.tpl" BLOCK_HEADER="Login" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"} +{include file="global/block_header.tpl" BLOCK_HEADER="Login" BLOCK_STYLE="clear:none; margin-left:13px; margin-top:15px;"}

diff --git a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl index e5c99524..c23e6f06 100644 --- a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl +++ b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl @@ -15,7 +15,7 @@ {assign var=listed value=0} {section contrib $CONTRIBHASHES} {math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate} - + {$rank++} {if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if} {($CONTRIBHASHES[contrib].hashrate * $GLOBAL.hashmods.personal)|number_format:"2"} diff --git a/public/templates/mmcFE/statistics/pool/contributors_shares.tpl b/public/templates/mmcFE/statistics/pool/contributors_shares.tpl index e14d3d8e..08b331c8 100644 --- a/public/templates/mmcFE/statistics/pool/contributors_shares.tpl +++ b/public/templates/mmcFE/statistics/pool/contributors_shares.tpl @@ -12,7 +12,7 @@ {assign var=rank value=1} {assign var=listed value=0} {section shares $CONTRIBSHARES} - + {$rank++} {if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if} {$CONTRIBSHARES[shares].shares|number_format} diff --git a/public/templates/mobile/error/404/default.tpl b/public/templates/mobile/error/404/default.tpl new file mode 100644 index 00000000..c423d2fa --- /dev/null +++ b/public/templates/mobile/error/404/default.tpl @@ -0,0 +1 @@ +

The page you requested was not found.

diff --git a/public/templates/mobile/error/default.tpl b/public/templates/mobile/error/default.tpl new file mode 100644 index 00000000..c423d2fa --- /dev/null +++ b/public/templates/mobile/error/default.tpl @@ -0,0 +1 @@ +

The page you requested was not found.

diff --git a/public/templates/mpos/error/404/default.tpl b/public/templates/mpos/error/404/default.tpl new file mode 100644 index 00000000..36f017b7 --- /dev/null +++ b/public/templates/mpos/error/404/default.tpl @@ -0,0 +1,6 @@ +
+

{$GLOBAL.website.name}

+
+

The page you requested was not found.

+
+
diff --git a/public/templates/mpos/error/default.tpl b/public/templates/mpos/error/default.tpl new file mode 100644 index 00000000..36f017b7 --- /dev/null +++ b/public/templates/mpos/error/default.tpl @@ -0,0 +1,6 @@ +
+

{$GLOBAL.website.name}

+
+

The page you requested was not found.

+
+
diff --git a/public/templates/mpos/statistics/pool/contributors_hashrate.tpl b/public/templates/mpos/statistics/pool/contributors_hashrate.tpl index 54b71788..a6af1a57 100644 --- a/public/templates/mpos/statistics/pool/contributors_hashrate.tpl +++ b/public/templates/mpos/statistics/pool/contributors_hashrate.tpl @@ -17,7 +17,7 @@ {assign var=listed value=0} {section contrib $CONTRIBHASHES} {math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate} - + {$rank++} {if $CONTRIBHASHES[contrib].donate_percent > 0}{/if} {if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if} diff --git a/public/templates/mpos/statistics/pool/contributors_shares.tpl b/public/templates/mpos/statistics/pool/contributors_shares.tpl index d61b73be..80ad4b23 100644 --- a/public/templates/mpos/statistics/pool/contributors_shares.tpl +++ b/public/templates/mpos/statistics/pool/contributors_shares.tpl @@ -13,7 +13,7 @@ {assign var=rank value=1} {assign var=listed value=0} {section shares $CONTRIBSHARES} - + {$rank++} {if $CONTRIBSHARES[shares].donate_percent > 0}{/if} {if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}