-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodify.php
56 lines (43 loc) · 1.67 KB
/
modify.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* @category modules
* @package onebyone
* @author WBCE Project
* @copyright florian
* @license WTFPL
*/
//no direct file access
if(count(get_included_files()) ==1){$z="HTTP/1.0 404 Not Found";header($z);die($z);}
//Load Language Files
$lang = __DIR__ . '/languages/' . LANGUAGE . '.php';
require (!file_exists($lang) ? __DIR__ . '/languages/EN.php' : $lang);
require_once __DIR__ .'/module_settings.php';
// Fetch media URL for replacing {SYSVAR:MEDIA_REL}
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
$actionURL = get_url_from_path(__DIR__).'/save.php';
$sSql = 'SELECT * FROM `{TP}mod_onebyone` WHERE `section_id`='.(int)$section_id;
$aData = $database->get_array($sSql)[0];
if (!empty($aData)) {
extract($aData);
/**
// THE FOLLOWING LINES ARE NOT NEEDED BECAUSE WE "extract"ED THESE ABOVE
// get values for Variables
$content1_code = $aData['content1_code'];
$content1_wysiwyg = $aData['content1_wysiwyg'];
. . . .
*/
if(!isset($wysiwyg_editor_loaded)) {
$wysiwyg_editor_loaded = true;
// No WYSIWYG Editor defined create a show_wysiwyg_editor() funktion, that only creates a textarea.
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
function show_wysiwyg_editor($name, $id, $content, $width, $height) {
echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
}
} else {
require_once(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
}
}
include (__DIR__."/templates/modify.tpl.php");
} else {
echo "<h3>Database error, did`t find the section data</h3>" ;
}