Vivvo CMS Support Forum Home | Free Trial | Online Demo | Docs and Manuals | Order Now   

Go Back   Vivvo CMS Support Forums > Code and Template Customizations > Customizations & Templates

Customizations & Templates Various hacks and customizations for Vivvo 4 branch. Template repository and all related template customization discussions.

Reply
 
Thread Tools Display Modes
Old 03-06-2012, 11:41 PM   #1
apocan
Vivvo Veteran
 
apocan's Avatar
 
Join Date: Jan 2007
Location: Turkiye
Age: 27
Posts: 857
Rep Power: 7
apocan is on a distinguished road
Default how to show all comments in a page with pagination?

Hello friends. is it possible to show all comments with pagination?

I have tried a solution by copying comments tpl file but in this soliton javascripts don't work. You can see here: http://www.trf1.net/haber-yorumlari.html

how can I show all comments with pagination and but also comments feed working?

Thanks
apocan is offline   Reply With Quote
Old 05-12-2012, 04:39 PM   #2
columbusman
Senior Vivvo User
 
Join Date: Jul 2007
Posts: 205
Rep Power: 6
columbusman is on a distinguished road
Default

Here is my code, keep in mind the comment page doesn't have page nav, but a bit of tweaking it will. I think you will like this layout more so than you're current one.

The way this is set up, if you click "speak" it will take you to the actual article comment section of the article.

I would love to figure out how to make the reply feature work, but have been unsuccessful.

Code:
                                        <vte:if test="{VIVVO_COMMENTS_ENABLE}">
                                         <div id="latest_comments" class="">

<vte:box module="box_comments">
		<vte:params>
<!--			<vte:param name="search_limit" value="200" />-->
			<vte:param name="search_sort_by" value="created" />
			<vte:param name="search_order" value="descending" />
			<vte:param name="search_limit" value="200" />
			<vte:param name="cache" value="1" />
		</vte:params>
        <vte:template>
        
        <vte:if test="{comment_list}">
							<vte:attribute name="style">
								<vte:if test="{ajax_output}">margin:0</vte:if>
							</vte:attribute>
								<vte:foreach item = "comment" from = "{comment_list}">
									<div class="single_comment">
										<div class="comment_header">
											<img src="{comment.get_avatar|24}" alt="avatar" width="24" height="24" />
											<vte:if test="{comment.get_www}">
												<a href="http://{comment.get_www}" target="_blank"><vte:value select="{comment.get_author}" /></a>
												<vte:else>
													<strong><vte:value select="{comment.get_author}" /></strong>
												</vte:else>
											</vte:if>
                                            <span class="comment_stamp">
                                           / <vte:value select="{comment.get_article_title}" /> /
											<!--<vte:value select="{comment.get_create_dt}" /> -->
                                           <span class="no_of_comments_counter">Posted <vte:value select="{comment.create_dt|pretty_date}" /></span>
                                            
                                            </span>
										</div>
                                                                                   
										<div class="comment_body">
                                        <div class="comment_text">
                                        (COMMENT ID - <vte:value select="{comment.get_id}" />)
											<a href="{comment.get_article_href}"><vte:value select="{comment.get_description|strip_tags}" /></a>
										</div>
                                        <p><!-- --></p>
                                        <div class="comment_actions">
                                         
                                        <vte:if test="{VIVVO_COMMENTS_ENABLE_THREADED}">
<a class="comment_reply" href="{comment.get_article_href}#post-reply" onClick="return reply_to_comment({comment.get_id},{comment.get_root_comment},{comment.get_plain_summary|json_encode_attr});">Speak</a></vte:if>
 						<div id="comment_vote_{comment.get_id}" class="result">
                                             	Rated    <vte:value select="{comment.get_vote}" />
                                            </div>
