Kyberia v2.0
[mirrors/Kyberia-bloodline.git] / inc / eventz / configure_template_id.inc
1 <?php
2 /* This program is free software. It comes without any warranty, to
3 * the extent permitted by applicable law. You can redistribute it
4 * and/or modify it under the terms of the Do What The Fuck You Want
5 * To Public License, Version 2, as published by Sam Hocevar. See
6 * http://sam.zoy.org/wtfpl/COPYING for more details. */
7
8 function configure_template_id() {
9 global $db,$error,$node;
10 $node_id=$node['node_id'];
11 $user_id=$_SESSION['user_id'];
12
13 if ($node['node_permission']=='owner') {
14
15 if (is_numeric($_POST['template_id'])) $template_id=$_POST['template_id'];
16 else {
17 $error=$error_messages['INCORRECT_TEMPLATE_ID'];
18 return false;
19 }
20
21 if ($_POST['apply_on_vector']) {
22 $vector=$node['node_vector'];
23 if (empty($vector)) {
24 $error=$error_messages['INCORRECT_VECTOR'];
25 return false;
26 }
27 $q="update nodes set template_id='$template_id' where node_vector like '$vector%'";
28 $db->query($q);
29 }
30
31 else {
32 $q="update nodes set template_id='$template_id' where node_id='$node_id'";
33 $db->query($q);
34 }
35 }
36 }
37 ?>
This page took 0.339172 seconds and 4 git commands to generate.