Project

General

Profile

« Previous | Next » 

Revision 1420

Added by Dietmar almost 14 years ago

YGN Ethical Hacker Group (2.8.2 / 2.9.0)

View differences:

modify.php
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         code
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
// Setup template object
20
$template = new Template(WB_PATH.'/modules/code');
21
$template->set_file('page', 'htt/modify.htt');
22
$template->set_block('page', 'main_block', 'main');
23

  
24
// Get page content
25
$query = "SELECT content FROM ".TABLE_PREFIX."mod_code WHERE section_id = '$section_id'";
26
$get_content = $database->query($query);
27
$content = $get_content->fetchRow();
28
$content = htmlspecialchars($content['content']);
29

  
30
// Insert vars
31
$template->set_var(
32
	array(
33
		'PAGE_ID'				=> $page_id,
34
		'SECTION_ID'			=> $section_id,
35
		'REGISTER_EDIT_AREA'	=> function_exists('registerEditArea') ? registerEditArea('content'.$section_id, 'php', false) : '',
36
		'WB_URL'				=> WB_URL,
37
		'CONTENT'				=> $content,
38
		'TEXT_SAVE'				=> $TEXT['SAVE'],
39
		'TEXT_CANCEL'			=> $TEXT['CANCEL'],
40
		'SECTION'				=> $section_id,
41
		'FTAN'					=> $admin->getFTAN()
42
	)
43
);
44

  
45
// Parse template object
46
$template->set_unknowns('keep');
47
$template->parse('main', 'main_block', false);
48
$template->pparse('output', 'page', false);
49

  
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         code
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21
// Setup template object
22
$template = new Template(WB_PATH.'/modules/code');
23
$template->set_file('page', 'htt/modify.htt');
24
$template->set_block('page', 'main_block', 'main');
25

  
26
// Get page content
27
$query = "SELECT content FROM ".TABLE_PREFIX."mod_code WHERE section_id = '$section_id'";
28
$get_content = $database->query($query);
29
$content = $get_content->fetchRow();
30
$content = htmlspecialchars($content['content']);
31

  
32
// Insert vars
33
$template->set_var(
34
	array(
35
		'PAGE_ID'				=> $page_id,
36
		'SECTION_ID'			=> $section_id,
37
		'REGISTER_EDIT_AREA'	=> function_exists('registerEditArea') ? registerEditArea('content'.$section_id, 'php', false) : '',
38
		'WB_URL'				=> WB_URL,
39
		'CONTENT'				=> $content,
40
		'TEXT_SAVE'				=> $TEXT['SAVE'],
41
		'TEXT_CANCEL'			=> $TEXT['CANCEL'],
42
		'SECTION'				=> $section_id,
43
		'FTAN'					=> $admin->getFTAN()
44
	)
45
);
46

  
47
// Parse template object
48
$template->set_unknowns('keep');
49
$template->parse('main', 'main_block', false);
50
$template->pparse('output', 'page', false);
51

  
50 52
?>

Also available in: Unified diff