Feature #26106
Allow certain HTML tags in comments
| Status: | New | Start date: | 2011-04-19 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Feature | |||
| Target version: | - | |||
| Votes: | 1 (View) |
Description
It would be nice if a subset of HTML tags could be used in comments.
This could be done like this:
Add a TS option like
plugin.tx_t3blog_pi1.blogList.allowTagsInComments = <b><i><a>
In class.singleFunctions.php, change:
protected function prepareCommentData($postUid, $commentAuthor, $commentTitle, $commentText, $authorEmail, $authorWebsite) {
$data = array(
'tstamp' => $GLOBALS['EXEC_TIME'],
'title' => $commentTitle,
'author' => $commentAuthor,
'fe_group' => $this->getPostFeGroup($postUid),
'email' => $authorEmail,
'website' => $authorWebsite,
'text' => $this->splitLongWordsInText(strip_tags($commentText)),
'approved' => intval($this->conf['approved']),
'parent_id' => intval($this->localPiVars['comParentId']),
'fk_post' => $postUid,
'spam' => $this->isSpam(array($commentAuthor, $commentTitle, $authorWebsite, $authorEmail, $commentText))
);
return $data;
}
to
protected function prepareCommentData($postUid, $commentAuthor, $commentTitle, $commentText, $authorEmail, $authorWebsite) {
$data = array(
'tstamp' => $GLOBALS['EXEC_TIME'],
'title' => $commentTitle,
'author' => $commentAuthor,
'fe_group' => $this->getPostFeGroup($postUid),
'email' => $authorEmail,
'website' => $authorWebsite,
'text' => $this->splitLongWordsInText(strip_tags($commentText, $this->conf['allowTagsInComments'])), // allow certain tags
'approved' => intval($this->conf['approved']),
'parent_id' => intval($this->localPiVars['comParentId']),
'fk_post' => $postUid,
'spam' => $this->isSpam(array($commentAuthor, $commentTitle, $authorWebsite, $authorEmail, $commentText))
);
return $data;
}
And add parseFunc < lib.parseFunc_RTE to the comment text field so editors can make use of the RTE when editing comments in the backend. plugin.tx_t3blog_pi1.blogList.comment.10 needs to be adjusted for this, e.g.:
10 = TEXT
10 {
field = text
parseFunc < lib.parseFunc_RTE
dataWrap (
<div class="commentTopNav">
<div class="author">{field:gravatar}{field:author}</div>
<div class="date">{field:date} {field:time}</div>
</div>
<div class="commentBody">
<h5>{field:title}</h5>
|
</div>
)
# {field:email}
}
History
Updated by Felix Nagel almost 2 years ago
- Category set to Feature
I would love to see this feature included in t3blog! As soon as Im able to allocate some time I will give your suggestions a try.
Thanks for your contribution!
Updated by Felix Nagel over 1 year ago
Works as expected with t3blog 1.1.2.