2010-08-12, 05:59 PM
2010-08-13, 06:44 AM
Copy and paste the entire code please.
2010-08-16, 05:48 PM
<?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 ( '&', '&', $string );
$string = str_replace ( ''', '\'', $string );
$string = str_replace ( '"', '"', $string );
$string = str_replace ( '<', '<', $string );
$string = str_replace ( '>', '>', $string );
$string = str_replace ( 'ü', '?', $string );
$string = str_replace ( 'Ü', '?', $string );
$string = str_replace ( 'ä', '?', $string );
$string = str_replace ( 'Ä', '?', $string );
$string = str_replace ( 'ö', '?', $string );
$string = str_replace ( 'Ö', '?', $string );
return $string;
}
?>