5 $set = $db->query(sprintf('select moods from users where user_id = %d', $_SESSION['user_id']));
7 $moods_expl = explode(";",$set->getString('moods'));
8 $moods_expl[count($moods_expl)-1] = $_POST['mood'];
10 if (is_numeric($_POST['mood'])) {
11 $_SESSION['mood_id'] = $_POST['mood'];
12 $set = $db->query(sprintf('select node_name, node_content from nodes where node_id = %d', $_POST['mood']));
14 $_SESSION['mood_name'] = strip_tags($set->getString('node_name'));
15 $_SESSION['mood_content'] = addslashes(substr(strip_tags($set->getString('node_content')),0,223));
18 $_SESSION['mood_id'] = '';
19 $_SESSION['mood_name'] = '';
20 $_SESSION['mood_content'] = '';
22 $moods = implode(";",$moods_expl);
23 $db->query(sprintf('update users set moods="%s" where user_id=%d', $moods, $_SESSION['user_id']));