<?php
#MyBB Account Manager Script integration [byTeraByTe]
# Description : Fetches user information based on their last post IP, displays Avatar, UserGroup, Posts Number, Rep, Email.
# Author : TeraByTe
# Created : 5/21/2011
# Updated : N/A
# Thread : http://mybbsource.com/
#MyBB Account Manager Script integration [byTeraByTe]
/*************************************************\
\*************************************************/
/*************************************************\
\*************************************************/
/*************************************************\
\*************************************************/
#Start Settings
$board_title = "Hallway Insider"; // Board Title
$db_host = "localhost"; // Database Host
$db_user = "terabyte_root"; // Database UserName
$db_pass = "pass123"; // Database Password
$db_name="terabyte_forum"; // Database name
$db_prefix ="mybb_"; // Table prefix
#End Settings
/*************************************************\
\*************************************************/
/*************************************************\
\*************************************************/
/*************************************************\
\*************************************************/
$input = $_SERVER['REMOTE_ADDR'];
$request = $_GET['request'];
if($input){
$conn = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db_name, $conn);
$query = "SELECT * FROM ".$db_prefix."users WHERE lastip = '$input'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$user = $row['username'];
$posts = $row['postnum'];
$group = $row['usergroup'];
$ptz = $row['newpoints'];
$rep = $row['reputation'];
$ava = $row['avatar'];
$email = $row['email'];
# Start Ranks
if($group == '4'){$gname = 'Administrator';}if($group == '2'){$gname = 'Member';}if($group == '8'){$gname = 'Subscriber';}if($group == '3'){$gname = 'Super Moderator';}if($group == '6'){$gname = 'Moderator';}if($group == '7'){$gname = 'Banned';}if($group == '9'){$gname = 'Community Contributor';}
# Stop Ranks
#Start Rep Title
if ($rep >= '1')
{
$tit = "Neutral";
}
if ($rep >= '2')
{
$tit = "Good";
}
if ($rep <= '0')
{
$tit = "Bad";
}
if(mysql_num_rows($result)){
?>
<!-- API :
User : <?=$user?> @
Posts : <?=$posts?> @
Group : <?=$gname?> @
Rep : <?=$rep?> @
Ava : <?=$ava?> @
-->
<html><head>
<title><?=$board_title?></title>
<style>
.body{
background-color: #C5D0DC;
}
.mods_box{
background: #dce7f2;
border-top: 1px solid #ebf2f8;
border-bottom: 1px solid #ebf2f8;
padding:0px;
text-align:left;
margin:0;
}
.mods_box item{
text-align:right;
}
a:link {
text-decoration: none;
color: #000;
}
a:visited {
text-decoration: none;
color: #000;
}
a:hover {
text-decoration: none;
color: #0F0;
}
a:active {
text-decoration: none;
color: #000;
}
@font-face {
font-family: ink;
src: url('http://media.hallwayinsider.com/fonts/i.ttf');
}
@font-face {
font-family: f25;
src: url('http://media.hallwayinsider.com/fonts/f25.ttf');
}
#welcome-block {
width: 100%;
overflow: none;
}
.welcome-picture {
float: left;
padding: 18px;
margin: 0px;
}
.welcome-info {
float: left;
width: 40%;
border-left: 1px solid #e4ebf2;
padding-left: 20px;
}
#welcome-block dt {
float: left;
clear: left;
width: 40%;
}
#welcome-block dd {
float: left;
}
.title {
font-size: 18px;
font-weight: bold;
color: #fff;
border: 1px solid #bbb;
background: #333333;
width: 291px;
margin-bottom: 0;
padding: 4px;
margin-right: 20px;
border-bottom: 0;
}
</style>
</head>
<body class="body">
<div class="mods_box"><font size="90" face="ink"><center><?=$board_title?> Account Manager [BETA]</center></font></div>
<div class="mods_box"><div id='welcome-block'>
<div class='welcome-picture'>
<img src='<?=$ava?>' alt="<?=$user?>'s Photo" width='96' height='100' class='photo' />
</div>
<div class='welcome-info'>
<dl>
<dt><strong>Name</strong></dt>
<dd><?=$user?></dd>
<dt><strong>Group</strong></dt>
<dd><span style='color: green'><b><?=$gname?></b></span></dd>
<dt><strong>Email</strong></dt>
<dd><?=$email?></dd>
<dt><strong>Total Posts</strong></dt>
<dd><?=$posts?></dd>
<dt><strong>Reputation</strong></dt>
<dd>
<div class='reputation positive'>
<span class='number'><?=$rep?></span>
<span class='title'><?=$tit?></span>
</div>
</dd>
</dl>
</div>
</div></div>
</body>
</html>
<?
}
elseif(!isset($modify) && !isset($_GET['browse'])) {
die("Please make a post on $board_title, and try again.");
}
} else {
echo 'Please enter a username';
}
?>