From: <be...@us...> - 2013-01-23 20:57:19
|
Revision: 10882 http://sourceforge.net/p/xoops/svn/10882 Author: beckmi Date: 2013-01-23 20:57:13 +0000 (Wed, 23 Jan 2013) Log Message: ----------- Adding FastComment Hack by Voltan for testing Modified Paths: -------------- XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt XoopsCore/branches/2.5.x/2.5.6/htdocs/class/commentrenderer.php XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_edit.php XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_form.php XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_new.php XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_post.php XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_reply.php XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_view.php XoopsCore/branches/2.5.x/2.5.6/htdocs/install/sql/mysql.structure.sql XoopsCore/branches/2.5.x/2.5.6/htdocs/kernel/comment.php XoopsCore/branches/2.5.x/2.5.6/htdocs/language/english/comment.php XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/admin/comments/main.php XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/admin/system_comments.html XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_flat.html XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_nest.html XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_thread.html Added Paths: ----------- XoopsCore/branches/2.5.x/2.5.6/upgrade/upd-2.4.0-to-2.4.1/ XoopsCore/branches/2.5.x/2.5.6/upgrade/upd-2.4.0-to-2.4.1/index.php XoopsCore/branches/2.5.x/2.5.6/upgrade/upd-2.4.0-to-2.4.1/license.dist.php XoopsCore/branches/2.5.x/2.5.6/upgrade/upd-2.5.5-to-2.5.6/ XoopsCore/branches/2.5.x/2.5.6/upgrade/upd-2.5.5-to-2.5.6/index.php Removed Paths: ------------- XoopsCore/branches/2.5.x/2.5.6/upgrade/licence-upgrade-keygen-2.4.0-to-2.4.1/ XoopsCore/branches/2.5.x/2.5.6/upgrade/upd-2.4.0a-to-2.4.0/ Modified: XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/docs/changelog.250.txt 2013-01-23 20:57:13 UTC (rev 10882) @@ -16,6 +16,8 @@ - jQuery to 1.9.0 (mamba) - jQueryUI to version 1.10 (mamba) +Added: Fast Comment Hack (Voltan) + =============================== 2012/04/15: Version 2.5.5 Final =============================== Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/class/commentrenderer.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/class/commentrenderer.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/class/commentrenderer.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -103,9 +103,18 @@ } else { $title = $this->_comments[$i]->getVar('com_title'); } - $poster = $this->_getPosterArray($this->_comments[$i]->getVar('com_uid')); + // Start edit by voltan + $poster = $this->_getPosterArray($this->_comments[$i]->getVar('com_uid'), $this->_comments[$i]->getVar('com_user'), $this->_comments[$i]->getVar('com_url')); if (false != $admin_view) { - $text = $this->_comments[$i]->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$this->_comments[$i]->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $this->_comments[$i]->getVar('com_ip') . '</span></div>'; + $com_email = $this->_comments[$i]->getVar('com_email'); + $text = $this->_comments[$i]->getVar('com_text'); + $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">'; + $text .= _CM_STATUS . ': ' . $this->_statusText[$this->_comments[$i]->getVar('com_status')] . '<br />'; + $text .= 'IP: <span style="font-weight: bold;">' . $this->_comments[$i]->getVar('com_ip') . '</span>'; + if(!empty($com_email)) { + $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>'; + } + $text .= '</div>'; } else { // hide comments that are not active if (XOOPS_COMMENT_ACTIVE != $this->_comments[$i]->getVar('com_status')) { @@ -114,6 +123,7 @@ $text = $this->_comments[$i]->getVar('com_text'); } } + // End edit by voltan $this->_tpl->append('comments', array('id' => $this->_comments[$i]->getVar('com_id') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($this->_comments[$i]->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($this->_comments[$i]->getVar('com_modified'), 'm') , 'poster' => $poster)); } } @@ -148,7 +158,15 @@ } if (false != $admin_view) { // admins can see all - $text = $tree[$comment_id]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span></div>'; + $com_email = $tree[$comment_id]['obj']->getVar('com_email'); + $text = $tree[$comment_id]['obj']->getVar('com_text'); + $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">'; + $text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br />'; + $text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>'; + if(!empty($com_email)) { + $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>'; + } + $text .= '</div>'; } else { // hide comments that are not active if (XOOPS_COMMENT_ACTIVE != $tree[$comment_id]['obj']->getVar('com_status')) { @@ -166,7 +184,9 @@ $replies = array(); $this->_renderThreadReplies($tree, $comment_id, $replies, ' ', $admin_view); $show_replies = (count($replies) > 0) ? true : false; - $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid') , 'id' => $tree[$comment_id]['obj']->getVar('com_id') , 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid') , 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm') , 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')) , 'replies' => $replies , 'show_replies' => $show_replies)); + // Start edit by voltan + $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid') , 'id' => $tree[$comment_id]['obj']->getVar('com_id') , 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid') , 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm') , 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid'), $tree[$comment_id]['obj']->getVar('com_user'), $tree[$comment_id]['obj']->getVar('com_url')) , 'replies' => $replies , 'show_replies' => $show_replies)); + // End edit by voltan } /** @@ -190,7 +210,9 @@ $title = $thread[$key]['obj']->getVar('com_title'); } $title = (false != $admin_view) ? $title . ' ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title; - $replies[] = array('id' => $key , 'prefix' => $current_prefix , 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm') , 'title' => $title , 'root_id' => $thread[$key]['obj']->getVar('com_rootid') , 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')] , 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid'))); + // Start edit by voltan + $replies[] = array('id' => $key , 'prefix' => $current_prefix , 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm') , 'title' => $title , 'root_id' => $thread[$key]['obj']->getVar('com_rootid') , 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')] , 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid'), $thread[$key]['obj']->getVar('com_user'), $thread[$key]['obj']->getVar('com_url'))); + // End edit by voltan $current_prefix .= $prefix; } if (isset($thread[$key]['child']) && ! empty($thread[$key]['child'])) { @@ -229,7 +251,15 @@ $title = $tree[$comment_id]['obj']->getVar('com_title'); } if (false != $admin_view) { - $text = $tree[$comment_id]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span></div>'; + $com_email = $tree[$comment_id]['obj']->getVar('com_email'); + $text = $tree[$comment_id]['obj']->getVar('com_text'); + $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">'; + $text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br />'; + $text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>'; + if(!empty($com_email)) { + $text .= '<br />' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>'; + } + $text .= '</div>'; } else { // skip this comment if it is not active and continue on processing its child comments instead if (XOOPS_COMMENT_ACTIVE != $tree[$comment_id]['obj']->getVar('com_status')) { @@ -246,7 +276,9 @@ } $replies = array(); $this->_renderNestReplies($tree, $comment_id, $replies, 25, $admin_view); - $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid') , 'id' => $tree[$comment_id]['obj']->getVar('com_id') , 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid') , 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm') , 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')) , 'replies' => $replies)); + // Start edit by voltan + $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid') , 'id' => $tree[$comment_id]['obj']->getVar('com_id') , 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid') , 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm') , 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid'), $tree[$comment_id]['obj']->getVar('com_user'), $tree[$comment_id]['obj']->getVar('com_url')) , 'replies' => $replies)); + // End edit by voltan } /** @@ -268,9 +300,10 @@ } else { $title = $thread[$key]['obj']->getVar('com_title'); } - $text = (false != $admin_view) ? $thread[$key]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_ip') . '</span></div>' : $thread[$key]['obj']->getVar('com_text'); - $replies[] = array('id' => $key , 'prefix' => $prefix , 'pid' => $thread[$key]['obj']->getVar('com_pid') , 'itemid' => $thread[$key]['obj']->getVar('com_itemid') , 'rootid' => $thread[$key]['obj']->getVar('com_rootid') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm') , 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid'))); - + $text = (false != $admin_view) ? $thread[$key]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_ip') . '</span><br />' . _CM_EMAIL . ' :<span style="font-weight: bold;">' . $this->_comments[$i]->getVar('com_email') . '</span></div>' : $thread[$key]['obj']->getVar('com_text'); + // Start edit by voltan + $replies[] = array('id' => $key , 'prefix' => $prefix , 'pid' => $thread[$key]['obj']->getVar('com_pid') , 'itemid' => $thread[$key]['obj']->getVar('com_itemid') , 'rootid' => $thread[$key]['obj']->getVar('com_rootid') , 'title' => $title , 'text' => $text , 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm') , 'date_modified' => formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm') , 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid'), $thread[$key]['obj']->getVar('com_user'), $thread[$key]['obj']->getVar('com_url'))); + // End edit by voltan $prefix = $prefix + 25; } if (isset($thread[$key]['child']) && ! empty($thread[$key]['child'])) { @@ -297,21 +330,32 @@ * @return string * @access private */ - function _getPosterName($poster_id) + // Start edit by voltan + function _getPosterName($poster_id, $poster_user, $poster_website) { $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { $com_poster =& $this->_memberHandler->getUser($poster_id); if (is_object($com_poster)) { $poster['uname'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $poster['id'] . '">' . $com_poster->getVar('uname') . '</a>'; - return $poster; + } - } - $poster['id'] = 0; // to cope with deleted user accounts - $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous']; + } elseif ($poster['id'] == 0 && $poster_user != '') { + $poster['id'] = 0; // to cope with deleted user accounts + if(!empty($poster_website)) { + $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>'; + } else { + $poster['uname'] = $poster_user; + } + } else { + $poster['id'] = 0; // to cope with deleted user accounts + $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous']; + } + return $poster; } - + // End edit by voltan + /** * Get an array with info about the poster * @@ -319,7 +363,8 @@ * @return array * @access private */ - function _getPosterArray($poster_id) + // Start edit by voltan + function _getPosterArray($poster_id, $poster_user, $poster_website) { $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { @@ -334,19 +379,34 @@ $poster['from'] = $com_poster->getVar('user_from'); $poster['postnum'] = $com_poster->getVar('posts'); $poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : ''; - return $poster; } - } - $poster['id'] = 0; // to cope with deleted user accounts - $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous']; - $poster['rank_title'] = ''; - $poster['avatar'] = 'blank.gif'; - $poster['regdate'] = ''; - $poster['from'] = ''; - $poster['postnum'] = 0; - $poster['status'] = ''; + } elseif ($poster['id'] == 0 && $poster_user != '') { + if(!empty($poster_website)) { + $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>'; + } else { + $poster['uname'] = $poster_user; + } + $poster['id'] = 0; // to cope with deleted user accounts + $poster['rank_title'] = ''; + $poster['avatar'] = 'blank.gif'; + $poster['regdate'] = ''; + $poster['from'] = ''; + $poster['postnum'] = 0; + $poster['status'] = ''; + } else { + $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous']; + $poster['id'] = 0; // to cope with deleted user accounts + $poster['rank_title'] = ''; + $poster['avatar'] = 'blank.gif'; + $poster['regdate'] = ''; + $poster['from'] = ''; + $poster['postnum'] = 0; + $poster['status'] = ''; + } + return $poster; } + // End edit by voltan /** * Get the IMG tag for the title icon Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_edit.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_edit.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_edit.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -65,6 +65,11 @@ $com_pid = $comment->getVar('com_pid'); $com_status = $comment->getVar('com_status'); $com_rootid = $comment->getVar('com_rootid'); +// Start Add by voltan +$com_user = $comment->getVar('com_user'); +$com_email = $comment->getVar('com_email'); +$com_url = $comment->getVar('com_url'); +// End Add by voltan if ($xoopsModule->getVar('dirname') != 'system') { include $GLOBALS['xoops']->path('header.php'); Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_form.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_form.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_form.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -45,6 +45,13 @@ } $cform->addElement(new XoopsFormText(_CM_TITLE, 'com_title', 50, 255, $com_title), true); +// Start add by voltan +if (!($com_user == '' && $com_email == '') || !$xoopsUser) { + $cform->addElement(new XoopsFormText(_CM_USER, 'com_user', 50, 60, $com_user), true); + $cform->addElement(new XoopsFormText(_CM_EMAIL, 'com_email', 50, 60, $com_email), true); + $cform->addElement(new XoopsFormText(_CM_URL, 'com_url', 50, 60, $com_url), false); +} +// End add by voltan $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'com_icon', $com_icon); $subject_icons = XoopsLists::getSubjectsList(); foreach ($subject_icons as $iconfile) { Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_new.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_new.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_new.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -72,7 +72,11 @@ $com_pid = 0; $com_rootid = 0; $com_text = ''; - + // Start Add by voltan + $com_user = ''; + $com_email = ''; + $com_url = ''; + // End Add by voltan include_once $GLOBALS['xoops']->path('include/comment_form.php'); include_once $GLOBALS['xoops']->path('footer.php'); } Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_post.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_post.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_post.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -58,6 +58,11 @@ } $op = ''; +$error_message = ''; +$com_user = ''; +$com_email = ''; +$com_url = ''; + if (!empty($_POST)) { if (isset($_POST['com_dopost'])) { $op = 'post'; @@ -76,11 +81,61 @@ xoops_load('XoopsCaptcha'); $xoopsCaptcha = XoopsCaptcha::getInstance(); if (! $xoopsCaptcha->verify()) { - $captcha_message = $xoopsCaptcha->getMessage(); - $op = 'preview'; + $error_message .= $xoopsCaptcha->getMessage() . '<br />'; } + + // Start add by voltan + xoops_load('XoopsUserUtility'); + xoops_loadLanguage('user'); + $myts =& MyTextSanitizer::getInstance(); + + // Check user name + $search_arr = array(" ","\t","\r\n","\r","\n",",",".","'",";",":",")", "(",'"','?','!','{','}','[',']','<','>','/','+','-','_', '\\','*','=','@','#','$','%','^','&'); + $replace_arr = array(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',''); + $com_user = trim($_POST['com_user']); + $com_user = $myts->stripSlashesGPC($com_user); + $com_user = $myts->xoopsCodeDecode($com_user); + $com_user = $myts->filterXss($com_user); + $com_user = strip_tags($com_user); + $com_user = strtolower($com_user); + $com_user = htmlentities($com_user, ENT_COMPAT, 'utf-8'); + $com_user = preg_replace('`\[.*\]`U', ' ', $com_user); + $com_user = preg_replace('`&(amp;)?#?[a-z0-9]+;`i', ' ', $com_user); + $com_user = preg_replace('`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', '\\1', $com_user); + $com_user = str_replace($search_arr, $replace_arr, $com_user); + + // Check Url + if(!empty($_POST['com_url'])) { + $com_url = trim($_POST['com_url']); + $com_url = filter_var($com_url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED); + } + + // Check Email + $com_email = $myts->stripSlashesGPC(trim($_POST['com_email'])); + $com_email = htmlspecialchars(trim($com_email), ENT_QUOTES); + $com_email = filter_var($com_email, FILTER_VALIDATE_EMAIL); + // Invalid email address + if (!checkEmail($com_email)) { + $error_message .= _US_INVALIDMAIL . '<br />'; + } + if (strrpos($com_email, ' ') > 0) { + $error_message .= _US_EMAILNOSPACES . '<br />'; + } + // Check forbidden email address if current operator is not an administrator + if (!$xoopsUser_isAdmin) { + foreach ($xoopsConfigUser['bad_emails'] as $be) { + if (!empty($be) && preg_match('/' . $be . '/i', $com_email)) { + $error_message .= _US_INVALIDMAIL . '<br />'; + break; + } + } + } + if(!empty($error_message)) { + $op = 'preview'; + } + // End add by voltan } - + $com_mode = isset($_POST['com_mode']) ? htmlspecialchars(trim($_POST['com_mode']), ENT_QUOTES) : 'flat'; $com_order = isset($_POST['com_order']) ? intval($_POST['com_order']) : XOOPS_COMMENT_OLD1ST; $com_itemid = isset($_POST['com_itemid']) ? intval($_POST['com_itemid']) : 0; @@ -124,8 +179,8 @@ $com_text = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['com_text'])); if ($xoopsModule->getVar('dirname') != 'system') { include_once $GLOBALS['xoops']->path('header.php'); - if (!empty($captcha_message)) { - xoops_error($captcha_message); + if (!empty($error_message)) { + xoops_error($error_message); } echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"> <tr><td class="head">' . $com_title . '</td></tr> @@ -147,6 +202,9 @@ case "post": $doimage = 1; $comment_handler =& xoops_gethandler('comment'); + // Start add by voltan + $myts =& MyTextSanitizer::getInstance(); + // Edit add by voltan $add_userpost = false; $call_approvefunc = false; $call_updatefunc = false; @@ -276,6 +334,11 @@ $comment->setVar('com_icon', $com_icon); $comment->setVar('com_modified', time()); $comment->setVar('com_modid', $com_modid); + // Start add by voltan + $comment->setVar('com_user', $com_user); + $comment->setVar('com_email', $com_email); + $comment->setVar('com_url', $com_url); + // End add by voltan if (isset($extra_params)) { $comment->setVar('com_exparams', $extra_params); } @@ -409,5 +472,4 @@ redirect_header(XOOPS_URL . '/', 1, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); break; } - ?> \ No newline at end of file Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_reply.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_reply.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_reply.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -47,7 +47,15 @@ } $comment_handler =& xoops_gethandler('comment'); $comment =& $comment_handler->get($com_id); -$r_name = XoopsUser::getUnameFromId($comment->getVar('com_uid')); + +// Start edit by voltan +if($comment->getVar('com_uid') == 0 && $comment->getVar('com_user') != '') { + $r_name = $comment->getVar('com_user'); +} else { + $r_name = XoopsUser::getUnameFromId($comment->getVar('com_uid')); +} +// End edit by voltan + $r_text = _CM_POSTER . ': <strong>' . $r_name . '</strong> ' . _CM_POSTED . ': <strong>' . formatTimestamp($comment->getVar('com_created')) . '</strong><br /><br />' . $comment->getVar('com_text'); $com_title = $comment->getVar('com_title', 'E'); if (!preg_match("/^" . _RE . "/i", $com_title)) { @@ -64,7 +72,12 @@ $com_icon = ''; $com_rootid = $comment->getVar('com_rootid'); $com_itemid = $comment->getVar('com_itemid'); - +// Start Add by voltan +$com_user = ''; +$com_email = ''; +$com_url = ''; +// End Add by voltan + include_once $GLOBALS['xoops']->path('header.php'); echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"> <tr><td class="head">' . $comment->getVar('com_title') . '</td></tr> Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_view.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_view.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/include/comment_view.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -199,6 +199,95 @@ </tr> </table> </form>'; + + // Start add by voltan + if (! empty($xoopsModuleConfig['com_anonpost']) || is_object($xoopsUser)) { + + xoops_load('XoopsLists'); + xoops_load('XoopsFormLoader'); + + if(file_exists($GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/comment_fast.php'))) { + include_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/comment_fast.php'); + } + if (isset($com_replytitle)) { + $myts =& MyTextSanitizer::getInstance(); + $com_title = $myts->htmlSpecialChars($com_replytitle); + if (!preg_match("/^" . _RE . "/i", $com_title)) { + $com_title = _RE . " " . xoops_substr($com_title, 0, 56); + } + } else { + $com_title = ''; + } + + // set form + $cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentfastform", 'comment_post.php', 'post', true); + $cform->addElement(new XoopsFormElementTray('')); + if (isset($xoopsModuleConfig['com_rule'])) { + include_once $GLOBALS['xoops']->path('include/comment_constants.php'); + switch ($xoopsModuleConfig['com_rule']) { + case XOOPS_COMMENT_APPROVEALL: + $rule_text = _CM_COMAPPROVEALL; + break; + case XOOPS_COMMENT_APPROVEUSER: + $rule_text = _CM_COMAPPROVEUSER; + break; + case XOOPS_COMMENT_APPROVEADMIN: + default: + $rule_text = _CM_COMAPPROVEADMIN; + break; + } + $cform->addElement(new XoopsFormLabel(_CM_COMRULES, $rule_text)); + } + $cform->addElement(new XoopsFormText(_CM_TITLE, 'com_title', 50, 255, $com_title), true); + if (!$xoopsUser) { + $cform->addElement(new XoopsFormText(_CM_USER, 'com_user', 50, 60, ''), true); + $cform->addElement(new XoopsFormText(_CM_EMAIL, 'com_email', 50, 60, ''), true); + $cform->addElement(new XoopsFormText(_CM_URL, 'com_url', 50, 60, ''), false); + } + $cform->addElement(new XoopsFormTextArea(_CM_MESSAGE, 'com_text', '', 10, 65), true); + if (!$xoopsUser) { + $cform->addElement(new XoopsFormCaptcha()); + } + + $cform->addElement(new XoopsFormHidden('com_id', 0)); + $cform->addElement(new XoopsFormHidden('com_pid', 0)); + $cform->addElement(new XoopsFormHidden('com_rootid', 0)); + $cform->addElement(new XoopsFormHidden('com_order', 0)); + $cform->addElement(new XoopsFormHidden('com_itemid', $com_itemid)); + $cform->addElement(new XoopsFormHidden('com_mode', $com_mode)); + $cform->addElement(new xoopsFormHidden('dohtml', 0)); + $cform->addElement(new xoopsFormHidden('dobr', 0)); + $cform->addElement(new xoopsFormHidden('dosmiley', 0)); + $cform->addElement(new xoopsFormHidden('doxcode', 0)); + + // add module specific extra params + if ('system' != $xoopsModule->getVar('dirname')) { + $comment_config = $xoopsModule->getInfo('comments'); + if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) { + $myts =& MyTextSanitizer::getInstance(); + foreach ($comment_config['extraParams'] as $extra_param) { + // This routine is included from forms accessed via both GET and POST + if (isset($_POST[$extra_param])) { + $hidden_value = $myts->stripSlashesGPC($_POST[$extra_param]); + } else if (isset($_GET[$extra_param])) { + $hidden_value = $myts->stripSlashesGPC($_GET[$extra_param]); + } else { + $hidden_value = ''; + } + $cform->addElement(new XoopsFormHidden($extra_param, $hidden_value)); + } + } + } + + $button_tray = new XoopsFormElementTray('', ' '); + $button_tray->addElement(new XoopsFormButton('', 'com_dopost', _CM_POSTCOMMENT, 'submit')); + $cform->addElement($button_tray); + $xoopsTpl->assign('commentform', $cform->render()); + } else { + $xoopsTpl->assign('commentform', ''); + } + // End add by voltan + $xoopsTpl->assign(array( 'commentsnav' => $navbar , 'editcomment_link' => 'comment_edit.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra , Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/install/sql/mysql.structure.sql =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/install/sql/mysql.structure.sql 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/install/sql/mysql.structure.sql 2013-01-23 20:57:13 UTC (rev 10882) @@ -96,34 +96,39 @@ # Table structure for table `comments` # -CREATE TABLE xoopscomments ( - com_id mediumint(8) unsigned NOT NULL auto_increment, - com_pid mediumint(8) unsigned NOT NULL default '0', - com_rootid mediumint(8) unsigned NOT NULL default '0', - com_modid smallint(5) unsigned NOT NULL default '0', - com_itemid mediumint(8) unsigned NOT NULL default '0', - com_icon varchar(25) NOT NULL default '', - com_created int(10) unsigned NOT NULL default '0', - com_modified int(10) unsigned NOT NULL default '0', - com_uid mediumint(8) unsigned NOT NULL default '0', - com_ip varchar(15) NOT NULL default '', - com_title varchar(255) NOT NULL default '', - com_text text, - com_sig tinyint(1) unsigned NOT NULL default '0', - com_status tinyint(1) unsigned NOT NULL default '0', - com_exparams varchar(255) NOT NULL default '', - dohtml tinyint(1) unsigned NOT NULL default '0', - dosmiley tinyint(1) unsigned NOT NULL default '0', - doxcode tinyint(1) unsigned NOT NULL default '0', - doimage tinyint(1) unsigned NOT NULL default '0', - dobr tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (com_id), - KEY com_pid (com_pid), - KEY com_itemid (com_itemid), - KEY com_uid (com_uid), - KEY com_title (com_title(40)), - KEY com_status (com_status) -) ENGINE=MyISAM; +CREATE `xoopscomments` ( + `com_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `com_pid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `com_rootid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `com_modid` smallint(5) unsigned NOT NULL DEFAULT '0', + `com_itemid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `com_icon` varchar(25) NOT NULL DEFAULT '', + `com_created` int(10) unsigned NOT NULL DEFAULT '0', + `com_modified` int(10) unsigned NOT NULL DEFAULT '0', + `com_uid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `com_user` varchar(60) NOT NULL, + `com_email` varchar(60) NOT NULL, + `com_url` varchar(60) NOT NULL, + `com_ip` varchar(15) NOT NULL DEFAULT '', + `com_title` varchar(255) NOT NULL DEFAULT '', + `com_text` text, + `com_sig` tinyint(1) unsigned NOT NULL DEFAULT '0', + `com_status` tinyint(1) unsigned NOT NULL DEFAULT '0', + `com_exparams` varchar(255) NOT NULL DEFAULT '', + `dohtml` tinyint(1) unsigned NOT NULL DEFAULT '0', + `dosmiley` tinyint(1) unsigned NOT NULL DEFAULT '0', + `doxcode` tinyint(1) unsigned NOT NULL DEFAULT '0', + `doimage` tinyint(1) unsigned NOT NULL DEFAULT '0', + `dobr` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`com_id`), + KEY `com_pid` (`com_pid`), + KEY `com_itemid` (`com_itemid`), + KEY `com_uid` (`com_uid`), + KEY `com_title` (`com_title`(40)), + KEY `com_status` (`com_status`), + KEY `com_user` (`com_user`), + KEY `com_email` (`com_email`) +) ENGINE=MyISAM; # -------------------------------------------------------- # RMV-NOTIFY Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/kernel/comment.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/kernel/comment.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/kernel/comment.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -44,6 +44,11 @@ $this->initVar('com_created', XOBJ_DTYPE_INT, 0, false); $this->initVar('com_modified', XOBJ_DTYPE_INT, 0, false); $this->initVar('com_uid', XOBJ_DTYPE_INT, 0, true); + // Start Add by voltan + $this->initVar('com_user', XOBJ_DTYPE_TXTBOX, null, false, 60); + $this->initVar('com_email', XOBJ_DTYPE_TXTBOX, null, false, 60); + $this->initVar('com_url', XOBJ_DTYPE_TXTBOX, null, false, 60); + // End Add by voltan $this->initVar('com_ip', XOBJ_DTYPE_OTHER, null, false); $this->initVar('com_sig', XOBJ_DTYPE_INT, 0, false); $this->initVar('com_itemid', XOBJ_DTYPE_INT, 0, false); @@ -135,6 +140,30 @@ { return $this->getVar('com_uid', $format); } + + // Start Add by voltan + /** + * Returns Class Base Variable com_user + */ + function com_user($format = '') + { + return $this->getVar('com_user', $format); + } + /** + * Returns Class Base Variable com_email + */ + function com_email($format = '') + { + return $this->getVar('com_email', $format); + } + /** + * Returns Class Base Variable com_url + */ + function com_url($format = '') + { + return $this->getVar('com_url', $format); + } + // End Add by voltan /** * Returns Class Base Variable com_ip @@ -315,12 +344,14 @@ foreach($comment->cleanVars as $k => $v) { ${$k} = $v; } + // Start edit by voltan if ($comment->isNew()) { $com_id = $this->db->genId('xoopscomments_com_id_seq'); - $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, com_exparams, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, %s, %s, %s, %u, %u, %u, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u)", $this->db->prefix('xoopscomments'), $com_id, $com_pid, $com_modid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr); + $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_user, com_email, com_url, com_ip, com_sig, com_itemid, com_rootid, com_status, com_exparams, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, %s, %s, %s, %u, %u, %u, %s, %s, %s, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u)", $this->db->prefix('xoopscomments'), $com_id, $com_pid, $com_modid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_user), $this->db->quoteString($com_email), $this->db->quoteString($com_url), $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr); } else { - $sql = sprintf("UPDATE %s SET com_pid = %u, com_icon = %s, com_title = %s, com_text = %s, com_created = %u, com_modified = %u, com_uid = %u, com_ip = %s, com_sig = %u, com_itemid = %u, com_rootid = %u, com_status = %u, com_exparams = %s, dohtml = %u, dosmiley = %u, doxcode = %u, doimage = %u, dobr = %u WHERE com_id = %u", $this->db->prefix('xoopscomments'), $com_pid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr, $com_id); + $sql = sprintf("UPDATE %s SET com_pid = %u, com_icon = %s, com_title = %s, com_text = %s, com_created = %u, com_modified = %u, com_uid = %u, com_user = %s, com_email = %s, com_url = %s, com_ip = %s, com_sig = %u, com_itemid = %u, com_rootid = %u, com_status = %u, com_exparams = %s, dohtml = %u, dosmiley = %u, doxcode = %u, doimage = %u, dobr = %u WHERE com_id = %u", $this->db->prefix('xoopscomments'), $com_pid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_user), $this->db->quoteString($com_email), $this->db->quoteString($com_url), $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr, $com_id); } + // End edit by voltan if (!$result = $this->db->query($sql)) { return false; } Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/language/english/comment.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/language/english/comment.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/language/english/comment.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -3,42 +3,46 @@ // _LANGCODE: en // _CHARSET : UTF-8 // Translator: XOOPS Translation Team -define('_CM_TITLE','Title'); -define('_CM_MESSAGE','Message'); -define('_CM_DOSMILEY','Enable Smiley Icons'); -define('_CM_DOHTML','Enable HTML Tags'); -define('_CM_DOAUTOWRAP','Auto wrap lines'); -define('_CM_DOXCODE','Enable XOOPS Codes'); -define('_CM_REFRESH','Refresh'); -define('_CM_PENDING','Pending'); -define('_CM_HIDDEN','Hidden'); -define('_CM_ACTIVE','Active'); -define('_CM_STATUS','Status'); -define('_CM_POSTCOMMENT','Publish Comment'); -define('_CM_REPLIES','Replies'); -define('_CM_PARENT','Parent'); -define('_CM_TOP','Top'); -define('_CM_BOTTOM','Bottom'); -define('_CM_ONLINE','Online!'); -define('_CM_POSTED','Published'); // Posted date -define('_CM_UPDATED','Updated'); -define('_CM_THREAD','Thread'); -define('_CM_POSTER','Author'); -define('_CM_JOINED','Joined'); -define('_CM_POSTS','Comments'); -define('_CM_FROM','From'); -define('_CM_COMDELETED','Comment(s) deleted.'); -define('_CM_COMDELETENG','Could not delete comment.'); -define('_CM_DELETESELECT','Delete all its child comments?'); -define('_CM_DELETEONE','No, delete only this comment'); -define('_CM_DELETEALL','Yes, delete all'); -define('_CM_THANKSPOST','Thanks for your comments!'); -define('_CM_NOTICE',"The comments are owned by the author. We aren't responsible for their content."); -define('_CM_COMRULES','Comment Rules'); -define('_CM_COMAPPROVEALL','Comments are always approved'); -define('_CM_COMAPPROVEUSER','Comments by registered users are always approved'); -define('_CM_COMAPPROVEADMIN','All comments need to be approved by administrator'); -define('_CM_COMANONPOST','Allow anonymous comments?'); -define('_CM_COMNOCOM','Disable comments'); +define('_CM_TITLE', 'Title'); +define('_CM_MESSAGE', 'Message'); +define('_CM_DOSMILEY', 'Enable Smiley Icons'); +define('_CM_DOHTML', 'Enable HTML Tags'); +define('_CM_DOAUTOWRAP', 'Auto wrap lines'); +define('_CM_DOXCODE', 'Enable XOOPS Codes'); +define('_CM_REFRESH', 'Refresh'); +define('_CM_PENDING', 'Pending'); +define('_CM_HIDDEN', 'Hidden'); +define('_CM_ACTIVE', 'Active'); +define('_CM_STATUS', 'Status'); +define('_CM_POSTCOMMENT', 'Publish Comment'); +define('_CM_REPLIES', 'Replies'); +define('_CM_PARENT', 'Parent'); +define('_CM_TOP', 'Top'); +define('_CM_BOTTOM', 'Bottom'); +define('_CM_ONLINE', 'Online!'); +define('_CM_POSTED', 'Published'); // Posted date +define('_CM_UPDATED', 'Updated'); +define('_CM_THREAD', 'Thread'); +define('_CM_POSTER', 'Author'); +define('_CM_JOINED', 'Joined'); +define('_CM_POSTS', 'Comments'); +define('_CM_FROM', 'From'); +define('_CM_COMDELETED', 'Comment(s) deleted.'); +define('_CM_COMDELETENG', 'Could not delete comment.'); +define('_CM_DELETESELECT', 'Delete all its child comments?'); +define('_CM_DELETEONE', 'No, delete only this comment'); +define('_CM_DELETEALL', 'Yes, delete all'); +define('_CM_THANKSPOST', 'Thanks for your comments!'); +define('_CM_NOTICE', "The comments are owned by the author. We aren't responsible for their content."); +define('_CM_COMRULES', 'Comment Rules'); +define('_CM_COMAPPROVEALL', 'Comments are always approved'); +define('_CM_COMAPPROVEUSER', 'Comments by registered users are always approved'); +define('_CM_COMAPPROVEADMIN', 'All comments need to be approved by administrator'); +define('_CM_COMANONPOST', 'Allow anonymous comments?'); +define('_CM_COMNOCOM', 'Disable comments'); +define('_CM_USER', 'Name'); +define('_CM_EMAIL', 'Email'); +define('_CM_URL', 'Website'); + ?> \ No newline at end of file Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/admin/comments/main.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/admin/comments/main.php 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/admin/comments/main.php 2013-01-23 20:57:13 UTC (rev 10882) @@ -280,13 +280,20 @@ { $com_id = $comments_arr[$i]->getVar('com_id'); $comments_poster_uname = $xoopsConfig['anonymous']; + // Start edit by voltan if ($comments_arr[$i]->getVar('com_uid') > 0) { $poster =& $member_handler->getUser($comments_arr[$i]->getVar('com_uid')); if (is_object($poster)) { $comments_poster_uname = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$comments_arr[$i]->getVar('com_uid').'">'.$poster->getVar('uname').'</a>'; } - } - + } elseif($comments_arr[$i]->getVar('com_uid') == 0 && $comments_arr[$i]->getVar('com_user') != '') { + if($comments_arr[$i]->getVar('com_url') != '') { + $comments_poster_uname = '<div class="pad2 marg2"><a href="' . $comments_arr[$i]->getVar('com_url') . '">' . $comments_arr[$i]->getVar('com_user') . '</a> ( <a href="mailto:' . $comments_arr[$i]->getVar('com_email') . '">' . $comments_arr[$i]->getVar('com_email') . '</a> ) ' . '</div>'; + } else { + $comments_poster_uname = '<div class="pad2 marg2">' . $comments_arr[$i]->getVar('com_user') . ' ( <a href="mailto:' . $comments_arr[$i]->getVar('com_email') . '">' . $comments_arr[$i]->getVar('com_email') . '</a> ) ' . '</div>'; + } + } + // End edit by voltan $comments_icon = ($comments_arr[$i]->getVar('com_icon') == '') ? '/images/icons/no_posticon.gif' : '/images/subject/' . htmlspecialchars( $comments_arr[$i]->getVar('com_icon'), ENT_QUOTES ); $comments_icon = '<img src="' . XOOPS_URL . $comments_icon . '" alt="" />'; Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/admin/system_comments.html =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/admin/system_comments.html 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/admin/system_comments.html 2013-01-23 20:57:13 UTC (rev 10882) @@ -1,69 +1,69 @@ -<{includeq file="db:system_header.html"}> -<!--Comments--> -<{if $form}> -<div class="spacer"><{$form}></div> -<{else}> -<div class="floatleft"><{$form_sort}></div> -<div class="floatright"> - <div class="xo-buttons"> - <button class="ui-corner-all" onclick="self.location.href='admin.php?fct=comments&op=comments_form_purge'"> - <img src="<{xoAdminIcons clear.png}>" alt="<{$smarty.const._AM_SYSTEM_COMMENTS_FORM_PURGE}>" /> - <{$smarty.const._AM_SYSTEM_COMMENTS_FORM_PURGE}> - </button> - </div> -</div> -<div class="clear"></div> -<table id="xo-comment-sorter" cellspacing="1" class="outer tablesorter"> - <thead> - <tr> - <th class="txtcenter width5"><input name='allbox' id='allbox' onclick='xoopsCheckAll("commentslist", "allbox");' type='checkbox' value='Check All' /></th> - <th class="txtcenter width5"></th> - <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_TITLE}></th> - <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_POSTED}></th> - <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_IP}></th> - <th class="txtcenter"><{$smarty.const._DATE}></th> - <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_MODULE}></th> - <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_STATUS}></th> - <th class="txtcenter width10"><{$smarty.const._AM_SYSTEM_COMMENTS_ACTION}></th> - </tr> - </thead> - <form name='commentslist' id='commentslist' action='<{$php_selft}>' method="post"> - <tbody> - <{foreach item=comments from=$comments}> - <tr class="<{cycle values='even,odd'}> alignmiddle"> - <td class="txtcenter"><input type='checkbox' name='commentslist_id[]' id='commentslist_id[]' value='<{$comments.comments_id}>'/></td> - <td class="txtcenter"><{$comments.comments_icon}></td> - <td class="txtcenter"><{$comments.comments_title}></td> - <td class="txtcenter"><{$comments.comments_poster}></td> - <td class="txtcenter"><{$comments.comments_ip}></td> - <td class="txtcenter"><{$comments.comments_date}></td> - <td class="txtcenter"><{$comments.comments_modid}></td> - <td class="txtcenter"><{$comments.comments_status}></td> - <td class="xo-actions txtcenter"> - <img class="cursorpointer" onclick="display_dialog('<{$comments.comments_id}>', true, true, 'slide', 'slide', 300, 500);" src="<{xoAdminIcons display.png}>" alt="<{$smarty.const._AM_SYSTEM_COMMENTS_VIEW}>" title="<{$smarty.const._AM_SYSTEM_COMMENTS_VIEW}>" /> - <a href="admin/comments/comment_edit.php?com_id=<{$comments.comments_id}>" title="<{$smarty.const._EDIT}>"> - <img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._EDIT}>"> - </a> - <a href="admin/comments/comment_delete.php?com_id=<{$comments.comments_id}>" title="<{$smarty.const._DELETE}>"> - <img src="<{xoAdminIcons delete.png}>" alt="<{$smarty.const._DELETE}>"> - </a> - </td> - </tr> - <{/foreach}> - </tbody> - <tr> - <td><input type='submit' name='<{$smarty.const._DELETE}>' value='<{$smarty.const._DELETE}>' /></td> - <td colspan="7"> </td> - </tr> - </form> -</table> -<{foreach item=comments from=$comments_popup}> -<!--Pop-pup--> -<div id='dialog<{$comments.comments_id}>' title='<{$comments.comments_icon}> <{$comments.comments_title}>' style='display:none;'> - <img src="<{xoAdminIcons comment.png}>" alt="comments" title="comments" class="xo-commentsimg" /> - <p><{$comments.comments_text}></p> -</div> -<{/foreach}> -<!--Pop-pup--> -<div class="txtright"><{$nav}></div> -<{/if}> +<{includeq file="db:system_header.html"}> +<!--Comments--> +<{if $form}> +<div class="spacer"><{$form}></div> +<{else}> +<div class="floatleft"><{$form_sort}></div> +<div class="floatright"> + <div class="xo-buttons"> + <button class="ui-corner-all" onclick="self.location.href='admin.php?fct=comments&op=comments_form_purge'"> + <img src="<{xoAdminIcons clear.png}>" alt="<{$smarty.const._AM_SYSTEM_COMMENTS_FORM_PURGE}>" /> + <{$smarty.const._AM_SYSTEM_COMMENTS_FORM_PURGE}> + </button> + </div> +</div> +<div class="clear"></div> +<table id="xo-comment-sorter" cellspacing="1" class="outer tablesorter"> + <thead> + <tr> + <th class="txtcenter width5"><input name='allbox' id='allbox' onclick='xoopsCheckAll("commentslist", "allbox");' type='checkbox' value='Check All' /></th> + <th class="txtcenter width5"></th> + <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_TITLE}></th> + <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_POSTED}></th> + <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_IP}></th> + <th class="txtcenter"><{$smarty.const._DATE}></th> + <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_MODULE}></th> + <th class="txtcenter"><{$smarty.const._AM_SYSTEM_COMMENTS_STATUS}></th> + <th class="txtcenter width10"><{$smarty.const._AM_SYSTEM_COMMENTS_ACTION}></th> + </tr> + </thead> + <form name='commentslist' id='commentslist' action='<{$php_selft}>' method="post"> + <tbody> + <{foreach item=comments from=$comments}> + <tr class="<{cycle values='even,odd'}> alignmiddle"> + <td class="txtcenter"><input type='checkbox' name='commentslist_id[]' id='commentslist_id[]' value='<{$comments.comments_id}>'/></td> + <td class="txtcenter"><{$comments.comments_icon}></td> + <td><{$comments.comments_title}></td> + <td class="txtcenter"><{$comments.comments_poster}></td> + <td class="txtcenter"><{$comments.comments_ip}></td> + <td class="txtcenter"><{$comments.comments_date}></td> + <td class="txtcenter"><{$comments.comments_modid}></td> + <td class="txtcenter"><{$comments.comments_status}></td> + <td class="xo-actions txtcenter"> + <img class="cursorpointer" onclick="display_dialog('<{$comments.comments_id}>', true, true, 'slide', 'slide', 300, 500);" src="<{xoAdminIcons display.png}>" alt="<{$smarty.const._AM_SYSTEM_COMMENTS_VIEW}>" title="<{$smarty.const._AM_SYSTEM_COMMENTS_VIEW}>" /> + <a href="admin/comments/comment_edit.php?com_id=<{$comments.comments_id}>" title="<{$smarty.const._EDIT}>"> + <img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._EDIT}>"> + </a> + <a href="admin/comments/comment_delete.php?com_id=<{$comments.comments_id}>" title="<{$smarty.const._DELETE}>"> + <img src="<{xoAdminIcons delete.png}>" alt="<{$smarty.const._DELETE}>"> + </a> + </td> + </tr> + <{/foreach}> + </tbody> + <tr> + <td><input type='submit' name='<{$smarty.const._DELETE}>' value='<{$smarty.const._DELETE}>' /></td> + <td colspan="7"> </td> + </tr> + </form> +</table> +<{foreach item=comments from=$comments_popup}> +<!--Pop-pup--> +<div id='dialog<{$comments.comments_id}>' title='<{$comments.comments_icon}> <{$comments.comments_title}>' style='display:none;'> + <img src="<{xoAdminIcons comment.png}>" alt="comments" title="comments" class="xo-commentsimg" /> + <p><{$comments.comments_text}></p> +</div> +<{/foreach}> +<!--Pop-pup--> +<div class="txtright"><{$nav}></div> +<{/if}> Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_flat.html =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_flat.html 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_flat.html 2013-01-23 20:57:13 UTC (rev 10882) @@ -1,9 +1,10 @@ -<table class="outer" cellpadding="5" cellspacing="1"> - <tr> - <th class="width20"><{$lang_poster}></th> - <th><{$lang_thread}></th> - </tr> - <{foreach item=comment from=$comments}> - <{include file="db:system_comment.html" comment=$comment}> - <{/foreach}> -</table> \ No newline at end of file +<table class="outer" cellpadding="5" cellspacing="1"> + <tr> + <th class="width20"><{$lang_poster}></th> + <th><{$lang_thread}></th> + </tr> + <{foreach item=comment from=$comments}> + <{include file="db:system_comment.html" comment=$comment}> + <{/foreach}> +</table> +<{if $commentform}><div class="commentform"><{$commentform}></div><{/if}> \ No newline at end of file Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_nest.html =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_nest.html 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_nest.html 2013-01-23 20:57:13 UTC (rev 10882) @@ -1,30 +1,31 @@ -<{section name=i loop=$comments}> -<br /> -<table cellspacing="1" class="outer"> - <tr> - <th class="width20"><{$lang_poster}></th> - <th><{$lang_thread}></th> - </tr> - <{include file="db:system_comment.html" comment=$comments[i]}> -</table> - -<!-- start comment replies --> -<{foreach item=reply from=$comments[i].replies}> -<br /> -<table class="bnone collapse"> - <tr> - <td width="<{$reply.prefix}>"></td> - <td> - <table class="outer" cellspacing="1"> - <tr> - <th class="width20"><{$lang_poster}></th> - <th><{$lang_thread}></th> - </tr> - <{include file="db:system_comment.html" comment=$reply}> - </table> - </td> - </tr> -</table> -<{/foreach}> -<!-- end comment tree --> -<{/section}> \ No newline at end of file +<{section name=i loop=$comments}> +<br /> +<table cellspacing="1" class="outer"> + <tr> + <th class="width20"><{$lang_poster}></th> + <th><{$lang_thread}></th> + </tr> + <{include file="db:system_comment.html" comment=$comments[i]}> +</table> + +<!-- start comment replies --> +<{foreach item=reply from=$comments[i].replies}> +<br /> +<table class="bnone collapse"> + <tr> + <td width="<{$reply.prefix}>"></td> + <td> + <table class="outer" cellspacing="1"> + <tr> + <th class="width20"><{$lang_poster}></th> + <th><{$lang_thread}></th> + </tr> + <{include file="db:system_comment.html" comment=$reply}> + </table> + </td> + </tr> +</table> +<{/foreach}> +<!-- end comment tree --> +<{/section}> +<{if $commentform}><div class="commentform"><{$commentform}></div><{/if}> \ No newline at end of file Modified: XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_thread.html =================================================================== --- XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_thread.html 2013-01-23 19:53:54 UTC (rev 10881) +++ XoopsCore/branches/2.5.x/2.5.6/htdocs/modules/system/templates/system_comments_thread.html 2013-01-23 20:57:13 UTC (rev 10882) @@ -1,37 +1,38 @@ -<{section name=i loop=$comments}> -<br /> -<table cellspacing="1" class="outer"> - <tr> - <th class="width20"><{$lang_poster}></th> - <th><{$lang_thread}></th> - </tr> - <{include file="db:system_comment.html" comment=$comments[i]}> -</table> - -<{if $show_threadnav == true}> -<div class="txtleft marg3 pad5"> -<a href="<{$comment_url}>" title="<{$lang_top}>"><{$lang_top}></a> | <a href="<{$comment_url}>&com_id=<{$comments[i].pid}>&com_rootid=<{$comments[i].rootid}>#newscomment<{$comments[i].pid}>"><{$lang_parent}></a> -</div> -<{/if}> - -<{if $comments[i].show_replies == true}> -<!-- start comment tree --> -<br /> -<table cellspacing="1" class="outer"> - <tr> - <th class="width50"><{$lang_subject}></th> - <th class="width20 txtcenter"><{$lang_poster}></th> - <th class="txtright"><{$lang_posted}></th> - </tr> - <{foreach item=reply from=$comments[i].replies}> - <tr> - <td class="even"><{$reply.prefix}> <a href="<{$comment_url}>&com_id=<{$reply.id}>&com_rootid=<{$reply.root_id}>" title=""><{$reply.title}></a></td> - <td class="odd txtcenter"><{$reply.poster.uname}></td> - <td class="even right"><{$reply.date_posted}></td> - </tr> - <{/foreach}> -</table> -<!-- end comment tree --> -<{/if}> - -<{/section}> \ No newline at end of file +<{section name=i loop=$comments}> +<br /> +<table cellspacing="1" class="outer"> + <tr> + <th class="width20"><{$lang_poster}></th> + <th><{$lang_thread}></th> + </tr> + <{include file="db:system_comment.html" comment=$comments[i]}> +</table> + +<{if $show_threadnav == true}> +<div class="txtleft marg3 pad5"> +<a href="<{$comment_url}>" title="<{$lang_top}>"><{$lang_top}></a> | <a href="<{$comment_url}>&com_id=<{$comments[i].pid}>&com_rootid=<{$comments[i].rootid}>#newscomment<{$comments[i].pid}>"><{$lang_parent}></a> +</div> +<{/if}> + +<{if $comments[i].show_replies == true}> +<!-- start comment tree --> +<br /> +<table cellspacing="1" class="outer"> + <tr> + <th class="width50"><{$lang_subject}></th> + <th class="width20 txtcenter"><{$lang_poster}></th> + <th class="txtright"><{$lang_posted}></th> + </tr> + <{foreach item=reply from=$comments[i].replies}> + <tr> + <td class="even"><{$reply... [truncated message content] |