function usersList($row,$lfields,$lists,$listid)
{global $database, $limitstart, $search, $mosConfig_sitename, $ueConfig, $_POST, $acl, $_REQUEST, $my, $mainframe;
$vAlpha = (isset($_REQUEST['vAlpha']) ? $_REQUEST['vAlpha'] : 'A' ); // STG 2006-09-09
if ( method_exists($mainframe,"setPageTitle"))
{$mainframe->setPageTitle( getLangDefinition($row->title));}
if ( method_exists($mainframe,"appendPathWay"))
{$mainframe->appendPathWay( htmlspecialchars(getLangDefinition($row->title)));}
$search = cbEscapeSQLsearch(cbGetEscaped(trim( strtolower( $search))));
$option_itemid = (isset($_REQUEST['Itemid'])) ? "&Itemid=".htmlspecialchars($_REQUEST['Itemid']) : getCBprofileItemid(true);
$ue_base_url = "index.php?option=com_comprofiler&task=usersList&listid=".$listid.$option_itemid; // Base URL string
$adminimagesdir = "components/com_comprofiler/images/";
$isModerator=isModerator($my->id);
$allusergids=array();
$usergids=explode(",",$row->usergroupids);
foreach ($usergids AS $usergid)
{$allusergids[]=$usergid;
if ($usergid==29 || $usergid==30)
{$groupchildren = array();
$groupchildren = $acl->get_group_children( $usergid, 'ARO','RECURSE' );
$allusergids = array_merge($allusergids,$groupchildren);}}
$usergids=implode(",",$allusergids);
// Select query
if ($row->sortfields!='')
{$orderby = " ORDER BY " . $row->sortfields;}
$filterby="";
if ($row->filterfields!='')
{$filterby = " AND " . utf8RawUrlDecode(substr($row->filterfields,1));}
// Search total
$query = "SELECT count(u.id) FROM #__users u, #__comprofiler ue WHERE u.id=ue.id AND u.block !=1 AND
ue.approved=1".( !($isModerator) ? " AND ue.banned=0" : "")." AND ue.confirmed=1 AND u.gid IN (".$usergids.")";
if (isset($search) && $search != "")
{$query .= " AND (";
$query .= ($ueConfig['name_format']!='3') ? " u.name LIKE '%$search%' " : " ";
$query .= ($ueConfig['name_format']!='3' && $ueConfig['name_format']!='1') ? "OR" : " ";
$query .= ($ueConfig['name_format']!='1') ? " u.username LIKE '%$search%'" : " ";
$query .= ")";}
$query .= " " . $filterby;
if (!$database->setQuery($query))
{print $database->getErrorMsg();}
$total = $database->loadResult();
if (empty($limitstart))
{$limitstart = 0;}
$limit = $ueConfig['num_per_page'];
if ($limit > $total)
{$limitstart = 0;}
// STG 2006-09-09 (next 16 lines)
if (isset($search) && $search != "")
{$query = "SELECT *, '' AS 'NA' FROM #__users u, #__comprofiler ue WHERE u.id=ue.id AND u.block!=1 and
ue.approved=1".( !($isModerator) ? " AND ue.banned=0" : "")." AND ue.confirmed=1 AND u.gid IN (".$usergids.")";
$query .= " AND (";
$query .= ($ueConfig['name_format']!='3') ? " u.name LIKE '%$search%' " : " ";
$query .= ($ueConfig['name_format']!='3' && $ueConfig['name_format']!='1') ? "OR" : " ";
$query .= ($ueConfig['name_format']!='1') ? " u.username LIKE '%$search%'" : " ";
$query .= ")";
$query .= " " . $filterby;
$query .= " " . $orderby;
$query .= " LIMIT $limitstart, $limit";}
else
{$query = "SELECT *, '' AS 'NA' FROM #__users u, #__comprofiler ue WHERE left(ue.lastname,1)='$vAlpha' AND
u.id=ue.id AND u.block!=1 and ue.approved=1".( !($isModerator) ? " AND ue.banned=0" : "")." AND ue.confirmed=1 AND u.gid IN (".$usergids.")";
$query .= " " . $filterby;
$query .= " " . $orderby;}
$database->setQuery($query);
$users=$database->loadObjectList();
?>
<TABLE WIDTH="100%" CELLPADDING="4" CELLSPACING="0" BORDER="0" ALIGN="center" CLASS="contentpane">
<TR>
<TD COLSPAN="2"><SPAN CLASS="contentheading"><?php echo getLangDefinition($row->title); ?></SPAN></
TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="contentdescription" COLSPAN="2">
<?php
if ((isset($search) && $search != "") || ($row->filterfields!=''))
{echo "<b>" . $total . "</b> " . _UE_USERPENDAPPRACTION . ":";}
else
{echo $mosConfig_sitename . " " . _UE_HAS . ": <b>" . $total . "</b> " . _UE_USERS;}
?>
</TD>
</TR>
<TR>
<TD>
<FORM NAME="adminForm" METHOD="post" ACTION="<?php echo sefRelToAbs($ue_base_url."&
action=search");?>" >
<TABLE WIDTH="100%" CELLPADDING="4" CELLSPACING="0" BORDER="0" ALIGN="center" CLASS="contentpane">
<TR>
<TD STYLE="width:50%;">
<INPUT TYPE="text" NAME="search" CLASS="inputbox" SIZE="15" MAXLENGTH="100"<?php if (isset($search))
{echo " value=\"".htmlspecialchars(cbGetUnEscaped(cbUnEscapeSQLsearch($search)))."\"";} ?> />
<INPUT TYPE="image" SRC="<?php echo $adminimagesdir; ?>search.gif" ALT="<?php echo _UE_SEARCH; ?>"
ALIGN="top" STYLE="border: 0px;" />
</TD>
<TD STYLE="width:50%;text-align:right;">
<?php echo $lists['plists']; ?>
</TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
<TR>
<TD>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><A HREF="<?php echo sefRelToAbs($ue_base_url); ?>" onClick="javascript:adminForm.search.value=''
"><?php echo _UE_LIST_ALL; ?></A></TD>
<TD> </TD>
</TR>
</TABLE>
<DIV STYLE="width:100%;text-align:center;">
<?php // STG 2006-09-09 (next 4 lines)
if (isset($search) && $search != "")
{echo writePagesLinks($limitstart,$limit,$total,$ue_base_url,$search);}
else
{echo writeAlphaLinks($vAlpha,$ue_base_url);}
?>
</DIV>
<HR SIZE="1" />
<SCRIPT TYPE="text/javascript"><!--//--><![CDATA[//><!--
var cbW3CDOM = (document.createElement && document.getElementsByTagName);
var cbUserURLs = new Array(<?php if (is_array($users)) {foreach($users as $user) {echo "\""
.unHtmlspecialchars(sefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user="
.$user->id.$option_itemid))."\",";}} ?>"");
function cbInitUserClick()
{
if (!cbW3CDOM) return;
var nav = document.getElementById('cbUserTable');
var trs = nav.getElementsByTagName('tr');
for (var i=0;i<trs.length;i++)
{
if (trs[i].id) {
trs[i].onclick = cbUserClick;
}
}
}
function cbUserClick(thisevent)
{
/* ddumpObject(thisevent,"event",3,0); */
/* alert("clicked!"+this.toString()
+window.event.target+window.event.currentTarget+(window.event.target==window.event.currentTarget));
*/
var mine;
if (thisevent) {
// alert("event!"+thisevent.toString()+thisevent.target+thisevent.target.toString()
+(thisevent.target.parentNode == this));
mine = (thisevent.target.parentNode == this);
} else if (window.event.target) {
// alert("clickedWE!"+this.toString()
+window.event.target+window.event.currentTarget+(window.event.target==window.event.currentTarget));
mine = (window.event.target==window.event.currentTarget);
} else if (window.event.srcElement) {
// alert("eventSRC!"+window.event.srcElement+window.event.srcElement.toString()
+(window.event.srcElement.parentNode == this));
mine = (window.event.srcElement.parentNode == this);
}
if (mine) {
window.location=cbUserURLs[this.id.substr(3)]; // cbUxxx --> xxx
}
return !mine;
}
function cbAddEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, true);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
} else {
return false;
}
}
cbAddEvent(window, 'load', cbInitUserClick);
//--><!]]></SCRIPT>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ID="cbUserTable">
<TR>
<?php
echo '<td><b>'.getLangDefinition($row->col1title)."</b></td>\n";
if ($row->col2enabled) echo '<td><b>'.getLangDefinition($row->col2title)."</b></td>\n";
if ($row->col3enabled) echo '<td><b>'.getLangDefinition($row->col3title)."</b></td>\n";
if ($row->col4enabled) echo '<td><b>'.getLangDefinition($row->col4title)."</b></td>\n";
?>
</TR>
<?php
$i = 0;
if (is_array($users) && count($users)>0)
{foreach($users as $user)
{$evenodd = $i % 2;
if ($evenodd == 0)
{$class = "sectiontableentry1";}
else
{$class = "sectiontableentry2";}
//print $user->name;
if($ueConfig['allow_profilelink']==1)
{$style = "style=\"cursor:hand;cursor<img src="http://www.joomlapolis.com/components/
com_joomlaboard/emoticons/tongue.png" alt="" style="vertical-align: middle;border:0px;" />ointer;\""
;
$style .= " id=\"cbU".$i."\"";}
// $style .= " onclick=\"javascript:window.location='".sefRelToAbs("index.php?
option=com_comprofiler&task=userProfile&user=".$user->id.$option_itemid)."'\"";
else
{$style = "";}
if ($user->banned)
{$colsNbr = 1+($row->col2enabled ? 1:0)+($row->col3enabled ? 1:0)+($row->col4enabled ? 1:0);
echo "\t<tr class=\"$class\"><td colspan=\"".$colsNbr."\"><span class=\"error\" style=\"
color:red;\">"._UE_BANNEDUSER." ("._UE_VISIBLE_ONLY_MODERATOR.") :</span></td></tr>";}
print "\t<tr class=\"$class\" ".$style.">\n";
//print $lfields;
$str = null;
eval("\$str = \"$lfields\";");
echo $str. "\n";
print "</tr>\n";
$i++;}}
else
{$colsNbr = 1+($row->col2enabled ? 1:0)+($row->col3enabled ? 1:0)+($row->col4enabled ? 1:0);
echo "\t<tr class=\"sectiontableentry1\"><td colspan=\"".$colsNbr."\">"._UE_NO_USERS_IN_LIST."</
td></tr>";}
?>
</TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD> </TD>
<TD> </TD>
</TR>
</TABLE>
<HR SIZE="1" />
<DIV STYLE="width:100%;text-align:center;">
<?php // STG 2006-09-09 (next 4 lines)
if (isset($search) && $search != "")
{echo writePagesLinks($limitstart,$limit,$total,$ue_base_url,$search);}
else
{echo writeAlphaLinks($vAlpha,$ue_base_url);}
?>
</DIV>
</TD>
</TR>
</TABLE>
<?php }
/******************************
Registration Functions
******************************/
|