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
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Wed Jul 14, 2004 8:55 pm Reply with quote

Baloo, I figured you'd waited long enough Wink

In mainfile.php, find
Code:
function adminblock() {
Then find
Code:
while ($row = $db->sql_fetchrow($result)) {

    $content = "<font class=\"content\">$row[content]</font>";
    themesidebox($row[title], $row[content]);
}
Add this line
Code:
return;

so that it now reads
Code:
while ($row = $db->sql_fetchrow($result)) {

    $content = "<font class=\"content\">$row[content]</font>";
    themesidebox($row[title], $row[content]);
}
return;
That will keep the hard coded Waiting Contents block from displaying. Now, create a block
Code:
<?php

if (eregi("block-RWH_WaitingContent.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

global $admin, $prefix, $db;
$title = ""._WAITINGCONT."";
$num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_queue"));
$content = "<font class=\"content\">";
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=submissions\">"._SUBMISSIONS."</a>: $num<br>";
$num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_reviews_add"));
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=reviews\">"._WREVIEWS."</a>: $num<br>";
$num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_links_newlink"));
$brokenl = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_links_modrequest WHERE brokenlink='1'"));
$modreql = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_links_modrequest WHERE brokenlink='0'"));
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=Links\">"._WLINKS."</a>: $num<br>";
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=LinksListModRequests\">"._MODREQLINKS."</a>: $modreql<br>";
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=LinksListBrokenLinks\">"._BROKENLINKS."</a>: $brokenl<br>";
$num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_downloads_newdownload"));
$brokend = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_downloads_modrequest WHERE brokendownload='1'"));
$modreqd = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_downloads_modrequest WHERE brokendownload='0'"));
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=downloads\">"._UDOWNLOADS."</a>: $num<br>";
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=DownloadsListModRequests\">"._MODREQDOWN."</a>: $modreqd<br>";
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=DownloadsListBrokenDownloads\">"._BROKENDOWN."</a>: $brokend<br></font>";
?>
and save/ftp it to your blocks folder. Activate it through your Administration panel and set permissions to Administrators Only.

YOU'RE WELCOME!! Groovy
 
View user's profile Send private message
baloo
Hangin' Around


Joined: Sep 10, 2002
Posts: 30

PostPosted: Wed Jul 14, 2004 11:04 pm Reply with quote

You truly are my saviour !!!

Now all I need to do is add some little bits and pieces, give it a sexy name and slap a (c)Baloo's Perfect PHP Scripts and I'll be famous ! Laughing

Thanks again Raven !
 
View user's profile Send private message
baloo
PostPosted: Tue Jul 20, 2004 8:10 am Reply with quote

That works nicely.
Can anyone help me to add a "Waiting Users" in the waiting Content block ? I'm using the latest YA. I gave it a shot myself and managed to completey screw everything up Smile
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6793
Location: Ha Noi, Viet Nam

PostPosted: Sun Oct 10, 2004 9:18 pm Reply with quote

Personally, I think phpnuke should have a stand alone Waiting Content block, that way module developers could take advantage of the opportunity to add their own code into the block file leading to a swathe of invaluable 'at a glance' information for Admins.
e.g.
Waiting events
.. Workboard projects
.. Admin PM's to be answered
.. Members in Chat rooms
.. ePetitions
etc etc
On the down side, I suppose this would lead to a shed load of sql calls and hammer site performance.
 
View user's profile Send private message Send e-mail
Raven
PostPosted: Sun Oct 10, 2004 9:32 pm Reply with quote

Since Admins would be using it, the overhead would be minimal. And, btw, I plan on incorporating this type of methodology into PHP-Portal.
 
Guardian2003
PostPosted: Sun Oct 10, 2004 9:40 pm Reply with quote

Thanks for the feedback Raven.
Yes, it would be nice if this (or something very similar) was incorporated into PHP-Portal.
When I think about it, I'm suprised that the numerous module developers have not already thought about this as IMO it would prove to be very useful.
 
Raven
PostPosted: Sun Oct 10, 2004 9:54 pm Reply with quote

This week I will be releasing some fundamental and foundation documentation on my 'Dream'.
 
Bluezzz
Involved
Involved


Joined: Feb 08, 2005
Posts: 290
Location: USA

PostPosted: Mon Aug 28, 2006 5:53 pm Reply with quote

I did as said above and it works great *except* one minor problem being that the old Waiting Content for Admin block is still showing. Considering the last post here was back in Oct 2004 ... I would think a fix should have been discovered and posted here? Can someone help me get rid of the old Waiting Content section of Admin please? Thanks : o}

_________________
Bluezzz
~ Stop & smell the roses, while you can! ~ 
View user's profile Send private message
Guardian2003
PostPosted: Mon Aug 28, 2006 9:42 pm Reply with quote

See Ravens post here dated July 15th 2004
The code he posted should prevent the waiting content from the admin block being displayed.
 
Bluezzz
PostPosted: Thu Aug 31, 2006 3:14 pm Reply with quote

Seems my code was abit different, I copied and pasted this code
Only registered users can see links on this board! Get registered or login!

And now it works fine. Thanks : o}
 
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 ©