Welcome, Guest. Please Login or Register.
May 10, 2025, 07:03:06 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  insert instead of remove « previous next »
Pages: [1] Reply Ignore Print
Author Topic: insert instead of remove  (Read 433 times)
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

insert instead of remove
« on: March 17, 2003, 01:48:27 AM »
Reply with quote

this is the code which removes an entry from the notification, can anybody tell me what I have to change that it ADDS an entry instead? that would be perfect. thanks.

function Notify6 ()
{
   global $username, $ID_BOARD, $txt, $HTTP_POST_VARS, $ID_MEMBER, $db_prefix, $doLimitOne;
   
   checkSession();

   if ($username == 'Guest')
      fatal_error($txt[138]);

   foreach ($HTTP_POST_VARS as $key=>$value)
      if (substr($key, 1, 6) == 'board-' && $value)
      {
         $board = substr($key, 6);
         
         $request = mysql_query("
            SELECT notifies
            FROM {$db_prefix}boards
            WHERE (ID_BOARD = $board)
            LIMIT 1") or database_error(__FILE__, __LINE__);
            
         list ($notification) = mysql_fetch_row($request);
         $notifies = explode(',', $notification);
         $notifications2 = array();
         
         foreach ($notifies as $note)
            if ($note != $ID_MEMBER)
               $notifications2[]=$note;
         
         $notification = implode(",", $notifications2);
         $request = mysql_query("
            UPDATE {$db_prefix}boards
            SET notifies = '$notification'
            WHERE ID_BOARD = $board
            $doLimitOne") or database_error(__FILE__, __LINE__);
      }

   ShowNotifications();
   

}
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:insert instead of remove
« Reply #1 on: March 17, 2003, 01:58:01 AM »
Reply with quote

i believe Notify2() function is the one that adds notification
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:insert instead of remove
« Reply #2 on: March 17, 2003, 02:05:14 AM »
Reply with quote

thanks. I tried that already, the area that I have problems with is:

foreach ($HTTP_POST_VARS as $key=>$value)
      if (substr($key, 1, 6) == 'board-' && $value)
      {
         $board = substr($key, 6);



I'm not too familiar with checkboxes. So I need to get the value  from the checkbox into the database.

what I want to do is:
in the notification center you have a list to all boards that your forum has, to email board notification to the boards you click the checkboxes and it will activate the notification to all selected boards. The notifiacation is working, but not yet via this way of actiavation.

any tips? thanks.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  insert instead of remove « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.040 seconds with 20 queries.