MyBB Community Forums

Full Version: HTML Usertitle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I downloaded HTML usertitle, and whenever I put html in my usertitle this happens (See attachment) How can I fix it?
Copy and paste the entire code please.
<?php
/**
 * HTML/BBCode User Titles
 *
 * Allows administrators to specify a BBcode/HTML usertitle
 *
 * Copyright 2008 Nick AKA Nickman
 */

if(!defined("IN_MYBB")) {
    die("This file cannot be accessed directly.");
}

$plugins->add_hook("admin_user_users_edit", "parseIt");
$plugins->add_hook("datahandler_user_update","unDoIt");

function bbcodetitle_info() {
    return array(
        "name"				=> "BBCode Usertitle",
        "description"		=> "Allows administrators to specify a BBcode/HTML usertitle",
        "website"			=> "http://www.mybbsource.com",
        "author"			=> "Nickman",
        "authorsite"		=> "http://mybbsource.com",
        "version"			=> "1.0"
    );
}

function bbcodetitle_activate() {
	global $db;
}
function parseIt()
{
	global $db,$mybb,$user;
	require_once MYBB_ROOT."inc/class_parser.php";
	$parser=new postParser();
	$parser_options = array(
				"allow_html" => "yes",
				"allow_mycode" => "yes",
				"allow_smilies" => "yes",
				"allow_imgcode" => "yes",
			);
			define("BBCODE_ALLOWED",true);
	$user['usertitle']=$parser->parse_message($user['usertitle'],$parser_options);
	return;
}
function unDoIt($arguments)
{
	if (defined('BBCODE_ALLOWED'))
	{

		$arguments->user_update_data['usertitle']=undo($arguments->user_update_data['usertitle']);
	}
}
function undo( $string )
{
  $string = str_replace ( '&amp;', '&', $string );
  $string = str_replace ( ''', '\'', $string );
  $string = str_replace ( '&quot;', '"', $string );
  $string = str_replace ( '&lt;', '<', $string );
  $string = str_replace ( '&gt;', '>', $string );
  $string = str_replace ( '&uuml;', '?', $string );
  $string = str_replace ( '&Uuml;', '?', $string );
  $string = str_replace ( '&auml;', '?', $string );
  $string = str_replace ( '&Auml;', '?', $string );
  $string = str_replace ( '&ouml;', '?', $string );
  $string = str_replace ( '&Ouml;', '?', $string );
  return $string;
}
?>