]> git.mxchange.org Git - mailer.git/commitdiff
- Daily/weekly/monthly reset completely rewritten
authorRoland Häder <roland@mxchange.org>
Mon, 8 Sep 2008 18:39:37 +0000 (18:39 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 8 Sep 2008 18:39:37 +0000 (18:39 +0000)
- Saving of non-admin config entries rewritten
- Statistics added to surfbar bottom frame
- GET_EXT_ID() and GET_EXT_NAME() rewritten due to load-extensions.php is
  rewritten too!
- Double close of database link fixed (causes double write of config)
- Several minor improvments/fixes
- Obsolete inc/monthly_newsletter.php removed

74 files changed:
.gitattributes
doubler.php
inc/db/lib-mysql3.php
inc/doubler_send.php
inc/extensions.php
inc/extensions/ext-
inc/extensions/ext-beg.php
inc/extensions/ext-bonus.php
inc/extensions/ext-holiday.php
inc/extensions/ext-newsletter.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-surfbar.php
inc/extensions/ext-yoomedia.php
inc/functions.php
inc/gen_sql_patches.php
inc/language/surfbar_de.php
inc/libs/cache_functions.php
inc/libs/output_functions.php
inc/libs/surfbar_functions.php
inc/load_extensions.php
inc/mails/beg_mails.php
inc/mails/bonus_mails.php
inc/modules/admin.php
inc/modules/admin/action-
inc/modules/admin/action-surfbar.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-
inc/modules/admin/what-config_home.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-list_surfbar_reflvl.php
inc/modules/admin/what-list_surfbar_urls.php
inc/modules/admin/what-maintenance.php
inc/modules/admin/what-unlock_surfbar_urls.php [new file with mode: 0644]
inc/modules/admin/what-user_contct.php
inc/modules/guest/action-
inc/modules/guest/action-online.php
inc/modules/login.php
inc/modules/member/action-
inc/modules/member/action-surfbar.php
inc/modules/member/what-
inc/modules/member/what-mydata.php
inc/modules/member/what-surfbar_book.php [new file with mode: 0644]
inc/modules/member/what-surfbar_start.php
inc/monthly/monthly_
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/monthly/monthly_surfbar.php [new file with mode: 0644]
inc/monthly_newsletter.php [deleted file]
inc/mysql-connect.php
inc/mysql-manager.php
inc/patch-system.php
inc/reset/reset_
inc/reset/reset_beg.php
inc/reset/reset_daily.php
inc/reset/reset_holiday.php
inc/reset/reset_surfbar.php [new file with mode: 0644]
inc/theme-manager.php
inc/weekly/.htaccess [new file with mode: 0644]
inc/weekly/weekly_ [new file with mode: 0644]
inc/weekly/weekly_surfbar.php [new file with mode: 0644]
surfbar.php
templates/de/emails/admin/admin_surfbar_url_reg.tpl [new file with mode: 0644]
templates/de/emails/admin/admin_surfbar_url_unlock.tpl
templates/de/emails/member/member_surfbar_url_reg.tpl [new file with mode: 0644]
templates/de/html/admin/admin_config_surfbar.tpl
templates/de/html/member/member_surfbar_book_dynamic.tpl [new file with mode: 0644]
templates/de/html/member/member_surfbar_book_static.tpl [new file with mode: 0644]
templates/de/html/surfbar/surfbar_frame_stats.tpl [new file with mode: 0644]
templates/de/html/surfbar/surfbar_frame_top.tpl
templates/de/html/surfbar/surfbar_frameset.tpl
templates/de/html/surfbar/surfbar_stopped.tpl

index 57e22a6f053cff200a7a0db1833c7be9246e3b21..f0758879806a528ad3723ade7029d2c3cbfe7b41 100644 (file)
@@ -363,6 +363,7 @@ inc/modules/admin/what-theme_edit.php -text
 inc/modules/admin/what-theme_import.php -text
 inc/modules/admin/what-unlock_emails.php -text
 inc/modules/admin/what-unlock_sponsor.php -text
+inc/modules/admin/what-unlock_surfbar_urls.php -text
 inc/modules/admin/what-updates.php -text
 inc/modules/admin/what-usage.php -text
 inc/modules/admin/what-user_contct.php -text
@@ -441,6 +442,7 @@ inc/modules/member/what-reflinks.php -text
 inc/modules/member/what-sponsor.php -text
 inc/modules/member/what-stats.php -text
 inc/modules/member/what-support.php -text
+inc/modules/member/what-surfbar_book.php -text
 inc/modules/member/what-surfbar_start.php -text
 inc/modules/member/what-themes.php -text
 inc/modules/member/what-transfer.php -text
@@ -460,7 +462,7 @@ inc/monthly/monthly_ -text
 inc/monthly/monthly_beg.php -text
 inc/monthly/monthly_bonus.php -text
 inc/monthly/monthly_newsletter.php -text
-inc/monthly_newsletter.php -text
+inc/monthly/monthly_surfbar.php -text
 inc/mysql-connect.php -text
 inc/mysql-manager.php -text
 inc/patch-system.php -text
@@ -536,12 +538,16 @@ inc/reset/reset_bonus.php -text
 inc/reset/reset_daily.php -text
 inc/reset/reset_engine.php -text
 inc/reset/reset_holiday.php -text
+inc/reset/reset_surfbar.php -text
 inc/security.php -text
 inc/session.php -text
 inc/sql_error.php -text
 inc/stats_bonus.php -text
 inc/stylesheet.php -text
 inc/theme-manager.php -text
+inc/weekly/.htaccess -text
+inc/weekly/weekly_ -text
+inc/weekly/weekly_surfbar.php -text
 /index.php -text
 /install.php -text
 install/menu-de.sql -text
@@ -594,6 +600,7 @@ templates/de/emails/admin/admin_support-order.tpl -text
 templates/de/emails/admin/admin_support-ordr.tpl -text
 templates/de/emails/admin/admin_support-reflink.tpl -text
 templates/de/emails/admin/admin_support-unconfirmed.tpl -text
+templates/de/emails/admin/admin_surfbar_url_reg.tpl -text
 templates/de/emails/admin/admin_surfbar_url_unlock.tpl -text
 templates/de/emails/admin/admin_transfer_ap.tpl -text
 templates/de/emails/admin/admin_transfer_points.tpl -text
@@ -658,6 +665,7 @@ templates/de/emails/member/member_support-order.tpl -text
 templates/de/emails/member/member_support-ordr.tpl -text
 templates/de/emails/member/member_support-reflink.tpl -text
 templates/de/emails/member/member_support-unconfirmed.tpl -text
+templates/de/emails/member/member_surfbar_url_reg.tpl -text
 templates/de/emails/member/member_surfbar_url_unlock.tpl -text
 templates/de/emails/member/member_transfer_recipient.tpl -text
 templates/de/emails/member/member_transfer_sender.tpl -text
@@ -1240,6 +1248,8 @@ templates/de/html/member/member_stats_table.tpl -text
 templates/de/html/member/member_support_contacted.tpl -text
 templates/de/html/member/member_support_contcted.tpl -text
 templates/de/html/member/member_support_form.tpl -text
+templates/de/html/member/member_surfbar_book_dynamic.tpl -text
+templates/de/html/member/member_surfbar_book_static.tpl -text
 templates/de/html/member/member_surfbar_link.tpl -text
 templates/de/html/member/member_surfbar_start_static.tpl -text
 templates/de/html/member/member_themes.tpl -text
@@ -1291,6 +1301,7 @@ templates/de/html/sponsor/sponsor_what.tpl -text
 templates/de/html/surfbar/.htaccess -text
 templates/de/html/surfbar/surfbar_frame_banner.tpl -text
 templates/de/html/surfbar/surfbar_frame_start.tpl -text
+templates/de/html/surfbar/surfbar_frame_stats.tpl -text
 templates/de/html/surfbar/surfbar_frame_top.tpl -text
 templates/de/html/surfbar/surfbar_frameset.tpl -text
 templates/de/html/surfbar/surfbar_start_banner.tpl -text
index ca2934f7b6cd3e9f1d2fb759a8dd4394b3b38cff..53ee0682606feaf46f0c85fdc7c85c76fcc8ead3 100644 (file)
@@ -138,16 +138,9 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
 
                                        // Add points to "total payed" including charge
                                        $points = $_POST['points'] - $_POST['points'] * $_CONFIG['doubler_charge'];
-                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET doubler_points=doubler_points+%s WHERE config=0 LIMIT 1",
-                                        array($points), __FILE__, __LINE__);
+                                       UPDATE_CONFIG("doubler_points", $points, "+");
                                        $_CONFIG['doubler_points'] += $points;
 
-                                       // Destroy cache
-                                       if (GET_EXT_VERSION("cache") >= "0.1.2")
-                                       {
-                                               if ($cacheInstance->cache_file("config", true)) $cacheInstance->cache_destroy();
-                                       }
-
                                        // Add second line for the referral but only when uid != refid
                                        if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid))
                                        {
@@ -159,7 +152,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                        }
 
                                        // Update usage counter
-                                       $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET doubler_counter=doubler_counter+1 WHERE config=0 LIMIT 1", __FILE__, __LINE__);
+                                       UPDATE_CONFIG("doubler_counter", 1, "+");
                                        $_CONFIG['doubler_counter']++;
 
                                        // Set constant
index 44bcbdcb920d1e665da12d7f74849fe665ebe8c4..f8eceec4b33efc69e89861f8fd5efbb7769e294b 100644 (file)
@@ -177,25 +177,22 @@ function SQL_SELECT_DB($dbName, $link, $F, $L) {
        return $select;
 }
 // SQL close link
-function SQL_CLOSE($link, $F, $L) {
+function SQL_CLOSE(&$link, $F, $L) {
+       // Is there still a valid link?
+       if (!is_resource($link)) {
+               // Skip double close
+               return false;
+       } // END - if
+
        global $_CONFIG, $cacheInstance, $cacheArray;
        if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($cacheInstance))) {
                // Update counter for db/cache
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET db_hits=%s, cache_hits=%s WHERE config=0 LIMIT 1",
-                       array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits'])), __FILE__, __LINE__);
-
-               // Update cache here
-               if (GET_EXT_VERSION("cache") >= "0.1.2") {
-                       if ($cacheInstance->cache_file("config", true)) {
-                               // Replace data
-                               $cacheInstance->cache_replace("cache_hits", $_CONFIG['cache_hits'], "0", $cacheArray);
-                               $cacheInstance->cache_replace("db_hits"   , $_CONFIG['db_hits']   , "0", $cacheArray);
-                       }
-               }
-       }
+               UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits'])));
+       } // END - if
 
-       // Close database link
+       // Close database link and forget the link
        $close = @mysql_close($link) or ADD_FATAL($F." (".$L."):".mysql_error());
+       $link = null;
        return $close;
 }
 // SQL free result
index a0d6ee84049095f6ecda8aa0c9ddd73e740e4928..71685ced4ea0542deff4ce7aae370565676ce932 100644 (file)
@@ -148,17 +148,9 @@ if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y"))
                        }
 
                        // Update doubler's account only when others are not updated
-                       if (!$OK)
-                       {
+                       if (!$OK) {
                                // Add points to used doubler points
-                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET doubler_used=doubler_used+%s WHERE config=0 LIMIT 1",
-                                array($points), __FILE__, __LINE__);
-
-                               // Destroy cache
-                               if (GET_EXT_VERSION("cache") >= "0.1.2")
-                               {
-                                       if ($cacheInstance->cache_file("config", true)) $cacheInstance->cache_destroy();
-                               }
+                               UPDATE_CONFIG("douber_used", $points, "+");
                        }
 
                        // Update variables to prevent errors
index fa5e463b8f089aef5cefb1bc9beb4074473875bb..5c15cdf857b98c597056170afe23759c6a26ac56 100644 (file)
@@ -471,7 +471,7 @@ function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
                        {
                                // Task not created so it's a brand-new extension which we need to register and create a task for!
                                $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES ('%s', '0', 'NEW', 'EXTENSION_UPDATE', '%s', '%s', UNIX_TIMESTAMP())",
-                                array(GET_ADMIN_ID(SQL_ESCAPE(get_session('admin_login'))), $ext_subj, addslashes($NOTES)), __FILE__, __LINE__);
+                                array(GET_ADMIN_ID(get_session('admin_login')), $ext_subj, addslashes($NOTES)), __FILE__, __LINE__);
                        }
 
                        // Free memory
@@ -547,21 +547,17 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL,
        // Return output
        return $OUT;
 }
-//
-function GET_EXT_NAME($id)
-{
+// Get extension name from id
+function GET_EXT_NAME ($id) {
        $ret = "";
        global $cacheArray, $_CONFIG;
-       if (!empty($cacheArray['extensions']['ext_id'][$id]))
-       {
+       if (!empty($cacheArray['extensions']['ext_name'][$id])) {
                // Load from cache
-               $ret = $cacheArray['extensions']['ext_id'][$id];
+               $ret = $cacheArray['extensions']['ext_name'][$id];
 
                // Count cache hits
                $_CONFIG['cache_hits']++;
-       }
-        else
-       {
+       } elseif (!EXT_IS_ACTIVE("cache")) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
@@ -570,27 +566,25 @@ function GET_EXT_NAME($id)
        }
        return $ret;
 }
-//
-function GET_EXT_ID($name)
-{
-       $ret = "0";
+// Get extension id from name
+function GET_EXT_ID($name) {
+       $ret = 0;
        global $cacheArray, $_CONFIG;
-       if ((isset($cacheArray['extensions']['ext_id'])) && (is_array($cacheArray['extensions']['ext_id'])))
-       {
+       if (isset($cacheArray['extensions']['ext_id'][$name])) {
                // Load from cache
-               $ret = array_search($name, $cacheArray['extensions']['ext_id']);
+               $ret = $cacheArray['extensions']['ext_id'][$name];
 
                // Count cache hits
                $_CONFIG['cache_hits']++;
-       }
-        else
-       {
+       } elseif (!EXT_IS_ACTIVE("cache")) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
                 array($name), __FILE__, __LINE__);
                list($ret) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
        }
+
+       // Return value
        return $ret;
 }
 //
index ca956b8af3ee00747f3beb5e98e6909fe2b16751..3b7509a073f6c09945bd4d196f8ffd9f8b48d52c 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index ab6b8826f8212f1e95be39a8214ec4c2233f0211..76b1042c10ce4f70fcf4a2d442f24ea360233825 100644 (file)
@@ -154,14 +154,8 @@ case "update": // Update an extension
                break;
 
        case "0.1.2":
-               // Get current month
-               $curr = date("m", time());
-               if (strlen($curr) == 1) $curr = "0".$curr;
-               if ($curr == "00") $curr = "12";
-
                // SQL queries for v0.1.2
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_mode ENUM('DIRECT', 'REF') NOT NULL DEFAULT 'REF'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_month CHAR(2) NOT NULL DEFAULT '".$curr."'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_ranks TINYINT(3) NOT NULL DEFAULT '10'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_active ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_rallye ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
@@ -268,24 +262,8 @@ default: // Do stuff when extension is loaded
        if ($_CONFIG['beg_uid_timeout'] > $OLD) $OLD = $_CONFIG['beg_uid_timeout'];
        $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_beg_ips WHERE timeout < ".(time() - $OLD - 60*60), __FILE__, __LINE__);
 
-       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
-       {
-               // Daily reset was run so let's check if begging rallye is active
-               if ($_CONFIG['beg_rallye'] == "Y")
-               {
-                       // Check for our winers
-                       $INC_POOL[] = sprintf("%sinc/monthly/monthly_beg.php", PATH);
-               }
-                else
-               {
-                       // Reset begging points
-                       $INC_POOL[] = sprintf("inc/reset/reset_beg.php", PATH);
-               }
-       }
-
        // Check for beg rallye is active and send mails out
-       if (($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_new_mem_notify'] == "Y"))
-       {
+       if (($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_new_mem_notify'] == "Y")) {
                // Include file for sending out mails
                $INC_POOL[] = sprintf("%sinc/mails/beg_mails.php", PATH);
        }
index b0bad4d91d50412f3a1c49d73b2f359a6590b7e8..2e6798241fccb10034768dce2395ddb462bae1e3 100644 (file)
@@ -130,7 +130,6 @@ case "update": // Update an extension
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_ranks TINYINT(3) NOT NULL DEFAULT '10'";
                // Use actual month for this update
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_bonus_month CHAR(2) NOT NULL DEFAULT '".date("m", time())."'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD login_bonus DOUBLE(20,3) NOT NULL DEFAULT '0.000'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD turbo_bonus DOUBLE(20,3) NOT NULL DEFAULT '0.000'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
@@ -353,14 +352,6 @@ KEY userid (userid)
                break;
 
        case "0.5.5": // SQL queries for v0.5.5
-               // Get previous month
-               $prev = date("m", time()) - 1;
-               if (strlen($prev) == 1) $prev = "0".$prev;
-               if ($prev == "00") $prev = "12";
-
-               // Reset monthly active rallye
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_config SET last_bonus_month='".$prev."' WHERE config=0 LIMIT 1";
-
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Weitere Variablenfehler in <STRONG>inc/monthly_bonus.php</STRONG> haben daf&uuml;r gesorgt, dass die monatliche Aktiv-Rallye nicht ausgesch&uuml;ttet wurde. Mit diesem Update wurde die Aussch&uuml;ttung initialisiert. Ihre Mitglieder bekommen voraussichtlicht nichts doppelt verg&uuml;tet.";
                break;
index a5937ff22537f92357276e2ce404dfde83a44891..a7210a86e351095448a4a2a468faf96f27a899c3 100644 (file)
@@ -227,13 +227,6 @@ default: // Do stuff when extension is loaded
        $dummy = LOAD_CONFIG();
        $_CONFIG = merge_array($_CONFIG, $dummy);
        unset($dummy);
-
-       // Do we have a daily-reset-run?
-       if (((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET")) || ($_CONFIG['holiday_mode'] == "DIRECT"))
-       {
-               // Ok, let's check for finished holidays and unlock those accounts
-               $INC_POOL[] = sprintf("%sinc/reset/reset_holiday.php", PATH);
-       }
        break;
 }
 
index 4b625bc6d6452de83b2b74f16ab0b38e0d44b42c..14fdc3907351769511477d74db0d6d56c13db7d1 100644 (file)
@@ -129,8 +129,6 @@ case "update": // Update an extension
                break;
 
        case "0.1.0": // SQL queries for v0.2.1
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD nl_month CHAR(2) NOT NULL DEFAULT '".date("m", time())."'";
-
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Nur bei installierter Erweiterung <STRONG>html_mail</STRONG> k&ouml;nnen Sie auch HTML-Mails versenden.";
                break;
index 2d7ea00271c2495c0fe8879ee06ba2cfe079cec8..b332e0d9b91e1a8cd72fd312677939b0e335fa81 100644 (file)
@@ -38,13 +38,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) {
 }
 
 // Version number
-$EXT_VERSION = "0.4.4";
+$EXT_VERSION = "0.4.5";
 
 // Auto-set extension version
 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -557,6 +557,14 @@ PRIMARY KEY (id)
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.";
                break;
+
+       case "0.4.5": // SQL queries for v0.4.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_month CHAR(2) NOT NULL DEFAULT '00'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_week CHAR(2) NOT NULL DEFAULT '00'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "T&auml;glichen/w&ouml;chentlichen/monatlichen Reset verbessert.";
+               break;
        }
        break;
 
index 7a09feec6eeb473256a0d78e9cfcd4d0c27b5977..739272cfe856fa64cbbdea00127559f03b4e8d43 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -101,25 +101,43 @@ INDEX (`url_id`)
 PRIMARY KEY(`id`)
 ) TYPE=MyISAM COMMENT='Surfbar referal levels'";
 
+       // Statistics
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_stats` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`last_online` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`userid`,`url_id`)
+) TYPE=MyISAM COMMENT='Surfbar Statistics'";
+
        // Add default referal level 0 with 100%
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_reflevels` (`level`, `percent`) VALUES (0, 100)";
 
        // Config entries
        $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '0.25000'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '1.00000'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '60'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '".(60*5)."'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.25000";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(60*5)."";
        $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_admin_unlock` ENUM('N','Y') NOT NULL DEFAULT 'N'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT '10.00000'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT '10'";
-       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(60*6)."'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT 10.00000";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6)."";
        $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30";
 
        // Member menus
-       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',5)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)";
-       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','Surfbar buchen','Y','Y',2)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',3)";
 
        // Admin menus
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','','Surfbar','URLs in der Surfbar verwalten, Einstellungen &auml;ndern und vieles mehr.',7)";
@@ -138,6 +156,7 @@ case "remove": // Do stuff when removing extension
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_reflevels`";
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
        $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 3";
        $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 5";
        break;
index 4004f16d9386edb7853b0b2005c7141bbcc7348b..93461af4850e14bf2f70e7a6307092859cc0ad49 100644 (file)
@@ -13,7 +13,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 7db231cb3ac38a47e97865b47e499fbc986ff457..8875dc134d41276bbe3eadd43b56c92eea7db455 100644 (file)
@@ -474,7 +474,7 @@ function GEN_PASS($LEN = 0) {
        return $PASS;
 }
 //
-function MAKE_DATETIME($time, $mode="0")
+function MAKE_DATETIME ($time, $mode="0")
 {
        if ($time == 0) {
                // Never happend
@@ -487,8 +487,7 @@ function MAKE_DATETIME($time, $mode="0")
        switch (GET_LANGUAGE())
        {
        case "de": // German date / time format
-               switch ($mode)
-               {
+               switch ($mode) {
                        case "0": $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
                        case "1": $ret = strtolower(date("d.m.Y - H:i", $time)); break;
                        case "2": $ret = date("d.m.Y|H:i", $time); break;
@@ -497,8 +496,7 @@ function MAKE_DATETIME($time, $mode="0")
                break;
 
        default:        // Default is the US date / time format!
-               switch ($mode)
-               {
+               switch ($mode) {
                        case "0": $ret = date("r", $time); break;
                        case "1": $ret = date("Y-m-d - g:i A", $time); break;
                        case "2": $ret = date("y-m-d|H:i", $time); break;
@@ -509,69 +507,55 @@ function MAKE_DATETIME($time, $mode="0")
 }
 
 // Translates the american decimal dot into a german comma
-function TRANSLATE_COMMA($dotted, $cut=true) {
+function TRANSLATE_COMMA ($dotted, $cut=true) {
        global $_CONFIG;
+
        // Default is 3 you can change this in admin area "Misc -> Misc Options"
        if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3";
-       if (!ereg("\.", $dotted)) $dotted .= ".".str_repeat("0", $_CONFIG['max_comma']);
-       if ($cut) {
-               // Remove trailing zeros
-               $dot = str_replace(".", "x", $dotted);
-               while(substr($dot, -1, 1) == "0") {
-                       $dot = substr($dot, 0, -1);
-               }
+       $maxComma = $_CONFIG['max_comma'];
 
-               if (substr($dot, -1, 1) == "x") {
-                       // Last char is the 'x'
-                       $dotted = substr($dot, 0, -1);
+       // Cut zeros off?
+       if ($cut) {
+               // Test for commata if in cut-mode
+               $com = explode(".", $dotted);
+               if (count($com) > 1) {
+                       // Commata found, so only zeros?
+                       if ($com[1] == str_repeat("0", strlen($com[1]))) {
+                               // Only zeros, so don't display them
+                               $maxComma = 0;
+                       } // END - if
                } else {
-                       // Last char is a number
-                       $dotted = str_replace("x", ".", $dot);
+                       // Don't display commatas even if there are none... ;-)
+                       $maxComma = 0;
                }
-       }
+       } // END - if
+
+       // Debug log
+       //DEBUG_LOG(__FUNCTION__.":dotted={$dotted},maxComma={$maxComma}");
 
        // Translate it now
        switch (GET_LANGUAGE()) {
        case "de":
-               $pos = strpos($dotted, ".");
-               if ($pos > 0) {
-                       if ($cut) {
-                               // Cut x numbers behind comma
-                               $dotted = str_replace(".", ",", substr($dotted, 0, ($pos + $_CONFIG['max_comma'] + 1)));
-                       } else {
-                               // Replace comma with dot
-                               $dotted = str_replace(".", ",", $dotted);
-                       }
-               } elseif (!$cut) {
-                       if (empty($pos)) {
-                               $dotted = "0,".str_repeat("0", $_CONFIG['max_comma']);
-                       } else {
-                               $dotted .= ",".str_repeat("0", $_CONFIG['max_comma']);
-                       }
-               }
+               $dotted = number_format($dotted, $maxComma, ",", ".");
                break;
 
        default:
-               if (!$cut) {
-                       if ($pos > 0) {
-                               $dotted = substr($dotted, 0, ($pos + $_CONFIG['max_comma'] + 1));
-                       } else {
-                               $dotted .= ".".str_repeat("0", $_CONFIG['max_comma']);
-                       }
-               }
+               $dotted = number_format($dotted, $maxComma, ".", ",");
                break;
        }
+
+       // Return translated value
        return $dotted;
 }
 
 //
-function DEREFERER($URL) {
+function DEREFERER ($URL) {
        $URL = URL."/modules.php?module=loader&amp;url=".urlencode(base64_encode(gzcompress(COMPILE_CODE($URL))));
        return $URL;
 }
 
 //
-function TRANSLATE_SEX($sex) {
+function TRANSLATE_SEX ($sex) {
        switch ($sex)
        {
                case "M": $ret = SEX_M; break;
@@ -695,7 +679,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") {
        if (isSessionVariableSet('admin_login')) {
                // Load Admin data
                $result = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
-                       array(SQL_ESCAPE(get_session('admin_login'))), __FILE__, __LINE__);
+                       array(get_session('admin_login')), __FILE__, __LINE__);
                list($ADMIN) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
        }
@@ -2224,7 +2208,7 @@ function get_session($var) {
        if (isSessionVariableSet($var)) {
                // Then  get it secured!
                $value = SQL_ESCAPE($_SESSION[$var]);
-       }
+       } // END - if
 
        // Return the value
        return $value;
@@ -2271,6 +2255,78 @@ function DEBUG_LOG ($message) {
                fclose($fp);
        } // END - if
 }
+// Reads a directory with PHP files in and gets only files back
+function GET_DIR_AS_ARRAY ($baseDir, $prefix) {
+       $INCs = array();
+
+       // Open directory
+       $dirPointer = opendir($baseDir) or mxchange_die("Cannot read ".basename($baseDir)." path!");
+
+       // Read all entries
+       while ($baseFile = readdir($dirPointer)) {
+               // Load file only if extension is active
+               // Make full path
+               $file = $baseDir.$baseFile;
+
+               // Is this a valid reset file?
+               if ((is_file($file)) && (is_readable($file)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) {
+                       // Remove both for extension name
+                       $extName = substr($baseFile, strlen($prefix), -4);
+
+                       // Try to find it
+                       $extId = GET_EXT_ID($extName);
+
+                       // Is the extension valid and active?
+                       if (($extId > 0) && (EXT_IS_ACTIVE($extName))) {
+                               // Then add this file
+                               $INCs[] = $file;
+                       }
+               } // END - if
+       } // END - while
+
+       // Close directory
+       closedir($dirPointer);
+
+       // Return array with include files
+       return $INCs;
+}
+// Load more reset scripts
+function RESET_ADD_INCLUDES () {
+       global $_CONFIG, $INC_POOL;
+
+       // Is the reset set or old sql_patches?
+       if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (GET_EXT_VERSION("sql_patches") < "0.4.5")) {
+               // Then abort here
+               return;
+       } // END - if
+
+       // Get more daily reset scripts
+       $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/reset/", "reset_"));
+
+       // Create current week mark
+       $currWeek = date("W", time());
+
+       // Has it changed?
+       if ($_CONFIG['last_week'] != $currWeek) {
+               // Include weekly reset scripts
+               $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_"));
+
+               // Update config
+               UPDATE_CONFIG("last_week", $currWeek);
+       } // END - if
+
+       // Create current month mark
+       $currMonth = date("m", time());
+
+       // Has it changed?
+       if ($_CONFIG['last_month'] != $currMonth) {
+               // Include monthly reset scripts
+               $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_"));
+
+               // Update config
+               UPDATE_CONFIG("last_month", $currMonth);
+       } // END - if
+}
 //
 //////////////////////////////////////////////////
 //                                              //
index 5876e3d5fd88c71dc607c5da7eb37dfc6958e750..2abce585f8980bb148ba0e437ca12cbd66f5452a 100644 (file)
@@ -46,8 +46,7 @@ if (empty($_CONFIG['pass_scramble'])) {
        $scrambleString = genScrambleString(40);
 
        // ... and store it there for future usage
-       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET pass_scramble='%s' WHERE config=0 LIMIT 1",
-        array($scrambleString), __FILE__, __LINE__);
+       UPDATE_CONFIG("pass_scramble", $scrambleString);
 
        // Also remember it in config
        $_CONFIG['pass_scramble'] = $scrambleString;
@@ -61,8 +60,7 @@ if (empty($_CONFIG['master_salt'])) {
        $masterSalt = scrambleString(substr(generateHash(GEN_PASS(rand(128, 256))), 0, -40));
 
        // ... and store it there for future usage
-       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET master_salt='%s' WHERE config=0 LIMIT 1",
-        array($masterSalt), __FILE__, __LINE__);
+       UPDATE_CONFIG("master_salt", $masterSalt);
 
        // Also remember it in config
        $_CONFIG['master_salt'] = $masterSalt;
@@ -96,8 +94,7 @@ if (empty($_CONFIG['file_hash'])) {
                //* DEBUG: */ die("Secret-Key: ".$secretKey."<br>Cookie: ".get_session('u_hash')."<br>Test: ".$test);
 
                // Write $file_hash to database
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET file_hash='%s' WHERE config=0 LIMIT 1",
-                array($file_hash), __FILE__, __LINE__);
+               UPDATE_CONFIG("file_hash", $file_hash);
 
                // Also update configuration
                $_CONFIG['secret_key'] = $secretKey;
index a49c8dc23f6fad2d5b89b1a25a7106da9bb6e313..54a81ee1f73f0d067239363f1547e3659b8e40c5 100644 (file)
@@ -51,6 +51,7 @@ define('ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT', "Prozent auf dynamische Verg&uuml
 define('ADMIN_CONFIG_SURFBAR_MAX_ORDER', "Maximal durch Mitglied in Surfbar buchbare URLs:(*)");
 define('ADMIN_CONFIG_SURFBAR_RESTART_TIME', "Ruhezeit der Surfbar, wenn alle URLs in Reload-Lock sind:");
 define('ADMIN_CONFIG_SURFBAR_AUTOSTART', "Surfbar soll nach Ruhezeit automatisch starten?");
+define('ADMIN_CONFIG_SURFBAR_STATS_RELOAD', "Reload-Zeit der Statistik unterhalb der beworbenen Seite:");
 define('ADMIN_SURFBAR_NOTIFY_UNLOCK_YES', "Ja, Admin(s) informieren.");
 define('ADMIN_SURFBAR_NOTIFY_UNLOCK_NO', "Nein, nicht informieren.");
 define('ADMIN_SURFBAR_NO_REF_LEVELS_FOUND', "Zur Zeit sind keine Referal-Ebenen f&uuml;r die Surfbar eingestellt.<br />\nBitte installieren Sie die Erweiterung <strong>surfbar</strong> neu.");
@@ -67,6 +68,12 @@ define('ADMIN_SURFBAR_DEL_URL', "URL l&ouml;schen");
 define('ADMIN_SURFBAR_UNLOCK_URL', "URL ent-/sperren");
 define('ADMIN_CONFIG_SURFBAR_NOTE', "(*): Es sind auch die &Uuml;bertragungen der URLs aus der Mailbuchung einbezogen. Es wird empfohlen, die Ruhezeit etwas l&auml;nger als die Reload-Sperre einzustellen.");
 
+// General member text
+define('MEMBER_SURFBAR_URL_ADDED', "URL hinzugef&uuml;gt und wartet auf Freischaltung.");
+define('MEMBER_SURFBAR_URL_NOT_ADDED', "URL konnte nicht hinzugef&uuml;gt werden, da ein Fehler vorliegt.");
+define('MEMBER_SURFBAR_ADD_URL', "URL in Surfbar buchen");
+define('MEMBER_SURFBAR_NO_MORE_ALLOWED', "Sie k&ouml;nnen leider nicht mehr URLs in der Surfbar buchen, da Sie das Maximum erreicht haben.");
+
 // Subject lines for admins
 define('ADMIN_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "URL in Surfbar gebucht");
 define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Mitglied hat URL in Surfbar gebucht");
index 9e5202d55878008d3336176e4a93091e0261af52..619579d5377425ef1ff8926e807723d9098a12ed 100644 (file)
@@ -68,8 +68,7 @@ class mxchange_cache
                                // Is there a .htaccess file?
                                if (file_exists($path.".htaccess")) {
                                        // Update database that we have tested it
-                                       $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET cache_tested='1' WHERE config=0 LIMIT 1", __FILE__, __LINE__);
-                                       $this->ret="done";
+                                       UPDATE_CONFIG("cache_tested", 1);
 
                                        // All done!
                                        return "done";
index c4391284349b458d32b065d4726abb86aff4981f..fb245f9b709f25f690c10aeac7bed389c4f4690c 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 72b8c8bb17a204caef20b7605b70ad7a5adf4438..4c931566ad8da8f87688334143e513372de0896a 100644 (file)
@@ -39,21 +39,50 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 
 // Admin has added an URL with given user id
 function SURFBAR_ADMIN_ADD_URL ($url, $uid, $reward, $costs, $paymentId) {
-       // Is this really an admin?
+       // Do some pre-checks
        if (!IS_ADMIN()) {
-               // Then leave here
+               // Not an admin
                return false;
-       } // END - if
-
-       // Check if that URL does not exist
-       if (SURFBAR_LOOKUP_BY_URL($url, $uid)) {
-               // Already found!
+       } elseif (!VALIDATE_URL($url)) {
+               // URL invalid
                return false;
-       } // END - if
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, $uid)) {
+               // URL already found in surfbar!
+               return false;
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS($uid)) {
+               // No more allowed!
+               return false;
+       }
 
        // Register the new URL
        return SURFBAR_REGISTER_URL($url, $uid, $reward, $costs, $paymentId, "CONFIRMED", "unlock");
 }
+// Member has added an URL
+function SURFBAR_MEMBER_ADD_URL ($url) {
+       global $_CONFIG;
+
+       // Do some pre-checks
+       if (!IS_LOGGED_IN()) {
+               // Not a member
+               return false;
+       } elseif (!VALIDATE_URL($url)) {
+               // URL invalid
+               return false;
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, $GLOBALS['userid'])) {
+               // URL already found in surfbar!
+               return false;
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
+               // No more allowed!
+               return false;
+       }
+
+       // Do we have fixed or dynamic payment model?
+       $reward = SURFBAR_DETERMINE_REWARD();
+       $costs  = SURFBAR_DETERMINE_COSTS();
+
+       // Register the new URL
+       return SURFBAR_REGISTER_URL($url, $GLOBALS['userid'], $reward, $costs);
+}
 // Looks up by an URL
 function SURFBAR_LOOKUP_BY_URL ($url) {
        // Now lookup that given URL by itself
@@ -104,7 +133,7 @@ ORDER BY %s %s",
        return $lastUrlData;
 }
 // Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
-function SURFBAR_REGISTER_URL ($url, $uid, $reward, $paymentId, $costs, $status="PENDING", $addMode="reg") {
+function SURFBAR_REGISTER_URL ($url, $uid, $reward, $costs, $paymentId=0, $status="PENDING", $addMode="reg") {
        global $_CONFIG;
 
        // Make sure by the user registered URLs are always pending
@@ -144,7 +173,7 @@ function SURFBAR_REGISTER_URL ($url, $uid, $reward, $paymentId, $costs, $status=
 // Inserts an url by given data array and return the insert id
 function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
        // Just run the insert query for now
-       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, reward, costs, payment_id, status) VALUES(%s, '%s', %s, %s, %s, '%s')",
+       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, reward, costs, payment_id, status) VALUES(%s, '%s', %s, %s, %d, '%s')",
                array(
                        bigintval($urlData['uid']),
                        $urlData['url'],
@@ -206,6 +235,37 @@ function SURFBAR_TRANSLATE_STATUS ($status) {
        // Return result
        return $statusTranslated;
 }
+// Determine reward
+function SURFBAR_DETERMINE_REWARD () {
+       global $_CONFIG;
+
+       // Do we have static or dynamic?
+       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
+               // Static model, so choose static values
+               $reward = $_CONFIG['surfbar_static_reward'];
+       } else {
+               // Dynamic model, so calculate values
+               die("DYNAMIC payment model not yet supported!");
+       }
+
+       // Return reward
+       return $reward;
+}
+// Determine costs
+function SURFBAR_DETERMINE_COSTS () {
+       global $_CONFIG;
+
+       // Do we have static or dynamic?
+       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
+               $costs  = $_CONFIG['surfbar_static_costs'];
+       } else {
+               // Dynamic model, so calculate values
+               die("DYNAMIC payment model not yet supported!");
+       }
+
+       // Return costs
+       return $costs;
+}
 // Determine right template name
 function SURFBAR_DETERMINE_TEMPLATE_NAME() {
        // Default is the frameset
@@ -290,6 +350,43 @@ WHERE userid NOT IN (".implode(",", $UIDs).") AND status='%s'",
        // Return result
        return $cnt;
 }
+// Check wether the user is allowed to book more URLs
+function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
+       global $_CONFIG;
+
+       // Simply check it out
+       return (SURFBAR_GET_TOTAL_USER_URLS($uid) < $_CONFIG['surfbar_max_order']);
+}
+// Get total amount of URLs of given status for current user
+function SURFBAR_GET_TOTAL_USER_URLS ($uid=0) {
+       global $_CONFIG;
+
+       // Is the user 0 and user is logged in?
+       if (($uid == 0) && (IS_LOGGED_IN())) {
+               // Then use this userid
+               $uid = $GLOBALS['userid'];
+       } elseif ($uid == 0) {
+               // Error!
+               return ($_CONFIG['surfbar_max_order'] + 1);
+       }
+
+       // Get amount from database
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
+FROM "._MYSQL_PREFIX."_surfbar_urls
+WHERE userid=%s
+LIMIT %s",
+               array($uid, $_CONFIG['surfbar_max_order']), __FILE__, __LINE__
+       );
+
+       // Fetch row
+       list($cnt) = SQL_FETCHROW($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $cnt;
+}
 // Generate a validation code for the given id number
 function SURFBAR_GENERATE_VALIDATION_CODE ($id, $salt="") {
        global $_CONFIG, $SURFBAR_CACHE;
@@ -364,12 +461,39 @@ function SURFBAR_PAY_POINTS ($id) {
        //DEBUG_LOG(__FUNCTION__.":uid=".$GLOBALS['userid'].",reward=".SURFBAR_GET_REWARD()."");
        ADD_POINTS_REFSYSTEM($GLOBALS['userid'], SURFBAR_GET_DATA('reward'));
 }
-// Update the salt for validation
-function SURFBAR_UPDATE_SALT() {
+// Updates the statistics of current URL/userid
+function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
+       global $_CONFIG;
+
        // Update views_total
        SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET views_total=views_total+1 WHERE id=%s LIMIT 1",
                array(SURFBAR_GET_ID()), __FILE__, __LINE__);
 
+       // Update the stats entry
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_stats SET count=count+1 WHERE userid=%s AND url_id=%s LIMIT 1",
+               array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__);
+
+       // Was that update okay?
+       if (SQL_AFFECTEDROWS() == 0) {
+               // No, then insert entry
+               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_stats (userid,url_id,count) VALUES(%s,%s,1)",
+                       array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__);
+       } // END - if
+
+       // Update total/daily/weekly/monthly counter
+       $_CONFIG['surfbar_total_counter']++;
+       $_CONFIG['surfbar_daily_counter']++;
+       $_CONFIG['surfbar_weekly_counter']++;
+       $_CONFIG['surfbar_monthly_counter']++;
+
+       // Update config as well
+       UPDATE_CONFIG(array("surfbar_total_counter", "surfbar_daily_counter", "surfbar_weekly_counter", "surfbar_monthly_counter"), array(1,1,1,1), "+");
+}
+// Update the salt for validation and statistics
+function SURFBAR_UPDATE_SALT_STATS () {
+       // Update statistics record
+       SURFBAR_UPDATE_INSERT_STATS_RECORD();
+
        // Simply store the salt from cache away in database...
        SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_salts SET last_salt='%s' WHERE url_id=%s AND userid=%s LIMIT 1",
                array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), $GLOBALS['userid']), __FILE__, __LINE__);
@@ -445,8 +569,8 @@ ORDER BY userid ASC", __FILE__, __LINE__);
                // Shall we add this to ignore?
                if ($points <= 0) {
                        // Ignore this one!
-                       $UIDs[] = $uid;
                        //DEBUG_LOG(__FUNCTION__.":uid={$uid} has depleted points amount!");
+                       $UIDs[] = $uid;
                } // END - if
        } // END - while
 
@@ -459,6 +583,23 @@ ORDER BY userid ASC", __FILE__, __LINE__);
        // Return result
        return $UIDs;
 }
+// Determine how many users are Online in surfbar
+function SURFBAR_DETERMINE_TOTAL_ONLINE () {
+       global $_CONFIG;
+
+       // Count all users in surfbar modue and return the value
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_surfbar_stats WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) >= %s",
+               array($_CONFIG['online_timeout']), __FILE__, __LINE__);
+
+       // Fetch count
+       list($cnt) = SQL_FETCHROW($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $cnt;
+}
 // Determine next id for surfbar view, always call this before you call other
 // getters below this function!!!
 function SURFBAR_GET_NEXT_ID ($id = 0) {
@@ -606,18 +747,18 @@ LIMIT 1",
                        $SURFBAR_CACHE['last_surfed'] = "0";
                } // END - if
 
-               // Are we in static mode?
-               if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
-                       // Then use static reward/costs!
-                       $SURFBAR_CACHE['reward'] = $_CONFIG['surfbar_static_reward'];
-                       $SURFBAR_CACHE['costs']  = $_CONFIG['surfbar_static_costs'];
-                       //DEBUG_LOG(__FUNCTION__.":FIXED - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
-               } else {
+               // Get base/fixed reward and costs
+               $SURFBAR_CACHE['reward'] = SURFBAR_DETERMINE_REWARD();
+               $SURFBAR_CACHE['costs']  = SURFBAR_DETERMINE_COSTS();
+               //DEBUG_LOG(__FUNCTION__.":BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
+
+               // Only in dynamic model add the dynamic bonus!
+               if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
                        // Calculate dynamic reward/costs and add it
                        $SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_REWARD_ADD();
                        $SURFBAR_CACHE['costs']  += SURFBAR_CALCULATE_DYNAMIC_COSTS_ADD();
-                       //DEBUG_LOG(__FUNCTION__.":DYNAMIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
-               }
+                       //DEBUG_LOG(__FUNCTION__.":DYNAMIC+ - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
+               } // END - if
 
                // Now get the id
                $nextId = SURFBAR_GET_ID();
index 1ca104512ee2326f03f31527a14b6ebdad63f7d1..c66ba0da31534461f36e7de146efc1b740089439 100644 (file)
@@ -75,6 +75,7 @@ if (EXT_IS_ACTIVE("cache")) {
        // Load language
        if ($cacheMode == "load") include(PATH."inc/language/cache_".GET_LANGUAGE().".php");
 } else {
+       // Cache extension not active
        $cacheMode = "no";
 }
 
@@ -87,15 +88,18 @@ if ($cacheMode == "load") {
 
        // Load extension data from cache file
        $EXT_DUMMY = $cacheInstance->cache_load();
+       $EXT_NAMES = array();
        foreach ($EXT_DUMMY['ext_name'] as $k=>$name) {
                // Load functions file
-               if ($EXT_DUMMY['ext_funcs'][$k] == "Y") require_once(PATH."inc/libs/".$name."_functions.php");
+               if ($EXT_DUMMY['ext_funcs'][$k] == "Y") {
+                       require_once(PATH."inc/libs/".$name."_functions.php");
+               } // END - if
 
                // Load Language file
                if ($EXT_DUMMY['ext_lang'][$k] == "Y") {
                        $INC = sprintf("%sinc/language/%s_%s.php", PATH, $name, GET_LANGUAGE());
                        if (file_exists($INC)) require_once($INC);
-               }
+               } // END - if
 
                // Load CSS file
                if ($EXT_DUMMY['ext_css'][$k] == "Y") $EXT_CSS_FILES[] = "".$name.".css";
@@ -103,26 +107,38 @@ if ($cacheMode == "load") {
                // Load extension file itself
                if (($EXT_DUMMY['ext_active'][$k] == "Y") || ($EXT_DUMMY['ext_keep'][$k] == "Y") || (IS_ADMIN())) {
                        require_once(PATH."inc/extensions/ext-".$name.".php");
-               }
+               } // END - if
 
-               // Transfer version number and active status
+               // Version number
                $EXT_DUMMY['ext_version'][$name] = $EXT_DUMMY['ext_version'][$k];
                unset($EXT_DUMMY['ext_version'][$k]);
+               // Extension is active
                $EXT_DUMMY['ext_active'][$name] = $EXT_DUMMY['ext_active'][$k];
                unset($EXT_DUMMY['ext_active'][$k]);
+               // Ext menu
                $EXT_DUMMY['ext_menu'][$name] = $EXT_DUMMY['ext_menu'][$k];
                unset($EXT_DUMMY['ext_menu'][$k]);
+               // Extension id
+               $EXT_DUMMY['ext_id'][$name] = $EXT_DUMMY['ext_id'][$k];
+               $id = $EXT_DUMMY['ext_id'][$name];
+               unset($EXT_DUMMY['ext_id'][$k]);
+
+               // Add ext name
+               $EXT_NAMES[$id] = $name;
+
+               // Mark it as active extension
                $cacheArray['active_extensions']['$name'] = $EXT_DUMMY['ext_keep'][$k];
                unset($EXT_DUMMY['ext_keep'][$k]);
-               $k2 = $EXT_DUMMY['ext_id'][$k];
-               $EXT_DUMMY['ext_id'][$k2] = $name;
-               if ($k2 != $k) unset($EXT_DUMMY['ext_id'][$k]);
 
                // Remove unneccessary data from memory
                unset($EXT_DUMMY['ext_lang'][$k]);
                unset($EXT_DUMMY['ext_css'][$k]);
                unset($EXT_DUMMY['ext_funcs'][$k]);
-       }
+       } // END - foreach
+
+       // Write dummy array back
+       $EXT_DUMMY['ext_name'] = $EXT_NAMES;
+       unset($EXT_NAMES);
 
        // Close cache file
        $cacheInstance->cache_close();
@@ -159,8 +175,7 @@ ORDER BY ext_name", __FILE__, __LINE__);
 $DEL = array();
 
 // At least one found?
-if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode == "no")) && ($CSS != "1") && ($CSS != "-1"))
-{
+if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode == "no")) && ($CSS != "1") && ($CSS != "-1")) {
        // Load theme management
        require_once(PATH."inc/theme-manager.php");
 
@@ -168,16 +183,12 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
        if ($cacheMode == "init") $cacheInstance->cache_init("EXTENSIONS");
 
        // Extensions are registered so we load them
-       while (list($EXT_ID, $name, $lang, $css, $active, $version) = SQL_FETCHROW($res_ext_crt))
-       {
+       while (list($EXT_ID, $name, $lang, $css, $active, $version) = SQL_FETCHROW($res_ext_crt)) {
                // Get menu entry
-               $result_menu = SQL_QUERY_ESC("SELECT has_menu FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1",
-                array($name), __FILE__, __LINE__);
-               list($menu) = SQL_FETCHROW($result_menu);
-               //* DEBUG: */ echo "*".$name."/".$menu."*<br>";
-
-               // An empty menu entry will be interpreted as N (no menu) to avoid problems
-               if (empty($menu)) $menu = "N";
+               $menu = "N";
+               if (MODULE_HAS_MENU($name)) {
+                       $menu = "Y";
+               } // END - if
 
                // Load extensions
                $file1 = sprintf("%sinc/extensions/ext-%s.php", PATH, $name);
@@ -185,71 +196,57 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
 
                // Special functions file
                $file3 = sprintf("%sinc/libs/%s_functions.php", PATH, $name);
+               echo $file3."<br />\n";
 
                // Does the extension file exists?
-               if (file_exists($file1) && is_readable($file1))
-               {
+               if (file_exists($file1) && is_readable($file1)) {
                        // If there's no language file specified we don't need to load one... ;-)
                        if (!empty($lang)) {
                                // Create language file
                                $file2 = sprintf("%sinc/language/%s_%s.php", PATH, $lang, GET_LANGUAGE());
                        }
 
-                       if (file_exists($file3) && is_readable($file3))
-                       {
+                       if (file_exists($file3) && is_readable($file3)) {
                                // Special functions file
                                $funcs = "Y";
                                require_once($file3);
-                       }
-                        else
-                       {
+                       } else {
                                // Don't load functions file
                                $funcs = "N";
                        }
 
                        // Do we need a language file?
-                       if (($file1 != $file2) && (file_exists($file2)) && (is_readable($file2)))
-                       {
+                       if (($file1 != $file2) && (file_exists($file2)) && (is_readable($file2))) {
                                // Load language file
                                $lang = "Y";
                                include($file2);
-                       }
-                        else
-                       {
+                       } else {
                                // Don't load language file
                                $lang = "N";
                        }
 
                        // Load extension
-                       if ($name != "sql_patches")
-                       {
+                       if ($name != "sql_patches")     {
                                // Load extension's file
                                include_once($file1);
-                       }
-                        else
-                       {
+                       } else {
                                // KEEP sql_patches ALWAYS ACTIVE!
                                $EXT_ALWAYS_ACTIVE = "Y";
                        }
 
-                       if ($css == "Y")
-                       {
+                       if ($css == "Y") {
                                $CSS_FILE = sprintf("%stheme/%s/css/%s.css", PATH, GET_CURR_THEME(), $name);
-                               if (file_exists($CSS_FILE))
-                               {
+                               if (file_exists($CSS_FILE)) {
                                        // CSS file for extension was found (use only relative path for now!)
                                        $EXT_CSS_FILES[] = $name.".css";
-                               }
-                                else
-                               {
+                               } else {
                                        // Don't load CSS file
                                        $css = "N";
                                }
-                       }
+                       } // END - if
 
                        // Add cache row
-                       if ($cacheMode == "init")
-                       {
+                       if ($cacheMode == "init") {
                                $cacheInstance->add_row(array(
                                        'ext_id'      => $EXT_ID,
                                        'ext_name'    => $name,
@@ -261,48 +258,39 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
                                        'ext_version' => $version,
                                        'ext_keep'    => $EXT_ALWAYS_ACTIVE,
                                ));
-                       }
-                        elseif ($cacheMode == "no")
-                       {
+                       } elseif ($cacheMode == "no") {
                                // Remember this value for later usage
                                $cacheArray['active_extensions'][$name] = $EXT_ALWAYS_ACTIVE;
                        }
-               }
-                elseif (!file_exists($file1))
-               {
+               } elseif (!file_exists($file1)) {
                        // Deleted extension file so we mark it for removal from DB
                        $DEL[] = $name;
                }
-       }
+       } // END - while
 
-       if ($cacheMode == "init")
-       {
+       if ($cacheMode == "init") {
                // Close cache file
                $cacheInstance->cache_close();
 
                // Load more cache files (like admins)
                require_once(PATH."inc/load_cache.php");
-       }
+       } // END - if
 }
 
 // Free memory
 SQL_FREERESULT($res_ext_crt);
 
 // Load include files
-if (!empty($INC_POOL[0]))
-{
-       foreach ($INC_POOL as $inc)
-       {
+if (!empty($INC_POOL[0])) {
+       foreach ($INC_POOL as $inc) {
                require_once($inc);
-       }
-}
+       } // END - foreach
+} // END - if
 
 // Uninstall extensions that are no longer in our system
-if (!empty($DEL[0]))
-{
+if (!empty($DEL[0])) {
        // Remove extensions from two tables: extension registry and tasks table
-       foreach ($DEL as $name)
-       {
+       foreach ($DEL as $name) {
                // First remove entry from extensions table
                $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
                 array($name), __FILE__, __LINE__);
@@ -310,10 +298,11 @@ if (!empty($DEL[0]))
                // Remove (maybe?) found tasks (main task and possible updates
                $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')",
                 array($name), __FILE__, __LINE__);
-       }
+       } // END - foreach
 
        // I think it's not neccessary to run the optimization function here
        // because we didn't delete so much data from database. Can you aggree?
-}
+} // END - if
+
 //
 ?>
index 44991df0be5c6910a26d099bca5bc214565f8fdd..ca5adfa470f68917aca8f22411c38718aeedd089 100644 (file)
@@ -47,7 +47,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 if ($CSS == 1) return;
 
 // Create timemark from saved month
-$mark = mktime(0, 0, 0, $_CONFIG['beg_month'], date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
 $SQL = ""; $MODE = "";
 
 // Shall I sent activation or deactivation mail?
index 43a382dbeaf31dfa9cbfdde6117568561e386643..44ab9f571716d087775ad4a43df26278caf1ee1e 100644 (file)
@@ -47,7 +47,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 if ($CSS == 1) return;
 
 // Create timemark from saved month
-$mark = mktime(0, 0, 0, $_CONFIG['bonus_month'], date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
 $SQL = ""; $MODE = "";
 
 // Shall I sent activation or deactivation mail?
index 604abdf9b43ebb5d0d7165d1579b0d28cdb02bb4..a117d14b8970864db74e0f9614b4f0a2520fa90e 100644 (file)
@@ -150,7 +150,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                LOAD_TEMPLATE("admin_settings_saved", false, $OUT);
        } elseif (!empty($_GET['hash'])) {
                // Output form for hash validation
-               LOAD_TEMPLATE("admin_validate_reset_hash_form", false, SQL_ESCAPE($_GET['hash']));
+               LOAD_TEMPLATE("admin_validate_reset_hash_form", false, $_GET['hash']);
        } elseif ((isset($_POST['validate_hash'])) && (!empty($_POST['login'])) && (!empty($_POST['hash']))) {
                // Validate the login data and hash
                $valid = ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN($_POST['hash'], $_POST['login']);
@@ -333,12 +333,12 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
        }
 } else {
        // Maybe an Admin want's to login?
-       $ret = CHECK_ADMIN_COOKIES(SQL_ESCAPE(get_session('admin_login')), SQL_ESCAPE(get_session('admin_md5')));
+       $ret = CHECK_ADMIN_COOKIES(get_session('admin_login'), get_session('admin_md5'));
        switch ($ret)
        {
        case "done":
                // Cookie-Data accepted
-               if ((set_session("admin_md5", SQL_ESCAPE(get_session('admin_md5')))) && (set_session("admin_login", SQL_ESCAPE(get_session('admin_login')))) && (set_session("admin_last", time())) && (set_session("admin_to", bigintval(get_session('admin_to'))))) {
+               if ((set_session("admin_md5", get_session('admin_md5'))) && (set_session("admin_login", get_session('admin_login'))) && (set_session("admin_last", time())) && (set_session("admin_to", bigintval(get_session('admin_to'))))) {
                        // Ok, Cookie-Update done
                        if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
                                // Check if action GET variable was set
index c68fa7661e70df027a667b615dc2c0fb66f07826..4f657c694043d011966dec2ebe001307d143390c 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 5ac0fe9348165965e325c28d53a38414ebf7e27e..d4964c6321e500dc612a9dbc20a6d9dacd269a69 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 7ef2e0aa551460bf65d5528565237463dca36aba..6b22d9ba5d27b5e164dedcc90a79a449e0fca28c 100644 (file)
@@ -283,7 +283,7 @@ function ADMIN_DO_ACTION($wht)
        $act = GET_ACTION($GLOBALS['module'], $wht);
 
        // Define admin login name and ID number
-       define('__ADMIN_LOGIN', SQL_ESCAPE(get_session('admin_login')));
+       define('__ADMIN_LOGIN', get_session('admin_login'));
        define('__ADMIN_ID'   , GET_ADMIN_ID(get_session('admin_login')));
 
        // Preload templates
index f5e1bd3796ad0d8cb26c8319f72781a91b238722..209036a08c221ece060e498d18381dea812e77a9 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 2f5264047441bcc76f980653e1216eafd4cdd0bd..28f59522010e90a705717871e5a549695f187e4e 100644 (file)
@@ -68,12 +68,11 @@ case "settings": // Settings related to the index page
        break;
 
 case "target": // Set which what-file will be placed in home-page (only modules.php?module=index)
-       if (isset($_GET['home']))
-       {
+       if (isset($_GET['home'])) {
                // Set new home
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET index_home='%s' WHERE config=0 LIMIT 1", array($_GET['home']), __FILE__, __LINE__);
-               $_CONFIG['index_home'] = $_GET['home'];
-       }
+               UPDATE_CONFIG("index_home", $_GET['home']);
+               $_CONFIG['index_home'] = SQL_ESCAPE($_GET['home']);
+       } // END - if
 
        // Load all what menu points
        $result = SQL_QUERY("SELECT id, what, title
index c986d658fe7a7fb4e64523c21452a43e39014bb2..1cd75f1270cddb5414a29bdb80f1ac936e6c9085 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -59,7 +59,9 @@ if (isset($_POST['ok'])) {
                'surfbar_restart_time'    => $_CONFIG['surfbar_restart_time'],
                'surfbar_static_lock'     => $_CONFIG['surfbar_static_lock'],
                'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
-               'surfbar_max_order'       => $_CONFIG['surfbar_max_order']
+               'surfbar_max_order'       => $_CONFIG['surfbar_max_order'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_stats_reload'    => $_CONFIG['surfbar_stats_reload']
        );
 
        // Prepare payment model for template
index 67926c09837abddadc0e8a12f2df6c4377fdef95..afc6135273a15d7cce32d9c20f78e3517136815b 100644 (file)
@@ -48,8 +48,7 @@ if ($_CONFIG['beg_rallye'] == "Y")
                // Okay, let's prepare...
                $curr = date("m", time()) - 1;
                if (strlen($curr) == 1) $curr = "0".$curr;
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET beg_month='%s' WHERE config=0 LIMIT 1",
-                array($curr), __FILE__, __LINE__);
+               UPDATE_CONFIG("last_month", $curr);
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_WITHDRAW_PREPARED);
                OUTPUT_HTML("<br />");
        }
@@ -106,7 +105,7 @@ ORDER BY beg_points DESC, last_online DESC, userid",
                define('__TOTAL', TRANSLATE_COMMA($total));
 
                // Check if we need to display form or not with manuel withdraw
-               if ($_CONFIG['beg_month'] == date("m", time()))
+               if ($_CONFIG['last_month'] == date("m", time()))
                {
                        // Load form
                        define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true));
index 721ee92dd8763c8c5f53e25f11f8e59ea30068cd..caefd309c9a63003fd8b3966756ddc8691bc7460 100644 (file)
@@ -40,22 +40,18 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
-if ($_CONFIG['bonus_active'] == "Y")
-{
+if ($_CONFIG['bonus_active'] == "Y") {
        // Shall I withdraw now?
-       if (isset($_POST['withdraw']))
-       {
+       if (isset($_POST['withdraw'])) {
                // Okay, let's prepare...
                $curr = date("m", time()) - 1;
                if (strlen($curr) == 1) $curr = "0".$curr;
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET last_bonus_month='%s' WHERE config=0 LIMIT 1",
-                array($curr), __FILE__, __LINE__);
+               UPDATE_CONFIG("last_month", $curr);
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_WITHDRAW_PREPARED);
                OUTPUT_HTML("<br />");
        }
 
-       if (GET_EXT_VERSION("bonus") >= "0.6.9")
-       {
+       if (GET_EXT_VERSION("bonus") >= "0.6.9") {
                // Add more bonus points here
                $USE = "(0";
                if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
@@ -64,17 +60,14 @@ if ($_CONFIG['bonus_active'] == "Y")
                if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
                if ($_CONFIG['bonus_ref_yn']   == "Y") $USE .= " + bonus_ref";
                $USE .= ")";
-       }
-        else
-       {
+       } else {
                // Old version ???
                $USE = "turbo_bonus";
        }
 
        // Autopurge installed?
        $LAST = "%s"; $ONLINE = "";
-       if (EXT_IS_ACTIVE("autopurge"))
-       {
+       if (EXT_IS_ACTIVE("autopurge")) {
                // Use last online timestamp to keep inactive members away from here
                $LAST   = " AND last_online >= %s";
                $ONLINE = bigintval(time() - $_CONFIG['ap_in_since']);
@@ -87,20 +80,19 @@ WHERE status='CONFIRMED' AND ".$USE." > 0".$LAST."
 ORDER BY active_bonus DESC, last_online DESC, userid",
         array($ONLINE), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0)
-       {
+       if (SQL_NUMROWS($result) > 0) {
                // List users
                $OUT = "";$SW = 2; $cnt = 1; $total = 0;
-               while(list($uid, $email, $sex, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result))
-               {
+               while(list($uid, $email, $sex, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) {
                        // Generate array fore the dynamic template
                        $WIN1 = ""; $WIN2 = "";
-                       if ($cnt <= $_CONFIG['bonus_ranks'])
-                       {
+                       if ($cnt <= $_CONFIG['bonus_ranks']) {
                                // Maybe he can win his active bonus?
                                $WIN1 = "<STRONG>";
                                $WIN2 = "</STRONG>";
                        }
+
+                       // Prepare content
                        $content = array(
                                'uid'   => $uid,
                                'email' => CREATE_EMAIL_LINK($email, "user_data"),
@@ -123,7 +115,7 @@ ORDER BY active_bonus DESC, last_online DESC, userid",
                define('__TOTAL', TRANSLATE_COMMA($total));
 
                // Check if we need to display form or not with manuel withdraw
-               if ($_CONFIG['bonus_month'] == date("m", time()))
+               if ($_CONFIG['last_month'] == date("m", time()))
                {
                        // Load form
                        define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true));
index 0ec2e773d91f01da63ef1dd4e64f88f85a637f56..839bce00b969d61e75da42b25bac06a17406e374 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 9c3c176e4ff0e016ba5b11dd17ee5e66a0d8d7e0..02c0b65f19beda0b743f08d7a3ea323e30487755 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 3b0bd4378b7708dd5929204d2a1c3e2ac4ca0591..e2d3e6a9b89b4daeea50832ef98a9e2332e27ce1 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -58,14 +57,11 @@ if (isset($_POST['ok']))
        }
 
        // Update config
-       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET maintenance='%s' WHERE config=0 LIMIT 1",
-        array($target_mode), __FILE__, __LINE__);
+       UPDATE_CONFIG("maintenance", $target_mode);
 
        // Load template
        LOAD_TEMPLATE("admin_settings_saved", false, $out);
-}
- else
-{
+} else {
        switch ($_CONFIG['maintenance'])
        {
        case 'Y': // Maintenance mode is active
@@ -79,5 +75,6 @@ if (isset($_POST['ok']))
        // Display form
        LOAD_TEMPLATE("admin_maintenance_form");
 }
+
 //
 ?>
diff --git a/inc/modules/admin/what-unlock_surfbar_urls.php b/inc/modules/admin/what-unlock_surfbar_urls.php
new file mode 100644 (file)
index 0000000..c1d2d52
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ================                             Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-unlock_surfbar_urls.php                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Unlock pending URLs for surfbar                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wartende URLs in der Surfbar freigeben           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
index 4475fed1d567c8ef5d398b2e3ea6d4097a3588a5..ef1104eda2c428bbd1318571d58e45de4380a206 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index c10ba15b5adc03de849ae54915b136f3c60bd44c..38264c411fcd9e63a62f675fb9f7dcb62b788e02 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index a030f9eff216dcbdbbc3eaad33caab411a7056b7..ec2317cbb5cc84d39afc0fb4b0960cee0836882d 100644 (file)
@@ -52,12 +52,9 @@ $total      = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_N
 if ($_CONFIG['mad_counter'] < $total)
 {
        // Update counter
+       UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total));
        $_CONFIG['mad_counter'] = $total;
        $_CONFIG['last_mad']    = time();
-       $result_mad = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET mad_timestamp=%s, mad_count='%s' WHERE config=0 LIMIT 1",
-        array($_CONFIG['last_mad'], $_CONFIG['mad_counter']), __FILE__, __LINE__);
-
-       // Destroy cache
 }
 
 // Put all values in constants for the template
index 8178d82f09903ac10e1da21162e5aab9b32f12ed..8c493c055b609584b2671f0577304151d51bab26 100644 (file)
@@ -59,14 +59,13 @@ if ($status != "CONFIRMED") {
        }
        $URL = URL."/modules.php?module=index&login=".$ERROR;
        LOAD_URL($URL);
-}
+} // END - if
 
 // Recheck if he got logged out because bad cookies
-if (!IS_LOGGED_IN())
-{
+if (!IS_LOGGED_IN()) {
        $URL = URL."/modules.php?module=index";
        LOAD_URL($URL);
-}
+} // END - if
 
 // Load adverstising template
 define('__MEMBER_ADVERT', LOAD_TEMPLATE("member_banner", true));
index 033f7eed5d3905654c1ea3a34a9aeecb8f488a14..456ce52d264cbd5a331f5c609bdb52b06854c604 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 8c80afd0debc10adb507b29fd486b0e53680685f..27fc07b6f7626d1d85522f6d460d27a67ac2021f 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 9a3c1104f434ae176cb60afb8cb3be4b661c3302..92b7347bac22be9d86b95be67f04efd4add71fce 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
index 97554795d5aff43bbd8a228289c1a93cbd5ac813..646a0a8b1c019d0cd2d3c70b2a8724e1f8ba8ec5 100644 (file)
@@ -111,15 +111,12 @@ case "show": // Show his data
        break;
 
 case "edit": // Edit data
-       if (EXT_IS_ACTIVE("country", true))
-       {
+       if (EXT_IS_ACTIVE("country", true)) {
                // New way                         0        1         2          3         4     5     6        7           8            9       10      11           12           13
                $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, sex, max_mails, receive_mails, last_update
 FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                 array(UID_VALUE), __FILE__, __LINE__);
-       }
-        else
-       {
+       } else {
                // Old way                         0        1         2        3      4     5     6        7           8            9       10      11           12           13
                $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, sex, max_mails, receive_mails, last_update
 FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
diff --git a/inc/modules/member/what-surfbar_book.php b/inc/modules/member/what-surfbar_book.php
new file mode 100644 (file)
index 0000000..13c7651
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ================                             Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_book.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Members can book new URLs here                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder koennen URLs buchen                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_LOGGED_IN()) {
+       // Redirect
+       LOAD_URL(URL."/modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
+       // Extension "surfbar" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "surfbar");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Still allowed to book more URLs?
+if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
+       // No more URLs allowed to book!
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_MORE_ALLOWED);
+} elseif (isset($_POST['ok'])) {
+       // Register the new URL
+       $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url']);
+
+       // Was this fine?
+       if ($insertId > 0) {
+               // URL added and waiting for unlock
+               $msg = MEMBER_SURFBAR_URL_ADDED;
+       } else {
+               // Something went wrong!
+               $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
+       }
+
+       // Load message template
+       LOAD_TEMPLATE("admin_settings_saved", false, $msg);
+} else {
+       // Prepare some content
+       $content = array(
+               'reward'     => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD()),
+               'costs'      => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS()),
+               'max_order'  => $_CONFIG['surfbar_max_order'],
+               'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
+       );
+
+       // Load surfbar order form
+       LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower($_CONFIG['surfbar_pay_model'])), false, $content);
+}
+
+//
+?>
index b90d08d33807f1b9fa565df1f037667e2b3d8d1b..65dddf0dc441b654ba9ca2df7ad8959a2142ff7f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
  * MXChange v0.2.1                                    Start: 09/05/2008 *
- * ================                             Last change: 09/05/2008 *
+ * ================                             Last change: 09/08/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-surfbar_start.php                           *
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -36,7 +36,12 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } elseif (!IS_LOGGED_IN()) {
-       LOAD_URL(URL."/modules.php?module=index");
+       // Not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
+       // Extension "surfbar" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "surfbar");
+       return;
 }
 
 // Add description as navigation point
@@ -50,11 +55,8 @@ $content = array(
        'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent'])
 );
 
-// Construct template name
-$templateName = "member_".substr(basename(__FILE__), 5, -4)."_".strtolower($_CONFIG['surfbar_pay_model']);
-
 // Load the template
-LOAD_TEMPLATE($templateName, false, $content);
+LOAD_TEMPLATE("member_start_".strtolower($_CONFIG['surfbar_pay_model']), false, $content);
 
 // Load surfbar link template
 LOAD_TEMPLATE("member_surfbar_link");
index 67c5a7f08138cd1b3ca5b3989abc1e02257c796b..2dd861a40c80f13fbafbff60f86649cdf0187b8b 100644 (file)
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *                                
- * For more information visit: http://www.mxchange.org                  *                                
- *                                                                      *                                
- * This program is free software; you can redistribute it and/or modify *                                
- * it under the terms of the GNU General Public License as published by *                                
- * the Free Software Foundation; either version 2 of the License, or    *                                
- * (at your option) any later version.                                  *                                
- *                                                                      *                                
- * This program is distributed in the hope that it will be useful,      *                                
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *                                
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *                                
- * GNU General Public License for more details.                         *                                
- *                                                                      *                                
- * You should have received a copy of the GNU General Public License    *                                
- * along with this program; if not, write to the Free Software          *                                
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *                                
- * MA  02110-1301  USA                                                  *                                
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
  ************************************************************************/
 
 // Some security stuff...
index d5afb1cd3c4db6cdc9c7095800cd6c627d7eaea5..579f4de62ca258f352794929a404ad0aedcf6ec3 100644 (file)
  ************************************************************************/
 
 // 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("beg")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
 
 // Get current month (2 digits)
 $curr = date("m", time());
 
 // Check if month is done
-if (($curr != $_CONFIG['beg_month']) && ($_CONFIG['beg_month'] > 0) && ($_CONFIG['beg_ranks'] > 0) && ($CSS != 1))
+if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONFIG['beg_ranks'] > 0) && ($CSS != 1))
 {
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "";
@@ -113,13 +110,7 @@ SET points=points+%s WHERE ref_depth=0 AND userid=%s LIMIT 1",
 
        // Free memory
        SQL_FREERESULT($result_main);
-
-       // Finally update database and config array
-       $_CONFIG['beg_month'] = $curr;
-       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET beg_month='%s' WHERE config=0 LIMIT 1",
-        array($curr), __FILE__, __LINE__);
-
-       // Destroy cache
 }
