]> git.mxchange.org Git - mailer.git/commitdiff
Added listing of sub id enhanced referral links in member area + used sub id in refer...
authorquix0r <quix0r@mxchange.org>
Wed, 17 Oct 2012 20:30:23 +0000 (20:30 +0000)
committerquix0r <quix0r@mxchange.org>
Wed, 17 Oct 2012 20:30:23 +0000 (20:30 +0000)
12 files changed:
.gitattributes
inc/extensions/ext-user.php
inc/filter/user_filter.php
inc/language/user_de.php
inc/libs/user_functions.php
inc/modules/member/what-reflinks.php
inc/referral-functions.php
templates/de/html/member/member_list_referral_level.tpl
templates/de/html/member/member_list_referral_row.tpl
templates/de/html/member/member_list_reflink_user_subids.tpl [new file with mode: 0644]
templates/de/html/member/member_list_reflink_user_subids_row.tpl [new file with mode: 0644]
templates/de/html/member/member_reflink.tpl

index 85ea562c3493cf6f8613e2642d97ce948ba74d8c..02f544e0e139a74e42f843b040d25bc26af00e03 100644 (file)
@@ -1997,6 +1997,8 @@ templates/de/html/member/member_list_referal_row.tpl svneol=native#text/plain
 templates/de/html/member/member_list_referral.tpl svneol=native#text/plain
 templates/de/html/member/member_list_referral_level.tpl svneol=native#text/plain
 templates/de/html/member/member_list_referral_row.tpl svneol=native#text/plain
+templates/de/html/member/member_list_reflink_user_subids.tpl svneol=native#text/plain
+templates/de/html/member/member_list_reflink_user_subids_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_subid_stats.tpl svneol=native#text/plain
index af69d72851c1526bae126ca0baf4a18162961a43..5436f59e6aa5def411f2d0e0dc991db47d30da2b 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.5.5');
+setThisExtensionVersion('0.5.6');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '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', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5'));
+setExtensionVersionHistory(array('0.0.0', '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', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -199,6 +199,7 @@ INDEX (`stats_type`)",
                unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', true, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', true, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -643,6 +644,14 @@ INDEX (`subid`)",
                                // Register filter
                                registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', false, true, isExtensionDryRun());
 
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Weiteren Filter f&uuml;r Mitglieder-Aktionen im Adminbereich hinzugef&uuml;gt.");
+                               break;
+
+                       case '0.5.6': // SQL queries for v0.5.6
+                               // Register filter
+                               registerFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', false, true, isExtensionDryRun());
+
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Weiteren Filter f&uuml;r Mitglieder-Aktionen im Adminbereich hinzugef&uuml;gt.");
                                break;
index 27980937c239c59933fd785675b2045a815ff148..150568dbdf752c33a940066e0f893581f1a2ff18 100644 (file)
@@ -238,5 +238,39 @@ function FILTER_ADD_USER_SUBID_MEMBER_ACTION ($filterData) {
        return $filterData;
 }
 
+// Filter for rendering content for sub id listing in what=reflinks
+function FILTER_MEMBER_REFLINK_USER_SUBIDS_CONTENT ($content = '') {
+       // Do this only for members
+       assert(isMember());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Does the current user have sub ids?
+       if (getTotalMemberSubIds() > 0) {
+               // Then Load all
+               $result = SQL_QUERY_ESC('SELECT `id`, `subid` FROM `{?_MYSQL_PREFIX?}_user_subids` WHERE `userid`=%s ORDER BY `subid` ASC',
+                       array(getMemberId()), __FUNCTION__, __LINE__);
+
+               // There should be entries left
+               assert(!SQL_HASZERONUMS($result));
+
+               // Load all
+               $out = '';
+               while ($row = SQL_FETCHARRAY($result)) {
+                       // Load row template
+                       $out .= loadTemplate('member_list_reflink_user_subids_row', true, $row);
+               } // END - while
+
+               // Load main template
+               $content .= loadTemplate('member_list_reflink_user_subids', true, $out);
+
+               // Free result
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Return data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $content;
+}
+
 // [EOF]
 ?>
index 99dce95edb626de36cf38cfa0e6964b6c5f08018..ba353ef6a141b6d9402022c124e468e251528e5f 100644 (file)
@@ -128,6 +128,8 @@ addMessages(array(
        'MEMBER_CHANGE_USER_SUBID' => "Geben Sie eine neue ein:",
        'MEMBER_INVALID_DO_USER_SUBID' => "Ung&uuml;ltiges Sub-Modul aufgerufen! Sollten Sie der Meinung sein, dies ist ein Fehler, so teilen Sie bitte dem Support mit, wie es zu dieser Meldung gekommen ist.",
        'MEMBER_BACK_SUBIDS_OVERVIEW_LINK' => "Zur&uuml;ck zur Sub-Id-&Uuml;bersicht ...",
+       'MEMBER_REFLINK_USER_SUBIDS_HEADER' => "Hier sehen Sie alle Ihre Sub-Ids, die Sie <a href=\"{%url=modules.php?module=login&amp;what=subids\">eingegeben</a> haben. Sie k&ouml;nnen anstelle der User-Id auch Ihren Nicknamen verwenden.",
+       'MEMBER_REFLINK_USER_SUBIDS_NOTICE' => "<strong>Hinweis:</strong> Tipp! Legen Sie sich z.B. pro Besuchertausch und Mailtausch je eine Sub-Ids zum genaueren Tracking an. Somit k&ouml;nnen Sie genauer feststellen, wor&uuml;ber das geworbene Mitglied sich angemeldet hat.",
 
        // Member - sub ids - submit buttons
        'MEMBER_USER_SUBIDS_ADD_SUBMIT' => "Sub-Id hinzuf&uuml;gen",
@@ -154,6 +156,7 @@ addMessages(array(
        'MEMBER_EDIT_USER_SUBIDS_TITLE' => "Ausgew&auml;hlte Sub-Ids editieren",
        'MEMBER_DELETE_USER_SUBIDS_TITLE' => "Ausgew&auml;hlte Sub-Ids l&ouml;schen",
        'MEMBER_SUBID_STATS_TITLE' => "Aufrufstatistik f&uuml;r Ihre Sub-Ids",
+       'MEMBER_REFLINK_USER_SUBIDS_TITLE' => "Ihr Referral-Link mit Sub-Ids zusammen benutzen",
 
        // Admin - sub ids - titles
        'ADMIN_EDIT_USER_SUBID_TITLE' => "Ausgew&auml;hlte Sub-Ids &auml;ndern",
index d0b5379881d64c08411a2b0f1fe82b4f65b144dd..bce9fc75795dec3ccd350679fa1a5af7d6545d39 100644 (file)
@@ -798,6 +798,9 @@ function createTesterUserAccount () {
 
 // Checks whether the given sub id is fused by current member
 function isMemberSubIdFree ($subId) {
+       // Only do this for logged-in members
+       assert(isMember());
+
        // Check it
        $isFree = (countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 0);
 
@@ -872,6 +875,21 @@ function getSubId ($id) {
        return $GLOBALS[__FUNCTION__][$id];
 }
 
+// "Getter for total count of current user's sub ids
+function getTotalMemberSubIds () {
+       // Only do this for logged-in members
+       assert(isMember());
+
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', true);
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 //-----------------------------------------------------------------------------
 //                                EL code functions
 //-----------------------------------------------------------------------------
index eef4ea8fe0823d334b3faa57ca0aefd388ea9aa9..82a9d43786c456a90d3aff712ee9692492ffa8d8 100644 (file)
@@ -116,6 +116,9 @@ if (!SQL_HASZERONUMS($result)) {
 // Free result
 SQL_FREERESULT($result);
 
+// Add extra content through filter
+$content['extra_content'] = runFilterChain('member_reflink_extra_content');
+
 // Load main template
 loadTemplate('member_reflink', false, $content);
 
index ad4b3f9feed2a9b4ce82ea769e87b9d0002cfce0..fc628b3daa59f2579be6486046aaefaad9960be4 100644 (file)
@@ -388,8 +388,14 @@ function getUserReferralPoints ($userid, $level) {
        $refs = array();
 
        // Get refs from database
-       $result = SQL_QUERY_ESC("SELECT
-       ur.`id`, ur.`refid`, ud.`status`, ud.`last_online`, ud.`mails_confirmed`, ud.`emails_received`
+       $result = SQL_QUERY_ESC('SELECT
+       ur.`id`,
+       ur.`refid`,
+       ud.`status`,
+       ud.`last_online`,
+       ud.`mails_confirmed`,
+       ud.`emails_received`,
+       ud.`subid`
 FROM
        `{?_MYSQL_PREFIX?}_user_refs` AS `ur`
 LEFT JOIN
@@ -405,7 +411,7 @@ WHERE
        ur.`userid`=%s AND
        ur.`level`=%s
 ORDER BY
-       ur.`refid` ASC",
+       ur.`refid` ASC',
                array(
                        bigintval($userid),
                        bigintval($level)
index 00d94b74e87c095bc06e4332b952e9a87552a761..4310c01b28579cde35b14b5a1abf320b42748d2a 100644 (file)
@@ -2,7 +2,7 @@
        <td align="center" style="padding:0px;margin:0px">
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed">
 <tr>
-       <td align="center" class="header_column" colspan="6">
+       <td align="center" class="header_column" colspan="7">
                <strong>{--MEMBER_REFLIST_LIST_TITLE_1--}$content[level]{--MEMBER_REFLIST_LIST_TITLE_2--}$content[percents]{--MEMBER_REFLIST_LIST_TITLE_3--}</strong>
        </td>
 </tr>
        <td align="center" class="header_column bottom right">
                <strong>{--MEMBER_CLICK_RATE--}</strong>
        </td>
-       <td align="center" class="header_column bottom">
+       <td align="center" class="header_column bottom right">
                <strong>{--MEMBER_REFLIST_ACTIVITY--}</strong>
        </td>
+       <td align="center" class="header_column bottom">
+               <strong>{--SUBID_VALUE--}</strong>
+       </td>
 </tr>
 $content[rows]
 <tr>
-       <td align="center" class="table_footer" colspan="6">
+       <td align="center" class="table_footer" colspan="7">
                <span class="notice">{%message,MEMBER_REFLIST_COUNTER=$content[counter]%}</span>
        </td>
 </tr>
index 556b7579ac2736da469c0a92a7f8980c601f0855..4458928f365f10cb7f2ff19937e23b948067d2e1 100644 (file)
@@ -17,4 +17,7 @@
        <td align="center" class="{%template,ColorSwitch%} bottom right">
                $content[activity]
        </td>
+       <td align="center" class="{%template,ColorSwitch%} bottom">
+               {%pipe,fixEmptyContentToDashes=$content[subid]%}
+       </td>
 </tr>
diff --git a/templates/de/html/member/member_list_reflink_user_subids.tpl b/templates/de/html/member/member_list_reflink_user_subids.tpl
new file mode 100644 (file)
index 0000000..de0b898
--- /dev/null
@@ -0,0 +1,15 @@
+<div align="center">
+<div class="table dashed">
+<div class="table_header bottom">
+       <strong>{--MEMBER_REFLINK_USER_SUBIDS_TITLE--}</strong>
+</div>
+{--MEMBER_REFLINK_USER_SUBIDS_HEADER--}
+<ul class="listing">
+$content
+</ul>
+</div>
+
+<div class="notice">
+       {--MEMBER_REFLINK_USER_SUBIDS_NOTICE--}
+</div>
+</div>
diff --git a/templates/de/html/member/member_list_reflink_user_subids_row.tpl b/templates/de/html/member/member_list_reflink_user_subids_row.tpl
new file mode 100644 (file)
index 0000000..56c602b
--- /dev/null
@@ -0,0 +1,4 @@
+<li class="listing">
+       {?URL?}/ref.php?refid={%pipe,getMemberId%}&amp;subid=$content[subid]<br />
+       <a href="{%url=modules.php?module=login&amp;what=subids&amp;do=stats&amp;id=$content[id]%}">{--MEMBER_USER_SUBID_STATS_LINK--}</a>
+</li>
index cf9926c9a7371eb85ee9238fcdcc0015a1050e88..153caa15cc4852b4da86d3287613a41efcd4ea70 100644 (file)
@@ -28,6 +28,10 @@ $content[nickname_content]
 </div>
 </div>
 
+<div class="para">
+       $content[extra_content]
+</div>
+
 <div class="para">
        $content[refbanner_content]
 </div>