krileon wrote:
Does anyone know how I can change the sorting order of the Pending Approved User list? I would like the latest registrations to appear at the top.
You'd need to adjust core database queries, please examine cbs libraries at administrator/com_comprofiler/library/cb/. May also want to review comprofiler.php.
Good news! It isn't that complicated after all.
I accomplished this by adding ONE line of code as the first line in the FOR loop:
[code:1]$counterlatest = count($users) - $i - 1;[/code:1]
Then I had to change every instance of $i to $counterlatest so that the correct entry in the array is being listed. Notice how I had to add an extra " - 1" at the end of the $counterlatest line. This removes the extra step in the counter -- if you don't do this, then your table will begin with a row to a user that has not yet been defined.
Here is a sample of the new code with all the changes:
[code:1]for($i = 0; $i < count($users); $i++) {
$counterlatest = count($users) - $i - 1;
echo "<tr align='left' valign='middle'>";
echo "<td><input id='u".$users[$counterlatest]->id."' style='size: 150%' type=\"checkbox\" checked\"checked\" name=\"uids[]\" value=\"".$users[$counterlatest]->id."\" /></td>";
echo "<td><a style='font-size: 160%' href='".cbSef("index.php?option=com_comprofiler&task=userProfile&user=".$users[$counterlatest]->id.($Itemid ? "&Itemid=". (int) $Itemid : ""«»))."'><B>".getNameFormat($users[$counterlatest]->name,$users[$counterlatest]->username,$ueConfig). "</b></a></td>";
echo "<td>".$users[$counterlatest]->email."</td>";
echo "<td>".cbFormatDate($users[$counterlatest]->registerDate)."</td>";
echo "<td><textarea name='comment".$users[$counterlatest]->id."' cols='10' rows='2'></textarea></td>";
echo "</tr><TR><TD COLSPAN=5><HR size=1></td></tr>";[/code:1]
You might notice I added an extra <TR> rows and some larger font styling to make the table prettier and easier to read. I also copied the APPROVE and REJECT buttons from below to the top. Since I'll focus on approving the latest registrations, no need to jump all the way down to the bottom of the list anymore
Now, every week, I can Reject the oldest stuff at the bottom whenever the Spirit moves me