MantisBT - SMF 3.0 "Saguaro"
View Issue Details
0002897SMF 3.0 "Saguaro"public2009-01-12 20:162014-05-31 13:56
Reporterregularexpression 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Summary0002897: Awaiting Activation - NOT shown on dropdown menu
Description7520:

Awaiting Activation tab is dependent on there being some members awaiting.
When there is, the tab is not listed on the dropdown menu (as you might expect).

See pic (for easy understanding)
TagsNo tags attached.
Attached Filespng 03.png (51,715) 2009-01-12 20:16
https://dev.simplemachines.org/mantis/file_download.php?file_id=278&type=bug
png

diff bug_2897.diff (2,577) 2009-06-07 15:29
https://dev.simplemachines.org/mantis/file_download.php?file_id=484&type=bug

Notes
(0006797)
Nao/Gilles   
2009-01-13 02:34   
Maybe the activation numbers are only calculated when you're in the member admin section? Which means it can't be inserted into the menu itself (which is built at Admin.php time).
(0006798)
TE   
2009-01-13 03:05   
Nao, that's the reason..

a possible solution:

in Admin.php

replace:
loadLanguage('Admin');

with:
loadLanguage('Admin');
loadLanguage('ManageMembers');

replace:
require_once($sourcedir . '/Subs-Menu.php');

with:
require_once($sourcedir . '/Subs-Menu.php');
require_once($sourcedir . '/ManageMembers.php');
ViewMembers();

replace:
                    'subsections' => array(
                        'all' => array($txt['view_all_members']),
                        'search' => array($txt['mlist_search']),

with:
                    'subsections' => array(
                        'all' => array($txt['view_all_members']),
                        'search' => array($txt['mlist_search']),
                        'approve' => array(sprintf($txt['admin_browse_awaiting_approval'], $context['awaiting_approval']), 'enabled' => $context['show_approve'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=approve'),
                        'activate' => array(sprintf($txt['admin_browse_awaiting_activate'], $context['awaiting_activation']), 'enabled' => $context['show_activate'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=activate'),

(0007962)
regularexpression   
2009-04-13 08:16   
I think the solution might be to store the amount as a variable like we do for unapproved members. Then we don't have to run the query on every admin page view.
(0008587)
regularexpression   
2009-06-07 15:29   
(Last edited: 2009-06-07 16:21)
Unfortunately the above solution won't work properly.
ViewMembers(); sets up extra tabs.

Copying the bits out of the function will work though.
I've attached a diff to do it.

I'm still not sure its the best way since these queries would be on every admin page. I do think it would be much better the total to be stored as a variable in settings_ table (aka $modSettings)

(0008878)
[SiNaN]   
2009-06-26 15:48   
I agree, it should be saved in $modSettings. Just sticking the query in updateStats() 'member' type should do it.
(0009103)
regularexpression   
2009-07-11 16:46   
* removed the "with fix" tag since its unlikely we'll be using my original patch. but i'll need to do something different.
(0015023)
Antes   
2014-05-31 13:56   
Fixed in SMF2.1