View Single Post
  #1  
Old 07-26-2011, 07:04 PM
Chris8's Avatar
Chris8 Chris8 is offline
 
Join Date: Nov 2009
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Parsing BBcodes in custom fields on member profile page.

People of vB perhaps you will be able to help me at least this time. I'm struggling with this problem since two days or so and I still cannot get it to work. I'm using vbulletin 3.8 series.

How the heck I will get bbcodes to work in custom fields in members profile. I'm trying to turn on smiles, urls and image parsing. I've digged various tutorials and plugins and and I've done a several mixes of them all and non of it works. I must be missing something obvious.

Here are some sample plugins I've tried.

PHP Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="parse_member_bbcode" active="1">
    <title>Parse BBCode in member profile fields</title>
    <description><![CDATA[Parse bbcode for profile fields in members profiles.]]></description>
    <version>1.0.0</version>
    <codes>
    </codes>
    <templates>
    </templates>
    <plugins>
        <plugin active="1">
            <title>Parse BBCode in extra profile fields</title>
            <hookname>member_complete</hookname>
            <phpcode><![CDATA[$userinfo['field7'] = $parser->do_parse($userinfo['field7']);
$userinfo['field8'] = $parser->do_parse($userinfo['field8']);
$userinfo['field9'] = $parser->do_parse($userinfo['field9']);
$userinfo['field10'] = $parser->do_parse($userinfo['field10']);
$userinfo['field11'] = $parser->do_parse($userinfo['field11']);]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>Parse BBCode in custom profile fields</title>
            <hookname>member_customfields</hookname>
            <phpcode><![CDATA[$profilefield['value'] = $parser->do_parse($profilefield['value']);]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>Init BBCode-Parser</title>
            <hookname>member_start</hookname>
            <phpcode><![CDATA[require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
    </phrases>
    <options>
    </options>
</product>

not working
PHP Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="bbcodes_style_profile" active="1">
    <title>Parse BBCode in Custom Profile Fields</title>
    <description>Give your users the full effect by letting them use BB Code in their profile.</description>
    <version>1.1</version>
    <codes>
    </codes>
    <templates>
    </templates>
    <plugins>
        <plugin active="1">
            <title>Parse BBCode for Custom Profile Fields</title>
            <hookname>member_customfields</hookname>
            <phpcode><![CDATA[if (!is_object($bbcode_parser))
    {
        require_once(DIR . '/includes/class_bbcode.php');
        $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
    }
     $profilefield['value'] = $bbcode_parser->parse($userinfo["$profilefieldname"],0, true);]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
    </phrases>
    <options>
    </options>
</product>
members page goes blank


in member_complete
PHP Code:
if ($userinfo['field7'])
{
if (!
is_object($bbcode_parser))
{
require_once(
DIR '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
}
$userinfo['field7'] = $bbcode_parser->parse($userinfo['field7'],0true);

not working

another one in member_complete
PHP Code:
require_once(DIR '/includes/class_bbcode.php'); 
$parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());

$post[field7] = $parser->do_parse($post[field7], falsefalsetruefalsefalsetrue); 

Not working and so on... I've used of course a proper field number and bbcode parameters. So any help would be appreciated. I would be grateful if you could share a solution that will work in 100% percent.

Please, help me.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01261 seconds
  • Memory Usage 1,796KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete