From: Roland Häder Date: Wed, 13 Jul 2011 08:53:29 +0000 (+0000) Subject: Member area section 'referal links' refactured: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=397daebbe84c443a220724a1a63e74945a1f0a30;p=mailer.git Member area section 'referal links' refactured: - The member can now see how much mails (of minimum) he has clicked to be randomly selected as referal id - He can also see his referal (including nickname if installed&set) - New CSS class listing for ul/li tags added - Templates renamed to new naming convention - TODOs.txt updated --- diff --git a/.gitattributes b/.gitattributes index 24bca0646c..c8d71fff34 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1669,6 +1669,8 @@ templates/de/html/member/member_list_beg.tpl svneol=native#text/plain templates/de/html/member/member_list_beg_row.tpl svneol=native#text/plain templates/de/html/member/member_list_coupon.tpl svneol=native#text/plain templates/de/html/member/member_list_coupon_row.tpl svneol=native#text/plain +templates/de/html/member/member_list_reflinks.tpl svneol=native#text/plain +templates/de/html/member/member_list_reflinks_row.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar_form.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar_row.tpl svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index f2d72504b0..c642acf2cb 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -54,8 +54,8 @@ ./inc/functions.php:2214: // @TODO Rename column data_type to e.g. mail_status ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); -./inc/language/de.php:1063: // @TODO Rewrite these two constants -./inc/language/de.php:1079: // @TODO Rewrite these three constants +./inc/language/de.php:1066: // @TODO Rewrite these two constants +./inc/language/de.php:1082: // @TODO Rewrite these three constants ./inc/language/de.php:758:// @TODO Are these constants longer used? ./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function. @@ -83,8 +83,8 @@ ./inc/libs/theme_functions.php:93: // @TODO Can't this be rewritten to an API function? ./inc/libs/user_functions.php:159: // @TODO These two constants are no longer used, maybe we reactivate this code? ./inc/libs/user_functions.php:250:// @TODO Double-check configuration entry here -./inc/libs/user_functions.php:345: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); -./inc/libs/user_functions.php:374: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); +./inc/libs/user_functions.php:344: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); +./inc/libs/user_functions.php:373: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); ./inc/libs/yoomedia_functions.php:114: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script ./inc/load_config.php:75: // @TODO Rewrite them to avoid this else block ./inc/loader/load-extension.php:13: * @TODO Rewrite this whole file * @@ -315,6 +315,8 @@ ./templates/de/html/admin/admin_list_country_edit_row.tpl:1: ./templates/de/html/admin/admin_reset_pass_done.tpl:1: ./templates/de/html/admin/admin_send_reset_link.tpl:1: +./templates/de/html/member/member_reflinks_row.tpl:1: +./templates/de/html/member/member_reflinks_table.tpl:1: ./templates/de/html/member/member_surfbar_book_dynamic.tpl:1: ./templates/de/html/member/member_surfbar_book_static.tpl:1: ./templates/de/html/member/member_surfbar_list_form.tpl:1: diff --git a/inc/databases.php b/inc/databases.php index 4f011b75f4..4c87186860 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -45,38 +45,39 @@ addCode('WRONG_PASS' , 0x001); addCode('WRONG_ID' , 0x002); addCode('ACCOUNT_LOCKED' , 0x003); addCode('ACCOUNT_UNCONFIRMED', 0x004); -addCode('UNKNOWN_STATUS' , 0x005); -addCode('NO_MAIL_TYPE' , 0x006); -addCode('CNTR_FAILED' , 0x007); -addCode('LOGOUT_DONE' , 0x008); -addCode('LOGOUT_FAILED' , 0x009); -addCode('URL_TIME_LOCK' , 0x00a); -addCode('URL_FOUND' , 0x00b); -addCode('OVERLENGTH' , 0x00c); -addCode('SUBJECT_URL' , 0x00d); -addCode('BLIST_URL' , 0x00e); -addCode('NO_RECS_LEFT' , 0x00f); -addCode('INVALID_TAGS' , 0x010); -addCode('MORE_POINTS' , 0x011); -addCode('COOKIES_DISABLED' , 0x012); -addCode('DATA_INVALID' , 0x013); -addCode('POSSIBLE_INVALID' , 0x014); -addCode('USER_404' , 0x015); -addCode('STATS_404' , 0x016); -addCode('ALREADY_CONFIRMED' , 0x017); -addCode('ERROR_MAILID' , 0x018); -addCode('EXTENSION_PROBLEM' , 0x019); -addCode('MORE_RECEIVERS1' , 0x01a); -addCode('MORE_RECEIVERS2' , 0x01b); -addCode('MORE_RECEIVERS3' , 0x01c); -addCode('INVALID_URL' , 0x01d); -addCode('MENU_NOT_VALID' , 0x01e); -addCode('LOGIN_FAILED' , 0x01f); -addCode('BEG_SAME_AS_OWN' , 0x020); -addCode('UNHANDLED_STATUS' , 0x021); -addCode('MODULE_MEMBER_ONLY' , 0x022); -addCode('UNKNOWN_ERROR' , 0x023); -addCode('PROFILE_UPDATED' , 0x024); +addCode('ACCOUNT_UNKNOWN' , 0x005); +addCode('UNKNOWN_STATUS' , 0x006); +addCode('NO_MAIL_TYPE' , 0x007); +addCode('CNTR_FAILED' , 0x008); +addCode('LOGOUT_DONE' , 0x009); +addCode('LOGOUT_FAILED' , 0x00a); +addCode('URL_TIME_LOCK' , 0x00b); +addCode('URL_FOUND' , 0x00c); +addCode('OVERLENGTH' , 0x00d); +addCode('SUBJECT_URL' , 0x00e); +addCode('BLIST_URL' , 0x00f); +addCode('NO_RECS_LEFT' , 0x010); +addCode('INVALID_TAGS' , 0x011); +addCode('MORE_POINTS' , 0x012); +addCode('COOKIES_DISABLED' , 0x013); +addCode('DATA_INVALID' , 0x014); +addCode('POSSIBLE_INVALID' , 0x015); +addCode('USER_404' , 0x016); +addCode('STATS_404' , 0x017); +addCode('ALREADY_CONFIRMED' , 0x018); +addCode('ERROR_MAILID' , 0x019); +addCode('EXTENSION_PROBLEM' , 0x01a); +addCode('MORE_RECEIVERS1' , 0x01b); +addCode('MORE_RECEIVERS2' , 0x01c); +addCode('MORE_RECEIVERS3' , 0x01d); +addCode('INVALID_URL' , 0x01e); +addCode('MENU_NOT_VALID' , 0x01f); +addCode('LOGIN_FAILED' , 0x020); +addCode('BEG_SAME_AS_OWN' , 0x021); +addCode('UNHANDLED_STATUS' , 0x022); +addCode('MODULE_MEMBER_ONLY' , 0x023); +addCode('UNKNOWN_ERROR' , 0x024); +addCode('PROFILE_UPDATED' , 0x025); // Full version setConfigEntry('FULL_VERSION', '0.2.1-FINAL'); diff --git a/inc/functions.php b/inc/functions.php index ad6274eb2e..c9713ce1d5 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1104,10 +1104,10 @@ function generateErrorCodeFromUserStatus ($status = '') { } // END - if // Default error code if unknown account status - $errorCode = getCode('ACCOUNT_STATUS_UNKNOWN'); + $errorCode = getCode('ACCOUNT_UNKNOWN'); // Generate constant name - $codeName = sprintf("ACCOUNT_STATUS_%s", strtoupper($status)); + $codeName = sprintf("ACCOUNT_%s", strtoupper($status)); // Is the constant there? if (isCodeSet($codeName)) { diff --git a/inc/language/de.php b/inc/language/de.php index ab4fa93f0d..f8c49ee611 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -599,7 +599,7 @@ addMessages(array( 'WE_HAVE' => "Wir haben", 'MEMBER_TEST_URL' => "Zur beworbenen Seite", 'ADMIN_ENTER_REDIRECT_URL' => "URL eingeben, wenn abgelehnt werden soll", - 'MEMBER_NO_REFBANNER_FOUND' => "Es sind noch keine Werbebanner eingerichtet worden. Bitte verwenden Sie solange Ihren Referal-Link.", + 'MEMBER_REFERAL_BANNER_404' => "Es sind noch keine Werbebanner eingerichtet worden. Bitte verwenden Sie solange Ihren Referal-Link.", 'ADMIN_ID_404' => "ID %s nicht gefunden.", 'ADMIN_ASSIGNED_ADMIN' => "Zugewiesener Admin", 'ADMIN_MEMBER_USERID' => "ID des Mitgliedes", @@ -1054,6 +1054,9 @@ addMessages(array( 'ADMIN_EDIT_EMAIL_FAILED' => "Änderungen an der Mail nicht gespeichert, bitte kontaktieren Sie den Support.", 'ADMIN_EMAIL_CHANGES_SAVED' => "Die Maildaten wurden aktualisiert.", 'ADMIN_EMAIL_CHANGES_NOT_SAVED' => "Keine Änderungen an der Mail vorgenommen. Maildaten wurden NICHT geändert.", + 'MEMBER_REFLINK_CENTER_TITLE' => "Alle Informationen zu Ihrem Werbelink", + 'MEMBER_RANDOM_REFID_CONFIRMED' => "Anzahl Mails von {%config,translateComma=user_min_confirmed%} bestätigt, damit Ihr Account per Zufall selektiert wird", + 'MEMBER_YOUR_REFID_IS' => "Sie wurden geworben von", 'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail %s bestätigt.", 'MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Bonus-Mail %s bestätigt hatten.", diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 73bb07cf49..e9a1477650 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -250,7 +250,7 @@ LIMIT 1", // @TODO Double-check configuration entry here function determineRandomReferalId () { // Default is zero refid - $refid = null; + $refid = NULL; // Is the extension version fine? if (isExtensionInstalledAndNewer('user', '0.3.4')) { @@ -272,8 +272,7 @@ function determineRandomReferalId () { list($refid) = SQL_FETCHROW($result); // Reset all users, this makes this random referal id more challenging - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0", - array($refid), __FUNCTION__, __LINE__); + SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0', __FUNCTION__, __LINE__); } // END - if // Free result @@ -746,7 +745,13 @@ function doExpressionUser ($data) { // Use dynamic call $functionName = "getFetchedUserData('userid', \$userid, '" . $data['callback'] . "')"; } elseif (!empty($data['matches'][4][$data['key']])) { - // User data found + // Do we have a number or a dollar sign in front of it? + if (preg_replace('/[^0123456789]/', '', $data['matches'][4][$data['key']]) != $data['matches'][4][$data['key']]) { + // Possible database column, so get it again + $data['matches'][4][$data['key']] = "getFetchedUserData('userid', getMemberId(), '" . $data['matches'][4][$data['key']] . "')"; + } // END - if + + // Fix all together $functionName = "getFetchedUserData('userid', " . $data['matches'][4][$data['key']] . ", '" . $data['callback'] . "')"; } } elseif ((!empty($data['callback'])) && (isUserDataValid())) { @@ -759,6 +764,7 @@ function doExpressionUser ($data) { // Surround the original function call with it $functionName = $data['extra_func'] . '(' . $functionName . ')'; } // END - if + /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'functionName=' . $functionName); // Generate replacer $replacer = '{DQUOTE} . ' . $functionName . ' . {DQUOTE}'; diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php index c1a5a1794b..35832a3fb8 100644 --- a/inc/modules/member/what-reflinks.php +++ b/inc/modules/member/what-reflinks.php @@ -65,7 +65,8 @@ if (isExtensionActive('nickname')) { $whereStatement = " WHERE `visible`='Y'"; if (isAdmin()) $whereStatement = ''; -$result = SQL_QUERY("SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner`", __FILE__, __LINE__); + +$result = SQL_QUERY('SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC', __FILE__, __LINE__); if (!SQL_HASZERONUMS($result)) { // List available ref banners @@ -74,7 +75,8 @@ if (!SQL_HASZERONUMS($result)) { $test = str_replace(getUrl(), getPath(), $row['url']); $size = '0'; if ($test == $row['url']) { // Download banner (I hope you keep the banner on same server???) - $fp = sendGetRequest($row['url']); $bannerContent = ''; + $fp = sendGetRequest($row['url']); + $bannerContent = ''; if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0)) { // Loads only found banner, when there is a 404 error this foreach() command // will cause an "Invalid argument supplied for foreach()" error @@ -101,14 +103,14 @@ if (!SQL_HASZERONUMS($result)) { $row['userid'] = getMemberId(); // Add row - $OUT .= loadTemplate('member_reflinks_row', true, $row); + $OUT .= loadTemplate('member_list_reflinks_row', true, $row); } // END - while // Load final template - $content['refbanner_content'] = loadTemplate('member_reflinks_table', true, $OUT); + $content['refbanner_content'] = loadTemplate('member_list_reflinks', true, $OUT); } else { // No refbanner found - $content['refbanner_content'] = displayMessage('{--MEMBER_NO_REFBANNER_FOUND--}', true); + $content['refbanner_content'] = displayMessage('{--MEMBER_REFERAL_BANNER_404--}', true); } // Free result diff --git a/inc/referal-functions.php b/inc/referal-functions.php index f9055fdcd0..8868904ead 100644 --- a/inc/referal-functions.php +++ b/inc/referal-functions.php @@ -92,7 +92,7 @@ function getReferalLevelPercents ($level) { * refid = inc/modules/guest/what-confirm.php need this * locked = Shall I pay it to normal (false) or locked (true) points ammount? */ -function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = '0') { +function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NULL) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . $refid . ' - ENTERED!'); // By default nothing has been added $added = false; diff --git a/templates/de/html/member/member_list_reflinks.tpl b/templates/de/html/member/member_list_reflinks.tpl new file mode 100644 index 0000000000..69f1e70ae9 --- /dev/null +++ b/templates/de/html/member/member_list_reflinks.tpl @@ -0,0 +1,10 @@ +
+ +$content + + + +
+
diff --git a/templates/de/html/member/member_list_reflinks_row.tpl b/templates/de/html/member/member_list_reflinks_row.tpl new file mode 100644 index 0000000000..1e38507489 --- /dev/null +++ b/templates/de/html/member/member_list_reflinks_row.tpl @@ -0,0 +1,18 @@ + + +
+ $content[alternate] +
+
{--REFBANNER_TOTALS--}: + {%pipe,translateComma=$content[counter]%} {--REFERAL_VIEWS--} / + {%pipe,translateComma=$content[clicks]%} {--REFERAL_CLICKS--} +
+ + + + +
<a href="{?URL?}/click.php?user=$content[userid]&banner=$content[id]" + target="_blank"><img src="{?URL?}/view.php?user=$content[userid]&banner=$content[id]" + alt="$content[alternate]" title="$content[alternate]" border="0" /></a>
+ + diff --git a/templates/de/html/member/member_reflink.tpl b/templates/de/html/member/member_reflink.tpl index f7203655f2..f6eb2be1e8 100644 --- a/templates/de/html/member/member_reflink.tpl +++ b/templates/de/html/member/member_reflink.tpl @@ -1,13 +1,29 @@ -
- {--MEMBER_YOUR_PERSONAL_REFERAL_LINK--}: -
-
- {?URL?}/ref.php?refid=$content[userid] +
+
+ {--MEMBER_REFLINK_CENTER_TITLE--}
+
    +
  • + {--MEMBER_YOUR_PERSONAL_REFERAL_LINK--}:
    + {?URL?}/ref.php?refid=$content[userid] +
  • $content[nickname_content] -
    - {--MEMBER_YOUR_REFCLICKS--}: {%user,ref_clicks,translateComma%} {--CLICKS--} +
  • + {--MEMBER_YOUR_REFCLICKS--}:
    + {%user,ref_clicks,translateComma%} {--CLICKS--} +
  • +
  • + {--MEMBER_RANDOM_REFID_CONFIRMED--}:
    + {%user,rand_confirmed,translateComma%} +
  • +
  • + {--MEMBER_YOUR_REFID_IS--}:
    + {%user,refid,makeNullToZero%} ({%user,nickname,fixEmptyContentToDashes=refid%}) +
  • +
