2012-02-04, 06:32 PM
(This post was last modified: 2012-02-04, 06:35 PM by ebildude123.)
So i wanted to make a plugin for mybb but i failed badly
I tried this but it wasn't working, anyone know why? and how to fix it?
I tried this but it wasn't working, anyone know why? and how to fix it?
<?php
/*********************************************************************************************
License:
1. No redistribution
2. No claiming as your own
You can however:
3. Modify for personal use without breaking rule 2
Thanks for using UserCP Ref Tools.
**********************************************************************************************
*/
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("usercp", "ref_tools");
function usercp_ref_tools_info()
{
return array(
"name" => "UserCP Ref Tools",
"description" => "This plugin adds ref tools to the UserCP page.",
"website" => "http://everythingcentral.org",
"author" => "ebildude123",
"authorsite" => "http://everythingcentral.org",
"version" => "1.0",
"guid" => "NULL",
"compatibility" => "16*"
);
}
function ref_tools($page)
{
$page = str_replace("<!-- end: usercp_referrals -->\n</td>\n</tr>\n</table>", "<!-- end: usercp_referrals -->\n</td>\n</tr>\n</table>\n<br />\n<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">\n<tr>\n<td class=\"thead\" colspan=\"{$colspan}\"><strong>Referral Tools</strong></td>\n</tr>\n<tr>\n<td class=\"trow2\">\n<img src=\"/images/refbanners/1.png\">\n<br />\nBBCode:\n<br />\n<div id=\"pid_0\" class=\"post_body\">\n<div class=\"body\" dir=\"ltr\">\n<code>\n[url={$mybb->settings['bburl']}/member.php?action=register&referrer={$mybb->user['uid']}][img]
{$mybb->settings['bburl']}/images/refbanners/1.png[/img][/url]\n</code>\n</div>\n</div>\n<br />\nHTML:\n<br />\n<div id=\"pid_0\" class=\"post_body\">\n<div class=\"body\" dir=\"ltr\">\n<code>\n<a href="{$mybb->settings['bburl']}/member.php?action=register&referrer={$mybb->user['uid']}"><img
src="{$mybb->settings['bburl']}/images/refbanners/1.png"></a>\n</code>\n</div>\n</div>\n</td>\n</tr>\n</table>", $page);
return $page;
}
?>