</div>
									</div>
                                                                                            <vte:if test="{VIVVO_MODULES_FEED}">
                                    <a href="{comment.get_article_href|switch_format:'rss'}"><img src="{VIVVO_THEME}img/icon_feed.gif" class="comment_feed" alt="{LNG_COMMENT_RSS}" title="{LNG_COMMENT_RSS}" /></a>
                                    

                                </vte:if>
                                
                                    </div>

								</vte:foreach>

							</vte:if>
        </vte:template>
        </vte:box>
                            </div>
                            <vte:box module="box_pagination">
                <vte:params>
                    <vte:param name="list" value="{comment_list}" />
                    <vte:param name="max_page" value="50" />
                </vte:params>
                <vte:template>
                    <div id="box_pagination">
                        <span class="pagination">	
                            <vte:if test="{previous_page_group} != ''">
                                <span class="page_button" style="cursor:pointer;" onClick="onPageChange({previous_page_group_number});">&lt;</span>
                            </vte:if>
                                
                            <vte:foreach item = "page" from = "{page_list}">
                                <vte:if test="{current_page} != {page[number]}">
                                    <span class="page_button" style="cursor:pointer;" onClick="onPageChange({page[number]});"><vte:value select="{page[number]}" /></span>
                                    <vte:else>
                                        <span style="color:#C90404;"><vte:value select="{page[number]}" /></span>
                                    </vte:else>
                                </vte:if>
                            </vte:foreach>
                                
                            <vte:if test="{next_page_group} != ''">
                                <span class="page_button" style="cursor:pointer;" onClick="onPageChange({next_page_group_number});">&gt;</span>
                            </vte:if>
                        </span>
                        Comments
                        <span class="pagination_total">
                            <vte:value select="{displaying}" />
                        </span>
                        of
                        <span class="pagination_total">
                            <vte:value select="{total_records}" />
                        </span> 
                    </div>
                </vte:template>
            </vte:box>
                            </vte:if>
                            	<vte:if test="!{ajax_output}">
		<script type="text/javascript">
			function reportComment(id) {
				new Ajax.Updater('comment_report_' + id, '<vte:value select="{VIVVO_ABSOLUTE_URL}" />', {
					parameters: {
						action: 'comment',
						cmd: 'reportInappropriateContent',
						COMMENT_id: id,
						template_output: 'box/dump'
					}
				});
			}
			function voteComment(id, vote) {
				new Ajax.Updater('comment_vote_' + id, '<vte:value select="{VIVVO_ABSOLUTE_URL}" />', {
					parameters: {
						action: 'comment',
						cmd: 'vote',
						COMMENT_id: id,
						COMMENT_vote: vote,
						template_output: 'box/dump'
					}
				});
			}
			function loadCommentsPage(pg) {
				new Ajax.Updater('comment_list', '<vte:value select="{VIVVO_ABSOLUTE_URL}" />', {
					parameters: {
						action: 'comment',
						cmd: 'proxy',
						pg: pg,
						CURRENT_URL: '<vte:value select="{CURRENT_URL}" />',
						article_id: <vte:value select="{article.get_id}" />,
						template_output: 'box/comments'
					}
				});
			}

			var reply_to_comment_id = 0;

			function updateComments() {

				var commentParam = $('comment_form').serialize(true);
				commentParam.template_output = 'box/comments_add';
				commentParam.form_container = 'comment_form_holder';

				var dump = $('comment_dump');
				if (dump) dump.remove();

				new Ajax.Updater(reply_to_comment_id != 0 ? 'new_comment_holder_' + reply_to_comment_id : 'new_comment_holder', '<vte:value select="{VIVVO_ABSOLUTE_URL}" />', {
					parameters: commentParam,
					evalScripts: true,
					insertion: 'before',
					onSuccess: function(xhr) {
						if (xhr.getResponseHeader('X-Vivvo-Action-Status') == 1) {
							var form = $('comment_form');
							form.down('textarea').value = '';
							<vte:if test="{VIVVO_COMMENTS_CAPTHA}">
								form.down('.captcha-image').src = '<vte:value select="{VIVVO_PROXY_URL}" />imagecode.html?article_id=<vte:value select="{article.get_id}" />&amp;ts=' + +new Date;
								form.down('input[name="COMMENT_captcha"]').value = '';
							</vte:if>
							<vte:if test="{VIVVO_ANALYTICS_TRACKER_ID}">
								_gaq.push(['_trackEvent', 'Article', 'Comment', '<vte:value select="{article.get_id}" />', 1]);
							</vte:if>
							<vte:if test="{VIVVO_COMMENTS_ENABLE_THREADED}">
								cancelReplyTo();
							</vte:if>
							clearCommentDumps();
						}
					}
				});

				return false;
			}

			function clearCommentDumps() {
				var commentDump = $('comment_dump_container');
				if (commentDump) {
					commentDump.childElements().invoke('remove');
				}
			}

			function addCommentDump(message, type, info) {
				var commentDump = $('comment_dump');
				if (!commentDump) {
					var container = $('comment_dump_container');
					if (!container) {
						return;
					}
					container.insert(commentDump = new Element('div', {'id': 'comment_dump'}));
				}
				if (info) {
					message += ': ' + info;
				}
				commentDump.insert(new Element('span', {'class': type}).update(message));
			}

			<vte:if test="{VIVVO_COMMENTS_ENABLE_THREADED}">
			function reply_to_comment(id, root, summary) {
				$('COMMENT_reply_to').value = id;
				$('COMMENT_root_comment').value = root;
				$('COMMENT_description').focus();
				$('writing_reply_to').update(summary);
				$('writing_reply').show();
				reply_to_comment_id = id;
				return false;
			}

			function cancelReplyTo() {
				$('COMMENT_reply_to').value = '';
				$('COMMENT_root_comment').value = '';
				$('writing_reply').hide();
				reply_to_comment_id = 0;
			}
			</vte:if>
		</script>
	</vte:if>
