2013-01-13, 02:19 PM
I'm creating a plugin and it seems to not work. I have limited knowledge of PHP unfortunately, but I thought I would try.
It is returning: "Parse error: syntax error, unexpected T_CLASS in /public_html/inc/plugins/pmtoast.php on line 34"
Can you please tell me how to fix this?
It is returning: "Parse error: syntax error, unexpected T_CLASS in /public_html/inc/plugins/pmtoast.php on line 34"
Can you please tell me how to fix this?
<?php
/****************************************************
* *
* PMToast 1.1 *
* Copyright © 2013 Xige Time, All Rights Reserved. *
* *
****************************************************/
// Pligin info.
function newsbar_info()
{
return array(
'name' => 'PM Toast',
'description' => 'PM Toast adds an advanced new Private Message notification.',
'website' => 'http://icyboards.com',
'author' => 'Xige Time',
'authorsite' => 'http://avastyles.com/',
'version' => '1.1'
);
}
// Stopping direct access.
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br /><i>Please make sure IN_MYBB is defined.</i>");
}
// Adding Hooks.
$plugins->add_hook("global_pm_alert", "pmtoast_template");
$plugins->add_hook("global.css", "pmtoast_styles");
// Creating PMToast.
function pmtoast_template($page)
{
$page = str_replace("<div class=\"pm_alert\" id=\"pm_notice\"><div class=\"float_right\"><a href=\"private.php?action=dismiss_notice&my_post_key={$mybb->post_code}\" title=\"{$lang->dismiss_notice}\" onclick=\"return MyBB.dismissPMNotice()\"><img src=\"{$theme['imgdir']}/dismiss_notice.gif\" alt=\"{$lang->dismiss_notice}\" title=\"[x]\" /></a></div><div>{$privatemessage_text}</div></div><br />\", "<div class=\"pm_alert\" id=\"pm_notice\">
<div class=\"float_right\"><a href=\"private.php?action=dismiss_notice&my_post_key={$mybb->post_code}\" title=\"{$lang->dismiss_notice}\" onclick=\"return MyBB.dismissPMNotice()\"><span id=\"pm_close\">Close</span></a></div><div>{$privatemessage_text}</div></div><br />", $page);
return $page;
}
function pmtoast_styles($page)
{
$page = str_replace("img {", ".pm_alert {/* DO NOT REMOVE */width: 120px;margin: 0 auto;height: 100px;position: fixed;bottom: 3%;left: 85%;right: 0%;text-align: left;z-index: 70;padding: 5px;/* END - DO NOT REMOVE */font-weight: normal;background: #FFFFFF;border: 1px solid #0F5C8E;color: #000000;font-size: 10px;}#pm_close {font-size: 9px;float:right;padding-top: 89px;} img {")
}
?>