************************************************************************/
// 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('user_count' , (user_confirmed + user_unconfirmed + user_locked));
// Start of this exchange
-define('__MT_START', MAKE_DATETIME($CONFIG['mt_start'], "3"));
+define('__MT_START', MAKE_DATETIME($_CONFIG['mt_start'], "3"));
// Projected number of members
-define('__MT_STAGE', $CONFIG['mt_stage']);
+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']);
-$YEAR = date("Y", $PROJECTED); $MONTH = date("m", $PROJECTED); $DAY = date("d", $PROJECTED);
+$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";
define('sent' , $sent);
// All clicks
-define ('user_links', abs($sent - $clicks));
+define('user_links', abs($sent - $clicks));
$clr = "0.00000";
if ($sent > 0) $clr = $clicks / $sent * 100;
//
// Initialize Variables
-$OUT_EXTRA = ""; $ROWS_EXTRA = 2;
-$OUT_POINTS = ""; $ROWS_POINTS = 2;
-$OUT_USER = ""; $ROWS_USER = 6;
+$OUT_EXTRA = ""; $rowNameS_EXTRA = 2;
+$OUT_POINTS = ""; $rowNameS_POINTS = 2;
+$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);
'value' => $extra
);
$OUT_EXTRA .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
- $ROWS_EXTRA++;
+ $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
'value' => $holiday
);
$OUT_USER .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
- $ROWS_USER++;
+ $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('__POINTS_MEDIADATA' , $OUT_POINTS);
define('__USER_MEDIADATA' , $OUT_USER);
define('__SPECIAL_MEDIADATA', $OUT_SPECIAL);
-define('__ROWSPAN_EXTRA' , $ROWS_EXTRA);
-define('__ROWSPAN_POINTS' , $ROWS_POINTS);
-define('__ROWSPAN_USER' , $ROWS_USER);
+define('__ROWSPAN_EXTRA' , $rowNameS_EXTRA);
+define('__ROWSPAN_POINTS' , $rowNameS_POINTS);
+define('__ROWSPAN_USER' , $rowNameS_USER);
// Patch level and it's timespamp
-define('__PATCH_LEVEL', $CONFIG['patch_level']);
-define('__PATCH_CTIME', MAKE_DATETIME($CONFIG['patch_ctime'], "2"));
+define('__PATCH_LEVEL', $_CONFIG['patch_level']);
+define('__PATCH_CTIME', MAKE_DATETIME($_CONFIG['patch_ctime'], "2"));
// Load template
-OPEN_TABLE("100%", "guest_content", "center", "top");
LOAD_TEMPLATE("mediadata");
-CLOSE_TABLE();
//
?>