1
I found it useful to modify the /modules/system/admin/findusers/main.php slightly so that if an account is inactive it is tagged (inactive) and the link goes to the extended profiles module in edit mode for that user. I wanted a way to find all the inactive accounts and be able to edit them by clicking on their name. So until I write a custom block I have the following code modification for the foreach loop beginning at line 289. This is for XOOPS version 2.2.3 final. Hopefully someone will find it useful.
foreach (array_keys($foundusers) as $j) {
if ($ucount % 2 == 0) {
$class = 'even';
} else {
$class = 'odd';
}
$ucount++;
$fuser_avatar = $foundusers[$j]->getVar("user_avatar") ?
"<img src='".XOOPS_UPLOAD_URL."/".$foundusers[$j]->getVar("user_avatar")."' alt='' />" : " ";
$fuser_name = $foundusers[$j]->getVar("uname") ? $foundusers[$j]->getVar("uname") : " ";
echo "<tr class='$class'><td align='center'><input type='checkbox' name='memberslist_id[]' id='memberslist_id[]'
value='".$foundusers[$j]->getVar("uid")."' /><input type='hidden'
name='memberslist_uname[".$foundusers[$j]->getVar("uid")."]' id='memberslist_uname[]'
value='".$foundusers[$j]->getVar("uname")."' /></td>";
echo "<td>$fuser_avatar</td>";
/*
This is a slightly modified code that allows the admin to click on an
inactive user and go directly to their account in edit mode.
Note:
Inactive accounts are tagged denoted (inactive) after their name
*/
//If the user is active
if( $level = $foundusers[$j]->level() > 0 )
{
echo "<td><a href='".XOOPS_URL."/userinfo.php?uid=".
$foundusers[$j]->getVar("uid")."'>".$foundusers[$j]->getVar("uname")."</a></td>";
}
else //If the user is inactive
{
$uid = $foundusers[$j]->getVar("uid");
$uname = $foundusers[$j]->getVar("uname");
echo "<td>
<a href=".XOOPS_URL."/modules/profile/admin/user.php?op=editordelete&id=$uid>
$uname (inactive)
</a>
</td>";
}
echo "<td>".$fuser_name."</td><td align='center'><a href='mailto:".$foundusers[$j]->getVar("email").
"'><img src='".XOOPS_URL."/images/icons/email.gif' border='0' alt='";
printf(_SENDEMAILTO,$foundusers[$j]->getVar("uname", "E"));
echo "' /></a></td><td align='center'>".formatTimeStamp($foundusers[$j]->getVar("user_regdate"),"s").
"</td><td align='center'>";
if ( $foundusers[$j]->getVar("last_login") != 0 ) {
echo formatTimeStamp($foundusers[$j]->getVar("last_login"),"m");
} else {
echo " ";
}
echo "</td><td align='center'>".$foundusers[$j]->getVar("posts")."</td>";
echo "</tr>n";
}