Recent Topics

1 May 30, 2008 05:41    

My b2evolution Version: Not Entered

Hi.. I've been using the Glossy Blue skin and I want to modify the "Author Name" of a Comment By a Visitor (Not a member)

What I want is simple really... to add a String (always) to the Author Name of a person other than a registered user..when the post comment

some thing like...
if( ! is_logged_in() )
{
$title_addition = '(V)'
/*add the value of the Author Name field in the form and the $title_addition before submitting*/
}

My knowledge of php is almost 0 and I couldnt find out how to retrieve a form field to modify and reset..

Any help would be much appreciated
Thanks

2 May 30, 2008 08:09

Copy the file _item_comment.inc.php from skins/ to skins/glossyblue/ then on line 52 change

$Comment->author();


to

$Comment->author( T_('Mr. '), T_(' !') );


and you'll get Comment from: Mr. random08 !

;)

3 May 31, 2008 22:27

sam2kb wrote:

Copy the file _item_comment.inc.php from skins/ to skins/glossyblue/ then on line 52 change

$Comment->author();


to

$Comment->author( T_('Mr. '), T_(' !') );


and you'll get Comment from: Mr. random08 !

;)

Thanks.... But..this dosnt seem to be working... from the looks of it glossyBlue Skin uses _item_feedback_inc.php to display comments..

Still your suggestion applies when displaying all comments right?..

What I want to do is add a particular string to a name of a visitor (some one not registered) Only.

From the look of things I have to do this before the Form is submitted... using...

if( ! is_logged_in() ) { ........} 

I hope i'm correct on the method.. but I dont know how to retrieve an the Comment title from the Form in order to change it..

4 Jun 01, 2008 01:20

This is exactly what you need. It adds text before and after the visitor name in comments.
Why can't you try first and then say that it doesn't work? :roll:

5 Jun 02, 2008 10:19

sam2kb wrote:

This is exactly what you need. It adds text before and after the visitor name in comments.
Why can't you try first and then say that it doesn't work? :roll:

I did Try it but nothing changed.....

Firstly I think the _item_comment.inc.php is not used in glossyBlue Skin I use... as far as I can see it uses a file named _item_feedback_inc.php (it certinally has all the codes in _item_comment.inc.php)

Secondly I dont want to attach a String to the name of all people who leave a comment....just the normal visitors (as opposed to those who have registered and has user names/passwords...)....

From what I can see u are changing the output Name of All Comment Names.. What I want is to change the output Name of all those who have not registered..

..
anyways thanks for ur help...:)

6 Jun 02, 2008 16:34

You are right about _item_feedback_inc.php :oops: , open this file and look at line 179

$Comment->author('','','','®','htmlbody',true);


This is how it works

/**
	 * Template function: display author of comment
	 *
	 * @param string String to display before author name if not a user
	 * @param string String to display after author name if not a user
	 * @param string String to display before author name if he's a user
	 * @param string String to display after author name if he's a user
	 * @param string Output format, see {@link format_to_output()}
	 * @param boolean true for link, false if you want NO html link
	 */
	function author( $before = '', $after = '#', $before_user = '', after_user = '#', $format = 'htmlbody', $makelink = false )

By default you have a regstered sign ® shown after registered user because the function has ® as 4th parameter.
First two parameters control before author name if not a user and after author name if not a user

Change this line and you'll see what I mean

$Comment->author('Before ',' After','','®','htmlbody',true);


Form is loading...