Surfbar continued and some rewrites/fixes:
authorRoland Häder <roland@mxchange.org>
Thu, 27 Nov 2008 20:10:18 +0000 (20:10 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 27 Nov 2008 20:10:18 +0000 (20:10 +0000)
- Some rewrites in base (root) scripts
- Surfbar continued with with edit form (saving data not completed!)
- Minor improvements/fixes

33 files changed:
.gitattributes
admin.php
agb.php
beg.php
birthday_confirm.php
click.php
confirm.php
css.php
debug.php
doubler.php
img.php
inc/databases.php
inc/extensions/ext-surfbar.php
inc/libs/surfbar_functions.php
inc/modules/guest/what-wernis_portal.php
inc/modules/member/what-surfbar_book.php
index.php
install.php
js.php
lead-confirm.php
login.php
mailid.php
mailid_top.php
modules.php
ref.php
show_bonus.php
sponsor_confirm.php
sponsor_ref.php
surfbar.php
templates/de/html/member/member_surfbar_book_dynamic.tpl
templates/de/html/member/member_surfbar_book_static.tpl
templates/de/html/member/member_surfbar_edit_action_form.tpl [new file with mode: 0644]
view.php

index 853b487..4947c0a 100644 (file)
@@ -1390,6 +1390,7 @@ 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.tp -text
 templates/de/html/member/member_surfbar_book_static.tpl -text
+templates/de/html/member/member_surfbar_edit_action_form.tpl -text
 templates/de/html/member/member_surfbar_link.tpl -text
 templates/de/html/member/member_surfbar_list.tpl -text
 templates/de/html/member/member_surfbar_list_row.tpl -text
index 5c6f49d..5a04fc8 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -42,17 +42,14 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "admin"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
-if (isBooleanConstantAndTrue('mxchange_installed'))
-{
+if (isBooleanConstantAndTrue('mxchange_installed')) {
        // Simply redirect... :-)
        LOAD_URL("modules.php?module=admin&amp;action=login");
        // Redirection should be done here
-}
- else
-{
+} else {
        // You have to configure first!
        LOAD_URL("install.php");
 }
diff --git a/agb.php b/agb.php
index 3302830..7f020fc 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "agb"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed'))
diff --git a/beg.php b/beg.php
index 0f69f2a..368d6db 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -46,7 +46,7 @@ $CSS = -1;
 $msg = null;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the "beg" extension active?
 if (!EXT_IS_ACTIVE("beg")) {
index 22cd6bf..daf118a 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "birthday_confirm"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the "birthday" extension active?
 if (!EXT_IS_ACTIVE("birthday")) {
index c10ff14..515a958 100644 (file)
--- a/click.php
+++ b/click.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "click"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['banner']))) {
        // Update clicks counter...
index 571941f..b6542b6 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "confirm"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
 if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')))
diff --git a/css.php b/css.php
index 4092cda..1917cee 100644 (file)
--- a/css.php
+++ b/css.php
@@ -45,7 +45,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $CSS = "1"; $GLOBALS['module'] = "css";
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Set header
 @header("Content-type: text/css");
index 7fefdf8..dd213e4 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "debug"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Redirect only to registration page when this script is installed
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index b779650..4bbc658 100644 (file)
@@ -46,7 +46,7 @@ $GLOBALS['refid'] = 0;
 $CSS = 0;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the "doubler" extension active?
 if (!EXT_IS_ACTIVE("doubler")) {
diff --git a/img.php b/img.php
index c962aec..2e7d46f 100644 (file)
--- a/img.php
+++ b/img.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "img"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index 4d01b2b..c6f35b9 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "563");
+define('CURR_SVN_REVISION', "564");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index e18f2e0..723662b 100644 (file)
@@ -55,7 +55,6 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 `id` BIGINT(20) UNSIGNED  NOT NULL AUTO_INCREMENT,
 `userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
 `url` VARCHAR(255) NOT NULL DEFAULT '',
-`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `last_salt` VARCHAR(255) NOT NULL DEFAULT '',
 `views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
 `views_max` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
@@ -68,7 +67,6 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 PRIMARY KEY(`id`),
 UNIQUE KEY `userid_url` (`userid`,`url`),
 INDEX `status_userid` (`status`,`userid`),
-INDEX (`payment_id`)
 ) TYPE=MyISAM COMMENT='Surfbar URLs'";
 
        // Reload locks
index 7bef443..fa03501 100644 (file)
@@ -320,8 +320,30 @@ function SURFBAR_MEMBER_DELETE_ACTION ($urlData) {
 // Display selected "action form"
 function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        // Translate some data
-       $urlData['registered']  = MAKE_DATETIME($urlData['registered'], "2");
-       $urlData['views_total'] = TRANSLATE_COMMA($urlData['views_total']);
+       $urlData['registered']    = MAKE_DATETIME($urlData['registered'], "2");
+       $urlData['views_total']   = TRANSLATE_COMMA($urlData['views_total']);
+       $urlData['views_max']     = TRANSLATE_COMMA($urlData['views_max']);
+       $urlData['views_allowed'] = TRANSLATE_COMMA($urlData['views_allowed']);
+       $urlData['last_locked']   = MAKE_DATETIME($urlData['last_locked'], "2");
+
+       // Is the lock reason empty?
+       if (empty($urlData['lock_reason'])) {
+               // Fix it to three dashes
+               $urlData['lock_reason'] = "---";
+       } // END - if
+
+       // Default is not limited
+       $urlData['limited_yes'] = "";
+       $urlData['limited_no']  = " checked=\"checked\"";
+       $urlData['limited']     = "false";
+
+       // Is this URL limited?
+       if ($urlData['views_max'] > 0) {
+               // Then rewrite form data
+               $urlData['limited_yes'] = " checked=\"checked\"";
+               $urlData['limited_no']  = "";
+               $urlData['limited']     = "true";
+       } // END - if
 
        // Load the form and display it
        LOAD_TEMPLATE(sprintf("member_surfbar_%s_action_form", $action), false, $urlData);
@@ -424,7 +446,7 @@ function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="AS
        } // END - if
 
        // Look up the record
-       $result = SQL_QUERY_ESC("SELECT id, userid, url, views_total, status, registered, last_locked, lock_reason, views_max, views_allowed
+       $result = SQL_QUERY_ESC("SELECT id, userid, url, views_total, views_max, views_allowed, status, registered, last_locked, lock_reason, views_max, views_allowed
 FROM "._MYSQL_PREFIX."_surfbar_urls
 WHERE %s='%s'".$add."
 ORDER BY %s %s
@@ -502,7 +524,7 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
        if (empty($uid)) $uid = 0;
 
        // Just run the insert query for now
-       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid,url,status,views_max,views_allowed) VALUES (%s,'%s','%s','%s','%s')",
+       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid,url,status,views_max,views_allowed) VALUES (%s,'%s','%s',%s,%s)",
                array(
                        $uid,
                        $urlData['url'],
@@ -1255,7 +1277,7 @@ function SURFBAR_GET_USER_URLS () {
        $URLs = array();
 
        // Begin the query
-       $result = SQL_QUERY_ESC("SELECT u.id, u.userid, u.url, u.views_total, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason
+       $result = SQL_QUERY_ESC("SELECT u.id, u.userid, u.url, u.views_total, u.views_max, u.views_allowed, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason
 FROM "._MYSQL_PREFIX."_surfbar_urls AS u
 WHERE u.userid=%s AND u.status != 'DELETED'
 ORDER BY u.id ASC",
index c7039a0..dae458d 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Special file
-require_once (PATH."inc/rdf.class.php");
+require_once(PATH."inc/rdf.class.php");
 
 // Add description as navigation point
 ADD_DESCR("guest", __FILE__);
index 97bc955..9775486 100644 (file)
@@ -51,7 +51,7 @@ ADD_DESCR("member", __FILE__);
 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'])) {
+} elseif ((isset($_POST['ok'])) && (isset($_POST['limited']))) {
        // Is limitation "no" and "limit" is > 0?
        if (($_POST['limited'] == "N") && ((isset($_POST['limit'])) && ($_POST['limit'] > 0)) || (!isset($_POST['limit']))) {
                // Set it to unlimited
@@ -61,14 +61,14 @@ if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
        // Register the new URL
        $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url'], $_POST['limit']);
 
+       // By default something went wrong
+       $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
+
        // 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;
-       }
+       } // END - if
 
        // Load message template
        LOAD_TEMPLATE("admin_settings_saved", false, $msg);
index 5a4e263..e0d16d7 100644 (file)
--- a/index.php
+++ b/index.php
@@ -43,7 +43,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "index";
 
 // Load config.php
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index 4cad098..51fb165 100644 (file)
@@ -45,7 +45,7 @@
 define('mxchange_installing', true);
 
 // Load security system
-require ("inc/libs/security_functions.php");
+require("inc/libs/security_functions.php");
 
 // Init "action" and "what"
 global $what, $action;
@@ -56,10 +56,10 @@ $GLOBALS['action'] = "";
 $GLOBALS['module'] = "install";
 
 // Load config file
-require ("inc/config.php");
+require("inc/config.php");
 
 // Header
-require (PATH."inc/header.php");
+require(PATH."inc/header.php");
 
 // Reload page to page=welcome when it is not specified
 if (!isset($_GET['page'])) {
@@ -78,14 +78,14 @@ if ((sizeof($FATAL == 0)) && (empty($FATAL[0]))) {
        LOAD_TEMPLATE("install_header");
 
        // Here start's our installtion stuff
-       require_once (PATH."inc/install-inc.php");
+       require_once(PATH."inc/install-inc.php");
 
        // Close main installation table
        LOAD_TEMPLATE("install_footer");
 }
 
 // Footer
-require (PATH."inc/footer.php");
+require(PATH."inc/footer.php");
 
 //
 ?>
diff --git a/js.php b/js.php
index 922b876..0ced4dc 100644 (file)
--- a/js.php
+++ b/js.php
@@ -51,7 +51,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $CSS = "1"; $GLOBALS['module'] = "js";
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is this script installed and a JavaScript tag is provied?
 if ((isBooleanConstantAndTrue('mxchange_installed')) && (isset($_GET['tag']))) {
index d9724b7..28672cc 100644 (file)
@@ -43,7 +43,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "lead-confirm";
 
 // Load config.php
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index e0e72b3..575533e 100644 (file)
--- a/login.php
+++ b/login.php
@@ -42,19 +42,17 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "login";
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
-if (isBooleanConstantAndTrue('mxchange_installed'))
-{
+if (isBooleanConstantAndTrue('mxchange_installed')) {
        // Simply redirect... :-)
        LOAD_URL("modules.php?module=index&amp;what=login");
        // Redirection should be done here
-}
- else
-{
+} else {
        // You have to configure first!
        LOAD_URL("install.php");
 }
+
 // Really all done here... ;-)
 ?>
index a913ef0..fe2c59e 100644 (file)
@@ -42,10 +42,9 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "mailid"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
-if (isBooleanConstantAndTrue('mxchange_installed'))
-{
+if (isBooleanConstantAndTrue('mxchange_installed')) {
        // Is the extension active
        if (!EXT_IS_ACTIVE("mailid", true)) {
                // Is not activated/installed yet!
index 921effc..cee39db 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "mailid";  $CSS = 0;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 if (isBooleanConstantAndTrue('mxchange_installed'))
 {
index 78bf8c7..da08bc7 100644 (file)
@@ -35,7 +35,7 @@
 //xdebug_start_trace();
 
 // Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )
-require_once ("inc/libs/security_functions.php");
+require_once("inc/libs/security_functions.php");
 
 // Init "action" and "what"
 global $what, $action, $startTime;
@@ -55,7 +55,7 @@ if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);
 $GLOBALS['module'] = secureString($_GET['module']);
 
 // Needed include files
-require ("inc/config.php");
+require("inc/config.php");
 
 // Check if logged in
 if (IS_MEMBER()) {
diff --git a/ref.php b/ref.php
index b8e7c2e..3d62586 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "ref"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Redirect only to registration page when this script is installed
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index 44bf06c..0953786 100644 (file)
@@ -43,7 +43,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "show_bonus"; $CSS = 0;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the "bonus" extension active?
 if (!EXT_IS_ACTIVE("bonus")) {
@@ -52,13 +52,11 @@ if (!EXT_IS_ACTIVE("bonus")) {
 } // END - if
 
 // List only rankings when script is installed
-if (isBooleanConstantAndTrue('mxchange_installed'))
-{
+if (isBooleanConstantAndTrue('mxchange_installed')) {
        // Include header
        include(PATH."inc/header.php");
 
-       if (($_GET['uid'] > 0) && ($_GET['d'] > 0) && (!empty($_GET['t'])))
-       {
+       if (($_GET['uid'] > 0) && ($_GET['d'] > 0) && (!empty($_GET['t']))) {
                // Set row name
                $t = "";
                switch ($_GET['t'])
@@ -71,8 +69,9 @@ if (isBooleanConstantAndTrue('mxchange_installed'))
                        $t = "mail_id";
                        break;
                }
-               if (!empty($t))
-               {
+
+               // Valid type?
+               if (!empty($t)) {
                        // Check for data
                        $result = SQL_QUERY_ESC("SELECT DISTINCT d.gender, d.surname, d.family, b.level, b.points
 FROM "._MYSQL_PREFIX."_user_data AS d
@@ -80,8 +79,7 @@ RIGHT JOIN "._MYSQL_PREFIX."_bonus_turbo AS b
 ON d.userid=b.userid
 WHERE d.status='CONFIRMED' AND d.userid=%s AND b.".$t."='%s' LIMIT 1",
  array(bigintval($_GET['uid']), bigintval($_GET['d'])), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1)
-                       {
+                       if (SQL_NUMROWS($result) == 1) {
                                // Load data
                                list($gender, $sname, $fname, $level, $points) = SQL_FETCHROW($result);
 
@@ -99,24 +97,18 @@ WHERE d.status='CONFIRMED' AND d.userid=%s AND b.".$t."='%s' LIMIT 1",
 
                                // Load pre-template
                                define('__BONUS_MSG', LOAD_TEMPLATE("show_bonus_msg", true));
-                       }
-                        else
-                       {
+                       } else {
                                // No data found
                                define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_NO_DATA."</FONT>");
                        }
 
                        // Free memory
                        SQL_FREERESULT($result);
-               }
-                else
-               {
+               } else {
                        // Wrong type entered
                        define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_WRONG_TYPE."</FONT>");
                }
-       }
-        else
-       {
+       } else {
                // Wrong call!
                define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_WRONG_CALL."</FONT>");
        }
@@ -135,11 +127,10 @@ WHERE d.status='CONFIRMED' AND d.userid=%s AND b.".$t."='%s' LIMIT 1",
 
        // Include footer
        include(PATH."inc/footer.php");
-}
- else
-{
+} else {
        // You have to configure first!
        LOAD_URL("install.php");
 }
+
 // Really all done here... ;-)
 ?>
index c10f2ce..e1c9c46 100644 (file)
@@ -34,7 +34,7 @@
 require_once("inc/libs/security_functions.php");
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index 73ffd57..6b66586 100644 (file)
@@ -34,7 +34,7 @@
 require_once("inc/libs/security_functions.php");
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Redirect only to registration page when this script is installed
 if (defined('mxchange_installed') && (isBooleanConstantAndTrue(mxchange_installed))) {
index bcedacf..4966280 100644 (file)
@@ -47,7 +47,7 @@ $CSS = 0;
 $msg = null;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
index fef10a0..cf36517 100644 (file)
@@ -41,7 +41,9 @@ var span = document.getElementById('span_limit');
 var old_limit = 0;
 
 function FocusLimitedNo () {
-       old_limit = limit.value;
+       if ((limit.value > 0) && (limit.value != '-')) {
+               old_limit = limit.value;
+       }
        limit.disabled = true;
        limit.setAttribute('class', 'disabled');
        limit.style.textAlign = 'center';
@@ -68,8 +70,8 @@ function SubmitForm () {
 }
 
 function ResetForm () {
-       FocusLimitedNo();
        old_limit = 0;
+       FocusLimitedNo();
        return true;
 }
 
index 48e29ff..ede041a 100644 (file)
@@ -41,7 +41,9 @@ var span = document.getElementById('span_limit');
 var old_limit = 0;
 
 function FocusLimitedNo () {
-       old_limit = limit.value;
+       if ((limit.value > 0) && (limit.value != '-')) {
+               old_limit = limit.value;
+       }
        limit.disabled = true;
        limit.setAttribute('class', 'disabled');
        limit.style.textAlign = 'center';
@@ -68,8 +70,8 @@ function SubmitForm () {
 }
 
 function ResetForm () {
-       FocusLimitedNo();
        old_limit = 0;
+       FocusLimitedNo();
        return true;
 }
 
diff --git a/templates/de/html/member/member_surfbar_edit_action_form.tpl b/templates/de/html/member/member_surfbar_edit_action_form.tpl
new file mode 100644 (file)
index 0000000..9c53c92
--- /dev/null
@@ -0,0 +1,79 @@
+<form id="edit" action="{!URL!}/modules.php?module=login&amp;what=surfbar_list" method="post" onsubmit="return SubmitForm()" onreset="return ResetForm()">
+<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 editieren:</strong>
+       </div>
+
+       <div class="member_input bottom2" style="padding-top:5px;padding-bottom:5px">
+               URL eingeben: <input class="member_normal" type="text" name="url" size="20" maxlength="255" value="$content[url]" />
+       </div>
+
+       <div class="member_input" style="padding-top:5px;padding-bottom:5px">
+               Soll die Anzahl Aufrufe begrenzt werden?<br />
+               <input type="radio" id="limited_no" onfocus="return FocusLimitedNo()" name="limited" value="N"$content[limited_no] /> {--NO--}
+               <input type="radio" id="limited_yes" onfocus="return FocusLimitedYes()" name="limited" value="Y"$content[limited_yes] /> {--YES--}
+       </div>
+
+       <div class="member_input bottom2" style="padding-top:5px;padding-bottom:5px">
+               Aufrufe begrenzen auf: <input class="member_normal" type="text" id="limit" name="limit" size="7" maxlength="20" value="$content[views_max]" />
+       </div>
+
+       <div class="member_title2 top2" style="padding-top:5px;padding-bottom:5px">
+               <input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />
+               <input type="hidden" name="id" value="$content[id]" />
+               <input type="hidden" name="action" value="edit" />
+               <input type="hidden" name="execute" value="1" />
+               <input type="submit" class="member_submit" name="ok" value="{--MEMBER_SURFBAR_ACTION_EDIT_SUBMIT--}" />
+       </div>
+</div>
+
+<script language="JavaScript" type="text/javascript">
+<!--
+var limit = document.getElementById('limit');
+var span = document.getElementById('span_limit');
+var old_limit = $content[views_max];
+
+function FocusLimitedNo () {
+       if ((limit.value > 0) && (limit.value != '-')) {
+               old_limit = limit.value;
+       }
+       limit.disabled = true;
+       limit.setAttribute('class', 'disabled');
+       limit.style.textAlign = 'center';
+       limit.value = '-';
+}
+
+function FocusLimitedYes () {
+       limit.disabled = false;
+       limit.setAttribute('class', 'member_normal');
+       limit.style.textAlign = 'left';
+       if (old_limit > 0) {
+               limit.value = old_limit;
+       } else {
+               limit.value = '';
+       }
+       limit.focus();
+}
+
+function SubmitForm () {
+       if (limit.value == '-') {
+               limit.value = 0;
+       }
+       return true;
+}
+
+function ResetForm () {
+       old_limit = 0;
+       FocusLimitedNo();
+       return false;
+}
+
+if ($content[limited] == true) {
+       FocusLimitedYes();
+} else {
+       FocusLimitedNo();
+}
+
+//-->
+</script>
+</form>
index 8194fa6..6993c8b 100644 (file)
--- a/view.php
+++ b/view.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "view"; $CSS = -1;
 
 // Load the required file(s)
-require ("inc/config.php");
+require("inc/config.php");
 
 if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['banner']))) {
        // Count banner view... we currently don't need the user's id but maybe