]> git.mxchange.org Git - mailer.git/commitdiff
Extension ext-beg improved, better EL code used:
authorRoland Häder <roland@mxchange.org>
Sun, 14 Aug 2011 03:57:13 +0000 (03:57 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 14 Aug 2011 03:57:13 +0000 (03:57 +0000)
- Two language strings merged together (ext-beg)
- Template call-back function {%template,DisplayUsername=$fooUserid%}
  introduced for encapsulated displaying of userid / nickname

12 files changed:
inc/language/beg_de.php
inc/libs/user_functions.php
inc/modules/member/what-transfer.php
templates/de/html/beg/beg_done.tpl
templates/de/html/beg/beg_failed.tpl
templates/de/html/guest/guest_list_active_row.tpl
templates/de/html/guest/guest_top10_row_earner.tpl
templates/de/html/guest/guest_top10_row_login.tpl
templates/de/html/guest/guest_top10_row_refs.tpl
templates/de/html/member/member_bonus_turbo_row.tpl
templates/de/html/member/member_list_refback_row.tpl
templates/de/html/member/member_list_referral_row.tpl

index 336a598aa94dfa9a4a47723eeb1163e9d125725b..dd543f951ce6969bf0b66bf4082ae47855358408 100644 (file)
@@ -48,16 +48,14 @@ addMessages(array(
        'ADMIN_CONFIG_BEG_USERID_TIMEOUT' => "Zeitsperre gegen eine Mitglied-Id",
        'ADMIN_CONFIG_BEG_REMOTE_IP_TIMEOUT' => "Zeitsperre gegen eine IP-Nummer",
        'BEG_LINK_BY' => "Bettel-Link bei <strong>{?MAIN_TITLE?}</strong>",
-       'BEG_LINK_USERID' => "Unser Mitglied <span class=\"data\">%s</span> hat {?POINTS?} gebettelt.",
+       'BEG_LINK_USERID' => "Unser Mitglied <span class=\"data\">%s</span> hat gerade {?POINTS?} gebettelt.",
        'BEG_USERID_STEAL_1' => "Das Mitglied ",
-       'BEG_USERID_STEAL_2' => " hat soeben ",
-       'BEG_USERID_STEAL_3' => " {?POINTS?} bei Ihnen erbettelt.",
-       'BEG_CLICKS' => "Dies war insgesamt der <strong>%s.</strong> Klick auf sein Bettel-Link.",
+       'BEG_USERID_STEAL_2' => " hat soeben <strong>{%%pipe,translateComma=%s%%} {?POINTS?}</strong> bei Ihnen erbettelt.",
+       'BEG_CLICKS' => "Dies war insgesamt der <strong>{%%pipe,translateComma=%s%%}.</strong> Klick auf sein Bettel-Link.",
        'BEG_THANKS_FOR_CLICK' => "Danke f&uuml;r Ihre Spende.",
        'BEG_CONTINUE_REGISTER' => "Und weiter geht es zur Anmeldung bei {?MAIN_TITLE?} ...",
        'BEG_SORRY_ANOTHER_WAS_HERE_1' => "Oh, schade! Es war vor kurzem schon einer hier! Das Mitglied ",
-       'BEG_SORRY_ANOTHER_WAS_HERE_2' => " hat von Ihnen auch keine ",
-       'BEG_SORRY_ANOTHER_WAS_HERE_3' => " {?POINTS?} erhalten.",
+       'BEG_SORRY_ANOTHER_WAS_HERE_2' => " hat von Ihnen auch keine <strong>{%%pipe,translateComma=%s%%} {?POINTS?}</strong> erhalten.",
        'BEG_THANKS_FOR_CLICK_AGAIN' => "Danke dennoch f&uuml;r den erneuten Klick.",
        'BEG_POINTS_MIN_MAX' => "zwischen <strong>{%config,translateComma=beg_points%}</strong> und <strong>{%config,translateComma=beg_points_max%} {?POINTS?}</strong>",
        'BEG_POINTS_FIXED' => "<strong>{%config,translateComma=beg_points%} {?POINTS?}</strong>",
index 71b180ee8fccc6c64bfa791f0f6178a5b493ceca..1241a8748bd1f4264365ed40c29be449ec00512d 100644 (file)
@@ -777,5 +777,23 @@ function doTemplateAdminListUserTitle ($template, $clear = false) {
        return $code;
 }
 
+// Template call-back function for displaying "username"
+function doTemplateDisplayUsername ($template, $clear = false, $userid = NULL) {
+       // Is a userid set?
+       if (!isValidUserId($userid)) {
+               // Please don't call this without a valid userid
+               debug_report_bug(__FUNCTION__, __LINE__, 'template=' . $template . ',clear=' . intval($clear) . ',userid[' . gettype($userid) . ']=' . intval($userid) . ' - Invalid userid provided.');
+       } // END - if
+
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$userid])) {
+               // Generate code
+               $GLOBALS[__FUNCTION__][$userid] = $userid . ' ({%user,nickname,fixEmptyContentToDashes=' . $userid . '%})';
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$userid];
+}
+
 // [EOF]
 ?>
index da1c7888aa7283ea75bd727638decdc6fda771c8..e9bd50bb2e84e8faf7b257f27de29866d506df2e 100644 (file)
@@ -225,7 +225,7 @@ switch ($mode) {
                                        if ((isPostRequestElementSet('to_userid')) && (postRequestElement('to_userid') == $userid)) {
                                                $OUT .= ' selected="selected"';
                                        } // END - if
-                                       $OUT .= '>' . $userid . ' ({%user,nickname,fixEmptyContentToDashes=' . $userid . '%})</option>';
+                                       $OUT .= '>{%template,DisplayUsername=' . $userid . '%}</option>';
                                } // END - while
                                $OUT .= '</select>';
                                $content['to_disabled'] = '';
index 82596b3cb06fb7ac7511627d9ad50f7e034f09ab..49d6581db8f3affc02cbf4316cd74bb0a0dae125 100644 (file)
@@ -1,5 +1,7 @@
 <div style="height:50px">
-       {--BEG_USERID_STEAL_1--}<strong>$content[userid]</strong>{--BEG_USERID_STEAL_2--}<strong>{%pipe,translateComma=$content[points]%}</strong>{--BEG_USERID_STEAL_3--}
+       {--BEG_USERID_STEAL_1--}
+       <strong>$content[userid]</strong>
+       {%message,BEG_USERID_STEAL_2=$content[points]%}
 </div>
 
 <div style="height:50px">
index a1324991b12b13062906138a770d617d6034e210..66af407c72654ed560f6388e7509d0578ba243d7 100644 (file)
@@ -1,5 +1,7 @@
 <div>
-       {--BEG_SORRY_ANOTHER_WAS_HERE_1--}<strong>$content[userid]</strong>{--BEG_SORRY_ANOTHER_WAS_HERE_2--}<strong>{%pipe,translateComma=$content[points]%}</strong>{--BEG_SORRY_ANOTHER_WAS_HERE_3--}
+       {--BEG_SORRY_ANOTHER_WAS_HERE_1--}
+       <strong>$content[userid]</strong>
+       {%message,BEG_SORRY_ANOTHER_WAS_HERE_2=$content[points]%}
 </div>
 
 <div>
index be39d2aa9a1580ad02370b80015fc9627009fd33..bd4275db130eacb21eba7df33b2d7706d5e8f774 100644 (file)
@@ -1,5 +1,5 @@
 <tr>
-       <td class="{%template,ColorSwitch%} bottom right">$content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%})</td>
+       <td class="{%template,ColorSwitch%} bottom right">{%template,DisplayUsername=$content[userid]%}</td>
        <td class="{%template,ColorSwitch%} bottom right">{%pipe,getTotalPoints,translateComma=$content[userid]%}</td>
        <td class="{%template,ColorSwitch%} bottom">$content[last_online]</td>
 </tr>
