]> git.mxchange.org Git - mailer.git/commitdiff
Some fixes and improvements:
authorRoland Häder <roland@mxchange.org>
Sat, 22 Nov 2008 16:45:25 +0000 (16:45 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 22 Nov 2008 16:45:25 +0000 (16:45 +0000)
- Extension "wernis" fixed, hopefully! :-)
- Booking points to user shall now no longer go to referal level one
- Backlink set to GNU project if link to us is enbaled
- Several minor fixes

beg.php
css.php
img.php
inc/databases.php
inc/header.php
inc/language/wernis_de.php
inc/modules/admin/what-add_points.php
ref.php
templates/de/html/copyright.tpl
templates/de/html/copyright_backlink.tpl
templates/de/html/member/member_wernis_mode_payout.tpl

diff --git a/beg.php b/beg.php
index 81ee8d4567d10f77126654180ddc56d5a2e00f87..0f69f2a4bafa798b3127766077b2317b27e1be67 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -58,9 +58,13 @@ if (!EXT_IS_ACTIVE("beg")) {
 if (isBooleanConstantAndTrue('mxchange_installed')) {
        // Check for userid
        if (!empty($_GET['uid'])) {
-               // Init user ID
+               // Init variables
                $uid = 0;
                $result = false;
+               $points = 0;
+
+               // Don't pay is the default...
+               $pay = false;
 
                // Validate if it is not a number
                if ("".($_GET['uid'] + 0)."" !== "".$_GET['uid']."") {
@@ -80,7 +84,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                }
 
                // Check if locked in so don't pay points
-               $login = IS_MEMBER(); $status = "failed";
+               $status = "failed";
 
                // Check if account was found
                if ((SQL_NUMROWS($result) == 1) && ($result != false)) {
@@ -101,7 +105,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                $points = mt_rand(($_CONFIG['beg_points'] * 100000), ($_CONFIG['beg_points_max'] * 100000)) / 100000;
 
                                // Set nickname / userid for the template(s
-                               define('__BEG_UID'   , $_GET['uid']);
+                               define('__BEG_UID'   , SQL_ESCAPE($_GET['uid']));
                                define('__BEG_CLICKS', ($clicks + 1));
                                define('__BEG_BANNER', LOAD_TEMPLATE("beg_banner", true));
                                define('__BEG_POINTS', TRANSLATE_COMMA($points));
@@ -109,7 +113,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                // Other status
                                $uid = 0;
                        }
-               }
+               } // END - if
 
                // Free memory
                SQL_FREERESULT($result);
@@ -125,9 +129,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__);
 
                        // Entry not found, points set and not logged in?
