MyBB Community Forums

Full Version: Plugin Hostera 1.6 [HELP]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<?php
/*
@------------------------------------------[-at-]
| Room Link 1.0 PLUGIN |
| BY Nexack |
[-at-]------------------------------------------[-at-]
*/
if(!defined("IN_MYBB"))
{
die("Nie tak! Plik powinien zostac wlczony za pomoca MyBB!");
}
$plugins->add_hook("usercp_start", "wpanelu1");
function room_info()
{
return array(
"name" => "Room Link",
"description" => "Menu Hostera - Room Link</b>",
"website" => "http://haxball-manager.pl/",
"author" => "Nexack",
"authorsite" => "http://haxball-manager.pl/",
"version" => "1.0",
);
}
function room_install()
{
global $db;
$query2 = " CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."room` (
`id` varchar(15) NOT NULL default '0',
`info` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
$db->query($query2);
$query = '<html>
<head>
<title>{$lang->user_cp}</title>
{$headerinclude}
</head>
<body>
{$header}
<style type="text/css">
._info {
background-color:#FFFACD;
border: 1px solid #DAA520;
width: 30%;
margin: 2px;
}
</style>
<table width="100%" border="0" align="center">
<tr>
{$usercpnav}
<td valign="top">
<table border="0" cellspacing="{$theme[\\\'borderwidth\\\']}" cellpadding="{$theme[\\\'tablespace\\\']}" class="tborder">
<tr>
<td class="thead" colspan="{$colspan}"><strong>Panel Hostera</strong></td>
</tr>
<tr>
{$avatar}
<td class="trow2">
<center><br />Witaj <strong>{$username}</strong>,<br /><br />
<p>Podaj link room lub zaznacz, ze go nie ma</p>
</center>
</td>
</tr>
<tr>
<td class="trow2">
<center><form action="./usercp.php?action=do_room" method="post">
Wprowadz link:
<input type="radio" name="info" onclick="document.getElementById(\'identyfikator\').style.display = this.checked ? \'block\' : \'none\'; this.form.elements[\'info\'].disabled = !this.checked" />
<div id="identyfikator" style="display: none">
<input type="text" name="info" />
</div>
<br />
Brak Hosta:
<input type="radio" name="info" value="Brak Hosta" onclick="document.getElementById(\'identyfikator\').style.display = this.checked ? \'none\' : \'block\'; this.form.elements[\'info\'].disabled = this.checked" />
<input type="submit" name="poszlo" value="Wyslij!" /></form>{$informacja}</center>
</td>
</tr>
</table>
{$latest_subscribed}
{$latest_threads}
{$latest_warnings}
{$user_notepad}
</td>
</tr>
</table>
{$footer}
</body>
</html>';
$db->escape_string("INSERT INTO ".TABLE_PREFIX."templates (`title`, `template`, `sid`) VALUES (`usercp_room`, `$query`, `-1`);");
}
function room_uninstall()
{
global $db;
$db-->query("DROP TABLE ".TABLE_PREFIX."room RESTRICT");
}
function room_deactivate()
{
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='usercp_room'");
}
function room_is_installed()
{
global $db, $info;
$query = $db->simple_select("templates", "*", "title=\"usercp_room\"");
$group = $db->fetch_array($query);
if($group === null || empty($group))
{
$info = false;
}
else
{
$info = true;
}
return $info;
}
function wpanelu1($page)
{
global $header, $headerinclude, $usercpnav, $footer, $mybb, $theme, $db, $lang, $templates;
if(THIS_SCRIPT == "usercp.php")
{
if($mybb->input['action'] == "room" || $mybb->input['action'] == "do_room")
{
if($mybb->input['action'] == "room")
{
add_breadcrumb($lang->nav_usercp, "usercp.php");
add_breadcrumb("Host Panel");
$username = $mybb->user['username'];
eval("\$usercp_room = \"".$templates->get("usercp_room")."\";");
output_page($usercp_room);
}
if($mybb->input['action'] == "do_room")
{
add_breadcrumb($lang->nav_usercp, "usercp.php");
add_breadcrumb("Host Panel");
$db->query("UPDATE ".TABLE_PREFIX."room SET info='$info' WHERE id='0'");
$stalosie = "Link zostal zaktualizowany";
}
output_page('<html><head><script type="text/javascript">
alert("'.$stalosie.'");
document.location="http://haxlife.com/usercp.php?action=room";
</script></head><body>
</body></html>');
}
}
else
{
return;
}
}
?>

this is the code.
There is document.location= it give always f5 to page 
If I delete this code. Page is only white.
we can't see $query html on link