index f1a7600d351239fc1bf65ac9bbaa45c5dbd30f57..f4f1ff706524c397d1a5170c8553ad72ae503a8d 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td class="top10_row1 {%template,ColorSwitch%} bottom right" align="center">{%pipe,translateComma=$content[count]%}</td>
-       <td class="top10_row2 {%template,ColorSwitch%} bottom right">$content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%})</td>
+       <td class="top10_row2 {%template,ColorSwitch%} bottom right">{%template,DisplayUsername=$content[userid]%}</td>
        <td class="top10_row3 {%template,ColorSwitch%} bottom right">{%pipe,translateComma=$content[points]%}</td>
        <td class="top10_row5 {%template,ColorSwitch%} bottom">$content[last_online]</td>
 </tr>
index e2ba4d604e16b8d955a6602847426723204cb738..8cdac7ad70bf63b43663f29399c1b604d176001a 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td class="top10_row1 {%template,ColorSwitch%} bottom right" align="center">{%pipe,translateComma=$content[count]%}</td>
-       <td class="top10_row2 {%template,ColorSwitch%} bottom right">$content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%})</td>
+       <td class="top10_row2 {%template,ColorSwitch%} bottom right">{%template,DisplayUsername=$content[userid]%}</td>
        <td class="top10_row3 {%template,ColorSwitch%} bottom right">{%user,total_logins,translateComma=$content[userid]%}</td>
        <td class="top10_row4 {%template,ColorSwitch%} bottom right">{%pipe,getTotalPoints,translateComma=$content[userid]%}</td>
        <td class="top10_row5 {%template,ColorSwitch%} bottom">$content[last_online]</td>
index 0eba04a28a6041ffd90560dffc2d3ac1b50f2b80..b0ef1d92053c482542a7c932ec80da4212c9d6df 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td class="top10_row1 {%template,ColorSwitch%} bottom right" align="center">{%pipe,translateComma=$content[count]%}</td>
-       <td class="top10_row2 {%template,ColorSwitch%} bottom right">$content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%})</td>
+       <td class="top10_row2 {%template,ColorSwitch%} bottom right">{%template,DisplayUsername=$content[userid]%}</td>
        <td class="top10_row3 {%template,ColorSwitch%} bottom right">{%pipe,translateComma=$content[refs]%}</td>
        <td class="top10_row4 {%template,ColorSwitch%} bottom right">{%pipe,getTotalPoints,translateComma=$content[userid]%}</td>
        <td class="top10_row5 {%template,ColorSwitch%} bottom">$content[last_online]</td>
index efab5bbf4e74a314713ae91df681281605607126..cf50294fc95ff54c7dba4795d72f01733ca362f1 100644 (file)
@@ -3,7 +3,7 @@
                {%pipe,translateComma=$content[rank]%}.
        </td>
        <td class="rank_$content[rank] bottom {%template,ColorSwitch%}" align="center">
-               $content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%})
+               {%template,DisplayUsername=$content[userid]%}
        </td>
        <td class="rank_$content[rank] bottom {%template,ColorSwitch%}" align="center">
                {%pipe,translateComma=$content[points]%}
index 9248d47e26613ec470be7a0bd912025018038d3a..e2fb30b378f8fe5acb80468116dc6f81353fe460 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
-               $content[refid] ({%user,nickname,fixEmptyContentToDashes=$content[refid]%})
+               {%template,DisplayUsername=$content[refid]%}
        </td>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
                $content[level_refid]
index b825ffcf8d22d38044734b49598f4850048f68f4..556b7579ac2736da469c0a92a7f8980c601f0855 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
-               $content[refid] ({%user,nickname,fixEmptyContentToDashes=$content[refid]%})
+               {%template,DisplayUsername=$content[refid]%}
        </td>
        <td align="center" class="{%template,ColorSwitch%} bottom right">
                {%user,status,translateUserStatus=$content[refid]%}