************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
-}
- elseif (!EXT_IS_ACTIVE("mediadata"))
-{
+} elseif (!EXT_IS_ACTIVE("mediadata")) {
ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "mediadata");
return;
}
define('__MT_STAGE', $_CONFIG['mt_stage']);
// Project timestamp when number of members are reached
-$PROJECTED = round((time() - $_CONFIG['mt_start']) / user_count * $_CONFIG['mt_stage'] + $_CONFIG['mt_start']);
+$PROJECTED = 0;
+if (user_count > 0) {
+ $PROJECTED = round((time() - $_CONFIG['mt_start']) / user_count * $_CONFIG['mt_stage'] + $_CONFIG['mt_start']);
+}
+
$YEAR = date('Y', $PROJECTED); $MONTH = date("m", $PROJECTED); $DAY = date("d", $PROJECTED);
$TEST = mktime(0, 0, 0, $MONTH, $DAY, $YEAR);
-if ($TEST > time())
-{
+if ($TEST > time()) {
define('__MT_PROJECTED', MAKE_DATETIME($PROJECTED, "3"));
-}
- else
-{
+} else {
define('__MT_PROJECTED', USER_PROJECTION_UNKNOWN);
}
if (empty($clicks)) $clicks = "0";
// Bonus mails
-if (EXT_IS_ACTIVE("bonus"))
-{
+if (EXT_IS_ACTIVE("bonus")) {
$bmails = MEDIA_GET_ENTRY("bonus_orders");
if (empty($bmails)) $bmails = "0";
$OUT_USER = ""; $rowNameS_USER = 6;
$OUT_SPECIAL = ""; // We don't need row count here
-if (EXT_IS_ACTIVE("beg"))
-{
+if (EXT_IS_ACTIVE("beg")) {
// Clicks on beg links
$result = SQL_QUERY("SELECT SUM(beg_clicks) FROM "._MYSQL_PREFIX."_user_data WHERE beg_clicks>0", __FILE__, __LINE__);
list($extra) = SQL_FETCHROW($result);
$OUT_EXTRA .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
$rowNameS_EXTRA++;
}
-if (EXT_IS_ACTIVE("doubler"))
-{
+
+if (EXT_IS_ACTIVE("doubler")) {
// Total payed points
$result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM "._MYSQL_PREFIX."_doubler WHERE completed='Y' AND points > 0", __FILE__, __LINE__);
list($count1, $points1) = SQL_FETCHROW($result);
$OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
}
-if (EXT_IS_ACTIVE("holiday"))
-{
+if (EXT_IS_ACTIVE("holiday")) {
// Total holiday requests
$result = SQL_QUERY("SELECT DISTINCT COUNT(h.userid)
FROM "._MYSQL_PREFIX."_user_holidays AS h
$rowNameS_USER++;
}
-if (EXT_IS_ACTIVE("transfer"))
-{
+if (EXT_IS_ACTIVE("transfer")) {
// Statistics for points transfers
$result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points)
FROM "._MYSQL_PREFIX."_user_transfers_in AS t
define('__PATCH_CTIME', MAKE_DATETIME($_CONFIG['patch_ctime'], "2"));
// Load template
-OPEN_TABLE("100%", "guest_content", "center", "top");
LOAD_TEMPLATE("mediadata");
-CLOSE_TABLE();
//
?>