+
 //
 ?>
index b555dd32384da2a020b43479b55878d2da0d639c..f4e465fb585342d050283271a33d2349fc0e9a9c 100644 (file)
@@ -49,7 +49,7 @@ if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
 // Get current month (2 digits)
 $curr = date("m", time());
 
-if (($curr != $_CONFIG['bonus_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1))
+if (($curr != $_CONFIG['last_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1))
 {
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "WHERE status='CONFIRMED'";
@@ -126,13 +126,7 @@ SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0", __
 
        // Free memory
        SQL_FREERESULT($result_main);
-
-       // Finally update database and config array
-       $_CONFIG['bonus_month'] = $curr;
-       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET last_bonus_month='%s' WHERE config=0 LIMIT 1",
-        array($curr), __FILE__, __LINE__);
-
-       // Destroy cache
 }
+
 //
 ?>
index a23eea936ab759c8b48ffd3da83e8924ad586a18..ed7eb9205b911b0e470b34fa8bfe3b564b851d34 100644 (file)
@@ -49,7 +49,7 @@ if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
 // Get current month (2 digits)
 $curr = date("m", time());
 
-if ($_CONFIG['nl_month'] != $curr)
+if ($_CONFIG['last_month'] != $curr)
 {
        // Check for unsubscribed members
        $result = SQL_QUERY("SELECT userid, nl_until FROM "._MYSQL_PREFIX."_user_data WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__);
@@ -72,12 +72,6 @@ if ($_CONFIG['nl_month'] != $curr)
 
                // Free memory
                SQL_FREERESULT($result);
-
-               // Update last month
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET nl_month='%s' WHERE config=0 LIMIT 1",
-                array($curr), __FILE__, __LINE__);
-
-               // Destroy cache
        }
 }
 
diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php
new file mode 100644 (file)
index 0000000..cdcf160
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : monthly_surfbar.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+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("surfbar")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+
+// Reset surfbar counter
+UPDATE_CONFIG("surfbar_monthly_counter", "0");
+$_CONFIG['surfbar_monthly_counter'] = 0;
+
+//
+?>
diff --git a/inc/monthly_newsletter.php b/inc/monthly_newsletter.php
deleted file mode 100644 (file)
index 018f57f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 03/04/2005 *
- * ===============                              Last change: 03/04/2005 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : monthly_newsletter.php                           *
- * -------------------------------------------------------------------- *
- * Short description : Monthly check for newsletter unsubscriptions     *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Monatlicher Test auf Newsletter-Abmeldungen      *
- * -------------------------------------------------------------------- *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
- *                                                                      *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or    *
- * (at your option) any later version.                                  *
- *                                                                      *
- * This program is distributed in the hope that it will be useful,      *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
- * GNU General Public License for more details.                         *
- *                                                                      *
- * You should have received a copy of the GNU General Public License    *
- * along with this program; if not, write to the Free Software          *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
- * MA  02110-1301  USA                                                  *
- ************************************************************************/
-
-// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
-
-// Check for unsubscribed members
-$result = SQL_QUERY("SELECT userid, nl_until FROM "._MYSQL_PREFIX."_user_data WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0)
-{
-       // Some unsubscriptions are found so we reset them to receive newsletters
-       while(list($uid, $until) = SQL_FETCHROW($result))
-       {
-               // Update account
-               $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET nl_receive='Y', nl_until='0' WHERE userid='".$uid."' LIMIT 1", __FILE__, __LINE__);
-
-               // Send email to him
-               $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_reset", true, $uid);
-               SEND_EMAIL($uid, NL_MEMBER_RESET_SUBJECT, $msg);
-
-               // Send email to admin
-               SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']);
-       }
-}
-
-//
-?>
index 9cd96c8fa492f27b5bdde675b4488abe42986120..0bc771cb1669a48be0b26e376dc6910e69d19c40 100644 (file)
@@ -106,7 +106,7 @@ LIMIT 1", __FILE__, __LINE__);
                                                // Something went wrong
                                                ADD_FATAL(FATAL_CANNOT_LOAD_CONFIG);
                                                return;
-                                       }
+                                       } // END - if
 
                                        // Load the configuration
                                        $_CONFIG = array_merge($_CONFIG, SQL_FETCHARRAY($result));
@@ -114,15 +114,6 @@ LIMIT 1", __FILE__, __LINE__);
                                        // Initialize include-file-pool
                                        $INC_POOL = array();
 
-                                       // Run daily reset
-                                       if ((date("d", $_CONFIG['last_update']) != date("d", time()) || ((isBooleanConstantAndTrue('DEBUG_MODE')))) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
-                                               // Do daily things in external PHP file but only when script is completely setup
-                                               $INC_POOL[] = sprintf("%sinc/reset/reset_daily.php", PATH);
-
-                                               // Daily reset was run!
-                                               define('__DAILY_RESET', "1");
-                                       }
-
                                        // Load "databases" aka static arrays
                                        require_once(PATH."inc/databases.php");
 
@@ -132,11 +123,29 @@ LIMIT 1", __FILE__, __LINE__);
                                        // Functions which are related to themes
                                        require_once(PATH."inc/theme-manager.php");
 
+                                       // Run daily reset
+                                       if ((date("d", $_CONFIG['last_update']) != date("d", time()) || ((isBooleanConstantAndTrue('DEBUG_MODE')))) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
+                                               // Do daily things in external PHP file but only when script is completely setup
+                                               $INC_POOL = array();
+                                               $INC_POOL[] = sprintf("%sinc/reset/reset_daily.php", PATH);
+
+                                               // Daily reset was run!
+                                               define('__DAILY_RESET', true);
+
+                                               // Add more includes
+                                               RESET_ADD_INCLUDES();
+
+                                               // Run the full reset scripts
+                                               foreach ($INC_POOL as $incFile) {
+                                                       require_once($incFile);
+                                               } // END - foreach
+                                       } // END - if
+
                                        // Load admin include file if he is admin
                                        if (IS_ADMIN()) {
                                                // Administrative functions
                                                require_once(PATH."inc/modules/admin/admin-inc.php");
-                                       }
+                                       } // END - if
 
                                        // Get all values
                                        if (($CSS != 1) && ($CSS != -1)) {
index f87c4c4c0df7957d258fb59ebd10e657605dc89c..a519c798b1ead0b181699020132891d3508c3d29 100644 (file)
@@ -400,8 +400,8 @@ function IS_ADMIN($admin="")
        // If admin login is not given take current from cookies...
        if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
                // Get admin login and password from session/cookies
-               $admin = SQL_ESCAPE(get_session('admin_login'));
-               $passCookie = SQL_ESCAPE(get_session('admin_md5'));
+               $admin = get_session('admin_login');
+               $passCookie = get_session('admin_md5');
        }
        //* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
 
@@ -629,7 +629,7 @@ function UPDATE_LOGIN_DATA ($UPDATE=true) {
                // Maybe first login time?
                if (empty($mod)) $mod = "login";
 
-               if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", SQL_ESCAPE(get_session('u_hash')), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) {
+               if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", get_session('u_hash'), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) {
                        // This will be displayed on welcome page! :-)
                        if (empty($LAST['module'])) {
                                $LAST['module'] = $mod; $LAST['online'] = $onl;
@@ -1375,12 +1375,11 @@ function activateExchange() {
                );
 
                // Run SQLs
-               foreach ($SQLs as $sql)
-               {
+               foreach ($SQLs as $sql) {
                        $result = SQL_QUERY($sql, __FILE__, __LINE__);
                }
 
-               // Destroy cache
+               // @TODO Destroy cache
        }
 }
 //
@@ -1392,8 +1391,7 @@ FROM "._MYSQL_PREFIX."_user_points AS p
 LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON p.userid=d.userid
 WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 1)
-       {
+       if (SQL_NUMROWS($result) == 1) {
                // Save his points to add them to the jackpot
                list($points) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -1402,8 +1400,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
                $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
 
                // Update mediadata as well
-               if (GET_EXT_VERSION("mediadata") >= "0.0.4")
-               {
+               if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
                        // Update database
                        MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $points);
                }
@@ -1417,8 +1414,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
         array(bigintval($uid)), __FILE__, __LINE__);
 
        // Remove from rallye if found
-       if (EXT_IS_ACTIVE("rallye"))
-       {
+       if (EXT_IS_ACTIVE("rallye")) {
                $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE userid=%s",
                 array(bigintval($uid)), __FILE__, __LINE__);
        }
@@ -1559,8 +1555,7 @@ function MODULE_HAS_MENU($mod)
 
        // All is false by default
        $ret = false;
-       if (GET_EXT_VERSION("cache") >= "0.1.2")
-       {
+       if (GET_EXT_VERSION("cache") >= "0.1.2") {
                if (isset($cacheArray['modules']['has_menu'][$mod]))
                {
                        // Check module cache and count hit
@@ -1574,22 +1569,21 @@ function MODULE_HAS_MENU($mod)
                        $_CONFIG['cache_hits']++;
                }
        }
-       if ((GET_EXT_VERSION("sql_patches") >= "0.3.6") && ($ret === false))
-       {
+
+       if ((GET_EXT_VERSION("sql_patches") >= "0.3.6") && ($ret === false)) {
                // Check database for entry
                $result = SQL_QUERY_ESC("SELECT has_menu FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1",
                 array($mod), __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) == 1)
-               {
+               if (SQL_NUMROWS($result) == 1) {
                        list($has_menu) = SQL_FETCHROW($result);
-                       if ($has_menu == "Y") $ret = true;
+                       $ret = ($has_menu == "Y");
                }
 
                // Free memory
                SQL_FREERESULT($result);
        } elseif (GET_EXT_VERSION("sql_patches") == "") {
                // No sql_patches installed, so maybe in admin area?
-               if ((IS_ADMIN()) && ($mod == "admin")) return true; // Then there is a menu!
+               $ret = ((IS_ADMIN()) && ($mod == "admin")); // Then there is a menu!
        }
 
        // Return status
@@ -1607,6 +1601,48 @@ function SUB_POINTS ($uid, $points) {
                MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $points);
        } // END - if
 }
+// Update config entries
+function UPDATE_CONFIG ($entries, $values, $updateMode="") {
+       // Do we have multiple entries?
+       if (is_array($entries)) {
+               // Walk through all
+               $all = "";
+               foreach ($entries as $idx => $entry) {
+                       // Update mode set?
+                       if (!empty($updateMode)) {
+                               // Update entry
+                               $all .= sprintf("%s=%s%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]);
+                       } else {
+                               // Check if string or number
+                               if (($values[$idx] + 0) === $values[$idx]) {
+                                       // Number detected
+                                       $all .= sprintf("%s=%s,", $entry, (float)$values[$idx]);
+                               } else {
+                                       // String detected
+                                       $all .= sprintf("%s='%s',", $entry, SQL_ESCAPE($values[$idx]));
+                               }
+                       }
+               } // END - foreach
 
+               // Remove last comma
+               $entries = substr($all, 0, -1);
+       } elseif (!empty($updateMode)) {
+               // Update mode set
+               $entries .= sprintf("=%s%s%s", $entries, $updateMode, (float)$value);
+       } else {
+               // Regular entry to update
+               $entries .= sprintf("='%s'", SQL_ESCAPE($values));
+       }
+
+       // Run database update
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__.":entries={$entries}");
+       SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET ".$entries." WHERE config=0 LIMIT 1", __FILE__, __LINE__);
+
+       // Destroy cache
+       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (SQL_AFFECTEDROWS() == 1)) {
+               global $cacheInstance;
+               if ($cacheInstance->cache_file("config", true)) $cacheInstance->cache_destroy();
+       } // END - if
+}
 //
 ?>
index 984103c8b0ae3aee42d46a4cc93fd407620a1de8..e3ec443cd32d789bfeb4e66c2f811aa0113d7ce1 100644 (file)
@@ -39,25 +39,12 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 }
 
 // Check for patch level differences between databases and current hard-coded
