×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Username in preview shows {username}

Username in preview shows {username} 15 years 1 month ago #7227

  • Sasa Stankovic
  • Sasa Stankovic's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Hi!

Maybe I do not have the patience, but I did not find any solution(s) to my problem.

1) Using Joomla 1.5.14 + !JoomlaComment 3.26
2) Using customization of SSlideBoth-emotop HTML with css-blackbg style
3) Altering HTML from the Joomla backend.
4) Altering HTML line #26 from:
<a href="{PREVIEW_LINK}#josc{id}">{PREVIEW_DATE}&nbsp;<b>{PREVIEW_TITLE}</b></a>
to
<a href="{PREVIEW_LINK}#josc{id}">{PREVIEW_DATE}&nbsp;{username}&nbsp;<b>{PREVIEW_TITLE}</b></a>
5) Expected result is not what the given is. I thought that "{username}" would be replaced by the comment authors nick. All I get is "...{username}..."

Question: Where am I doing wrong?
If not - is this a bug => kill it.
If not a bug - advise me.

Regards

Username in preview shows {username} 15 years 1 month ago #7245

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
The template HTML files are actually not even loaded as HTML, they are templates that are built in realtime. The problem you are facing is that the {previewline}{/previewline} code block of the template doesn't even look for the {username} block, it only does it in the {post}{/post} block. So you'd have to move the {username} str_replace code from the {post} process section of the comment.class.php file to where the {previewline} str_replace function takes place.

I can't look at it right now for you however as we are very close to a new release and I have never looked at JC 3.x (I only work on JoomlaComment4).

Username in preview shows {username} 15 years 1 month ago #7271

  • Sasa Stankovic
  • Sasa Stankovic's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
To move would result in loss functionality.
Extending functionality is desired.

You tipped me so I got what I wanted. Thank you.

Please move this post to another section and close it.

Code prior fix:
                    $previewline        = $this->_previewline;
/* {PREVIEW_LINK} */
                    $previewline        = str_replace('{PREVIEW_LINK}', $address, $previewline);
                    /* {PREVIEW_DATE} */
                    $previewline        = str_repl...
Code after fix:
                    $previewline        = $this->_previewline;
                    /* {username}       */
                    $previewline        = str_replace('{username}', $item["name"], $previewline);
                    /* {PREVIEW_LINK} */
                    $previewline        = str_replace('{PREVIEW_LINK}', $address, $previewline);
                    /* {PREVIEW_DATE} */
                    $previewline        = str_repl...

Username in preview shows {username} 15 years 1 month ago #7272

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
Yes not move sorry, just copy code and adjust as appropriate - you've done it exactly as I would of ;) Glad you got it sorted.
  • Page:
  • 1
Time to create page: 0.103 seconds