| 1 | <?php |
| 2 | function bookstyl() { |
| 3 | global $error,$node,$db; |
| 4 | |
| 5 | $user_id = $_SESSION['user_id']; |
| 6 | $bookstyl = $_POST['bookstyl']; |
| 7 | |
| 8 | $set=$db->query("select * from nodes where node_parent=19 and external_link='session://bookstyl' and node_creator='$user_id'"); |
| 9 | if($set->getNumRows() == 0) { |
| 10 | |
| 11 | $addnode['node_content'] = $bookstyl; |
| 12 | $addnode['node_name'] = "book styl"; |
| 13 | $addnode['node_creator'] = $user_id; |
| 14 | $addnode['node_parent'] = 19; |
| 15 | $addnode['template_id'] = 4; |
| 16 | $addnode['external_link'] = "session://bookstyl"; |
| 17 | $addnode_id = nodes::addNode($addnode); |
| 18 | $_SESSION['bookstyl']= $bookstyl; |
| 19 | |
| 20 | } |
| 21 | else { |
| 22 | |
| 23 | $q = "update nodes set node_content='$bookstyl' where node_parent=19 and external_link='session://bookstyl' and node_creator='$user_id'"; |
| 24 | $db->query($q); |
| 25 | |
| 26 | } |
| 27 | $_SESSION['bookstyl']= $bookstyl; |
| 28 | |
| 29 | } |
| 30 | ?> |