-if (CURR_PATCH_LEVEL > $_CONFIG['patch_level'])
-{
+if (CURR_PATCH_LEVEL > $_CONFIG['patch_level']) {
        // Update database and CONFIG array
-       $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET patch_level='".CURR_PATCH_LEVEL."', patch_ctime=UNIX_TIMESTAMP() WHERE config=0 LIMIT 1",
-        __FILE__, __LINE__);
+       UPDATE_CONFIG(array("patch_level", "path_ctime"), array(CURR_PATH_LEVEL, "UNIX_TIMESTAMP()"));
        $_CONFIG['patch_level'] = CURR_PATCH_LEVEL;
        $_CONFIG['patch_ctime'] = time();
-
-       // Destroy cache
-       if (GET_EXT_VERSION("cache") >= "0.1.2")
-       {
-               if ($cacheInstance->cache_file("config", true))
-               {
-                       // Replace data
-                       $cacheInstance->cache_replace("patch_level", $_CONFIG['patch_level'], "0", $cacheArray);
-                       $cacheInstance->cache_replace("patch_ctime", $_CONFIG['patch_ctime'], "0", $cacheArray);
-               }
-       }
-}
+} // END - if
 
 //
 ?>
index 6d6f0c00414d18ae4b455b10d19476b255d4e51f..98eaa943fe939f69aad83625d364150c7f6a4dbd 100644 (file)
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *                                
- * For more information visit: http://www.mxchange.org                  *                                
- *                                                                      *                                
- * This program is free software; you can redistribute it and/or modify *                                
- * it under the terms of the GNU General Public License as published by *                                
- * the Free Software Foundation; either version 2 of the License, or    *                                
- * (at your option) any later version.                                  *                                
- *                                                                      *                                
- * This program is distributed in the hope that it will be useful,      *                                
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *                                
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *                                
- * GNU General Public License for more details.                         *                                
- *                                                                      *                                
- * You should have received a copy of the GNU General Public License    *                                
- * along with this program; if not, write to the Free Software          *                                
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *                                
- * MA  02110-1301  USA                                                  *                                
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
  ************************************************************************/
 
 // 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("")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 }
