]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/user_filter.php
Added listing of sub id enhanced referral links in member area + used sub id in refer...
[mailer.git] / inc / filter / user_filter.php
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]
 ?>