source: extensions/ContactForm/admin/cf_persoform.tab.php @ 14428

Last change on this file since 14428 was 14428, checked in by ddtddt, 12 years ago

[extensions] - ContactForm - add perso text on form

File size: 1.5 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3check_status(ACCESS_ADMINISTRATOR);
4
5global $template, $conf, $user;
6
7//charge Persoform
8$query = '
9select 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 = '
23select 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
36if (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?>
Note: See TracBrowser for help on using the repository browser.