index e8fb34aecb3c0429400517abb8085ccc331f5336..c668ba3b2ebd77861dccec11cc674b5120df1664 100644 (file)
  ************************************************************************/
 
 // 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("beg")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
 
 // Reset accounts
 $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET beg_points=0.00000 WHERE beg_points > 0",
index 9df8158716b335d423c99fe096c40e2487d22e28..d18d2fbd629c3dbef228117e36d472918b147b23 100644 (file)
@@ -88,19 +88,7 @@ SQL_FREERESULT($result_daily);
 $_CONFIG['last_update'] = time();
 
 // Update database
-$result_daily = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config
-SET last_update=UNIX_TIMESTAMP()
-WHERE config=0 AND last_update != UNIX_TIMESTAMP()
-LIMIT 1", __FILE__, __LINE__);
-
-// Destroy cache
-if ((GET_EXT_VERSION("cache") >= "0.1.2") && (SQL_AFFECTEDROWS() == 1))
-{
-       if ($cacheInstance->cache_file("config", true))
-       {
-               $cacheInstance->cache_replace("last_update", time(), "0", $cacheArray);
-       }
-}
+UPDATE_CONFIG("last_update", time());
 
 //
 ?>
index 93397faf1afcd38379f30b877f8dbbbb73888ae5..45e8b9fd48e6096ac296d35beeb19f3af68e2b40 100644 (file)
  ************************************************************************/
 
 // 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("holiday")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday");
        return;
 }
@@ -50,11 +47,9 @@ if (($CSS == 1) || ((!isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['h
 $result_main = SQL_QUERY("SELECT userid, holiday_activated FROM "._MYSQL_PREFIX."_user_data
 WHERE holiday_activated > 0 AND holiday_activated < ".time()." AND holiday_active='N'
 ORDER BY holiday_activated", __FILE__, __LINE__);
-if (SQL_NUMROWS($result_main) > 0)
-{
+if (SQL_NUMROWS($result_main) > 0) {
        // We have found at least one useraccount so let's check it...
-       while(list($uid, $activated) = SQL_FETCHROW($result_main))
-       {
+       while(list($uid, $activated) = SQL_FETCHROW($result_main)) {
                // Check if his holiday can be activated
                $result_holiday = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays
 WHERE userid=%s AND holiday_start <= ".time()." AND holiday_end > ".time()." LIMIT 1",
diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php
new file mode 100644 (file)
index 0000000..4fc2f6b
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_surfbar.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Things to be done on daily reset                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Dinge, die beim taeglichen Reset erledigt werden *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+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("")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+
+// Reset surfbar counter
+UPDATE_CONFIG("surfbar_daily_counter", "0");
+$_CONFIG['surfbar_daily_counter'] = 0;
+
+//
+?>
index 5a3f843988c85669372c6ec052b5f12a8c1d195f..d03bbfa7c265e422b21482cb431be4ecf17f9b60 100644 (file)
@@ -41,7 +41,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 // Always make sure the session management is initialized first
 require_once(PATH."inc/session.php");
 
-//
+// Get current theme name
 function GET_CURR_THEME() {
        global $INC_POOL, $_CONFIG, $CSS;
 
diff --git a/inc/weekly/.htaccess b/inc/weekly/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/weekly/weekly_ b/inc/weekly/weekly_
new file mode 100644 (file)
index 0000000..80ccc6b
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : weekly_                                          *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+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("")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+//
+?>
diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php
new file mode 100644 (file)
index 0000000..74ce5f6
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : weekly_surfbar.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+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("surfbar")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+// Reset the surfbar counter
+UPDATE_CONFIG("surfbar_weekly_counter", "0");
+$_CONFIG['surfbar_weekly_counter'] = 0;
+
+//
+?>
index 703e39be1f498a0abbf9a2f517e7521147d672fd..82021884384fcf3f5c29f07520cc207048bad6b9 100644 (file)
@@ -61,7 +61,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
        }
 
        // Is there a check value?
-       if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isset($_GET['frame'])) && (($_GET['frame'] == "stop") || ($_GET['frame'] == "stop2")))) {
+       if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isset($_GET['frame'])) && (in_array($_GET['frame'], array("stop", "stop2", "stats"))))) {
                // Reload-lock is full, surfbar stopped so...
                // Load header
                require_once(PATH."inc/header.php");
@@ -77,6 +77,23 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
 
                        // This makes the footer appear again
                        unset($_GET['frame']);
+               } elseif ((isset($_GET['frame'])) && ($_GET['frame'] == "stats")) {
+                       // Get total points amount
+                       $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+
+                       // Prepare content
+                       $content = array(
+                               'points'  => TRANSLATE_COMMA($points),
+                               'online'  => SURFBAR_DETERMINE_TOTAL_ONLINE(),
+                               'reload'  => ($_CONFIG['surfbar_stats_reload'] * 1000),
+                               'c_total' => TRANSLATE_COMMA($_CONFIG['surfbar_total_counter']),
+                               'c_today' => TRANSLATE_COMMA($_CONFIG['surfbar_daily_counter']),
+                               'c_week'  => TRANSLATE_COMMA($_CONFIG['surfbar_weekly_counter']),
+                               'c_month' => TRANSLATE_COMMA($_CONFIG['surfbar_monthly_counter']),
+                       );
+
+                       // Load template for "stats" page
+                       LOAD_TEMPLATE("surfbar_frame_stats", false, $content);
                } else {
                        // Prepare content
                        $content = array(
@@ -126,9 +143,6 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
 
                        // Is there a valid id?
                        if ($nextId > 0) {
-                               // Get total points amount
-                               $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
-
                                // Then prepare other content
                                $content = array(
                                        'id'          => $nextId,
@@ -138,12 +152,11 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                        'url'         => SURFBAR_GET_URL($nextId),
                                        'curr_reload' => SURFBAR_GET_USER_RELOAD_LOCK(),
                                        'max_urls'    => SURFBAR_GET_TOTAL_URLS(),
-                                       'reload'      => SURFBAR_GET_RELOAD_TIME($nextId),
-                                       'points'      => TRANSLATE_COMMA($points)
+                                       'reload'      => SURFBAR_GET_RELOAD_TIME($nextId)
                                );
 
-                               // Update salt (double-call lock!)
-                               SURFBAR_UPDATE_SALT();
+                               // Update salt (double-call lock!) and statistics
+                               SURFBAR_UPDATE_SALT_STATS();
                        } else {
                                // Load new URL
                                LOAD_URL("surfbar.php?frame=stop2");
diff --git a/templates/de/emails/admin/admin_surfbar_url_reg.tpl b/templates/de/emails/admin/admin_surfbar_url_reg.tpl
new file mode 100644 (file)
index 0000000..1d86efc
--- /dev/null
@@ -0,0 +1,28 @@
+{--HELLO_ADMIN--},
+
+ein Mitglied hat soeben eine URL in der Surfbar gebucht.
+
+Hier sind alle dazu:
+------------------------------------------
+Gebuchte URL: $content[url]
+------------------------------------------
+Email: $DATA[email]
+------------------------------------------
+Framekiller-Test:
+$content[frametester]
+------------------------------------------
+User-ID: $content[uid]
+------------------------------------------
+Kosten/Aufruf: $content[costs] {!POINTS!}
+------------------------------------------
+Verg&uuml;tung/Aufruf: $content[reward] {!POINTS!}
+------------------------------------------
+Status: $content[status]
+------------------------------------------
+ID in der Surfbar: $content[insert_id]
+------------------------------------------
+
+{--ADMIN_THANX--}
+  {--YOUR--} {!MAIN_TITLE!} {--SCRIPT--}
+
+{!URL!}/admin.php
index 1a7ac084a09548dce4359f472b43e2828073be2a..d02553d28cf7f2190d43cec05d7fb7a24d2c35e5 100644 (file)
@@ -15,7 +15,7 @@ $content[frametester]
 ------------------------------------------
 User-ID: $content[uid]
 ------------------------------------------
-Verg&uuml;tung: $content[reward] {!POINTS!}
+Verg&uuml;tung/Aufruf: $content[reward] {!POINTS!}
 ------------------------------------------
 Status: $content[status]
 ------------------------------------------
diff --git a/templates/de/emails/member/member_surfbar_url_reg.tpl b/templates/de/emails/member/member_surfbar_url_reg.tpl
new file mode 100644 (file)
index 0000000..bef971e
--- /dev/null
@@ -0,0 +1,19 @@
+{--HELLO--} Mitglied,
+
+Sie haben soeben eine URL in der Surfbar gebucht.
+
+Hier sind alle Daten:
+------------------------------------------
+Gebuchte URL: $content[url]
+------------------------------------------
+Ihre User-ID: $content[uid]
+------------------------------------------
+Status: $content[status]
+------------------------------------------
+ID in der Surfbar: $content[insert_id]
+------------------------------------------
+
+Mit freundlichem Gruss,
+  Ihr {!MAIN_TITLE!} Team
+
+{!URL!} ({!WEBMASTER!})
index bb9ffa5c89f35ae96e4bdcd7e8faed2134845905..1f8f34b160c28accb9b7a21f2111b9965a98b3da 100644 (file)
                        <INPUT type="text" name="surfbar_restart_time" size="6" maxlength="20" value="$content[surfbar_restart_time]" />
                </TD>
        </TR>
+       <TR><TD height="3" colspan="2" class="seperator">&nbsp;</TD></TR>
+       <TR>
+               <TD height="30" align="right" style="padding-right:5px">
+                       {--ADMIN_CONFIG_SURFBAR_STATS_RELOAD--}
+               </TD>
+               <TD>
+                       <INPUT type="text" name="surfbar_stats_reload" size="6" maxlength="20" value="$content[surfbar_stats_reload]" />
+               </TD>
+       </TR>
        <TR><TD height="8" colspan="2" class="seperator bottom2">&nbsp;</TD></TR>
        <TR>
                <TD align="center" colspan="2" class="admin_footer bottom2">
diff --git a/templates/de/html/member/member_surfbar_book_dynamic.tpl b/templates/de/html/member/member_surfbar_book_dynamic.tpl
new file mode 100644 (file)
index 0000000..7336c0d
--- /dev/null
@@ -0,0 +1,26 @@
+<form action="{!URL!}/modules.php?module=login&amp;what=surfbar_book" method="post">
+<div class="member_table dashed" style="width:600px;margin-top:10px">
+       <div class="member_title2 bottom2" style="padding-top:5px;padding-bottom:5px">
+               <strong>URL in Surfbar buchen:</strong>
+       </div>
+
+       <div class="member_input" style="padding-top:5px;padding-bottom:5px">
+               URL eingeben: <input type="text" name="url" size="20" maxlength="255" value="http://" />
+       </div>
+
+       <div class="member_input" style="padding-top:5px;padding-bottom:5px">
+               Jeder Seiten-Aufruf durch andere Mitglieder kostet Ihnen mindestens <span
+                class="surfbar_points">$content[costs] {!POINTS!}</span>. Surfen Sie mit
+               der Surfbar erhalten Sie mindestens <span class="surfbar_points">$content[reward]
+               {!POINTS!}</span> auf Ihr Konto gutgeschrieben.<br />
+               <br />
+               Sie haben bereits <strong>$content[curr_order]</strong> von maximal
+               <strong>$content[max_order]</strong> erlaubten URLs gebucht.
+       </div>
+
+       <div class="member_title2 top2" style="padding-top:5px;padding-bottom:5px">
+               <input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />&nbsp;*
+               <input type="submit" class="member_submit" name="ok" value="{--MEMBER_SURFBAR_ADD_URL--}" />
+       </div>
+</div>
+</form>
diff --git a/templates/de/html/member/member_surfbar_book_static.tpl b/templates/de/html/member/member_surfbar_book_static.tpl
new file mode 100644 (file)
index 0000000..49385e1
--- /dev/null
@@ -0,0 +1,26 @@
+<form action="{!URL!}/modules.php?module=login&amp;what=surfbar_book" method="post">
+<div class="member_table dashed" style="width:600px;margin-top:10px">
+       <div class="member_title2 bottom2" style="padding-top:5px;padding-bottom:5px">
+               <strong>URL in Surfbar buchen:</strong>
+       </div>
+
+       <div class="member_input" style="padding-top:5px;padding-bottom:5px">
+               URL eingeben: <input type="text" name="url" size="20" maxlength="255" value="http://" />
+       </div>
+
+       <div class="member_input" style="padding-top:5px;padding-bottom:5px">
+               Jeder Seiten-Aufruf durch andere Mitglieder kostet Ihnen <span
+                class="surfbar_points">$content[costs] {!POINTS!}</span>. Surfen Sie mit
+               der Surfbar erhalten Sie <span class="surfbar_points">$content[reward]
+               {!POINTS!}</span> auf Ihr Konto gutgeschrieben.<br />
+               <br />
+               Sie haben bereits <strong>$content[curr_order]</strong> von maximal
+               <strong>$content[max_order]</strong> erlaubten URLs gebucht.
+       </div>
+
+       <div class="member_title2 top2" style="padding-top:5px;padding-bottom:5px">
+               <input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />&nbsp;*
+               <input type="submit" class="member_submit" name="ok" value="{--MEMBER_SURFBAR_ADD_URL--}" />
+       </div>
+</div>
+</form>
diff --git a/templates/de/html/surfbar/surfbar_frame_stats.tpl b/templates/de/html/surfbar/surfbar_frame_stats.tpl
new file mode 100644 (file)
index 0000000..0e0ca5a
--- /dev/null
@@ -0,0 +1,21 @@
+<table border="0" cellspacing="0" cellpadding="0" width="100%" class="surfbar_table">
+<tr>
+       <td class="surfbar_td">
+               &raquo;Guthaben: <span class="surfbar_points">$content[points]&nbsp;{!POINTS!}</span>&laquo;&nbsp;-
+               &raquo;Jetzt Online: <span class="surfbar_counter">$content[online]</span>&laquo;&nbsp;-
+               &raquo;Seitenaufrufe: Heute:<span class="surfbar_counter">$content[c_today]</span>&nbsp;-
+               Woche:<span class="surfbar_counter">$content[c_week]</span>&nbsp;-
+               Monat:<span class="surfbar_counter">$content[c_month]</span>&nbsp;-
+               Gesamt:<span class="surfbar_counter">$content[c_total]</span>&laquo;
+       </td>
+</tr>
+</table>
+<script language="JavaScript" type="text/javascript">
+<!--
+function Reload() {
+       this.location.reload();
+}
+
+window.setTimeout("Reload()", $content[reload]);
+//-->
+</script>
\ No newline at end of file
index da821e07dc2618757a4b8d18d5347da9456f72b2..5da82c3da39714e471adaa891ebfda59049c2228 100644 (file)
@@ -5,14 +5,13 @@
                <span id="surfbar_counter">X</span>&nbsp;<span
                 id="counter_word">Sekunden</span>&laquo;&nbsp;&raquo;<span
                 class="surfbar_reload">$content[curr_reload]</span> von <span
-                class="surfbar_max">$content[max_urls]</span> im Reload&laquo;&nbsp;&raquo;Guthaben:
-               <span class="surfbar_points">$content[points]&nbsp;{!POINTS!}</span>&laquo;<br />
+                class="surfbar_max">$content[max_urls]</span> im Reload&laquo;<br />
 
                &raquo;<a href="$content[url]" target="_blank">Aktuelle Seite in neuem
-               Fenster &ouml;ffnen</a>&laquo;&nbsp;[<a target="_parent"
-                href="{!URL!}/login.php">Loginbereich</a>|<a target="_parent"
-                href="{!URL!}/modules.php?module=login&amp;what=logout">Ausloggen</a>|<a
-                href="javascript:window.close()">Schliessen</a>]<br />
+               Fenster &ouml;ffnen</a>&laquo;&nbsp;<span class="surfbar_navi">[<a
+                target="_parent" href="{!URL!}/login.php">Loginbereich</a>|<a
+                target="_parent" href="{!URL!}/modules.php?module=login&amp;what=logout">Ausloggen</a>|<a
+                href="javascript:window.close()">Schliessen</a>]</span><br />
 
                &raquo;{!MAIN_TITLE!} ist f&uuml;r den Inhalt nicht verantwortlich!&laquo;
        </td>
index a8abfa1bbe1eb92fe54643f34452d82bb48bf098..e5e49ad8f265dcac37d2d9932cdb00b0b9a7fe76 100644 (file)
@@ -5,12 +5,13 @@ if (top.frames.length > 0) {
 }
 //-->
 </script>
-<frameset rows="62,*" frameborder="no" border="0" framespacing="0">
+<frameset rows="62,*,18" frameborder="no" border="0" framespacing="0">
        <frameset cols="*,469" frameborder="no" border="0" framespacing="0">
                <frame name="surfbar_top" src="{!URL!}/surfbar.php?frame=top" frameborder="no" scrolling="no" noresize>
                <frame name="surfbar_banner" src="{!URL!}/surfbar.php?frame=banner" frameborder="no" scrolling="no" noresize>
        </frameset>
        <frame name="surfbar_url" src="{!URL!}/surfbar.php?frame=start" frameborder="no" scrolling="no" noresize>
+       <frame name="surfbar_stats" src="{!URL!}/surfbar.php?frame=stats" frameborder="no" scrolling="no" noresize>
 </frameset>
 <noframes>
        Ihr Browser unterst&uuml;tzt keine Frames!
index d08da48a3f961a7b7422e1cb348ad7c85a1b6dcd..41bee3adfa583350ea6afc16e7a4af16d583de44 100644 (file)
@@ -23,7 +23,7 @@ function Restart () {
 }
 
 function ShowButton () {
-       buttonDiv.innerHTML = "<form action='{!URL!}/surfbar.php' target='_parent' method='GET'><input type='submit' class='member_submit' value='Surfbar erneut starten' /></form>";
+       buttonDiv.innerHTML = "<form action='{!URL!}/surfbar.php' target='_self' method='GET'><input type='hidden' name='frame' value='top' /><input type='submit' class='member_submit' value='Surfbar erneut starten' /></form>";
 }
 
 function Counter () {