3 global $db,$error,$node;
4 $moods_expl = explode(";",$_POST['moodlist']);
7 if (empty($moods_expl[count($moods_expl)-1])) $moods_sw = 1;
11 for ($i = 0;$i < count($moods_expl)-$moods_sw;$i++) {
12 $set = $db->query(sprintf('select node_id from nodes where node_id = %d', $moods_expl[$i]));
14 if ($set->getString('node_id')) {
15 if (!in_array($moods_expl[$i],$moodlist)) {
16 $moodlist[$moods_cn] = $moods_expl[$i];
21 $error = sprintf('%d does not exist, ', $moods_expl[$i]);
26 $moods_impl = implode(";",$moodlist);
28 if (!empty($_SESSION['mood_id'])) $moods_impls .= $_SESSION['mood_id'];
30 $db->query(sprintf('update users set moods = "%s" where user_id = %d', $moods_impl, $_SESSION['user_id']));