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 [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 16 Aug 2002 17:21:35 | postnuke_modules/New_pnadmin/html/modules/admin | pnfunctions.php,1.5,1.6 | Richard Cave |
| Fixed SQL error in restoreToDefault(). | |||
Update of /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/admin
In directory ns7.hostnuke.net:/tmp/cvs-serv8458/New_pnadmin/html/modules/admin
Modified Files:
pnfunctions.php
Log Message:
Fixed SQL error in restoreToDefault().
Index: pnfunctions.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/admin/pnfunctions.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pnfunctions.php 14 Aug 2002 20:09:17 -0000 1.5
--- pnfunctions.php 16 Aug 2002 17:21:32 -0000 1.6
***************
*** 77,81 ****
$gID = $result->fields[0];
}
! $result = $gID;
}else{
$query = "SELECT ".$column['name']." FROM ".$table." WHERE ".$column['id']."='".$gID."'";
--- 77,81 ----
$gID = $result->fields[0];
}
! $liteName = $gID;
}else{
$query = "SELECT ".$column['name']." FROM ".$table." WHERE ".$column['id']."='".$gID."'";
***************
*** 88,95 ****
$gName = $result->fields[0];
}
! $result = $gName;
}
! return $result;
}
--- 88,95 ----
$gName = $result->fields[0];
}
! $liteName = $gName;
}
! return $liteName;
}
***************
*** 149,153 ****
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return;
}
for (; !$result->EOF; $result->MoveNext() ) {
--- 149,153 ----
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return 0;
}
for (; !$result->EOF; $result->MoveNext() ) {
***************
*** 177,181 ****
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return;
}
for (; !$result->EOF; $result->MoveNext() ) {
--- 177,181 ----
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return 0;
}
for (; !$result->EOF; $result->MoveNext() ) {
***************
*** 194,197 ****
--- 194,198 ----
$table = $pntable['group_table'];
$column = &$pntable['group'];
+ $latest = 0;
$query = "SELECT MAX(".$column['order'].") as latest FROM ".$table;
***************
*** 200,209 ****
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
- return 0;
}
! if (!$result->EOF) {
$latest = $result->fields[0] + 1;
- } else {
- $latest = 0;
}
--- 201,207 ----
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
}
! else if (!$result->EOF) {
$latest = $result->fields[0] + 1;
}
***************
*** 237,241 ****
}
! // Make an array of all pisible links to the admin-image.
$imageList = array("/pnimages/admin.gif","/pnimages/admin.jpg","/pnimages/admin.png","/images/admin.gif","/images/admin.jpg","/images/admin.png");
// And then check what link we are going to use.
--- 235,239 ----
}
! // Make an array of all possible links to the admin-image.
$imageList = array("/pnimages/admin.gif","/pnimages/admin.jpg","/pnimages/admin.png","/images/admin.gif","/images/admin.jpg","/images/admin.png");
// And then check what link we are going to use.
***************
*** 297,301 ****
if (!$result->EOF) {
! return $gID;
} else {
return getAdminLiteName(0,1);
--- 295,299 ----
if (!$result->EOF) {
! return $result->fields[0];
} else {
return getAdminLiteName(0,1);
***************
*** 310,313 ****
--- 308,312 ----
$column = &$pntable['members'];
$modTable = pnConfigGetVar('prefix')."_modules";
+ $old_modules = 0;
$query = "SELECT ".$column['mid']." FROM ".$table;
***************
*** 316,320 ****
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return 0;
}
for (; !$result->EOF; $result->MoveNext() ) {
--- 315,319 ----
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return $old_modules;
}
for (; !$result->EOF; $result->MoveNext() ) {
***************
*** 327,331 ****
if ( $resultSelSub == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! }elseif ($resultSelSub->EOF) {
$old_modules++;
}
--- 326,333 ----
if ( $resultSelSub == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
! return $old_modules;
! }
!
! if ($resultSelSub->EOF) {
$old_modules++;
}
***************
*** 341,347 ****
$table = $pntable['member_table'];
$column = &$pntable['members'];
// ----------------------------------------------------------------------------------------
// Modules in group
! $modTable = pnConfigGetVar('prefix')."_modules";
$infotype_cols = &$pntable['members'];
--- 343,350 ----
$table = $pntable['member_table'];
$column = &$pntable['members'];
+ $new_modules = 0;
// ----------------------------------------------------------------------------------------
// Modules in group
! $modTable = pnConfigGetVar('prefix')."_modules";
$infotype_cols = &$pntable['members'];
***************
*** 503,509 ****
function printAllTabs($show_in_a_row,$images,$useSkin,$func)
{
! $ModName = basename(dirname(__FILE__));
! list($dbconn) = pnDBGetConn();
! $pntable = admin_pntables();
// -------------------------------------------------------------
$show_in_a_row = $show_in_a_row - 1;
--- 506,512 ----
function printAllTabs($show_in_a_row,$images,$useSkin,$func)
{
! $ModName = basename(dirname(__FILE__));
! list($dbconn) = pnDBGetConn();
! $pntable = admin_pntables();
// -------------------------------------------------------------
$show_in_a_row = $show_in_a_row - 1;
***************
*** 514,520 ****
$column = &$pntable['group'];
! $bgInfo = getimagesize("modules/$ModName/skins/".$useSkin."/pnimages/".$images['tab']);
! $hojden = $bgInfo[1];
! $bredden = $bgInfo[0];
// Start tab-printing
--- 517,523 ----
$column = &$pntable['group'];
! $bgInfo = getimagesize("modules/$ModName/skins/".$useSkin."/pnimages/".$images['tab']);
! $hojden = $bgInfo[1];
! $bredden = $bgInfo[0];
// Start tab-printing
***************
*** 553,560 ****
}
// If it is the selected group we should use a different image and not use a link.
if($func == $gID){
// Check if it is the last group/row
! if((($i+1) == $num) || ($shown == $show_in_a_row)){
$useSelectedBgImage = "modules/$ModName/skins/".$useSkin."/pnimages/".$images['tab_selected_at_the_end'];
}else{
--- 556,565 ----
}
+ $indexNext = $index + 1;
+
// If it is the selected group we should use a different image and not use a link.
if($func == $gID){
// Check if it is the last group/row
! if(($indexNext == $recordCount) || ($shown == $show_in_a_row)){
$useSelectedBgImage = "modules/$ModName/skins/".$useSkin."/pnimages/".$images['tab_selected_at_the_end'];
}else{
***************
*** 563,568 ****
$useBgImage = $useSelectedBgImage;
$useLink = " ".$gName."";
! }else{
! $indexNext = $index + 1;
// Else, check if it is the last group/row
if(($indexNext == $recordCount) || ($shown == $show_in_a_row)){
--- 568,572 ----
$useBgImage = $useSelectedBgImage;
$useLink = " ".$gName."";
! }else{
// Else, check if it is the last group/row
if(($indexNext == $recordCount) || ($shown == $show_in_a_row)){
***************
*** 573,577 ****
// Get next record
$result->MoveNext();
! $NextGiD = $result->fields[0];
if($NextGiD == $func){
$useBgImage = "modules/$ModName/skins/".$useSkin."/pnimages/".$images['tab_before_selected_tab'];
--- 577,581 ----
// Get next record
$result->MoveNext();
! $NextGiD = $result->fields[0];
if($NextGiD == $func){
$useBgImage = "modules/$ModName/skins/".$useSkin."/pnimages/".$images['tab_before_selected_tab'];
***************
*** 640,644 ****
return;
}
! if (!$result->EOF) {
$query = "DELETE FROM ".$table." WHERE ".$column['mid']."='".$modID."'";
$resultDelSub = $dbconn->Execute( $query );
--- 644,648 ----
return;
}
! if (!$resultSelSub->EOF) {
$query = "DELETE FROM ".$table." WHERE ".$column['mid']."='".$modID."'";
$resultDelSub = $dbconn->Execute( $query );
***************
*** 654,668 ****
function removeGroup($gID,$target)
{
! list($dbconn) = pnDBGetConn();
!
$pntable = admin_pntables();
-
$table = $pntable['group_table'];
$column = &$pntable['group'];
$query = "DELETE FROM ".$table." WHERE ".$column['id']."='".$gID."'";
$result = $dbconn->Execute( $query );
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
- return;
}
--- 658,670 ----
function removeGroup($gID,$target)
{
! list($dbconn) = pnDBGetConn();
$pntable = admin_pntables();
$table = $pntable['group_table'];
$column = &$pntable['group'];
+
$query = "DELETE FROM ".$table." WHERE ".$column['id']."='".$gID."'";
$result = $dbconn->Execute( $query );
if ( $result == false ) {
PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
}
***************
*** 839,843 ****
// Modules in group
$modTable = pnConfigGetVar('prefix')."_modules";
- $infotype_cols = &$pntable['members'];
$query = "SELECT ".$modTable.".pn_id FROM ".$modTable.
--- 841,844 ----
***************
*** 854,858 ****
if(!checkModID($modID)){
! $query = "INSERT INTO ".$pntable['member_table']." (". $infotype_cols['gid'].",". $infotype_cols['mid'].") VALUES ('".$preferedGroup."','".$modID."')";
$resultIns = $dbconn->Execute( $query );
if ( $resultIns == false ) {
--- 855,859 ----
if(!checkModID($modID)){
! $query = "INSERT INTO ".$table." (". $column['gid'].",". $column['mid'].") VALUES ('".$preferedGroup."','".$modID."')";
$resultIns = $dbconn->Execute( $query );
if ( $resultIns == false ) {
***************
*** 896,899 ****
--- 897,917 ----
$column = &$pntable['group'];
+ $output .= "<option value=\"\"";
+ if($getID == 0){
+ $output .= " selected";
+ }
+ $output .= ">"._ADMIN_LITE_ALLMODULES_TAB_;
+ if($notThisID != "hide_numbers"){
+ $output .= " (";
+
+ // RCave - $gID was the original value but it isn't valid until
+ // selected from the database further in the code.
+ // $output .= countMembersInGroup($gID);
+ // I changed $gID to $getID - is this correct???
+ $output .= countMembersInGroup($getID);
+ $output .= " "._ADMIN_LITE_MODULES_.")";
+ }
+ $output .= "</option>\n";
+
if($notThisID == "hide_numbers"){
$query = "SELECT ".$column['id'].",".$column['name']." FROM ".$table." ORDER BY ".$column['order'];
***************
*** 909,927 ****
return;
}
-
- // RCave - FIX THIS - $gID isn't valid yet
- /*
- $output .= "<option value=\"\"";
- if($getID == 0){
- $output .= " selected";
- }
- $output .= ">"._ADMIN_LITE_ALLMODULES_TAB_;
- if($notThisID != "hide_numbers"){
- $output .= " (";
- $output .= countMembersInGroup($gID);
- $output .= " "._ADMIN_LITE_MODULES_.")";
- }
- $output .= "</option>\n";
- */
for (; !$result->EOF; $result->MoveNext() ) {
--- 927,930 ----
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 |