15if (!defined(
'XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
19require_once XOOPS_ROOT_PATH.
'/header.php';
21require_once XOOPS_MODULE_PATH .
'/legacy/forms/CommentEditForm.class.php';
22require_once XOOPS_ROOT_PATH .
'/include/comment_constants.php';
27$t_root =& XCube_Root::getSingleton();
29$t_root->mLanguageManager->loadModuleMessageCatalog(
'legacy');
30$t_root->mLanguageManager->loadPageTypeMessageCatalog(
'comment');
33$com_id = isset($_GET[
'com_id']) ? (int)$_GET[
'com_id'] : 0;
34$com_mode = isset($_GET[
'com_mode']) ? htmlspecialchars(trim($_GET[
'com_mode']), ENT_QUOTES) :
'';
36 if (is_object($xoopsUser)) {
37 $com_mode = $xoopsUser->getVar(
'umode');
39 $com_mode = $xoopsConfig[
'com_mode'];
42if (!isset($_GET[
'com_order'])) {
43 if (is_object($xoopsUser)) {
44 $com_order = $xoopsUser->getVar(
'uorder');
46 $com_order = $xoopsConfig[
'com_order'];
49 $com_order = (int)$_GET[
'com_order'];
51$comment_handler =& xoops_gethandler(
'comment');
52$comment =& $comment_handler->get($com_id);
55$r_text = _CM_POSTER.
': <b>'.$r_name.
'</b> '._CM_POSTED.
': <b>'.formatTimestamp($comment->getVar(
'com_created')).
'</b><br><br>'.$comment->getVar(
'com_text');$com_title = $comment->getVar(
'com_title',
'E');
56if (!preg_match(
'/^re:/i', $com_title)) {
57 $com_title =
'Re: ' . xoops_substr($com_title, 0, 56);
68$com_rootid = $comment->getVar(
'com_rootid');
69$com_itemid = $comment->getVar(
'com_itemid');
74$res_comment =& $comment->createChild();
79if (is_object($xoopsUser)) {
80 $comment->set(
'uid', $xoopsUser->get(
'uid'));
82 $comment->set(
'uid', 0);
88if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
93$actionForm->prepare();
94$actionForm->load($res_comment);
99$handler =& xoops_gethandler(
'subjecticon');
100$subjectIcons =& $handler->getObjects();
102themecenterposts($comment->getVar(
'com_title'), $r_text);
107$renderSystem =& $t_root->getRenderSystem($t_root->mContext->mBaseRenderSystemName);
108$renderTarget =& $renderSystem->createRenderTarget(
'main');
110$renderTarget->setTemplateName(
'legacy_comment_edit.html');
112$renderTarget->setAttribute(
'actionForm', $actionForm);
113$renderTarget->setAttribute(
'subjectIcons', $subjectIcons);
114$renderTarget->setAttribute(
'xoopsModuleConfig', $xoopsModuleConfig);
115$renderTarget->setAttribute(
'com_order', $com_order);
120$renderSystem->render($renderTarget);
125print $renderTarget->getResult();
127require_once XOOPS_ROOT_PATH .
'/footer.php';
static getUnameFromId($userid, $usereal=0)