51ff3226 |
1 | <?php |
51ff3226 |
2 | |
ac3bdc72 |
3 | function book() { |
4 | global $db,$error,$node; |
5 | |
6 | $q="update neurons set link='bookmark',synapse_creator='".$_SESSION['user_id']."',synapse=synapse+1 where dst='".$_SESSION['user_id']."' and src='".$node['node_id']."'"; |
7 | $result=$db->update($q); |
8 | if (!$result) { |
9 | $q="insert into neurons set synapse_created=NOW(),dst='".$_SESSION['user_id']."',src='".$node['node_id']."',synapse_creator='".$_SESSION['user_id']."',link='bookmark'"; |
10 | $db->query($q); |
51ff3226 |
11 | } |
ac3bdc72 |
12 | $q="update node_access set node_bookmark='yes' where user_id='".$_SESSION['user_id']."' and node_id='".$node['node_id']."'"; |
13 | $result=$db->query($q); |
14 | |
15 | $_SESSION['bookmarks'][$node['node_id']]=$node['node_name']; |
16 | |
17 | return true; |
18 | } |
51ff3226 |
19 | ?> |
20 | |
21 | |