##############################################################
## MOD Title: BBCode Avatar
## MOD Author: khaledelmansoury < khaledelmansoury@hotmail.com > (Khaled El Mansoury) http://master-portal.pytalhost.net/
## MOD Description: Mit diesem Mod kannst du per BBCode das Avatars 
##                  eines users zeigen, z.B: [avatar]ABC[/avatar], nun 
##                  erscheint statt dieses Codes das Avatar des Users ABC
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 5 min
## Files To Edit: 1
##                includes/bbcode.php
## Included Files:  show_avatar.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy show_avatar.php to show_avatar.php
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
	// [i] and [/i] for italicizing text.
	$text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
	$text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);

#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Avatar code start
    $text = preg_replace("#\[avatar:$uid\](.*?)\[/avatar:$uid\]#sie", "make_avatar_link('\\1')", $text);
	// Avatar code end
#
#-----[ FIND ]------------------------------------------
#
	// [i] and [/i] for italicizing text.
	$text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$text = preg_replace("#\[avatar\](.*?)\[/avatar\]#si", "[avatar:$uid]\\1[/avatar:$uid]", $text);
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function make_avatar_link($user)
{
  return "<a href=\"profile.php?mode=viewprofile&u=$user\"><img border=\"0\" src=\"show_avatar.php?username=$user\"></a>";

}	

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM