Recent Topics

1 May 26, 2005 00:19    

I have modded my B2Evo to display comments in the individual posts - like so... in skins/comments.php

Code:
if( ! $c )
{ // Comments not requested
$disp_comments = 0; // DO NOT Display the comments if not requested
$disp_comment_form = 0; // DO NOT Display the comments form if not requested
}

Comment out the $dsip_comments = 0 line, like this:
Code:
if( ! $c )
{ // Comments not requested
// $disp_comments = 0; // DO NOT Display the comments if not requested
$disp_comment_form = 0; // DO NOT Display the comments form if not requested
}

so the comments diplay inline - and this is sweet - can anyone tell me where to mod in orderto change the link that says

comments 3 - in order to change it to simply say "leave a comment" - I saw it somewher and now cant find it ! It's driving me mad.

and iv'e had tooo many beers -- someone know? - theres a part where theres the comment variable.. ?

2 May 26, 2005 09:07

feedback_link()
Template function: Displays link to feedback page (under some conditions)

feedback_link( [ string $type = 'feedbacks' ] , [ string $before = '' ] , [ string $after = '' ] , [ string $zero = '#' ] , [ string $one = '#' ] , [ string $more = '#' ] , [ string $title = '#' ] , [ boolean $use_popup = '#' ] , [ boolean $hideifnone = '#' ] , [ string $mode = '' ] , [ string $blogurl = '' ] ) 


Parameters:
string $type: Type of feedback to link to (feedbacks (all)/comments/trackbacks/pingbacks)
string $before: String to display before the link (if comments are to be displayed)
string $after: String to display after the link (if comments are to be displayed)
string $zero: Link text to display when there are 0 comments
string $one: Link text to display when there is 1 comment
string $more: Link text to display when there are >1 comments (include %d for # of comments)
string $title: Link title
boolean $use_popup: true to use a popup windows ('#' to use if comments_popup_windows() is there)
boolean $hideifnone: true to hide if no feedback ('#' for default)
string $mode: 'pid' or 'title'
string $blogurl: url to use

This is a copy of the technical documentation.
found here : http://doc.b2evolution.net/0.9.0/evocore/Item.html#methodfeedback_link

3 May 26, 2005 12:12

wow - I've been using B2Evo for a couple years now and never found those docs ! I'm gonnna have a ball reading this - thanks much!

4 May 26, 2005 13:10

and now for my next dumb question - in which file is that set?

5 May 26, 2005 16:20

In your _main.php file ;)

Normally you will have something like this :

<?php $Item->feedback_link( 'comments' ) // Link to comments ?>


change the parameters with whatever you want (looking at the parameters in the tech doc offcourse.

6 May 26, 2005 19:22

Absolutely perfect! - thanks much.

:D

7 May 23, 2006 08:32

just an update for folks in here running v0.9.2

I found that you can edit the comment display line easily in this file: b2evocor/_class_item.php

this appears at line 730:


				if( $title == '#' ) $title = T_('Display comments / Leave a comment');
				if( $zero == '#' ) $zero = T_('Leave a comment');
				if( $one == '#' ) $one = T_('1 comment');
				if( $more == '#' ) $more = T_('%d comments');
				break;

change it to this:

				
				if( $title == '#' ) $title = T_('Display comments / Leave a comment');
				if( $zero == '#' ) $zero = T_('Leave a comment');
				if( $one == '#' ) $one = T_('Leave a comment - 1 comment');
				if( $more == '#' ) $more = T_('Leave a comment - %d comments');
				break;

8 May 23, 2006 09:27

There is no need to hack the item class, if you take a look at the code for the function it shows you how to achieve the same effect without hacking :-

	/**
	 * Template function: Displays link to feedback page (under some conditions)
	 *
	 * {@internal Item::feedback_link(-)}}
	 *
	 * @param string Type of feedback to link to (feedbacks (all)/comments/trackbacks/pingbacks)
	 * @param string String to display before the link (if comments are to be displayed)
	 * @param string String to display after the link (if comments are to be displayed)
	 * @param string Link text to display when there are 0 comments
	 * @param string Link text to display when there is 1 comment
	 * @param string Link text to display when there are >1 comments (include %d for # of comments)
	 * @param string Link title
	 * @param boolean true to use a popup windows ('#' to use if comments_popup_windows() is there)
	 * @param boolean true to hide if no feedback ('#' for default)
	 * @param string 'pid' or 'title'
	 * @param string url to use
	 */
	function feedback_link( $type = 'feedbacks', $before = '', $after = '',
													$zero='#', $one='#', $more='#', $title='#',
													$use_popup = '#',	$hideifnone = '#', $mode = '', $blogurl='' )

ie/ change skins/<skin name>/_main.php :-


$Item->feedback_link('feedbacks', '', '', 'Leave a comment', 'Leave a comment - 1 comment', 'Leave a comment - %d comments', 'Display comments / Leave a comment' );

¥


Form is loading...