• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Profile Posts with BB Codes 1.2

Admin

Well-Known Member
Staff member
Administrator
## About

As of XenForo 1.2, posts in profile pages are limited to text-only. That's unfortunate because I know for a fact that my members love using BB Codes to interact with each other on their profile pages (or share visitor messages as it was stilled called in vBulletin). To me, it just makes these pages look more interesting and interactive.

## What this add-on does

mqu8.png

obgq.png



This add-on will allow you to enable BB Codes in posts on your profile page. Depending on the settings, your users will be able to use text markups, post images or YouTube videos.

Your custom BB Codes are supported.

Smilies are back in town and can be used instead of their text representation.
clear.png


Lastly, you can enable independently BB Code settings for your users' status messages - although here I would restrict the BB Codes to basic text markup and smilies.

## Upgrade

If you are upgrading this add-on from an earlier version, make sure to notice the different path structure of this add-on. Previously, the add-on was stored in library/MobileReadProfileBbCode. This and future versions will be stored in library/MobileRead/ProfileBbCode. In other words, once you upgraded the add-on and copied its new files, you can delete the old directory library/MobileReadProfileBbCode.

## Installation

This add-on is compatible with xF 1.2 (RC1 tested). It supports functionality only available in xF 1.2 and later, including automated template modifications and event listener hinting for performance improvements.

## Install on xF 1.2

Install this add-on and configure the settings in home->options->profile & status BB code. You're ready to go!

## Install on xF 1.1

Install this add-on. Before you can configure the settings in home->options->profile & status BB code, you need to perform the following template modifications:

(notice: if you decide to uninstall this add-on, you will have to revert these templates again)

member_card
--------------

Find:

HTML:
<blockquote class="status">{xen:helper bodytext, $user.status}</blockquote>

Replace with:

HTML:
<blockquote class="status baseHtml">{xen:helper profileBbCode, $bbCodeParser, 'member_card', $user.status}</blockquote>

member_view
--------------

Find:

HTML:
<xen:if is="{$user.status}"><p class="userStatus" id="UserStatus">{xen:helper bodyText, $user.status} <xen:datetime time="$user.status_date" /></p></xen:if>

Replace with:

HTML:
<xen:if is="{$user.status}"><p class="userStatus" id="UserStatus"><span class="baseHtml">{xen:helper profileBbCode, $bbCodeParser, 'member_view', $user.status}</span> <xen:datetime time="$user.status_date" /></p></xen:if>


member_view
--------------

Find:

HTML:
<xen:if is="{$visitor.user_id} == {$user.user_id}">
    <textarea name="message" class="textCtrl StatusEditor Elastic" placeholder="{xen:phrase update_your_status}..." rows="3" cols="50" data-statusEditorCounter="#statusEditorCounter"></textarea>
<xen:else />
    <textarea name="message" class="textCtrl Elastic" placeholder="{xen:phrase write_something}..." rows="3" cols="50"></textarea>
</xen:if>

Replace with:

HTML:
<xen:if is="{$visitor.user_id} == {$user.user_id}">
    <xen:if is="{$wysiwyg}">
        {xen:raw $editorTemplate}
    <xen:else />
        <textarea name="message" class="textCtrl StatusEditor Elastic" placeholder="{xen:phrase update_your_status}..." rows="3" cols="50" data-statusEditorCounter="#statusEditorCounter"></textarea>
    </xen:if>
<xen:else />
    <xen:if is="{$wysiwyg}">
        {xen:raw $editorTemplate}
    <xen:else />
        <textarea name="message" class="textCtrl Elastic" placeholder="{xen:phrase write_something}..." rows="3" cols="50"></textarea>
    </xen:if>
</xen:if>


message_simple
-----------------


Find:

HTML:
<article><blockquote class="ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">{xen:helper bodyText, $message.message}</blockquote></article>

Replace with:

HTML:
<article><blockquote class="ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">{xen:helper profileBbCode, $bbCodeParser, 'message_simple', $message.message}</blockquote></article>


news_feed_item_profile_post_insert
-------------------------------------


Find:

HTML:
{xen:helper bodyText, $content.message}

Replace with:

HTML:
{xen:helper snippet, $content.message, $xenOptions.newsFeedMessageSnippetLength}


profile_post_comment
-----------------------


Find:

HTML:
<article><blockquote>{xen:helper bodytext, $comment.message}</blockquote></article>

Replace with:

HTML:
<article><blockquote class="baseHtml">{xen:helper profileBbCode, $bbCodeParser, 'profile_post_comment', $comment.message}</blockquote></article>


profile_post_edit
--------------------


Find:

HTML:
<dl class="ctrlUnit">
    <dt><label for="ctrl_message">{xen:phrase message}:</label></dt>
    <dd><textarea name="message" id="ctrl_message" class="textCtrl Elastic" rows="2">{$profilePost.message}</textarea></dd>
</dl>

Replace with:

HTML:
<dl class="ctrlUnit fullWidth surplusLabel">
    <dt><label for="ctrl_message">{xen:phrase message}:</label></dt>
    <xen:if is="{$wysiwyg}">
        <dd>{xen:raw $editorTemplate}</dd>
    <xen:else />
        <dd><textarea name="message" id="ctrl_message" class="textCtrl Elastic" rows="2">{$profilePost.message}</textarea></dd>
    </xen:if>
</dl>


FAQ

Q: When I update my status on my profile page, the status under my name doesn't show parsed BB code until I refresh the screen.

A: This is only a cosmetic issue visible to you until you refresh your screen. The updated status line is refreshed through Javascript (quick_reply_profile.js) the first time, and it would require a modification of that file.

Q: I want to migrate from vB and keep all the BB Codes in existing visitor messages. How can I do this?

A: You will need to apply a small patch to the Importer script to prevent it from stripping the BB Code:
In library/XenForo/Importer/vBulletin.php
-----------------------------------------


Find:

HTML:
'message' => $parser->render($this->_convertToUtf8($vm['pagetext'])),

Replace it with

HTML:
'message' => $this->_convertToUtf8($vm['pagetext']),
Download tuoitreit.vn_addon-mrprofilebbcode_120.zip (230.71 KB)
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top