]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-surfbar_book.php
Extension 'yoomedia' now alpha status, some rewrites
[mailer.git] / inc / modules / member / what-surfbar_book.php
index d9dda0fb03abbc08b7270e1025aa3a4fa3afa79c..97bc955c30e4b6f093c80d9b141920e0f3e98739 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } elseif (!IS_MEMBER()) {
@@ -45,15 +45,21 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 }
 
 // Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
+ADD_DESCR("member", __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'])) {
+       // Is limitation "no" and "limit" is > 0?
+       if (($_POST['limited'] == "N") && ((isset($_POST['limit'])) && ($_POST['limit'] > 0)) || (!isset($_POST['limit']))) {
+               // Set it to unlimited
+               $_POST['limit'] = 0;
+       } // END - if
+
        // Register the new URL
-       $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url']);
+       $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url'], $_POST['limit']);
 
        // Was this fine?
        if ($insertId > 0) {
@@ -69,8 +75,8 @@ if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
 } else {
        // Prepare some content
        $content = array(
-               'reward'     => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD()),
-               'costs'      => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS()),
+               'reward'     => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)),
+               'costs'      => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)),
                'max_order'  => $_CONFIG['surfbar_max_order'],
                'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
        );