-
+ +
$content[refbanner_content]
diff --git a/templates/de/html/member/member_reflink_nickname.tpl b/templates/de/html/member/member_reflink_nickname.tpl index e2f780314a..7cc5bc1b7d 100644 --- a/templates/de/html/member/member_reflink_nickname.tpl +++ b/templates/de/html/member/member_reflink_nickname.tpl @@ -1,6 +1,6 @@ -
+
{--MEMBER_NICKNAME_YOUR_REFERAL_LINK--}:
-
+ diff --git a/templates/de/html/member/member_reflinks_row.tpl b/templates/de/html/member/member_reflinks_row.tpl index 1b6d098065..11f5d85d80 100644 --- a/templates/de/html/member/member_reflinks_row.tpl +++ b/templates/de/html/member/member_reflinks_row.tpl @@ -1,18 +1 @@ - - -
- $content[alternate] -
-
{--REFBANNER_TOTALS--}: - $content[counter] {--REFERAL_VIEWS--} / - $content[clicks] {--REFERAL_CLICKS--} -
- - - - -
<a href="{?URL?}/click.php?user=$content[userid]&banner=$content[id]" - target="_blank"><img src="{?URL?}/view.php?user=$content[userid]&banner=$content[id]" - alt="$content[alternate]" title="$content[alternate]" border="0" /></a>
- - + diff --git a/templates/de/html/member/member_reflinks_table.tpl b/templates/de/html/member/member_reflinks_table.tpl index 69f1e70ae9..11f5d85d80 100644 --- a/templates/de/html/member/member_reflinks_table.tpl +++ b/templates/de/html/member/member_reflinks_table.tpl @@ -1,10 +1 @@ -
- -$content - - - -
-
+ diff --git a/theme/business/css/general.css b/theme/business/css/general.css index fbb916e5b7..9a159c28df 100644 --- a/theme/business/css/general.css +++ b/theme/business/css/general.css @@ -620,3 +620,16 @@ strong.menu_invisible, strong.sub_menu_invisible { .rank_3 { font-weight: bold; } + +ul.listing { + text-align: left; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + padding-left: 5px; + list-style-type: none; +} + +li.listing { + padding-bottom: 5px; +} diff --git a/theme/default/css/general.css b/theme/default/css/general.css index 5ab7c66714..1e10eb3c92 100644 --- a/theme/default/css/general.css +++ b/theme/default/css/general.css @@ -666,3 +666,16 @@ strong.menu_invisible, strong.sub_menu_invisible { .rank_3 { font-weight: bold; } + +ul.listing { + text-align: left; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + padding-left: 5px; + list-style-type: none; +} + +li.listing { + padding-bottom: 5px; +} diff --git a/theme/desert/css/general.css b/theme/desert/css/general.css index c2b1de3344..a890205c27 100644 --- a/theme/desert/css/general.css +++ b/theme/desert/css/general.css @@ -606,3 +606,16 @@ strong.menu_invisible, strong.sub_menu_invisible { .rank_3 { font-weight: bold; } + +ul.listing { + text-align: left; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + padding-left: 5px; + list-style-type: none; +} + +li.listing { + padding-bottom: 5px; +} diff --git a/theme/org/css/general.css b/theme/org/css/general.css index 1f3d1ed049..29c3b94d4f 100644 --- a/theme/org/css/general.css +++ b/theme/org/css/general.css @@ -501,3 +501,16 @@ strong.menu_invisible, strong.sub_menu_invisible { .rank_3 { font-weight : bold; } + +ul.listing { + text-align: left; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + padding-left: 5px; + list-style-type: none; +} + +li.listing { + padding-bottom: 5px; +} diff --git a/theme/schleuder/css/general.css b/theme/schleuder/css/general.css index 76c0ccff8a..a6e3f3a488 100644 --- a/theme/schleuder/css/general.css +++ b/theme/schleuder/css/general.css @@ -541,3 +541,16 @@ ul, ol { .rank_3 { font-weight : bold; } + +ul.listing { + text-align: left; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + padding-left: 5px; + list-style-type: none; +} + +li.listing { + padding-bottom: 5px; +} diff --git a/theme/ship-simu/css/general.css b/theme/ship-simu/css/general.css index a6ff5efa0a..aa451dfbe9 100644 --- a/theme/ship-simu/css/general.css +++ b/theme/ship-simu/css/general.css @@ -511,3 +511,16 @@ ul, ol { margin-left : 10px; margin-right : 10px; } + +ul.listing { + text-align: left; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + padding-left: 5px; + list-style-type: none; +} + +li.listing { + padding-bottom: 5px; +}