1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | check_status(ACCESS_ADMINISTRATOR); |
---|
4 | |
---|
5 | global $template, $conf, $user; |
---|
6 | |
---|
7 | //charge Persoform |
---|
8 | $query = ' |
---|
9 | select param,value |
---|
10 | FROM ' . CONFIG_TABLE . ' |
---|
11 | WHERE param = "persoformtop" |
---|
12 | ;'; |
---|
13 | $result = pwg_query($query); |
---|
14 | |
---|
15 | $row = mysql_fetch_array($result); |
---|
16 | |
---|
17 | $template->assign( |
---|
18 | array( |
---|
19 | 'PERSOFORMTOP' => $row['value'], |
---|
20 | )); |
---|
21 | |
---|
22 | $query = ' |
---|
23 | select param,value |
---|
24 | FROM ' . CONFIG_TABLE . ' |
---|
25 | WHERE param = "persoformbottom" |
---|
26 | ;'; |
---|
27 | $result = pwg_query($query); |
---|
28 | |
---|
29 | $row = mysql_fetch_array($result); |
---|
30 | |
---|
31 | $template->assign( |
---|
32 | array( |
---|
33 | 'PERSOFORMBOTTOM' => $row['value'], |
---|
34 | )); |
---|
35 | |
---|
36 | if (isset($_POST['submitpersoform'])) |
---|
37 | { |
---|
38 | $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="persoformtop" LIMIT 1;'; |
---|
39 | pwg_query($q); |
---|
40 | $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("persoformtop","'.$_POST['persoform_top'].'","Add text above form to contactform plugin");'; |
---|
41 | pwg_query($query); |
---|
42 | |
---|
43 | $template->assign( |
---|
44 | array( |
---|
45 | 'PERSOFORMTOP' => stripslashes($_POST['persoform_top']), |
---|
46 | )); |
---|
47 | |
---|
48 | $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="persoformbottom" LIMIT 1;'; |
---|
49 | pwg_query($q); |
---|
50 | $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("persoformbottom","'.$_POST['persoform_bottom'].'","Add text below form to contactform plugin");'; |
---|
51 | pwg_query($query); |
---|
52 | |
---|
53 | $template->assign( |
---|
54 | array( |
---|
55 | 'PERSOFORMBOTTOM' => stripslashes($_POST['persoform_bottom']), |
---|
56 | )); |
---|
57 | } |
---|
58 | |
---|
59 | ?> |
---|