raffael3d
Jr. Member
 
Posts: 79

I'm a llama!
|
 |
insert instead of remove
« on: March 17, 2003, 01:48:27 AM » |
|
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();
}
|