Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] Real username gets published via email notification
Pages: [1]   Go Down
  Print  
Author Topic: [solved] Real username gets published via email notification  (Read 1924 times)
0 Members and 1 Guest are viewing this topic.
hauben
Newbie
*

Karma: 0
Offline Offline

Posts: 3


« on: February 24, 2011, 21:47:39 »

Hello!

I'm using JComments 2.2.0.2 and I setup the system that only the usernames are shown and not the real names
(Settings -> Layout -> Author's name: Username (login))

This works fine for the frontend but within email notification the real name gets shown which I do not wanne have.

Is there another configuration possiblity or is this a bug ?

Best regards
Frank
« Last Edit: February 28, 2012, 17:45:29 by smart » Logged
foobar
Newbie
*

Karma: 0
Offline Offline

Posts: 1


« Reply #1 on: March 14, 2011, 23:06:45 »

Hi!

I would consider this a bug. It is not difficult to fix, see the file components/com_jcomments/tpl/default/tpl_email.php between line 42 and 46 (in version 2.2.0.2):
Code:
<a style="color: #3c452d;font: bold 1em Verdana, Arial, Sans-Serif;" href="<?php echo $comment->homepage?>" target="_blank"><?php echo $comment->name?></a>
<?php
} else {
?>

<span style="color: #3c452d;font: bold 1em Verdana, Arial, Sans-Serif;"><?php echo $comment->name?></span>

You can hardcode the other behaviour (always displaying the username) by changing $comment->name to $comment->username (at both occurences).
It would be better to use a conditional statement, but I do not have time to find out how to read the display_author setting the "correct" way. The above mentioned workaround suits me fine (for now, at least).
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #2 on: April 19, 2011, 03:15:08 »

This issue could be fixed more correctly in /components/com_jcomments/jcomments.php. Find code:

Code: (php)
$txt = trim(preg_replace('/(\s){2,}/i', '\\1', $txt));
$txt = str_replace( 'class="quotebody"', 'style="margin: 5px 0 0 0;padding: 8px; border: 1px dashed #aaa;"', $txt );
$comment->comment = $txt;
unset( $bbcode );

and insert after:
Code: (php)
$comment->author = JComments::getCommentAuthorName($comment);

And change in template: $comment->name with $comment->author.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] Real username gets published via email notification
 
Jump to: