Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / New_pnadmin / html / modules / admin / pnblocks [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 09 Aug 2002 23:18:52 | postnuke_modules/New_pnadmin/html/modules/admin/pnblocks | adminmodules.php,1.1.1.1,1.2 | Richard Cave |
| ADODB conversion. | |||
Update of /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/admin/pnblocks
In directory ns7.hostnuke.net:/tmp/cvs-serv26158/New_pnadmin/html/modules/admin/pnblocks
Modified Files:
adminmodules.php
Log Message:
ADODB conversion.
Index: adminmodules.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/admin/pnblocks/adminmodules.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** adminmodules.php 3 Aug 2002 10:01:12 -0000 1.1.1.1
--- adminmodules.php 9 Aug 2002 23:18:50 -0000 1.2
***************
*** 2,13 ****
// File: $Id$ $Name$
// ----------------------------------------------------------------------
! // POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
- // Based on:
- // PHP-NUKE Web Portal System - http://phpnuke.org/
- // Thatware - http://thatware.org/
- // ----------------------------------------------------------------------
// LICENSE
//
--- 2,9 ----
// File: $Id$ $Name$
// ----------------------------------------------------------------------
! // PostNuke Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// LICENSE
//
***************
*** 43,272 ****
pnSecAddSchema('admin::', 'Tab Name:Tab module:');
! function getUrl($back){
! $dirList = explode("/",__FILE__);
! $url = $dirList[(count($dirList)-$back)];
! return $url;
}
! function getRequests($url){
! $url = explode("?",$url);
! $get_list = explode("&",$url[1]);
! for($i = 0;$i < count($get_list);$i++){
! $getContent = explode("=",$get_list[$i]);
! $getName = $getContent[0];
! $getValue = $getContent[1];
! if($getName != "gID"){
! if($content){
! $content .="&";
! }
! $content .= $getName."=".$getValue;
! }
! }
! return "?".$content;
}
! function admin_list_modules($row){
! list($dbconn) = pnDBGetConn();
! $pntable = pnDBGetTables();
!
! if(!pnSecAuthAction(0, "admin::", "::", ACCESS_EDIT)) {
! return;
! }
! // Get the modName, a little hard to do when the __FILE__ doesn't work
! // so we have to go "back" a few steps to get the name of the module
! $ModName = getUrl(3);
! // Get all requests made by other pages so we an remember where we are
! // have to get the sessionvar because the modload cleans the request uri
! // so the gID will be lost.
! $getQuery = getRequests($GLOBALS['REQUEST_URI']);
! $use_gID = $GLOBALS['gID'];
! if($use_gID > 0 || $use_gID == 'none'){
! if($use_gID == 'none'){
! $use_gID = 0;
! }
! $setSuccess = pnModSetVar('admin','user_'.pnUserGetVar('uid'),$use_gID);
! }else{
! $use_gID = pnModGetVar('admin','user_'.pnUserGetVar('uid'));
! }
! if(!$setSuccess){
! // $content = "Unable to set \"user_".pnUserGetVar('uid')."\" with value ".$use_gID."!?<br>";
! }
! // Start the first content data, a table start
! $content .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
! // Include this only if it hasen't been included before.
! require_once("modules/".$ModName."/pntables.php");
! require_once("modules/".$ModName."/pnfunctions.php");
! require_once("modules/".$ModName."/pninit.php"); // Only to use the restore function
! // Make a connection and get all tables
! $pntable = admin_pntables();
! // Group/Tab table
! $table = $pntable['group_table'];
! $column = &$pntable['group'];
! // Modules in group/tab table
! $modtable = $pntable['member_table'];
! $modcolumn = &$pntable['members'];
! // Modules table
! $modulestable = pnConfigGetVar('prefix')."_modules";
! // Select
! $result = mysql_query("SELECT * FROM ".$table." ORDER BY ".$column['order']);
! $num = mysql_numrows($result);
! for ($i = 0 ;$i < $num; $i++){
! $gID = mysql_result($result, $i, $column['id']);
! $gName = mysql_result($result, $i, $column['name']);
!
! if (pnSecAuthAction(0, "Admin::", $gName."::", ACCESS_EDIT)) {
! if($use_gID == $gID){
! $content .= "<tr><td><b>".$gName."</b> <a href=\"".$getQuery."&gID=none\"><img src=\"images/global/upb.gif\" border=\"0\"></a></td></tr>";
! $query = "SELECT ".$modcolumn['mid']." FROM ".$modtable." INNER JOIN ".$modulestable." AS mod ON ".$modcolumn['mid']." = mod.pn_id WHERE ".$modcolumn['gid']."='".$gID."' ORDER BY mod.pn_displayname";
! $result2 = mysql_query($query);
! $num2 = mysql_numrows($result2);
! if($num2 > 0){
! for ($i2 = 0 ;$i2 < $num2; $i2++){
! $mID = mysql_result($result2, $i2, $modcolumn['mid']);
! // -------------------------------------------------------------
! // Get information about the module
! //
! list($admin,$image,$name,$status) = getModInfo($mID);
! // -------------------------------------------------------------
! //
! // Check and see if there is an image that we can use, else just
! // display the name.
! //
! // if (pnSecAuthAction(0, "Adminblock::", $gName.":".$name.":", ACCESS_EDIT)) {
! if (pnSecAuthAction(0, "admin::", ":".$name.":", ACCESS_EDIT)) {
! if($status == 3 || $status == 5){
! if(checkShowModule($name)){
! $content .= "<tr><td align=\"left\" nowrap valign=\"bottom\"> <strong><big>·</big></strong> <a href=\"".$admin."&gID=".$gID."\">$name</a></td></tr>\n";
! }
! }
! }
! }
! }
! }else{
! $content .= "<tr><td><strong><big>·</big></strong> <a href=\"".$getQuery."&gID=".$gID."\">".$gName."</a></td></tr>";
! }
! }
! }
! //$content .="<tr><td align=\"right\" valign=\"bottom\" nowrap>[ <a href=\"admin.php?op=main&module=".$ModName."&admin_func=edit&gID=".$gID."\">Edit admin</a> ]</td></TR>";
! $content .="</table><br>";
! $content .="<div align=\"center\">[ <a href=\"admin.php?op=main&module=".$ModName."&admin_func=edit&gID=".$GLOBALS['gID']."\">"._ADMIN_LITE_EDIT_."</a> | <a href=\"admin.php\">"._ADMIN_LITE_ADMIN_."</a> | <a href=\"user.php?module=ns-user&op=logout\">"._ADMIN_LITE_LOGOUT_."</a> ]</div>";
- // <Original Author>
- // -----------------------------------------------------------------------------------------------------
- // Original Author of the following code: Jim McDonald
- // Purpose of code: Display menu, with lots of options
- // -----------------------------------------------------------------------------------------------------
- $pntable = pnDBGetTables();
- $vars = pnBlockVarsFromContent($row['content']);
-
- // Waiting content
- if (!empty($vars['displaywaiting'])) {
- // Separate from current content, if any
- if ($contentOther == 1) {
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], "", "", "");
- }
-
-
- $header = 0;
-
- if (pnSecAuthAction(0, "Stories::", "::", ACCESS_ADD)) {
- $result = $dbconn->Execute("SELECT count(1) FROM $pntable[queue]
- WHERE {$pntable['queue_column']['arcd']}=0");
- if ($dbconn->ErrorNo() == 0) {
- list($qnum) = $result->fields;
- $result->Close();
- if ($qnum) {
- if ($header == 0) {
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
- $header = 1;
- }
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], _SUBMISSIONS.": $qnum", "admin.php?module=ns-addstory&op=submissions", "");
- $contentOther = 1;
- }
- }
- }
-
- if (pnSecAuthAction(0, "Reviews::", "::", ACCESS_ADD)) {
- $result = $dbconn->Execute("SELECT count(1) FROM $pntable[reviews_add]");
- if ($dbconn->ErrorNo() == 0) {
- list($rnum) = $result->fields;
- $result->Close();
- if ($rnum) {
- if ($header == 0) {
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
- $header = 1;
- }
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], _WREVIEWS.": $rnum", "admin.php?module=reviews&op=main", "");
- $contentOther = 1;
- }
- }
- }
-
- if (pnSecAuthAction(0, "Web Links::", "::", ACCESS_ADD)) {
- $result = $dbconn->Execute("SELECT count(1) FROM $pntable[links_newlink]");
- if ($dbconn->ErrorNo() == 0) {
- list($lnum) = $result->fields;
- $result->Close();
- if ($lnum) {
- if ($header == 0) {
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
- $header = 1;
- }
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], _WLINKS.": $lnum", "admin.php?module=web_links&op=main", "");
- $contentOther = 1;
- }
- }
- }
-
- if (pnSecAuthAction(0, "Downloads::", "::", ACCESS_ADD)) {
- $result = $dbconn->Execute("SELECT count(1) FROM $pntable[downloads_newdownload]");
- if ($dbconn->ErrorNo() == 0) {
- list($dnum) = $result->fields;
- $result->Close();
- if ($dnum) {
- if ($header == 0) {
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
- $header = 1;
- }
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], _WDOWNLOADS.": $dnum", "admin.php?module=downloads&op=main", "");
- $contentOther = 1;
- }
- }
- }
-
- if (pnSecAuthAction(0, "FAQ::", "::", ACCESS_ADD)) {
- $faqcolumn = &$pntable['faqanswer_column'];
- $result = $dbconn->Execute("SELECT count(1) FROM $pntable[faqanswer] WHERE $faqcolumn[answer]=''");
- if ($dbconn->ErrorNo() == 0) {
- list($fnum) = $result->fields;
- $result->Close();
- if ($fnum) {
- if ($header == 0) {
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
- $header = 1;
- }
- $content .= addMenuStyledUrl_WaitingContent($vars['style'], _FQUESTIONS.": $fnum", "admin.php?module=faq&op=FaqCatUnanswered", "");
- $contentOther = 1;
- }
- }
- }
- }
- // -----------------------------------------------------------------------------------------------------
- // </Original Author>
! if(empty($row['title'])) {
$row['title'] = "Admin Menu";
! }
! $row['content'] = $content;
! return themesideblock($row);
}
--- 39,279 ----
pnSecAddSchema('admin::', 'Tab Name:Tab module:');
! function getUrl($back)
! {
! $dirList = explode("/",__FILE__);
! $url = $dirList[(count($dirList)-$back)];
! return $url;
}
! function getRequests($url)
! {
! $url = explode("?",$url);
! $get_list = explode("&",$url[1]);
! for($i = 0;$i < count($get_list);$i++){
! $getContent = explode("=",$get_list[$i]);
! $getName = $getContent[0];
! $getValue = $getContent[1];
! if($getName != "gID"){
! if($content){
! $content .="&";
! }
! $content .= $getName."=".$getValue;
! }
! }
! return "?".$content;
}
! function admin_list_modules($row)
! {
! list($dbconn) = pnDBGetConn();
! $pntable = pnDBGetTables();
!
! if(!pnSecAuthAction(0, "admin::", "::", ACCESS_EDIT)) {
! return;
! }
! // Get the modName, a little hard to do when the __FILE__ doesn't work
! // so we have to go "back" a few steps to get the name of the module
! $ModName = getUrl(3);
! // Get all requests made by other pages so we an remember where we are
! // have to get the sessionvar because the modload cleans the request uri
! // so the gID will be lost.
! $getQuery = getRequests($GLOBALS['REQUEST_URI']);
! $use_gID = $GLOBALS['gID'];
! if($use_gID > 0 || $use_gID == 'none'){
! if($use_gID == 'none'){
! $use_gID = 0;
! }
! $setSuccess = pnModSetVar('admin','user_'.pnUserGetVar('uid'),$use_gID);
! }else{
! $use_gID = pnModGetVar('admin','user_'.pnUserGetVar('uid'));
! }
! if(!$setSuccess){
! // $content = "Unable to set \"user_".pnUserGetVar('uid')."\" with value ".$use_gID."!?<br>";
! }
! // Start the first content data, a table start
! $content .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
! // Include this only if it hasen't been included before.
! require_once("modules/".$ModName."/pntables.php");
! require_once("modules/".$ModName."/pnfunctions.php");
! require_once("modules/".$ModName."/pninit.php"); // Only to use the restore function
! // Make a connection and get all tables
! $pntable = admin_pntables();
! // Group/Tab table
! $table = $pntable['group_table'];
! $column = &$pntable['group'];
! // Modules in group/tab table
! $modtable = $pntable['member_table'];
! $modcolumn = &$pntable['members'];
! // Modules table
! $modulestable = pnConfigGetVar('prefix')."_modules";
! // Select
! $query = "SELECT ".$column['id'].",".$column['name']." FROM ".$table." ORDER BY ".$column['order'];
! $result = $dbconn->Execute( $query );
! if ( $result == false ) {
! PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return;
! }
+ for (; !$result->EOF; $result->MoveNext() ) {
+ $gID = $result->fields[0];
+ $gName = $result->fields[1];
+
+ if (pnSecAuthAction(0, "Admin::", $gName."::", ACCESS_EDIT)) {
+ if($use_gID == $gID){
+ $content .= "<tr><td><b>".$gName."</b> <a href=\"".$getQuery."&gID=none\"><img src=\"images/global/upb.gif\" border=\"0\"></a></td></tr>";
+ $query = "SELECT ".$modcolumn['mid']." FROM ".$modtable." INNER JOIN ".$modulestable." AS mod ON ".$modcolumn['mid']." = mod.pn_id WHERE ".$modcolumn['gid']."='".$gID."' ORDER BY mod.pn_displayname";
! $result2 = $dbconn->Execute( $query );
! if ( $result2 == false ) {
! PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return;
! }
+ for (; !$result2->EOF; $result2->MoveNext() ) {
+ $mID = $result2->fields[0];
+ // -------------------------------------------------------------
+ // Get information about the module
+ //
+ list($admin,$image,$name,$status) = getModInfo($mID);
+ // -------------------------------------------------------------
+ //
+ // Check and see if there is an image that we can use, else just
+ // display the name.
+ //
+ // if (pnSecAuthAction(0, "Adminblock::", $gName.":".$name.":", ACCESS_EDIT)) {
+ if (pnSecAuthAction(0, "admin::", ":".$name.":", ACCESS_EDIT)) {
+ if($status == 3 || $status == 5){
+ if(checkShowModule($name)){
+ $content .= "<tr><td align=\"left\" nowrap valign=\"bottom\"> <strong><big>·</big></strong> <a href=\"".$admin."&gID=".$gID."\">$name</a></td></tr>\n";
+ }
+ }
+ }
+ }
+ }else{
+ $content .= "<tr><td><strong><big>·</big></strong> <a href=\"".$getQuery."&gID=".$gID."\">".$gName."</a></td></tr>";
+ }
+ }
+ }
+ //$content .="<tr><td align=\"right\" valign=\"bottom\" nowrap>[ <a href=\"admin.php?op=main&module=".$ModName."&admin_func=edit&gID=".$gID."\">Edit admin</a> ]</td></TR>";
+ $content .="</table><br>";
+ $content .="<div align=\"center\">[ <a href=\"admin.php?op=main&module=".$ModName."&admin_func=edit&gID=".$GLOBALS['gID']."\">"._ADMIN_LITE_EDIT_."</a> | <a href=\"admin.php\">"._ADMIN_LITE_ADMIN_."</a> | <a href=\"user.php?module=ns-user&op=logout\">"._ADMIN_LITE_LOGOUT_."</a> ]</div>";
! // <Original Author>
! // -----------------------------------------------------------------------------------------------------
! // Original Author of the following code: Jim McDonald
! // Purpose of code: Display menu, with lots of options
! // -----------------------------------------------------------------------------------------------------
! $pntable = pnDBGetTables();
! $vars = pnBlockVarsFromContent($row['content']);
!
! // Waiting content
! if (!empty($vars['displaywaiting'])) {
! // Separate from current content, if any
! if ($contentOther == 1) {
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], "", "", "");
! }
!
!
! $header = 0;
!
! if (pnSecAuthAction(0, "Stories::", "::", ACCESS_ADD)) {
! $result = $dbconn->Execute("SELECT count(1) FROM $pntable[queue]
! WHERE {$pntable['queue_column']['arcd']}=0");
! if ($dbconn->ErrorNo() == 0) {
! list($qnum) = $result->fields;
! $result->Close();
! if ($qnum) {
! if ($header == 0) {
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
! $header = 1;
! }
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], _SUBMISSIONS.": $qnum", "admin.php?module=ns-addstory&op=submissions", "");
! $contentOther = 1;
! }
! }
! }
!
! if (pnSecAuthAction(0, "Reviews::", "::", ACCESS_ADD)) {
! $result = $dbconn->Execute("SELECT count(1) FROM $pntable[reviews_add]");
! if ($dbconn->ErrorNo() == 0) {
! list($rnum) = $result->fields;
! $result->Close();
! if ($rnum) {
! if ($header == 0) {
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
! $header = 1;
! }
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], _WREVIEWS.": $rnum", "admin.php?module=reviews&op=main", "");
! $contentOther = 1;
! }
! }
! }
!
! if (pnSecAuthAction(0, "Web Links::", "::", ACCESS_ADD)) {
! $result = $dbconn->Execute("SELECT count(1) FROM $pntable[links_newlink]");
! if ($dbconn->ErrorNo() == 0) {
! list($lnum) = $result->fields;
! $result->Close();
! if ($lnum) {
! if ($header == 0) {
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
! $header = 1;
! }
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], _WLINKS.": $lnum", "admin.php?module=web_links&op=main", "");
! $contentOther = 1;
! }
! }
! }
!
! if (pnSecAuthAction(0, "Downloads::", "::", ACCESS_ADD)) {
! $result = $dbconn->Execute("SELECT count(1) FROM $pntable[downloads_newdownload]");
! if ($dbconn->ErrorNo() == 0) {
! list($dnum) = $result->fields;
! $result->Close();
! if ($dnum) {
! if ($header == 0) {
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
! $header = 1;
! }
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], _WDOWNLOADS.": $dnum", "admin.php?module=downloads&op=main", "");
! $contentOther = 1;
! }
! }
! }
!
! if (pnSecAuthAction(0, "FAQ::", "::", ACCESS_ADD)) {
! $faqcolumn = &$pntable['faqanswer_column'];
! $result = $dbconn->Execute("SELECT count(1) FROM $pntable[faqanswer] WHERE $faqcolumn[answer]=''");
! if ($dbconn->ErrorNo() == 0) {
! list($fnum) = $result->fields;
! $result->Close();
! if ($fnum) {
! if ($header == 0) {
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], "<strong>" . _WAITINGCONT. "</strong>", "", "");
! $header = 1;
! }
! $content .= addMenuStyledUrl_WaitingContent($vars['style'], _FQUESTIONS.": $fnum", "admin.php?module=faq&op=FaqCatUnanswered", "");
! $contentOther = 1;
! }
! }
! }
! }
! // -----------------------------------------------------------------------------------------------------
! // </Original Author>
!
!
!
! if(empty($row['title'])) {
$row['title'] = "Admin Menu";
! }
! $row['content'] = $content;
! return themesideblock($row);
}
***************
*** 276,280 ****
// Original Author of the following code: Jim McDonald
// Purpose of code: Display menu, with lots of options
! function startMenuStyle_WaitingContent($style){
// Nothing to do for style == 1 (bullet list)
$content = "";
--- 283,288 ----
// Original Author of the following code: Jim McDonald
// Purpose of code: Display menu, with lots of options
! function startMenuStyle_WaitingContent($style)
! {
// Nothing to do for style == 1 (bullet list)
$content = "";
***************
*** 286,290 ****
}
! function endMenuStyle_WaitingContent($style){
// Nothing to do for style == 1 (bullet list)
$content = "";
--- 294,299 ----
}
! function endMenuStyle_WaitingContent($style)
! {
// Nothing to do for style == 1 (bullet list)
$content = "";
***************
*** 297,301 ****
! function addMenuStyledUrl_WaitingContent($style, $name, $url, $comment){
if ($style == 1) {
// Bullet list
--- 306,311 ----
! function addMenuStyledUrl_WaitingContent($style, $name, $url, $comment)
! {
if ($style == 1) {
// Bullet list
***************
*** 358,365 ****
}
! function blocks_admin_actions($row){
global $pntheme;
! list($dbconn) = pnDBGetConn();
! $pntable = pnDBGetTables();
// Break out options from our content field
--- 368,376 ----
}
! function blocks_admin_actions($row)
! {
global $pntheme;
! list($dbconn) = pnDBGetConn();
! $pntable = pnDBGetTables();
// Break out options from our content field
View Statistics - Next Notice - Previous Notice
| Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |