-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_events.php
executable file
·78 lines (69 loc) · 2.67 KB
/
post_events.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
class post_events{
function humorcms_content_content(){
$this->content_content_content();
}
function content_content_content(){
if($this->_output['url_plug']){
header("Location: ".APP_ROOT_URL."index.php?page=plug&url=".urlencode($this->_output['url_plug'])."&iid=".$this->_input['iid']);
exit;
}
}
function ieditor_ieditor_default(){
//print "d";exit;
if($this->_input['iid']){
list($width, $height, $type, $attr) = getimagesize($_REQUEST['file']);
$this->_output['widthi'] = $width;
$this->_output['heighti'] = $height;
}else{
$this->_output['setwidth'] = '';
$this->_output['setheight'] = '';
}
}
function ieditor_ieditor_edit(){
$othumb = $this->_input['lpath'];
$rthumb = $this->_input['lpath'].".edit";
rename($rthumb,$othumb);
if($this->_input['editmain']){
list($width, $height, $type, $attr) = getimagesize($_REQUEST['file']);
$cwidth = $GLOBALS['sconf']['THUMBNAIL']['container_width'];
$cheight = $GLOBALS['sconf']['THUMBNAIL']['container_height'];
include_once(APP_ROOT."flexycms/modules/humorcms/content_manager.php");
$obj = new content_manager;
$result = $obj->get_cinfo($this->_input['editmain']);
$lpath = $GLOBALS['sconf']['CONTENT_IMAGES']['content_images'].$result[0]['v_file_name'];
$file = APP_ROOT_URL.$GLOBALS['sconf']['CONTENT_IMAGES']['orig_url'].$result[0]['v_file_name'];
$url = APP_ROOT_URL."flexycms/modules/ieditor/?width=".$width."&height=".$height."&cwidth=".$cwidth."&cheight=".$cheight."&lpath=".urlencode($lpath)."&file=".urlencode($file);
header("Location: $url");
exit;
}else{
$url = APP_ROOT_URL. 'flexycms/myadmin/index.php/page-content-mgr-content-content_choice-add_new';
header("Location: $url");
exit;
}
}
function humorcms_content_insert(){
if($this->_input['ieditor_edit']){
$obj = new content_manager();
$result = $obj->get_cinfo($this->_input['add_new']['id_content']);
$lpath = $GLOBALS['sconf']['THUMBNAIL']['thumbnail_root'].$result[0]['v_thumbnail'];
$file = APP_ROOT_URL.$GLOBALS['sconf']['CONTENT_IMAGES']['orig_url'].$result[0]['v_thumbnail'];
$url = APP_ROOT_URL. "flexycms/modules/ieditor/?iid={$this->_input['add_new']['id_content']}&lpath=".urlencode($lpath)."&file=".urlencode($file);
header("Location: $url");
exit;
}
}
function humorcms_content_update(){
$this->humorcms_content_insert();
}
function run($module,$mgr,$choice,$input,$output){
$fn_name = "{$module}_{$mgr}_{$choice}";
$this->_input = $input;
$this->_output = $output;
$fn_array = get_class_methods("post_events");
if(in_array($fn_name,$fn_array) || in_array(strtolower($fn_name),$fn_array)){
$this->$fn_name();
}
return $this->_output;
}
}