<?php
/**
* MyBB 1.4
* Copyright © 2008 MyBB Group, All Rights Reserved
*
* Default Avatar by Santiago Dimattia
* http://www.teleportz.com.ar
*
*/
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("postbit", "add_default_avatar_postbit");
$plugins->add_hook("member_profile_end", "add_default_avatar_memberpage");
function default_avatar_info()
{
/**
* Array of information about the plugin.
* name: The name of the plugin
* description: Description of what the plugin does
* website: The website the plugin is maintained at (Optional)
* author: The name of the author of the plugin
* authorsite: The URL to the website of the author (Optional)
* version: The version number of the plugin
* guid: Unique ID issued by the MyBB Mods site for version checking
* compatibility: A CSV list of MyBB versions supported. Ex, "121,123", "12*". Wildcards supported.
*/
return array(
"name" => "Default avatar",
"description" => "Show a default avatar is the user dosn't have one",
"website" => "",
"author" => "Santiago Dimattia",
"authorsite" => "http://www.teleportz.com.ar",
"version" => "0.1",
"guid" => "",
"compatibility" => "14*"
);
}
function default_avatar_activate()
{
return TRUE;
}
function default_avatar_deactivate()
{
return TRUE;
}
function add_default_avatar_postbit(&$post)
{
global $mybb, $templates;
if($post['useravatar'] == '')
{
$post['avatar'] = 'images/avatars/invalid_url.gif';
$avatar_width_height = 'width="84" height="84"';
eval("\$avatar .= \"".$templates->get("postbit_avatar")."\";");
$post['useravatar'] = $avatar;
}
return $post;
}
function add_default_avatar_memberpage()
{
global $mybb, $templates, $memprofile, $avatar;
if($avatar == '')
{
$avatar = '<img src="images/avatars/invalid_url.gif" alt="" width="84" height="84" />';
}
return true;
}
?>