From: <du...@us...> - 2012-12-24 00:06:44
|
Revision: 10533 http://sourceforge.net/p/xoops/svn/10533 Author: dugris Date: 2012-12-24 00:06:38 +0000 (Mon, 24 Dec 2012) Log Message: ----------- Remove comments and notifications from system module Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comment.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_flat.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_nest.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_thread.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2012-12-23 20:28:55 UTC (rev 10532) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2012-12-24 00:06:38 UTC (rev 10533) @@ -388,121 +388,6 @@ return $block; } - -function b_system_comments_show($options) -{ - $xoops = Xoops::getInstance(); - $block = array(); - include_once XOOPS_ROOT_PATH . '/include/comment_constants.php'; - $comment_handler = $xoops->getHandlerComment(); - $criteria = new CriteriaCompo(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); - $criteria->setLimit(intval($options[0])); - $criteria->setSort('com_created'); - $criteria->setOrder('DESC'); - - // Check modules permissions - $moduleperm_handler = $xoops->getHandlerGroupperm(); - $gperm_groupid = $xoops->isUser() ? $xoops->user->getGroups() : array(XOOPS_GROUP_ANONYMOUS); - $criteria1 = new CriteriaCompo(new Criteria('gperm_name', 'module_read', '=')); - $criteria1->add(new Criteria('gperm_groupid', '(' . implode(',', $gperm_groupid) . ')', 'IN')); - $perms = $moduleperm_handler->getObjects($criteria1, true); - $modIds = array(); - foreach ($perms as $item) { - $modIds[] = $item->getVar('gperm_itemid'); - } - if (count($modIds) > 0) { - $modIds = array_unique($modIds); - $criteria->add(new Criteria('com_modid', '(' . implode(',', $modIds) . ')', 'IN')); - } - // Check modules permissions - - $comments = $comment_handler->getObjects($criteria, true); - $member_handler = $xoops->getHandlerMember(); - $module_handler = $xoops->getHandlerModule(); - $modules = $module_handler->getObjectsArray(new Criteria('hascomments', 1), true); - $comment_config = array(); - foreach (array_keys($comments) as $i) { - $mid = $comments[$i]->getVar('com_modid'); - $com['module'] = '<a href="' . XOOPS_URL . '/modules/' . $modules[$mid]->getVar('dirname') . '/">' . $modules[$mid]->getVar('name') . '</a>'; - if (!isset($comment_config[$mid])) { - $comment_config[$mid] = $modules[$mid]->getInfo('comments'); - } - $com['id'] = $i; - $com['title'] = '<a href="' . XOOPS_URL . '/modules/' . $modules[$mid]->getVar('dirname') . '/' . $comment_config[$mid]['pageName'] . '?' . $comment_config[$mid]['itemName'] . '=' . $comments[$i]->getVar('com_itemid') . '&com_id=' . $i . '&com_rootid=' . $comments[$i]->getVar('com_rootid') . '&' . htmlspecialchars($comments[$i]->getVar('com_exparams')) . '#comment' . $i . '">' . $comments[$i]->getVar('com_title') . '</a>'; - $com['icon'] = htmlspecialchars($comments[$i]->getVar('com_icon'), ENT_QUOTES); - $com['icon'] = ($com['icon'] != '') ? $com['icon'] : 'icon1.gif'; - $com['time'] = XoopsLocal::formatTimestamp($comments[$i]->getVar('com_created'), 'm'); - if ($comments[$i]->getVar('com_uid') > 0) { - $poster = $member_handler->getUser($comments[$i]->getVar('com_uid')); - if (is_object($poster)) { - $com['poster'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $comments[$i]->getVar('com_uid') . '">' . $poster->getVar('uname') . '</a>'; - } else { - $com['poster'] = $xoops->getConfig('anonymous'); - } - } else { - $com['poster'] = $xoops->getConfig('anonymous'); - } - $block['comments'][] = $com; - unset($com); - } - return $block; -} - -// RMV-NOTIFY -function b_system_notification_show() -{ - include_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; - $xoops = Xoops::getInstance(); - $xoops->loadLanguage('notification'); - // Notification must be enabled, and user must be logged in - if (!$xoops->isUser() || !notificationEnabled('block')) { - return false; // do not display block - } - $notification_handler = $xoops->getHandlerNotification(); - // Now build the a nested associative array of info to pass - // to the block template. - $block = array(); - $categories = notificationSubscribableCategoryInfo(); - if (empty($categories)) { - return false; - } - foreach ($categories as $category) { - $section['name'] = $category['name']; - $section['title'] = $category['title']; - $section['description'] = $category['description']; - $section['itemid'] = $category['item_id']; - $section['events'] = array(); - $subscribed_events = $notification_handler->getSubscribedEvents($category['name'], $category['item_id'], $xoops->module->getVar('mid'), $xoops->user->getVar('uid')); - foreach (notificationEvents($category['name'], true) as $event) { - if (!empty($event['admin_only']) && !$xoops->user->isAdmin($xoops->module->getVar('mid'))) { - continue; - } - $subscribed = in_array($event['name'], $subscribed_events) ? 1 : 0; - $section['events'][$event['name']] = array( - 'name' => $event['name'], 'title' => $event['title'], 'caption' => $event['caption'], - 'description' => $event['description'], 'subscribed' => $subscribed - ); - } - $block['categories'][$category['name']] = $section; - } - // Additional form data - $block['target_page'] = "notification_update.php"; - // FIXME: better or more standardized way to do this? - $script_url = explode('/', $_SERVER['PHP_SELF']); - $script_name = $script_url[count($script_url) - 1]; - $block['redirect_script'] = $script_name; - $block['submit_button'] = _NOT_UPDATENOW; - $block['notification_token'] = $xoops->security()->createToken(); - return $block; -} - -function b_system_comments_edit($options) -{ - $inputtag = "<input type='text' name='options[]' value='" . intval($options[0]) . "' />"; - $form = sprintf(_MB_SYSTEM_DISPLAYC, $inputtag); - return $form; -} - function b_system_topposters_edit($options) { include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comment.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comment.html 2012-12-23 20:28:55 UTC (rev 10532) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comment.html 2012-12-24 00:06:38 UTC (rev 10533) @@ -1,63 +0,0 @@ -<!-- start comment post --> - <tr> - <td class="head"><a id="comment<{$comment.id}>"></a> <{$comment.poster.uname}></td> - <td class="head"><div class="comDate"><span class="comDateCaption"><{$lang_posted}>:</span> <{$comment.date_posted}> <span class="comDateCaption"><{$lang_updated}>:</span> <{$comment.date_modified}></div></td> - </tr> - <tr> - - <{if $comment.poster.id != 0}> - - <td class="odd"> - <div class="comUserRank"> - <div class="comUserRankText"><{$comment.poster.rank_title}></div> - <img class="comUserRankImg" src="<{$xoops_upload_url}>/<{$comment.poster.rank_image}>" alt="" /> - </div> - <img class="comUserImg" src="<{$xoops_upload_url}>/<{$comment.poster.avatar}>" alt="" /> - <div class="comUserStat"><span class="comUserStatCaption"><{$lang_joined}>:</span> <{$comment.poster.regdate}></div> - <div class="comUserStat"><span class="comUserStatCaption"><{$lang_from}>:</span> <{$comment.poster.from}></div> - <div class="comUserStat"><span class="comUserStatCaption"><{$lang_posts}>:</span> <{$comment.poster.postnum}></div> - <div class="comUserStatus"><{$comment.poster.status}></div></td> - - <{else}> - - <td class="odd"> </td> - - <{/if}> - - <td class="odd"> - <div class="comTitle"><{$comment.image}><{$comment.title}></div> - <div class="comText"><{$comment.text}></div> - </td> - </tr> - <tr> - <td class="even"></td> - - <{if $xoops_iscommentadmin == true}> - - <td class="even txtright"> - <a href="<{$editcomment_link}>&com_id=<{$comment.id}>" title="<{$lang_edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" /></a> - <a href="<{$deletecomment_link}>&com_id=<{$comment.id}>" title="<{$lang_delete}>"><img src="<{$xoops_url}>/images/icons/delete.gif" alt="<{$lang_delete}>" /></a> - <a href="<{$replycomment_link}>&com_id=<{$comment.id}>" title="<{$lang_reply}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a> - </td> - - <{elseif $xoops_isuser == true && $xoops_userid == $comment.poster.id}> - - <td class="even txtright"> - <a href="<{$editcomment_link}>&com_id=<{$comment.id}>" title="<{$lang_edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" /></a> - <a href="<{$replycomment_link}>&com_id=<{$comment.id}>" title="<{$lang_reply}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a> - </td> - - <{elseif $xoops_isuser == true || $anon_canpost == true}> - - <td class="even txtright"> - <a href="<{$replycomment_link}>&com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a> - </td> - - <{else}> - - <td class="even"> </td> - - <{/if}> - - </tr> -<!-- end comment post --> \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_flat.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_flat.html 2012-12-23 20:28:55 UTC (rev 10532) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_flat.html 2012-12-24 00:06:38 UTC (rev 10533) @@ -1,9 +0,0 @@ -<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="module:system|system_comment.html" comment=$comment}> - <{/foreach}> -</table> \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_nest.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_nest.html 2012-12-23 20:28:55 UTC (rev 10532) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_nest.html 2012-12-24 00:06:38 UTC (rev 10533) @@ -1,30 +0,0 @@ -<{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="module:system|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="module:system|system_comment.html" comment=$reply}> - </table> - </td> - </tr> -</table> -<{/foreach}> -<!-- end comment tree --> -<{/section}> \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_thread.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_thread.html 2012-12-23 20:28:55 UTC (rev 10532) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_comments_thread.html 2012-12-24 00:06:38 UTC (rev 10533) @@ -1,37 +0,0 @@ -<{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="module:system|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 Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php 2012-12-23 20:28:55 UTC (rev 10532) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php 2012-12-24 00:06:38 UTC (rev 10533) @@ -65,10 +65,6 @@ $modversion['templates'][] = array('file' => 'system_userform.html', 'description' => ''); $modversion['templates'][] = array('file' => 'system_rss.html', 'description' => ''); $modversion['templates'][] = array('file' => 'system_redirect.html', 'description' => ''); -$modversion['templates'][] = array('file' => 'system_comment.html', 'description' => ''); -$modversion['templates'][] = array('file' => 'system_comments_flat.html', 'description' => ''); -$modversion['templates'][] = array('file' => 'system_comments_thread.html', 'description' => ''); -$modversion['templates'][] = array('file' => 'system_comments_nest.html', 'description' => ''); $modversion['templates'][] = array('file' => 'system_siteclosed.html', 'description' => ''); $modversion['templates'][] = array('file' => 'system_dummy.html', 'description' => ''); $modversion['templates'][] = array('file' => 'system_block_dummy.html', 'description' => ''); @@ -135,14 +131,6 @@ $modversion['blocks'][$i]['template'] = 'system_block_newusers.html'; $i++; $modversion['blocks'][$i]['file'] = 'system_blocks.php'; -$modversion['blocks'][$i]['name'] = _MI_SYSTEM_BNAME11; -$modversion['blocks'][$i]['description'] = 'Shows most recent comments'; -$modversion['blocks'][$i]['show_func'] = 'b_system_comments_show'; -$modversion['blocks'][$i]['options'] = '10'; -$modversion['blocks'][$i]['edit_func'] = 'b_system_comments_edit'; -$modversion['blocks'][$i]['template'] = 'system_block_comments.html'; -$i++; -$modversion['blocks'][$i]['file'] = 'system_blocks.php'; $modversion['blocks'][$i]['name'] = _MI_SYSTEM_BNAME13; $modversion['blocks'][$i]['description'] = 'Shows theme selection box'; $modversion['blocks'][$i]['show_func'] = 'b_system_themes_show'; @@ -920,13 +908,6 @@ $modversion['config'][$i]['valuetype'] = 'int'; $modversion['config'][$i]['default'] = 1; $i++; -$modversion['config'][$i]['name'] = 'active_comments'; -$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_COMMENTS'; -$modversion['config'][$i]['description'] = ''; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = '1'; -$i++; $modversion['config'][$i]['name'] = 'active_filemanager'; $modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_FILEMANAGER'; $modversion['config'][$i]['description'] = ''; @@ -1019,13 +1000,6 @@ $modversion['config'][$i]['valuetype'] = 'int'; $modversion['config'][$i]['default'] = 10; $i++; -$modversion['config'][$i]['name'] = 'comments_pager'; -$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_COMMENTS_PAGER'; -$modversion['config'][$i]['description'] = ''; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 20; -$i++; $modversion['config'][$i]['name'] = 'groups_pager'; $modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_GROUPS_PAGER'; $modversion['config'][$i]['description'] = ''; @@ -1071,14 +1045,6 @@ $modversion['config'][$i]['default'] = 'dhtmltextarea'; $modversion['config'][$i]['options'] = $editors; $i++; -$modversion['config'][$i]['name'] = 'comments_editor'; -$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_COMMENTS_EDITOR'; -$modversion['config'][$i]['description'] = '_MI_SYSTEM_PREFERENCE_COMMENTS_EDITOR_DSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'dhtmltextarea'; -$modversion['config'][$i]['options'] = $editors; -$i++; $modversion['config'][$i]['name'] = 'general_editor'; $modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_GENERAL_EDITOR'; $modversion['config'][$i]['description'] = '_MI_SYSTEM_PREFERENCE_GENERAL_EDITOR_DSC'; |