-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathedit.php
More file actions
138 lines (127 loc) · 4.58 KB
/
edit.php
File metadata and controls
138 lines (127 loc) · 4.58 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
/**
* iForum - a bulletin Board (Forum) for ImpressCMS
*
* Based upon CBB 3.08
*
* @copyright http://www.xoops.org/ The XOOPS Project
* @copyright http://xoopsforge.com The XOOPS FORGE Project
* @copyright http://xoops.org.cn The XOOPS CHINESE Project
* @copyright XOOPS_copyrights.txt
* @copyright readme.txt
* @copyright http://www.impresscms.org/ The ImpressCMS Project
* @license GNU General Public License (GPL)
* a copy of the GNU license is enclosed.
* ----------------------------------------------------------------------------------------------------------
* @package CBB - XOOPS Community Bulletin Board
* @since 3.08
* @author phppp
* ----------------------------------------------------------------------------------------------------------
* iForum - a bulletin Board (Forum) for ImpressCMS
* @since 1.00
* @author modified by stranger
* @version $Id$
*/
include 'header.php';
// Disable cache
$icmsConfig["module_cache"][icms::$module->getVar("mid")] = 0;
include ICMS_ROOT_PATH."/header.php";
foreach (array('forum', 'topic_id', 'post_id', 'order', 'pid') as $getint)
{
$ {
$getint }
= isset($_GET[$getint]) ? (int)$_GET[$getint] :
0;
}
$viewmode = (isset($_GET['viewmode']) && $_GET['viewmode'] != 'flat') ? 'thread' :
'flat';
if (empty($forum) )
{
redirect_header("index.php", 2, _MD_ERRORFORUM);
exit();
}
elseif (empty($post_id) )
{
redirect_header("viewforum.php?forum=$forum", 2, _MD_ERRORPOST);
exit();
}
else
{
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
$forumpost = $post_handler->get($post_id);
$forum_obj = $forum_handler->get($forumpost->getVar("forum_id"));
if (!$forum_handler->getPermission($forum_obj))
{
redirect_header("index.php", 2, _MD_NORIGHTTOACCESS);
exit();
}
if (icms::$module->config['wol_enabled'])
{
$online_handler = icms_getmodulehandler('online', basename(__DIR__), 'iforum' );
$online_handler->init($forum_obj);
}
$isadmin = iforum_isAdmin($forum_obj);
$uid = is_object(icms::$user)? icms::$user->getVar('uid'):
0;
$topic_status = $topic_handler->get($topic_id, 'topic_status');
if ($topic_handler->getPermission($forum_obj, $topic_status, 'edit')
&& ($isadmin || $forumpost->checkIdentity()) )
{
}
else
{
redirect_header("viewtopic.php?forum=".$forum_obj->getVar('forum_id')."&topic_id=$topic_id&post_id=$post_id&order=$order&viewmode=$viewmode&pid=$pid", 2, _MD_NORIGHTTOEDIT);
exit();
}
if (!$isadmin && !$forumpost->checkTimelimit('edit_timelimit'))
{
redirect_header("viewtopic.php?forum=".$forum_obj->getVar('forum_id')."&topic_id=$topic_id&post_id=$post_id&order=$order&viewmode=$viewmode&pid=$pid", 2, _MD_TIMEISUP);
exit();
}
$post_id2 = $forumpost->getVar('pid');
$dohtml = $forumpost->getVar('dohtml');
$dosmiley = $forumpost->getVar('dosmiley');
$doxcode = $forumpost->getVar('doxcode');
$dobr = $forumpost->getVar('dobr');
$icon = $forumpost->getVar('icon');
$attachsig = $forumpost->getVar('attachsig');
$topic_id = $forumpost->getVar('topic_id');
$istopic = ($forumpost->istopic() )?1:0;
$isedit = 1;
$subject_pre = "";
$subject = $forumpost->getVar('subject', "E");
$message = $forumpost->getVar('post_text', "E");
$poster_name = $forumpost->getVar('poster_name', "E");
$attachments = $forumpost->getAttachment();
$post_karma = $forumpost->getVar('post_karma');
$require_reply = $forumpost->getVar('require_reply');
$hidden = "";
include 'include/forumform.inc.php';
if (!$istopic)
{
$forumpost2 = $post_handler->get($post_id2);
$r_message = $forumpost2->getVar('post_text');
$isadmin = 0;
if ($forumpost2->getVar('uid'))
{
$r_name = iforum_getUnameFromId($forumpost2->getVar('uid'), icms::$module->config['show_realname']);
if (iforum_isAdmin($forum_obj, $forumpost2->getVar('uid'))) $isadmin = 1;
}
else
{
$poster_name = $forumpost2->getVar('poster_name');
$r_name = (empty($poster_name))?$icmsConfig['anonymous']:
$poster_name;
}
$r_date = formatTimestamp($forumpost2->getVar('post_time'));
$r_subject = $forumpost2->getVar('subject');
$r_content = _MD_BY." ".$r_name." "._MD_ON." ".$r_date."<br /><br />";
$r_content .= $r_message;
$r_subject = $forumpost2->getVar('subject');
echo "<table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>".$r_subject."</td></tr>";
echo "<tr><td><br />".$r_content."<br /></td></tr></table>";
}
include ICMS_ROOT_PATH.'/footer.php';
}