View Full Version : How to parse smilies in Activity Stream?
BasilFawlty
12-24-2012, 02:57 PM
I just noticed that smilies are not parsed in my new VB install. Instead it only shows the smilie code. Does anyone know how to mod the VB so that smilies are parsed in the activity stream? I'm using v 4.2. It seems this is the default "as designed: behavior, but I'd really rather have the smilies display in Activity Stream (What's New). :confused:
You can do it, but you have to edit some files. In vb/activitystream/view/perm/forum/post.php around line 90 you can add code to do the parsing (added lines in red):
$preview = strip_quotes($postinfo['pagetext']);
$postinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(
fetch_trimmed_title(strip_bbcode($preview, false, true, true, true),
vb::$vbulletin->options['as_snippet'])
));
global $vbulletin;
require_once(DIR . "/includes/class_bbcode.php");
$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$postinfo['preview'] = $parser->parse_smilies($postinfo['preview'], false);
$forumperms = fetch_permissions($threadinfo['forumid']);
$show['threadcontent'] = ($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canviewthreads']);
$userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
Then since that only takes care of replies, you need do the same thing in vb/activitystream/view/perm/forum/thread.php, except change postinfo to threadinfo (in two places).
I should also mention that although I tried this and it seems to display smilies on the activity stream page, it looks like the preview in the activity stream is meant to be plain text and inserting smilie images requires html, so I don't know what other effects these changes might have.
Soapchick
06-20-2013, 02:41 AM
Very grateful for this info. Thanks you kh99.
MaxSof
09-19-2013, 06:09 PM
how to make CMS?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.