[Work In Progress] 'is_activated' in Members Management

Started by mab, March 11, 2005, 08:44:15 AM

Previous topic - Next topic

mab

'Cause of undelivered activation mails (User mail providers errors), I wanna be able to see in members list if an account is activated or not (without having to open each member profile)

Yesterday I find how to design it. then I'm trying writing the MOD to do it.
But before packaging it, I think that it could be more perfect...

So that's what I wrote :

open ./Sources/ManageMembers.php :
// Makes  'is_activated' available for use in templates.


                                                                      FIND :
$request = db_query("
SELECT
ID_MEMBER, memberName, realName, emailAddress, memberIP, IFNULL(lastLogin, 0) AS lastLogin, posts


                                                                      REPLACE WITH :
// Add , is_activated in the DB query

$request = db_query("
SELECT
ID_MEMBER, memberName, realName, emailAddress, memberIP, IFNULL(lastLogin, 0) AS lastLogin, posts, is_activated


                                                                      FIND :
$context['members'][] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'email' => $row['emailAddress'],
'ip' => $row['memberIP'],
'last_active' => $difference,
'posts' => $row['posts'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>'
);


                                                                      REPLACE WITH :
// Add 'is_activated' => $row['is_activated'] in variables array

$context['members'][] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'email' => $row['emailAddress'],
'ip' => $row['memberIP'],
'last_active' => $difference,
'posts' => $row['posts'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'is_activated' => $row['is_activated']
);





open ./Themes/default/ManageMembers.template.php :
// Display 'is_activated' value (and activation link)  in member list, instead of displaying lastlogin and post count if account isn't activated.


                                                                      FIND :
<td class="windowbg">
' . $member['last_active'] . '
</td>
<td class="windowbg2">
' . $member['posts'] . '
</td>';


                                                                      REPLACE WITH :
// Display note and activation link

';
if ($member['is_activated'])
echo '
<td class="windowbg">
' . $member['last_active'] . '
</td>
<td class="windowbg2">
' . $member['posts'] . '
</td>';
else
echo '
<td class="windowbg" colspan="2">
<i><b>Inactive</b> (<a href="' . $scripturl . '?action=profile2;sa=activateAccount;userID=' . $member['id'] . ';sesc=' . $context['session_id'] . '">Activate</a>)</i>
</td>';




Looks like this (french version) :



As you can see, I don't have do any language integration. And I think that's one of the thing that I've to do before compiling it into a real MOD package.


Comments and help are welcome.  :)
If someone allready knows wich language variables exists, it would be easier for him writing the few lines for languages integration.


;)
-


Advertisement: