1<?php
2/**
3 * XOOPS comment edit
4 *
5 * You may not change or alter any portion of this comment or credits
6 * of supporting developers from this source code or any supporting source code
7 * which is considered copyrighted (c) material of the original comment or credit authors.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
13 * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
14 * @package             kernel
15 * @since               2.0.0
16 * @author              Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
17 */
18
19if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
20    die('Restricted access');
21}
22
23include_once $GLOBALS['xoops']->path('include/comment_constants.php');
24
25if (('system' !== $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) || (!is_object($xoopsUser) && !$xoopsModuleConfig['com_anonpost']) || !is_object($xoopsModule)) {
26    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
27}
28
29xoops_loadLanguage('comment');
30
31$com_id   = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0;
32$com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
33
34if ($com_mode == '') {
35    if (is_object($xoopsUser)) {
36        /* @var  XoopsUser $xoopsUser */
37        $com_mode = $xoopsUser->getVar('umode');
38    } else {
39        $com_mode = $xoopsConfig['com_mode'];
40    }
41}
42
43if (!isset($_GET['com_order'])) {
44    if (is_object($xoopsUser)) {
45        $com_order = $xoopsUser->getVar('uorder');
46    } else {
47        $com_order = $xoopsConfig['com_order'];
48    }
49} else {
50    $com_order = (int)$_GET['com_order'];
51}
52
53/**
54 */
55$comment_handler = xoops_getHandler('comment');
56$comment         = $comment_handler->get($com_id);
57$dohtml          = $comment->getVar('dohtml');
58$dosmiley        = $comment->getVar('dosmiley');
59$dobr            = $comment->getVar('dobr');
60$doxcode         = $comment->getVar('doxcode');
61$com_icon        = $comment->getVar('com_icon');
62$com_itemid      = $comment->getVar('com_itemid');
63$com_title       = $comment->getVar('com_title', 'e');
64$com_text        = $comment->getVar('com_text', 'e');
65$com_pid         = $comment->getVar('com_pid');
66$com_status      = $comment->getVar('com_status');
67$com_rootid      = $comment->getVar('com_rootid');
68// Start Add by voltan
69$com_user  = $comment->getVar('com_user');
70$com_email = $comment->getVar('com_email');
71$com_url   = $comment->getVar('com_url');
72// End Add by voltan
73
74if ($xoopsModule->getVar('dirname') !== 'system') {
75    include $GLOBALS['xoops']->path('header.php');
76    include $GLOBALS['xoops']->path('include/comment_form.php');
77    include $GLOBALS['xoops']->path('footer.php');
78} else {
79    xoops_cp_header();
80    include $GLOBALS['xoops']->path('include/comment_form.php');
81    xoops_cp_footer();
82}
83