* -------------------------------------------------------------------- *
* Kurzbeschreibung : Funktionen fuer den Newsletter an die Gaeste *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
// @TODO Lame description
function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") {
if (empty($cnt)) $cnt = 0;
- $ADD = ""; $DT_MODE = 0;
+ $add = ""; $DT_MODE = 0;
if ($uid > 0) {
// Load entries only from a single user
- $ADD = " AND userid='".bigintval($uid)."'";
+ $add = " AND userid='".bigintval($uid)."'";
$MODE = "member"; $COLS = "4"; $DT_MODE = "2";
$NOT_FOUND = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
} else {
// List entries
$result = SQL_QUERY("SELECT userid, refid, points, timemark
FROM `{!_MYSQL_PREFIX!}_doubler`
-WHERE completed='".$done."' AND is_ref='".$ref."'".$ADD."
+WHERE completed='".$done."' AND is_ref='".$ref."'".$add."
ORDER BY timemark ".$sort."
LIMIT ".$limit, __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// List entries
$OUT = ""; $SW = 2;
- while (list($uid, $rid, $points, $time) = SQL_FETCHROW($result)) {
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Rewrite userid/refid only if admin is in
if (IS_ADMIN()) {
// Set links to admin area
- if ($uid > 0) { $uid = ADMIN_USER_PROFILE_LINK($uid); } else { $uid = "---"; }
- if ($rid > 0) { $rid = ADMIN_USER_PROFILE_LINK($rid); } else { $rid = "---"; }
- }
+ if ($content['userid'] > 0) { $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); } else { $content['userid'] = "---"; }
+ if ($content['refid'] > 0) { $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']); } else { $content['refid'] = "---"; }
+ } // END - if
// Prepare data for the row template
$content = array(
- 'uid' => $uid,
- 'rid' => $rid,
- 'points' => TRANSLATE_COMMA($points),
- 'stamp' => MAKE_DATETIME($time, $DT_MODE),
+ 'uid' => $content['userid'],
+ 'rid' => $content['refid'],
+ 'points' => TRANSLATE_COMMA($content['points']),
+ 'stamp' => MAKE_DATETIME($content['timemark'], $DT_MODE),
'sw' => $SW,
);