diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php
index 500dec768..446fa550e 100644
--- a/e107_core/shortcodes/batch/user_shortcodes.php
+++ b/e107_core/shortcodes/batch/user_shortcodes.php
@@ -660,8 +660,27 @@ class user_shortcodes extends e_shortcode
";
}
}
-
-
+
+ // v2.x extended user field data.
+ /**
+ * Usage {USER_EUF: field=xxxx} (excluding the 'user_' )
+ * @param string $parm
+ * @return string
+ */
+ function sc_user_euf($parm='')
+ {
+
+ if(!empty($parm['field']))
+ {
+ $fld = 'user_'.$parm['field'];
+ $val = $this->var[$fld];
+ return e107::getUserExt()->renderValue($val); //TODO auto-detect type, from within the user-extended class.
+
+ }
+
+ return ' ';
+
+ }
function sc_user_extended_all($parm)
{
diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml
index 5b99eee52..ce59a5cdf 100644
--- a/e107_core/xml/default_install.xml
+++ b/e107_core/xml/default_install.xml
@@ -189,6 +189,7 @@
'link' => 'blogcalendar_menu/config.php',
),
)]]>
+ login
0
1
diff --git a/e107_handlers/userclass_class.php b/e107_handlers/userclass_class.php
index dda42ca63..7666b1fbb 100644
--- a/e107_handlers/userclass_class.php
+++ b/e107_handlers/userclass_class.php
@@ -141,12 +141,12 @@ class user_class
if ($temp = $e107->ecache->retrieve_sys(UC_CACHE_TAG))
{
- $this->class_tree = e107::getArrayStorage()->read($temp);
+ $this->class_tree = e107::unserialize($temp);
unset($temp);
}
else
{
- if($this->sql_r->field('userclass_classes','userclass_parent') && $this->sql_r->select('userclass_classes', '*', 'ORDER BY userclass_parent', 'nowhere')) // The order statement should give a consistent return
+ if($this->sql_r->field('userclass_classes','userclass_parent') && $this->sql_r->select('userclass_classes', '*', 'ORDER BY userclass_parent,userclass_name', 'nowhere')) // The order statement should give a consistent return
{
while ($row = $this->sql_r->fetch())
{
@@ -221,6 +221,9 @@ class user_class
{
$is = array();
$start_array = explode(',', $startList);
+
+
+
foreach ($start_array as $sa)
{ // Merge in latest values - should eliminate duplicates as it goes
$is[] = $sa; // add parent to the flat list first
diff --git a/user.php b/user.php
index e17340fad..cbc6b3b1b 100644
--- a/user.php
+++ b/user.php
@@ -235,30 +235,52 @@ if (isset($id))
exit;
}
-$users_total = $sql->count("user","(*)", "WHERE user_ban = 0");
+// $users_total = $sql->count("user","(*)", "WHERE user_ban = 0");
-if (!$sql->select("user", "*", "user_ban = 0 ORDER BY user_id $order LIMIT $from,$records"))
-{
- echo "
".LAN_USER_53."
";
-}
-else
-{
- $userList = $sql->db_getList();
- $text = $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes);
- foreach ($userList as $row)
+
+ // --------------------- List Users ------------------------ //TODO Put all of this into a class.
+
+ $users_total= 0;
+ $query = "SELECT u.*, ue.* FROM `#user` AS u LEFT JOIN `#user_extended` AS ue ON u.user_id = ue.user_extended_id WHERE u.user_ban = 0 ORDER BY u.user_id ".$order." LIMIT ".intval($from).",".intval($records);
+
+ if (!$data = $sql->retrieve($query,true))
+
+ // if (!$sql->select("user", "*", "user_ban = 0 ORDER BY user_id $order LIMIT $from,$records"))
{
- $loop_uid = $row['user_id'];
-
- $text .= renderuser($row, "short");
+ echo "".LAN_USER_53."
";
}
- $text .= $tp->parseTemplate($USER_SHORT_TEMPLATE_END, TRUE, $user_shortcodes);
-}
+ else
+ {
+ $users_total = count($data);
+ // $userList = $sql->db_getList();
+
+ $text = $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes);
+ foreach ($data as $row)
+ {
+ $loop_uid = $row['user_id'];
+
+ // $text .= renderuser($row, "short");
+ e107::getScBatch('user')->setVars($row);
+
+ $text .= $tp->parseTemplate($USER_SHORT_TEMPLATE, TRUE, $user_shortcodes);
+ }
+ $text .= $tp->parseTemplate($USER_SHORT_TEMPLATE_END, TRUE, $user_shortcodes);
+ }
+
+ $ns->tablerender(LAN_USER_52, $text);
+
+ $parms = $users_total.",".$records.",".$from.",".e_SELF.'?[FROM].'.$records.".".$order;
+ echo " ".$tp->parseTemplate("{NEXTPREV={$parms}}")."
";
+
+
+
+
+
+
+
-$ns->tablerender(LAN_USER_52, $text);
-$parms = $users_total.",".$records.",".$from.",".e_SELF.'?[FROM].'.$records.".".$order;
-echo " ".$tp->parseTemplate("{NEXTPREV={$parms}}")."
";
function renderuser($uid, $mode = "verbose")
@@ -281,7 +303,7 @@ function renderuser($uid, $mode = "verbose")
}
}
- e107::getScBatch('user')->setVars($user);
+
if($mode == 'verbose')
{