Author |
Message |
j4rdin
Worker


Joined: May 26, 2006
Posts: 153
|
Posted:
Sun Apr 27, 2008 2:50 pm |
|
I have just added the Approved Membership Lite module to Raven Nuke 2.20.02 and all seems to work Ok.
Is it possible to add and "membership accounts waiting for approval" to the admin waiting content module. At present if you don't check your emails on a regular basis, you could miss a new members application.
John |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Sun Apr 27, 2008 5:57 pm |
|
Hi John,
I'm sure the duplicate post wasn't intentional, so I removed one.
The waiting content block is actually in the mainfile.php in the function adminblock(). Try this, open mainfile.php and find function adminblock() {. Then,
FIND:Code: $content .= '</span>';
themesidebox($title, $content);
|
INSERT BEFORE:Code: # Approve Membership
global $user_prefix;
$result = $db->sql_query('SELECT COUNT(*) FROM '.$user_prefix.'_pendingusers');
$row = $db->sql_fetchrow($result);
$content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=approvemembers">'._USERS.'</a>: '.$row[0].'<br />';
|
|
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
kguske

|
Posted:
Sun Apr 27, 2008 7:33 pm |
|
You will also need to add this line to your /language/lang-english.php file (or the appropriate language file):
Code:define('_USERS','Users');
|
|
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon Apr 28, 2008 5:57 am |
|
j4rdin, I see that you were already well taken care of over here. Thanks kguske! |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
kguske

|
Posted:
Mon Apr 28, 2008 2:16 pm |
|
Haven't add it to RN SVN yet, but I added logic to detect if either Approve Membership or CNBYA have been added, and the count is displayed accordingly. |
|
|
|
 |
montego

|
Posted:
Tue Apr 29, 2008 5:09 am |
|
|
|
 |
j4rdin

|
Posted:
Tue Apr 29, 2008 12:52 pm |
|
kguske wrote: | Haven't add it to RN SVN yet, but I added logic to detect if either Approve Membership or CNBYA have been added, and the count is displayed accordingly. |
Thanks for the quick reply and sorry about the duplicate post, for some reason FF didn't show that the post had been sent properly (for either post) not sure why, hence my trip over to your site Montego.
I came across a post somewhere which asked about added functionality for the Waiting Content block, it seemed to suggest if everything was added it would soon get to big and as someone pointed out most of the time it doesn't show anything on a lot of sites.
Is it possible to add an admin control module for the block, maybe to allow the admin to switch of those functions not required and to switch the display between on and only when content waiting.
Thanks for the help.
John |
|
|
|
 |
kguske

|
Posted:
Tue Apr 29, 2008 7:09 pm |
|
I wouldn't worry about it getting too big by just adding the number of users waiting to be approved. But I definitely appreciate the concern - why display anything if there is nothing pending?
How about replacing function adminblock() in mainfile.php with this:
Code:function adminblock() {
global $admin, $prefix, $db, $admin_file, $user_prefix;
if (is_admin($admin)) {
$sql = 'SELECT title, content FROM '.$prefix.'_blocks WHERE bkey=\'admin\'';
$result = $db->sql_query($sql);
while (list($title, $content) = $db->sql_fetchrow($result)) {
$content = preg_replace('/\badmin.php/', $admin_file.'.php', $content); //RN6444
$content = '<span class="content">'.$content.'</span>';
themesidebox($title, $content);
}
$title = _WAITINGCONT;
$content = '<span class="content">';
$num = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_queue'));
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=submissions">'._SUBMISSIONS.'</a>: '.$num.'<br />';
$num = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_reviews_add'));
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=reviews">'._WREVIEWS.'</a>: '.$num.'<br />';
$num = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_links_newlink'));
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=Links">'._WLINKS.'</a>: '.$num.'<br />';
$modreql = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_links_modrequest WHERE brokenlink=0'));
if ($modreql > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=LinksListModRequests">'._MODREQLINKS.'</a>: '.$modreql.'<br />';
$brokenl = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_links_modrequest WHERE brokenlink=1'));
if ($brokenl > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=LinksListBrokenLinks">'._BROKENLINKS.'</a>: '.$brokenl.'<br />';
$num = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_downloads_newdownload'));
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=downloads">'._UDOWNLOADS.'</a>: '.$num.'<br />';
$modreqd = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_downloads_modrequest WHERE brokendownload=0'));
if ($modreqd > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=DownloadsListModRequests">'._MODREQDOWN.'</a>: '.$modreqd.'<br />';
$brokend = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_downloads_modrequest WHERE brokendownload=1'));
if ($brokend > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=DownloadsListBrokenDownloads">'._BROKENDOWN.'</a>: '.$brokend.'<br />';
$result = $db->sql_query('SELECT COUNT(*) FROM '.$prefix.'_gcal_event WHERE approved = 0');
$row = $db->sql_fetchrow($result);
$num = $row[0];
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=gcalendar">'._GCALENDAR_EVENTS.'</a>: '.$row[0].'<br />';
# Approve Membership
if (file_exists('modules/Approve_Membership/index.php'))
{
$result = $db->sql_query('SELECT COUNT(*) FROM '.$user_prefix.'_pendingusers');
$row = $db->sql_fetchrow($result);
$num = $row[0];
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=approvemembers">'._USERS.'</a>: '.$row[0].'<br />';
}
# CNBYA
if (file_exists('modules/Your_Account/credits.html'))
{
$result = $db->sql_query('SELECT COUNT(*) FROM '.$user_prefix.'_users_temp');
$row = $db->sql_fetchrow($result);
$num = $row[0];
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="modules.php?name=Your_Account&file=admin&op=listpending">'._USERS.'</a>: '.$row[0].'<br />';
}
$content .= ' </span>';
themesidebox($title, $content);
}
}
|
Montego, I think this would be a nice addition to RN - would you agree? |
|
|
|
 |
montego

|
Posted:
Wed Apr 30, 2008 5:31 am |
|
I supposed that I could get used to it, but having worked with buggy software for so long, I always get nervous when I don't see something that I expect to be there. I.e., I like seeing that I have NO pending content. BUT, I'm a pretty "quirky" guy, so never mind me...
However, that still does raise a support point that many people who are familiar with nuke will be asking "where is my waiting content content?". But, it would tighten up that space a bit. |
|
|
|
 |
kguske

|
Posted:
Wed Apr 30, 2008 5:38 am |
|
Oops...added it to SVN with the nukeWYSIWYG changes. The waiting content block will still be displayed - it just won't show anything that doesn't have anything waiting. |
|
|
|
 |
montego

|
Posted:
Wed Apr 30, 2008 6:25 am |
|
Lets see if the others notice...  |
|
|
|
 |
kguske

|
Posted:
Wed Apr 30, 2008 6:39 am |
|
Last night I was playing around with a DHTML popup that would display waiting content. Not too hard to implement, just need to add cookie code to the JS so it would display it only once per browser session, rather than on every page, which would be pretty annoying to the admin... |
|
|
|
 |
|