-                       if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!$login) && ($_CONFIG['beg_pay_mode'] == "NONE")) {
-                               // Don't pay is the default...
-                               $pay = false;
+                       if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && ($_CONFIG['beg_pay_mode'] == "NONE")) {
 
                                // Admin is testing?
                                if (!IS_ADMIN()) {
@@ -149,39 +151,32 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 
                                // Pay points?
                                if ($pay) {
-                                       // Set mode depending on how many mails the member has to confirm
-                                       $locked = false;
-                                       if (($ref_payout > 0) && ($_CONFIG['allow_direct_pay'] == "N")) $locked = true;
-
-                                       // Is begging rallye active?
-                                       if ($_CONFIG['beg_rallye'] == "Y") {
-                                               // Add points to rallye account
-                                               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET beg_points=beg_points+%s WHERE userid=%s LIMIT 1",
-                                                       array($points, $uid), __FILE__, __LINE__);
+                                       // Add points to user or begging rallye account
+                                       if (BEG_ADD_POINTS($uid, $points)) {
+                                               // Set "done" message
+                                               define('__BEG_MSG', LOAD_TEMPLATE("beg_done", true));
                                        } else {
-                                               // Add points to account
-                                               unset($DEPTH);
-                                               ADD_POINTS_REFSYSTEM($uid, $points, false, "0", $locked, strtolower($_CONFIG['beg_mode']));
+                                               // Error!
+                                               define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
                                        }
-
-                                       // Subtract begged points from member account if the admin has selected one
-                                       if ($_CONFIG['beg_uid'] > 0) {
-                                               // Subtract from this account
-                                               SUB_POINTS($_CONFIG['beg_uid'], $points);
-                                       } // END - if
-
-                                       // Set message
-                                       define('__BEG_MSG', LOAD_TEMPLATE("beg_done", true));
                                } else {
                                        // Error!
                                        define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
                                }
-                       } elseif ($login) {
+                       } elseif (IS_MEMBER()) {
                                // Logged in user found!
                                define('__BEG_MSG', LOAD_TEMPLATE("beg_login", true));
-                       } elseif ($_CONFIG['beg_pay_mode'] != "NONE") {
-                               // Other pay-mode active!
-                               define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower($_CONFIG['beg_pay_mode']), true));
+                       } elseif ($_CONFIG['beg_pay_mode'] != "NONE") { // Other pay-mode active!
+                               // Prepare content for template
+                               $content = array(
+                                       'clicks' => __BEG_CLICKS,
+                                       'points' => __BEG_POINTS,
+                                       'uid'    => __BEG_UID
+                               );
+
+                               // Load message template depending on pay-mode
+                               define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower($_CONFIG['beg_pay_mode']), true, $content));
+                               $pay = true;
                        } else {
                                // Clicked received while reload lock is active
                                define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
@@ -197,10 +192,17 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                        LOAD_TEMPLATE("beg_link");
 
                        // Tracker code enabled? (We don't track users here!
-                       if ($_CONFIG['beg_pay_mode'] != "NONE") {
+                       if (($_CONFIG['beg_pay_mode'] != "NONE") && ($pay)) {
+                               // Prepare content for template
+                               $content = array(
+                               );
+
                                // Include config-depending template
-                               LOAD_TEMPLATE("beg_pay_code_".strtolower($_CONFIG['beg_pay_mode']));
-                       } // END - if
+                               LOAD_TEMPLATE("beg_pay_code_".strtolower($_CONFIG['beg_pay_mode']), false, $content);
+                       } elseif (!$pay) {
+                               // Cannot pay! :-(
+                               define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+                       }
 
                        // Include footer
                        require_once(PATH."inc/footer.php");
diff --git a/css.php b/css.php
index ef86272f3a696d839f4e5caa5a7471b00e79d978..4092cda32106c76e80df98d8a3e3a5f0c01f0967 100644 (file)
--- a/css.php
+++ b/css.php
@@ -6,9 +6,9 @@
  * -------------------------------------------------------------------- *
  * File              : css.php                                          *
  * -------------------------------------------------------------------- *
- * Short description : Image code for multi-purposes                    *
+ * Short description : Cascading Style Sheets output                    *
  * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Code-Bild fuer verschiedene Zwecke               *
+ * Kurzbeschreibung  : Ausgabe der Cascading-Style-Sheets (CSS)         *
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
diff --git a/img.php b/img.php
index 54b2173947309fed0661fb14402f9322744b783f..c962aeca321935c06f7ea5ef5c8f1fb1dc2dd6ce 100644 (file)
--- a/img.php
+++ b/img.php
@@ -69,7 +69,4 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 }
 
 // Really all done here... ;-)
-die();
-
-//
 ?>
index 9435b220593eedb043c8725b18ace71b118559e8..8e09b8e81b431f0ffde8efc04baa39888572bc5b 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', "532");
+define('CURR_SVN_REVISION', "533");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index fe18f73c4e5add995bac2de8534de4b4f3f6009f..b6d3f52b6e27f0ccb8a58b28e74e96a000b5c4d7 100644 (file)
@@ -96,7 +96,7 @@ if (($header != "1") && ($header != "2")) {
                                // Do not add the fatal message in installation mode
                                if (basename($_SERVER['PHP_SELF']) != "install.php") ADD_FATAL(NO_CONFIG_FOUND);
                        }
-               }
+               } // END - if
 
                // Save some little memory
                unset($TITLE);
