Commit 54762c91 authored by lphuberdeau's avatar lphuberdeau

[MOD] Switching all comments to the ajax interface, removing non-forum related...

[MOD] Switching all comments to the ajax interface, removing non-forum related code from the comments templates, which need renaming now
parent 71fc7279
This diff is collapsed.
......@@ -2710,113 +2710,6 @@ class Comments extends TikiLib
}
}
/* post a comment
* @param string comments_objectId
* @param array $params: list of options($_REQUEST)
* @return the threadId
* @return $feedbacks, $errors */
function post_in_object($comments_objectId, &$params, &$feedbacks, &$errors) {
global $smarty, $tiki_p_admin, $tiki_p_admin_comments, $tiki_p_post_comments, $tiki_p_edit_comments, $prefs, $user, $captchalib;
if (!empty($params['comments_parentId'])) {
$parent_id = $params['comments_parentId'];
} else {
$parent_id = 0;
}
if (!($tiki_p_post_comments == 'y')) {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra('Permission denied'));
$smarty->display("error.tpl");
die;
}
if (!empty($params['comments_threadId'])) {
if (!($tiki_p_edit_comments == 'y' || $this->user_can_edit_post($user, $params['comments_threadId']))) {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra('Permission denied'));
$smarty->display("error.tpl");
die;
}
}
if ( $prefs['feature_comments_locking'] == 'y' ) {
if ( $this->is_object_locked($comments_objectId) ) {
$smarty->assign('msg', tra("Those comments are locked"));
$smarty->display("error.tpl");
die;
}
$parent_comment_info = $this->get_comment($parent_id);
if ( $parent_comment_info['locked'] == 'y' ) {
$smarty->assign('msg', tra("This thread is locked"));
$smarty->display("error.tpl");
die;
}
}
if (empty($user) && $prefs['feature_antibot'] == 'y' && !$captchalib->validate()) {
$errors[] = $captchalib->getErrors();
}
if ($prefs['feature_contribution'] == 'y' && $prefs['feature_contribution_mandatory_comment'] == 'y' && empty($params['contributions'])) {
$errors[] = tra('A contribution is mandatory');
}
if ( ( $prefs['comments_notitle'] != 'y' && empty($params['comments_title']) ) || ( empty($params['comments_data']) && $prefs['feature_forums_allow_thread_titles'] != 'y' ) ) {
$errors[] = tra('You have to enter a title and text');
}
if (!empty($params['anonymous_email']) && !validate_email($params['anonymous_email'], $prefs['validateEmail'])) {
$errors[] = tra('Invalid Email');
}
// what do we do???
if (!empty($errors)) {
return 0;
}
// Remove HTML tags and empty lines at the end of the posted comment
$params['comments_data'] = rtrim(strip_tags($params['comments_data']));
if ( isset($params['anonymous_name']) ) {
$params['anonymous_name'] = trim(strip_tags($params['anonymous_name']));
} else {
$params['anonymous_name'] = '';
}
if (!isset($params['freetag_string'])) {
$params['freetag_string'] = '';
}
if (!isset($params['anonymous_email'])) {
$params['anonymous_email'] = '';
}
if (!isset($params['anonymous_website'])) {
$params['anonymous_website'] = '';
}
if ( isset($params['comments_reply_threadId']) && ! empty($params['comments_reply_threadId']) ) {
$reply_info = $this->get_comment($params['comments_reply_threadId']);
$in_reply_to = $reply_info['message_id'];
} else {
$in_reply_to = '';
}
if ( isset($params['comments_postComment_anonymous']) && ! empty($user) && $prefs['feature_comments_post_as_anonymous'] == 'y' ) {
$params['comments_postComment'] = $params['comments_postComment_anonymous'];
$user = '';
}
if ($params['comments_threadId'] == 0) { // new post
$message_id = '';
$threadId = $this->post_new_comment($comments_objectId, $parent_id, $user, $params['comments_title'], $params['comments_data'], $message_id, $in_reply_to,
'n', '', '', isset($params['contributions'])? $params['contributions']: '', $params['anonymous_name'], '', $params['anonymous_email'], $params['anonymous_website']);
} elseif ($tiki_p_edit_comments == 'y' || $this->user_can_edit_post($user, $params['comments_threadId'])) {
$threadId = $params['comments_threadId'];
$this->update_comment($threadId, $params['comments_title'], '', ($params['comments_data']), 'n', '', '', $comments_objectId, isset($params['contributions'])? $params['contributions']: '');
}
if (!empty($errors)) {
return 0;
} else {
$approved = ($tiki_p_admin_comments == 'y' || $prefs['feature_comments_moderation'] != 'y') ? 'y' : 'n';
if ($approved == 'n') {
$feedbacks[] = tra('Your message has been queued for approval and will be posted after a moderator approves it.');
}
return $threadId;
}
}
function get_all_thread_attachments($threadId, $offset=0, $maxRecords=-1, $sort_mode='created_desc') {
$query = 'select tfa.* from `tiki_forum_attachments` tfa, `tiki_comments` tc where tc.`threadId`=tfa.`threadId` and ((tc.`threadId`=? and tc.`parentId`=?) or tc.`parentId`=?) order by '.$this->convertSortMode($sort_mode);
$bindvars = array($threadId, 0, $threadId);
......
......@@ -365,6 +365,16 @@ class Services_Comment_Controller
}
return true;
case 'image gallery':
return $prefs['feature_image_galleries_comments'] == 'y';
case 'file gallery':
return $prefs['feature_file_galleries_comments'] == 'y';
case 'poll':
return $prefs['feature_poll_comments'] == 'y';
case 'faq':
return $prefs['feature_faq_comments'] == 'y';
case 'blog post':
return $prefs['feature_blogposts_comments'] == 'y';
default:
return false;
}
......
......@@ -8,13 +8,11 @@
{/section}
</span>
{/if}
{if ($forum_mode eq 'y' and $forum_info.vote_threads eq 'y' and $tiki_p_forum_vote eq 'y') or ($forum_mode neq 'y' and $prefs.comments_vote eq 'y' and $tiki_p_vote_comments eq 'y')}
{if ($forum_info.vote_threads eq 'y' and $tiki_p_forum_vote eq 'y')}
<span class="score">
<b>{tr}Score{/tr}</b>: {$comment.average|string_format:"%.2f"}
{if $comment.userName ne $user and $comment.approved eq 'y' and (
( $forum_mode neq 'y' and $tiki_p_vote_comments eq 'y' )
or ( $forum_mode eq 'y' and $forum_info.vote_threads eq 'y' and ( $tiki_p_forum_vote eq 'y' or $tiki_p_admin_forum eq 'y' ) )
)}
{if $comment.userName ne $user and $comment.approved eq 'y' and
( $forum_info.vote_threads eq 'y' and ( $tiki_p_forum_vote eq 'y' or $tiki_p_admin_forum eq 'y' ) )}
<b>{tr}Vote{/tr}</b>:
{if $first eq 'y'}
......@@ -40,25 +38,17 @@
{if $thread_style != 'commentStyle_headers' and $comment.approved eq 'y'}
<div class="actions">
{if ( $prefs.feature_comments_locking neq 'y' or $thread_is_locked neq 'y' ) and
( ( $forum_mode neq 'y' and $tiki_p_post_comments == 'y' )
or ( $forum_mode eq 'y' and $tiki_p_forum_post eq 'y' and ( $forum_is_locked neq 'y' or $prefs.feature_comments_locking neq 'y' ) ) )}
{if $forum_mode neq 'y'}
{button href="?post_reply=1&comments_threshold=`$comments_threshold`&comments_reply_threadId=`$comment.threadId`&comments_offset=`$comments_offset`&thread_sort_mode=`$thread_sort_mode`&comments_per_page=`$comments_per_page`&comments_parentId=`$comment.threadId`&thread_style=`$thread_style`#form"
_auto_args='*'
_text="{tr}Reply{/tr}"}
{else}
{if $first eq 'y'}
{button href="#form" _text="{tr}Reply{/tr}"}
{elseif $comments_grandParentId}
{button href="?post_reply=1&comments_threshold=`$comments_threshold`&comments_reply_threadId=`$comment.threadId`&comments_offset=`$comments_offset`&thread_sort_mode=`$thread_sort_mode`&comments_per_page=`$comments_per_page`&comments_grandParentId=`$comment_grandParentId`&comments_parentId=`$comments_grandParentId`&thread_style=`$thread_style`#form"
_auto_args='*'
_text="{tr}Reply{/tr}"}
{elseif $forum_info.is_flat neq 'y'}
{button href="?post_reply=1&comments_threshold=`$comments_threshold`&comments_reply_threadId=`$comment.threadId`&comments_offset=`$comments_offset`&thread_sort_mode=`$thread_sort_mode`&comments_per_page=`$comments_per_page`&comments_grandParentId=`$comment.parentId`&comments_parentId=`$comment.parentId`&thread_style=`$thread_style`#form"
_auto_args='*'
_text="{tr}Reply{/tr}"}
{/if}
( $tiki_p_forum_post eq 'y' and ( $forum_is_locked neq 'y' or $prefs.feature_comments_locking neq 'y' ) )}
{if $first eq 'y'}
{button href="#form" _text="{tr}Reply{/tr}"}
{elseif $comments_grandParentId}
{button href="?post_reply=1&comments_threshold=`$comments_threshold`&comments_reply_threadId=`$comment.threadId`&comments_offset=`$comments_offset`&thread_sort_mode=`$thread_sort_mode`&comments_per_page=`$comments_per_page`&comments_grandParentId=`$comment_grandParentId`&comments_parentId=`$comments_grandParentId`&thread_style=`$thread_style`#form"
_auto_args='*'
_text="{tr}Reply{/tr}"}
{elseif $forum_info.is_flat neq 'y'}
{button href="?post_reply=1&comments_threshold=`$comments_threshold`&comments_reply_threadId=`$comment.threadId`&comments_offset=`$comments_offset`&thread_sort_mode=`$thread_sort_mode`&comments_per_page=`$comments_per_page`&comments_grandParentId=`$comment.parentId`&comments_parentId=`$comment.parentId`&thread_style=`$thread_style`#form"
_auto_args='*'
_text="{tr}Reply{/tr}"}
{/if}
{/if}
</div>
......
{* $Id$ *}
<div class="clearfix postbody-title">
{if $prefs.feature_comments_locking neq 'y' or
( $forum_mode neq 'y' and $comment.locked neq 'y' and $thread_is_locked neq 'y' )
or ( $forum_mode eq 'y' and $comment.locked neq 'y' and $thread_is_locked neq 'y' )}
( $comment.locked neq 'y' and $thread_is_locked neq 'y' )}
{assign var='this_is_locked' value='n'}
{else}
{assign var='this_is_locked' value='y'}
{/if}
{if $thread_style != 'commentStyle_headers' and $this_is_locked eq 'n' and $comment.threadId > 0
and ( $forum_mode neq 'y' || ( $forum_mode eq 'y' and $forumId > 0 and $comments_parentId > 0 ) )}
and ( $forumId > 0 and $comments_parentId > 0 )}
<div class="actions">
{if $forum_mode neq 'y' && $tiki_p_admin_comments eq 'y'}
{if $prefs.feature_comments_moderation eq 'y' && $comment.approved eq 'n'}
{self_link comments_approve='y' comments_threadId=$comment.threadId _icon='comment_approve'}{tr}Approve{/tr}{/self_link}
{self_link comments_approve='n' comments_threadId=$comment.threadId _icon='comment_reject'}{tr}Reject{/tr}{/self_link}
{/if}
{if $prefs.comments_archive eq 'y'}
{assign var='anchor' value=$comment.threadId}
{if $comment.archived eq 'y'}
{self_link comment_archive='n' comments_threadId=$comment.threadId _anchor="threadId$anchor" _icon='ofolder'}{tr}Unarchive{/tr}{/self_link}
{else}
{self_link comment_archive='y' comments_threadId=$comment.threadId _anchor="comments" _icon='folder'}{tr}Archive{/tr}{/self_link}
{/if}
{/if}
{/if}
{if $forum_mode neq 'y' && (
$tiki_p_edit_comments eq 'y'
|| $comment.userName == $user
)
|| $forum_mode eq 'y' && (
{if (
$tiki_p_admin_forum eq 'y'
|| ( $comment.userName == $user && $tiki_p_forum_edit_own_posts eq 'y' )
)}
......@@ -42,9 +23,7 @@
>{icon _id='page_edit'}</a>
{/if}
{if
( $forum_mode neq 'y' and $tiki_p_remove_comments eq 'y' )
|| ( $forum_mode eq 'y' and $tiki_p_admin_forum eq 'y' )}
{if $tiki_p_admin_forum eq 'y'}
<a title="{tr}Delete{/tr}"
{if $first eq 'y'}
class="admlink" href="tiki-view_forum.php?comments_offset={$smarty.request.topics_offset}{$thread_sort_mode_param}&amp;comments_threshold={$smarty.request.topics_threshold}{$comments_find_param}&amp;comments_remove=1&amp;comments_threadId={$comment.threadId}&amp;forumId={$forum_info.forumId}{$comments_per_page_param}"
......@@ -54,7 +33,7 @@
>{icon _id='cross' alt="{tr}Delete{/tr}"}</a>
{/if}
{if $tiki_p_forums_report eq 'y' and $forum_mode eq 'y'}
{if $tiki_p_forums_report eq 'y'}
{self_link report=$comment.threadId _icon='delete' _alt="{tr}Report this post{/tr}" _title="{tr}Report this post{/tr}"}{/self_link}
{/if}
......@@ -63,7 +42,7 @@
{/if}
{if $user and $prefs.feature_user_watches eq 'y' and $display eq ''}
{if $forum_mode eq 'y' and $first eq 'y'}
{if $first eq 'y'}
{if $user_watching_topic eq 'n'}
{self_link watch_event='forum_post_thread' watch_object=$comments_parentId watch_action='add' _icon='eye' _alt="{tr}Monitor this Topic{/tr}" _title="{tr}Monitor this Topic{/tr}"}{/self_link}
{else}
......@@ -86,7 +65,7 @@
{if $first neq 'y'}
<div class="checkbox">
{if $tiki_p_admin_forum eq 'y' and $forum_mode eq 'y' and $comment.threadId > 0}
{if $tiki_p_admin_forum eq 'y' and $comment.threadId > 0}
<input type="checkbox" name="forumthread[]" value="{$comment.threadId|escape}" {if $smarty.request.forumthread and in_array($comment.threadId,$smarty.request.forumthread)}checked="checked"{/if} />
{/if}
</div>
......@@ -96,7 +75,7 @@
<div class="title">
{if $first eq 'y'}
<h2>{$comment.title|escape}</h2>
{elseif ( $forum_mode neq 'y' and $prefs.comments_notitle neq 'y' ) or ($forum_mode eq 'y' and $prefs.forum_reply_notitle neq 'y')}
{elseif $prefs.forum_reply_notitle neq 'y'}
{if $comments_reply_threadId == $comment.threadId}
{icon _id='flag_blue'}<span class="highlight">
{/if}
......
This diff is collapsed.
{if $prefs.feature_page_title ne 'n'}<h1>{$info.pageName}</h1>{/if}
<div class="wikitext">{$info.parsed}</div>
{if $comments_cant}
{include file="comments.tpl"}
{/if}
<div id="comment-container-{$info.page_id|escape}" data-target="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=wiki+page&amp;objectId={$info.pageName|escape:'url'}"></div>
{jq}
var id = '#comment-container-{{$info.page_id}}';
$(id).comment_load($(id).data('target'));
{/jq}
......@@ -184,9 +184,12 @@
|| $tiki_p_post_comments == 'y'
|| $tiki_p_edit_comments == 'y')}
<div id="page-bar" class="clearfix">
{include file='comments_button.tpl'}
<span class="button"><a id="comment-toggle" href="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=image+gallery&amp;objectId={$galleryId|escape:'url'}#comment-container">{tr}Comments{/tr}</a></span>
{jq}
$('#comment-toggle').comment_toggle();
{/jq}
</div>
{include file='comments.tpl'}
<div id="comment-container"></div>
{/if}
<table class="normal noslideshow">
......
......@@ -208,16 +208,18 @@
{if $galleryId gt 0
&& $prefs.feature_file_galleries_comments == 'y'
&& (($tiki_p_read_comments == 'y'
&& $comments_cant != 0)
&& ($tiki_p_read_comments == 'y'
|| $tiki_p_post_comments == 'y'
|| $tiki_p_edit_comments == 'y')}
<div id="page-bar" class="clearfix">
{include file='comments_button.tpl'}
<span class="button"><a id="comment-toggle" href="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=file+gallery&amp;objectId={$galleryId|escape:'url'}#comment-container">{tr}Comments{/tr}</a></span>
{jq}
$('#comment-toggle').comment_toggle();
{/jq}
</div>
{include file='comments.tpl'}
<div id="comment-container"></div>
{/if}
{/if}
......
......@@ -107,15 +107,13 @@
{* don't show comments if feature disabled or not enough rights *}
{if $prefs.feature_wiki_comments == 'y'
&& $comments_allowed_on_page == 'y'
&& ($prefs.wiki_comments_allowed_per_page neq 'y' or $info.comments_enabled eq 'y')
&& $tiki_p_wiki_view_comments == 'y'
&& (($tiki_p_read_comments == 'y'
&& $comments_cant != 0)
|| $tiki_p_post_comments == 'y'
||$tiki_p_edit_comments == 'y')}
{assign var=pagemd5 value=$page|@md5}
{include file='comments_button.tpl'}
<a id="comment-toggle" href="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=wiki+page&amp;objectId={$page|escape:'url'}#comment-container">{tr}New Comments{/tr}</a>
<span class="button"><a id="comment-toggle" href="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=wiki+page&amp;objectId={$page|escape:'url'}#comment-container">{tr}Comments{/tr}</a></span>
{jq}
$('#comment-toggle').comment_toggle();
{/jq}
......@@ -180,9 +178,7 @@
{/if}
{/if}
{if $prefs.feature_wiki_comments eq 'y' and $tiki_p_wiki_view_comments == 'y' and $edit_page ne 'y' and $comments_allowed_on_page == 'y'}
<a name="comments"></a>
{include file='comments.tpl'}
{if $prefs.feature_wiki_comments eq 'y' and $tiki_p_wiki_view_comments == 'y' and $edit_page ne 'y'}
<div id="comment-container"></div>
{/if}
......
......@@ -124,12 +124,14 @@
{*---------------------- comments *}
{if $prefs.feature_poll_comments == 'y' && !empty($pollId)
&& (($tiki_p_read_comments == 'y'
&& $comments_cant != 0)
&& ($tiki_p_read_comments == 'y'
|| $tiki_p_post_comments == 'y'
|| $tiki_p_edit_comments == 'y')}
<div id="page-bar" class="clearfix">
{include file='comments_button.tpl'}
<span class="button"><a id="comment-toggle" href="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=poll&amp;objectId={$pollId|escape:'url'}#comment-container">{tr}Comments{/tr}</a></span>
{jq}
$('#comment-toggle').comment_toggle();
{/jq}
</div>
{include file='comments.tpl'}
<div id="comment-container"></div>
{/if}
......@@ -10,9 +10,12 @@
</div>
{if $prefs.feature_blogposts_comments == 'y'
&& ($blog_data.allow_comments == 'y' or $blog_data.allow_comments == 'c')
&& (($tiki_p_read_comments == 'y' && $comments_cant != 0)
&& ($tiki_p_read_comments == 'y'
|| $tiki_p_post_comments == 'y'
|| $tiki_p_edit_comments == 'y')}
{include file='comments.tpl' show_comzone='y'}
<div id="comment-container" data-target="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=blog+post&amp;objectId={$postId|escape:'url'}"></div>
{jq}
var id = '#comment-container';
$(id).comment_load($(id).data('target'));
{/jq}
{/if}
......@@ -131,9 +131,12 @@
{/if}
{if $prefs.feature_faq_comments == 'y'
&& (($tiki_p_read_comments == 'y'
&& $comments_cant != 0)
&& ($tiki_p_read_comments == 'y'
|| $tiki_p_post_comments == 'y'
|| $tiki_p_edit_comments == 'y')}
{include file='comments.tpl'}
<div id="comment-container" data-target="tiki-ajax_services.php?controller=comment&amp;action=list&amp;type=faq&amp;objectId={$faqId|escape:'url'}"></div>
{jq}
var id = '#comment-container';
$(id).comment_load($(id).data('target'));
{/jq}
{/if}
......@@ -91,13 +91,6 @@ foreach( array_reverse( $pages ) as $id => $info )
if( $tiki_p_view == 'y' ) {
$renderer->runSetups();
$comments_per_page = $prefs['wiki_comments_per_page'];
$thread_sort_mode = $prefs['wiki_comments_default_ordering'];
$comments_vars=Array('page');
$comments_objectId = 'wiki page:' . $info['pageName'];
$_REQUEST['page'] = $info['pageName'];
include('comments.php');
$contents[] = $smarty->fetch('tiki-show_page.tpl');
if( $id === count($pages) - 1 )
......
......@@ -261,18 +261,6 @@ if ($prefs['gal_image_mouseover'] != 'n') {
}
$smarty->assign_by_ref('over_info', $over_info);
}
if ($prefs['feature_image_galleries_comments'] == 'y') {
$comments_per_page = $prefs['image_galleries_comments_per_page'];
$thread_sort_mode = $prefs['image_galleries_comments_default_order'];
$comments_vars = array(
'galleryId',
'offset',
'sort_mode'
);
$comments_prefix_var = 'image gallery:';
$comments_object_var = 'galleryId';
include_once ("comments.php");
}
include_once ('tiki-section_options.php');
if ($prefs['feature_theme_control'] == 'y') {
$cat_type = 'image gallery';
......
......@@ -324,15 +324,6 @@ if ($prefs['flaggedrev_approval'] == 'y' && isset($_REQUEST['latest']) && $objec
$pageRenderer->forceLatest();
}
if ($prefs['feature_wiki_comments'] == 'y' and $objectperms->wiki_view_comments ) {
$comments_per_page = $prefs['wiki_comments_per_page'];
$thread_sort_mode = $prefs['wiki_comments_default_ordering'];
$comments_vars=Array('page');
$comments_prefix_var='wiki page:';
$comments_object_var='page';
include_once('comments.php');
}
require_once 'lib/cache/pagecache.php';
$pageCache = Tiki_PageCache::create()
->disableForRegistered()
......
......@@ -103,17 +103,6 @@ if( isset( $_REQUEST['pagenum'] ) && $_REQUEST['pagenum'] > 0 ) {
$pageRenderer->useRaw();
// Comments engine!
if ($prefs['feature_wiki_comments'] == 'y') {
$comments_per_page = $prefs['wiki_comments_per_page'];
$thread_sort_mode = $prefs['wiki_comments_default_ordering'];
$comments_vars = array('page');
$comments_prefix_var = 'wiki page:';
$comments_object_var = 'page';
include_once ("comments.php");
}
include_once ('tiki-section_options.php');
$pageRenderer->runSetups();
ask_ticket('index-raw');
......
......@@ -803,15 +803,6 @@ if (isset($_GET['slideshow'])) {
// Browse view
$smarty->assign('thumbnail_size', $prefs['fgal_thumb_max_size']);
$smarty->assign('show_details', isset($_REQUEST['show_details']) ? $_REQUEST['show_details'] : 'n');
// Set comments config
if ($prefs['feature_file_galleries_comments'] == 'y') {
$comments_per_page = $prefs['file_galleries_comments_per_page'];
$thread_sort_mode = $prefs['file_galleries_comments_default_ordering'];
$comments_vars = array('galleryId', 'offset', 'sort_mode', 'find');
$comments_prefix_var = 'file gallery:';
$comments_object_var = 'galleryId';
include_once ('comments.php');
}
$options_sortorder = array( tra('Creation Date') => 'created'
, tra('Name') => 'name'
......
......@@ -132,15 +132,6 @@ if ($tiki_p_view_poll_voters == 'y' && !empty($_REQUEST['list']) && isset($_REQU
$smarty->assign_by_ref('list_votes', $list_votes['data']);
$smarty->assign_by_ref('cant_pages', $list_votes['cant']);
}
// Poll comments
if ($prefs['feature_poll_comments'] == 'y' && isset($_REQUEST['pollId'])) {
$comments_per_page = $prefs['poll_comments_per_page'];
$thread_sort_mode = $prefs['poll_comments_default_ordering'];
$comments_vars = array('pollId');
$comments_prefix_var = 'poll:';
$comments_object_var = 'pollId';
include_once ('comments.php');
}
$smarty->assign_by_ref('poll_info_arr', $poll_info_arr);
$smarty->assign_by_ref('start_year', $start_year);
$smarty->assign_by_ref('vote_from_date', $vote_from_date);
......
......@@ -214,15 +214,6 @@ class ObjectRenderer_Wiki extends ObjectRenderer // {{{
$options['display_template'] = 'print/print-' . $options['display'] . '_wiki.tpl';
$smarty->assign( 'info', $this->info );
if (isset($options['comments']) && $options['comments']) {
global $comments_objectId, $forum_mode, $comments_per_page;
$comments_objectId = 'wiki page:' . $this->info['pageName'];
$forum_mode = 'n';
$comments_per_page = 100;
$smarty->assign('tiki_p_post_comments', 'n');
include 'comments.php';
}
return $smarty->fetch( $options['display_template'] );
}
......
......@@ -126,25 +126,6 @@ $post_info['last_page'] = $pages;
$post_info['pagenum'] = $_REQUEST['page'];
$smarty->assign('post_info', $post_info);
if ($prefs['feature_blogposts_comments'] == 'y') {
if (isset($_REQUEST['comments_per_page'])) {
$comments_per_page = $_REQUEST['comments_per_page'];
} else {
$comments_per_page = $prefs['blog_comments_per_page'];
}
$thread_sort_mode = $prefs['blog_comments_default_ordering'];
$comments_vars = array(
'postId',
'offset',
'find',
'sort_mode',
'blogId'
);
$comments_prefix_var = 'blog post:';
$comments_object_var = 'postId';
include_once ("comments.php");
}
$cat_type = 'blog';
$cat_objid = $blogId;
include_once ('tiki-section_options.php');
......
......@@ -69,16 +69,6 @@ if (isset($_REQUEST["sugg"])) {
$suggested = $faqlib->list_suggested_questions(0, -1, 'created_desc', '', $_REQUEST["faqId"]);
$smarty->assign_by_ref('suggested', $suggested["data"]);
$smarty->assign('suggested_cant', count($suggested["data"]));
if ($prefs['feature_faq_comments'] == 'y') {
$comments_per_page = $prefs['faq_comments_per_page'];
$thread_sort_mode = $prefs['faq_comments_default_ordering'];
$comments_vars = array(
'faqId'
);
$comments_prefix_var = 'faq:';
$comments_object_var = 'faqId';
include_once ("comments.php");
}
include_once ('tiki-section_options.php');
if ($prefs['feature_theme_control'] == 'y') {
$cat_type = 'faq';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment