Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Tue Apr 18, 2023 4:14 am Reply with quote

Since yesterday testing and couldn't find any error. Today morning I decided to activate a block to see if the all function are in order then it came this one.

Notice: Trying to access array offset on value of type bool in /www.bestbuildpc.org/admin/modules/blocks.php on line 963

Code:
function ChangeStatus($bid, $ok=0) {

   global $prefix, $db, $admin_file;
   $bid = intval($bid);
   $row = $db->sql_fetchrow($db->sql_query('SELECT `active FROM `' . $prefix . '_blocks` WHERE `bid`=\'' . $bid . '\''));
   $active = intval($row['active']);
   if (($ok) OR ($active == 1)) {
      if ($active == 0) {
         $active = 1;
      } elseif ($active == 1) {
         $active = 0;
      }
      $result2 = $db->sql_query('UPDATE `' . $prefix . '_blocks` SET `active`=\'' . $active . '\' WHERE `bid`=\'' . $bid . '\'');
      Header('Location: ' . $admin_file . '.php?op=BlocksAdmin');
   } else {
      $row3 = $db->sql_fetchrow($db->sql_query('SELECT `title`, `content`, `url`, `bposition` FROM `' . $prefix . '_blocks` WHERE `bid`=\'' . $bid . '\''));
      $title = $row3['title'];
      $content = $row3['content'];
      $url = $row3['url'];
      $bposition = $row3['bposition'];
      include_once('header.php');
      GraphicAdmin();
      echo '<br />';
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1774

PostPosted: Tue Apr 18, 2023 11:22 am Reply with quote

You should really compare at first your files with the files from the core-package. It seems you made changes on it. [ Only registered users can see links on this board! Get registered or login! ]

From all what I can see, you missed an ` in the first query on the active-field:

php Code:
// yours

$row = $db->sql_fetchrow($db->sql_query('SELECT `active FROM `' . $prefix . '_blocks` WHERE `bid`=\'' . $bid . '\''));

// try this
$row = $db->sql_fetchrow($db->sql_query('SELECT `active` FROM `' . $prefix . '_blocks` WHERE `bid`=\'' . $bid . '\''));

_________________
Github: RavenNuke

Last edited by neralex on Wed Apr 19, 2023 8:53 am; edited 1 time in total 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Tue Apr 18, 2023 6:16 pm Reply with quote

Yes, my mistake grrrrrr. Bang Head Bang Head Bang Head Thanks
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

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 ©