@@ -106,6 +106,7 @@ if (($header != "1") && ($header != "2")) {
 
                // Include meta data in "guest" module
                if ($GLOBALS['module'] == "index") {
+                       // Load meta data template
                        LOAD_TEMPLATE("metadata");
 
                        // Add meta description to header
index 56da9c0dde7ee60b6c824190e600d1ae480c178e..5f0963bf1458357065773d07a2e0e7ae31b6aecc 100644 (file)
@@ -60,7 +60,7 @@ define('WERNIS_ADMIN_API_MD5', "WDS66-API-Key (api_md5=xxxxx; 32-stellig)");
 define('WERNIS_ADMIN_API_URL', "Basis-URL der API-Skripte");
 define('WERNIS_ADMIN_REFID', "Ihre Referal-ID bei WDS66-Portal (= Ihr Username!)");
 define('WERNIS_ADMIN_WPASS', "Wernis-Passwort (nicht Account-Passwort!)");
-define('WERNIS_ADMIN_CONFIG_NOTE', "<A href=\"http://www.wds66.com/ref.php?refid=10437\" target=\"_blank\">Hier</A> k&ouml;nnen Sie schon f&uuml;r <strong>5,00&euro;</strong>=<strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> Wernis-Account dennoch n&ouml;tig!) Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von und nach WDS66-Wernis-Portal ben&ouml;tigt. Die Betreibergeb&uuml;hren und Umrechnungsfaktoren sind f&uuml;r den Betrieb Ihres {!MT_WORD2!} komplett in Wernis ausgelegt, diese m&uuml;ssen Sie also noch anpassen, wenn Sie z.B. Punkte haben und in Wernis auszahlen lassen wollen.");
+define('WERNIS_ADMIN_CONFIG_NOTE', "[<a href=\"http://www.wds66.com/ref.php?refid=10437\" target=\"_blank\">Hier</a>] k&ouml;nnen Sie schon f&uuml;r <strong>5,00&euro;</strong>=<strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> Wernis-Account dennoch n&ouml;tig!) Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von und nach WDS66-Wernis-Portal ben&ouml;tigt. Die Betreibergeb&uuml;hren und Umrechnungsfaktoren sind f&uuml;r den Betrieb Ihres {!MT_WORD2!} komplett in Wernis ausgelegt, diese m&uuml;ssen Sie also noch anpassen, wenn Sie z.B. Punkte haben und in Wernis auszahlen lassen wollen.");
 define('WERNIS_ADMIN_NO_TRANSFERS', "Derzeit keine Wernis transferiert!");
 define('WERNIS_ADMIN_WDS66_ACCOUNT', "Account bei WDS66-Portal");
 define('WERNIS_ADMIN_TRANSFERED', "Wernis transferiert");
@@ -81,8 +81,8 @@ define('WERNIS_ADMIN_WITHDRAW_FEE_FIX', "Fixe Betreibergeb&uuml;hr f&uuml;r Einz
 define('WERNIS_API_REQUEST_DATA_INVALID', "Interner Fehler: Abfragedaten sind defekt!");
 define('WERNIS_API_REQUEST_DATA_MISSING', "Interner Fehler: Abfragedaten sind nicht komplett!");
 define('WERNIS_API_REQUEST_ERROR', "Abfragefehler: <span class=\"data\">%s</span>");
-define('WERNIS_API_REQUEST_FAILED', "Unbekannter Fehler <span class=\"data\">%s</span> von API erhalten! Bitte im [<A href=\"http://forum.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Forum\">Forum melden</A>], den Fehlercode nennen und wie es dazu gekommen ist.");
-define('WERNIS_API_REQUEST_FAILED_AUTH', "Authorisierung an API fehlgeschlagen! Bitte API-ID und Key &uuml;berpr&uuml;fen. [<A href=\"http://www.wds66.com/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</A>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort!");
+define('WERNIS_API_REQUEST_FAILED', "Unbekannter Fehler <span class=\"data\">%s</span> von API erhalten! Bitte im [<a href=\"http://forum.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Forum\">Forum melden</a>], den Fehlercode nennen und wie es dazu gekommen ist.");
+define('WERNIS_API_REQUEST_FAILED_AUTH', "Authorisierung an API fehlgeschlagen! Bitte API-ID und Key &uuml;berpr&uuml;fen. [<a href=\"http://www.wds66.com/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</a>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort!");
 define('WERNIS_API_REQUEST_FAILED_USER', "Useraccount nicht gefunden oder Wernis-Passwort ist ung&uuml;ltig!");
 define('WERNIS_API_REQUEST_FAILED_OWN', "&Uuml;berweisung an eigenes Account nicht m&ouml;glich.");
 define('WERNIS_API_REQUEST_FAILED_AMOUNT', "Konto weist nicht gen&uuml;gend Deckung auf.");
@@ -110,8 +110,8 @@ define('WERNIS_MEMBER_PAYOUT_POINTS', "Auszahlf&auml;higes Wernis-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes Wernis-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchf&uuml;hren");
 define('WERNIS_MEMBER_PAYOUT_NOTE', "Ihr Wernis-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Wernis-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren WDS66-Usernamen.");
-define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<A href=\"http://www.wds66.com/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</A>]");
-define('WERNIS_MEMBER_WDS66_PASSWORD', "Wernis-Passwort (nicht Accountpasswort!): [<A href=\"http://www.wds66.com/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</A>]");
+define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<a href=\"http://www.wds66.com/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</a>]");
+define('WERNIS_MEMBER_WDS66_PASSWORD', "Wernis-Passwort (nicht Accountpasswort!): [<a href=\"http://www.wds66.com/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</a>]");
 define('WERNIS_MEMBER_WDS66_AMOUNT', "Zu &uuml;berweisenden Betrag eingeben:");
 define('WERNIS_MEMBER_MODE_INVALID', "Ung&uuml;ltiger Modus <span class=\"data\">%s</span> erkannt! Bitte links im Men&uuml; fortfahren.");
 define('WERNIS_MEMBER_EMPTY_USERNAME', "Sie haben Ihren WDS66-Usernamen nicht eingegeben.");
index e77b3f24fe9f6cc5f891650604d8ac4cdd03c6ca..683da19824b61a92dcccfcd2093f09196bc7203c 100644 (file)
@@ -93,6 +93,12 @@ if ($_GET['u_id'] == "all") {
                SQL_FREERESULT($result);
 
                if ((isset($_POST['ok'])) && (!empty($_POST['points']))) {
+                       global $DEPTH;
+                       // Remove depth to prevent booking errors. This is a bad coding
+                       // practice, thats also why we need to write this project from
+                       // scratch...
+                       unset($DEPTH);
+
                        // Ok, add points and send an email to him...
                        ADD_POINTS_REFSYSTEM(bigintval($_GET['u_id']), bigintval($_POST['points']), false, "0", false, "direct");
 
diff --git a/ref.php b/ref.php
index 43df1346907dde9ffd18422ce52666c714de8c86..b8e7c2e03599351b35cd4ed47c4cb363512e9951 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -6,7 +6,7 @@
  * -------------------------------------------------------------------- *
  * File              : ref.php                                          *
  * -------------------------------------------------------------------- *
- * Short description : Redirection for the referal link                *
+ * Short description : Redirection for the referal link                 *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Weiterleitungsscript fuer die Referal-Links      *
  * -------------------------------------------------------------------- *
index 7efa31d3a4e662b7313b9510b5edc0b08129cc26..7d07e736869d70ed6da1da889c94c419ef138847 100644 (file)
@@ -1,10 +1,12 @@
 <TABLE border="0" cellspacing="0" cellpadding="0" align="center">
        <TR>
-               <TD align="center" class="footer_lines">{!TITLE!}
-               v{!FULL_VERSION!} R{!CURR_SVN_REVISION!}<br />
-               Copyright &copy; 2003 - 2008 by Roland H&auml;der</TD>
+               <TD align="center" class="footer_lines">
+                       {!TITLE!} v{!FULL_VERSION!} R{!CURR_SVN_REVISION!}<br />
+                       Copyright &copy; 2003 - 2008 by Roland H&auml;der
+               </TD>
                <TD align="center" width="50%" class="footer_lines">This
-               website&#39;s engine is free software which is released under the GNU
-               GPL either version 2 of the License.</TD>
+                       website&#39;s engine is free software which is released under the
+                       GNU GPL either version 2 of the License.
+               </TD>
        </TR>
 </TABLE>
index 0386c1a486bc8bd80eb73f8bfcd858a263d02594..543399082a3d9a370b0d4c228fd52b8ef1e2da3b 100644 (file)
@@ -7,7 +7,8 @@
                </TD>
                <TD align="center" width="50%" class="footer_lines">
                        This website&#39;s engine is free software which is released under
-                       the GNU GPL either version 2 of the License.
+                       the [<a href="http://www.gnu.org" rel="external" target="_blank"
+                        title="GNU is Not Unix">GNU</a>] GPL either version 2 of the License.
                </TD>
        </TR>
 </TABLE>
index 872a89a924ef648fe460aff1e4a03bbdd53852f5..031c7ff786883fe92456a6f673f9bbcfff4d9141 100644 (file)
@@ -1,4 +1,4 @@
-<form action="{!URL!}/modules.php?module=login&amp;what=wernis&amp;mode=pay" method="POST" style="margin-bottom: 0px">
+<form action="{!URL!}/modules.php?module=login&amp;what=wernis&amp;mode=payout" method="POST" style="margin-bottom: 0px">
 <table border="0" cellspacing="0" cellpadding="0" width="440" class="member_table dashed">
        <tr>
                <td colspan="3" align="center" class="member_title2 bottom2"