columbusman is offline   Reply With Quote
Old 05-17-2012, 02:33 PM   #3
apocan
Vivvo Veteran
 
apocan's Avatar
 
Join Date: Jan 2007
Location: Turkiye
Age: 27
Posts: 857
Rep Power: 7
apocan is on a distinguished road
Default

thank you. any idea how to do a pagination?
apocan is offline   Reply With Quote
Old 05-19-2012, 05:26 AM   #4
columbusman
Senior Vivvo User
 
Join Date: Jul 2007
Posts: 205
Rep Power: 6
columbusman is on a distinguished road
Default

I've been playing with the coding... soon I think, but Micha could really steer us in the right direction... please Micha
columbusman is offline   Reply With Quote
Old 05-21-2012, 08:22 AM   #5
Micha
Administrator
 
Micha's Avatar
 
Join Date: Feb 2006
Location: Belgrade
Posts: 2,662
Rep Power: 10
Micha will become famous soon enough
Default

From what I can see, you already have pagination included in your code above.
The one thing I see missing there is

Code:
<vte:param name="pg" value="{pg}" />
parameter in box comments module params section.
Without that parameter, pagination won't work.
__________________
--[Read Forum Rules and Guidelines before you post!!!]--

Djole, Djole, bas si bezobrazan sto si se pravio da si mali zekan. Zato cu te dobro kazniti...
Micha is offline   Reply With Quote
Old 05-31-2012, 10:26 PM   #6
apocan
Vivvo Veteran
 
apocan's Avatar
 
Join Date: Jan 2007
Location: Turkiye
Age: 27
Posts: 857
Rep Power: 7
apocan is on a distinguished road
Default

it didnt work
apocan is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Order now:

Order your copy of Vivvo now and get:
bullet Six months free upgrades
bullet Free support
bullet Full source code
bullet Immediate download
bullet Starting at only $295.00
Order now

Support HelpDesk:

You can submit a trouble ticket in the support area at any time, using your client area email and password.

Vivvo CMS Resource Center:

The Vivvo CMS Resource Center is your window to a variety of resources that showcase Vivvo's features and technologies. So whether you're brand new to Vivvo or a seasoned user, you can find the information you need right here!

Latest Additions:

Contact us:

Business hours
Mon-Fri 9:00AM - 6:00PM GMT+1
(Europe)
Telephone Sales
381 11 311-50-20
Email inquiries
sales@vivvo.net
(Sales inquiries)
support@vivvo.net
(Support inquiries)

All times are GMT +1. The time now is 12:19 AM.
Contact Us - Vivvo Home - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.