Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
j4rdin
Worker
Worker


Joined: May 26, 2006
Posts: 153
Location: West Sussex - UK

PostPosted: Sun Apr 27, 2008 2:50 pm Reply with quote

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
 
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Sun Apr 27, 2008 5:57 pm Reply with quote

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>&middot;</big></strong>&nbsp;<a href="'.$admin_file.'.php?op=approvemembers">'._USERS.'</a>: '.$row[0].'<br />';

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
kguske
PostPosted: Sun Apr 27, 2008 7:33 pm Reply with quote

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: 9456
Location: Arizona

PostPosted: Mon Apr 28, 2008 5:57 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
kguske
PostPosted: Mon Apr 28, 2008 2:16 pm Reply with quote

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
PostPosted: Tue Apr 29, 2008 5:09 am Reply with quote

kguske, sounds good sir.
 
j4rdin
PostPosted: Tue Apr 29, 2008 12:52 pm Reply with quote

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
PostPosted: Tue Apr 29, 2008 7:09 pm Reply with quote

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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<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>&middot;</big></strong>&nbsp;<a href="modules.php?name=Your_Account&amp;file=admin&amp;op=listpending">'._USERS.'</a>: '.$row[0].'<br />';
        }
        $content .= '&nbsp;</span>';
        themesidebox($title, $content);
    }
}

Montego, I think this would be a nice addition to RN - would you agree?
 
montego
PostPosted: Wed Apr 30, 2008 5:31 am Reply with quote

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... Laughing

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
PostPosted: Wed Apr 30, 2008 5:38 am Reply with quote

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
PostPosted: Wed Apr 30, 2008 6:25 am Reply with quote

Lets see if the others notice... Wink Smile
 
kguske
PostPosted: Wed Apr 30, 2008 6:39 am Reply with quote

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...
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©