All pastes #936756 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-10 16:59 UTC
rendered paste body
<?php
/*-----------------------------------------------------
-- Mono Country v1.0 BETA
-- A product of DBS-entertainment
-- Copyright held 2005 by Dabomstew
-- INDEX.php
-----------------------------------------------------*/
session_start();
class bbcode {
var $engine="";
function bbcode()
{
require "bbcode_engine.php";
$this->engine= new bbcode_engine;
$this->engine->cust_tag("/</","&lt;");
$this->engine->cust_tag("/>/","&gt;");
//Since \n and <br> screw up preg, convert them out.
$this->engine->cust_tag("/\n/","&nbrlb;");
$this->engine->simple_bbcode_tag("b");
$this->engine->simple_bbcode_tag("i");  
$this->engine->simple_bbcode_tag("u");  
$this->engine->simple_bbcode_tag("s");
$this->engine->simple_bbcode_tag("sub");  
$this->engine->simple_bbcode_tag("sup");
$this->engine->simple_bbcode_tag("big");
$this->engine->simple_bbcode_tag("small"); 
$this->engine->adv_bbcode_tag("list","ul");
$this->engine->adv_bbcode_tag("olist","ol");
$this->engine->adv_bbcode_tag("item","li");
$this->engine->adv_option_tag("font","font","family");
$this->engine->adv_option_tag("size","font","size"); 
$this->engine->adv_option_tag("url","a","href");
$this->engine->adv_option_tag("color","font","color");
$this->engine->adv_option_tag("style","span","style");
$this->engine->simp_option_notext("img","src");
$this->engine->simp_bbcode_att("img","src");
$this->engine->cust_tag("/\(c\)/","&copy;");
$this->engine->cust_tag("/\(tm\)/","&#153;");
$this->engine->cust_tag("/\(r\)/","&reg;");
$this->engine->adv_option_tag_em("email","a","href");
$this->engine->adv_bbcode_att_em("email","a","href");

$this->engine->cust_tag("/\[left\](.+?)\[\/left\]/","<div align='left'>\\1</div>");
$this->engine->cust_tag("/\[center\](.+?)\[\/center\]/","<div align='center'>\\1</div>");
$this->engine->cust_tag("/\[right\](.+?)\[\/right\]/","<div align='right'>\\1</div>");
$this->engine->cust_tag("/\[quote=(.+?)\](.+?)\[\/quote\]/","<div class='quotetop'>QUOTE(\\1)</div><div class='quotemain'>\\2</div>");
$this->engine->cust_tag("/\[quote\](.+?)\[\/quote\]/","<div class='quotetop'>QUOTE</div><div class='quotemain'>\\1</div>");
$this->engine->cust_tag("/\[code\](.+?)\[\/code\]/","<div class='codetop'>CODE</div><div class='codemain'><code>\\1</code></div>");
$this->engine->cust_tag("/\[codebox\](.+?)\[\/codebox\]/","<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>\\1</div>");
$this->engine->cust_tag("/&nbrlb;/","<br />\n"); 
}
function bbcode_parse($html)
{
return $this->engine->parse_bbcode($html);
}

}
function strip_html_tags($text)
{
return preg_replace("/<(.+?)>/is","", $text);
}
function forums_rank($tp)
{

if ( $tp < 3 ) { return "#1 Absolute Newbie"; }
else if ( $tp < 7 ) { return "#2 Newbie"; }
else if ( $tp < 12 ) { return "#3 Beginner"; }
else if ( $tp < 18 ) { return "#4 Not Experienced"; }
else if ( $tp < 25 ) { return "#5 Rookie"; }
else if ( $tp < 50 ) { return "#6 Average"; }
else if ( $tp < 100 ) { return "#7 Good"; }
else if ( $tp< 200 ) { return "#8 Very Good"; }
else if ( $tp < 350 ) { return "#9 Greater Than Average"; }
else if ( $tp < 500 ) { return "#10 Experienced"; }
else if ( $tp < 750 ) { return "#11 Highly Experienced"; }
else if ( $tp < 1200 ) { return "#12 Honoured"; }
else if ( $tp < 1800 ) { return "#13 Highly Hounoured"; }
else if ( $tp < 2500 ) { return "#14 Respect King"; }
else if ( $tp < 5000) { return "#15 True Champion"; }
}
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
$_GET['u'] = abs((int) $_GET['u']);
$bbc = new bbcode();
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{
$q=mysql_query("SELECT u.*,us.*,c.*,h.*,g.*,f.*,ul.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN cities c ON u.location=c.cityid LEFT JOIN houses h ON u.maxwill=h.hWILL LEFT JOIN gangs g ON g.gangID=u.gang LEFT JOIN fedjail f ON f.fed_userid=u.userid LEFT JOIN users_levels ul ON u.user_level=ul.ul_id WHERE u.userid={$_GET['u']}",$c);
if(mysql_num_rows($q) == 0)
{
print "Sorry, we could not find a user with that ID, check your source.";
}
else
{
$r=mysql_fetch_array($q);
if ( !$r['married'] )
{
$marital="<font color='red'>No</font>";
$partner="";
}
else
{
$k=mysql_query("SELECT username FROM users WHERE userid={$r['married']}", $c);
$mrname=mysql_result($k,0,0);
$marital="<a href='viewuser.php?u={$r['married']}' style='color:green;'>".$mrname."</a>";
$partner=" [With <a href='viewuser.php?u={$r['married']}'>".$mrname."</a>]";
}
$userl=$r['ul_name'];
$lon=date('F j, Y g:i:s a',$r['laston']);
$sup=date('F j, Y g:i:s a',$r['signedup']);
$ts=$r['strength']+$r['agility']+$r['guard']+$r['labour']+$r['IQ'];
$d="";
$la=time()-$r['laston'];
$unit="seconds";
if($la >= 60)
{
$la=(int) ($la/60);
$unit="minutes";
}
if($la >= 60)
{
$la=(int) ($la/60);
$unit="hours";
if($la >= 24)
{
$la=(int) ($la/24);
$unit="days";
}
}
if($r['ul_color']) {
$uname="<font color='{$r['ul_color']}'>";
if($r['ul_isbold']) { $uname.="<b>"; }
$uname.=$r['username'];
if($r['ul_isbold']) { $uname.="</b>"; }
$uname.="</font>";
$r['username']=$uname;
}
else if($r['donatordays']) {
$r['username'] = "<font color=red>{$r['username']}</font>";
} 
if($r['donatordays']) {$d="<img src='donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; }
if($r['laston'] >= time()-15*60) { $on="<font color=green><b>Online</b></font>"; } else { $on="<font color=red><b>Offline</b></font>"; }
if($r['cityminlevel'] <= $ir['level'] && $r['location'] != $ir['location']) { $travel="[<a href='monorail.php?i={$r['location']}' style='font-weight: 800;'>Travel</a>]"; } else { $travel=""; }
if(!$r['gender']) { $r['gender']="Shemale"; }
print "<h3>Profile for {$r['username']}</h3>
<table width=100%><tr style='background:gray'><th width=40%>General Info</th><th width=30%>Financial Info</th> <th width=40%>Display Pic</th></tr>
<tr><td valign=top>Name: {$r['username']} [{$r['userid']}] $d<br />
User Level: $userl<br />";
$total=$r['crimes_1']+$r['crimes_2']+$r['crimes_3']+$r['crimes_4']+$r['crimes_11'];
if($r['ul_isstaff']) { print "\nDuties: {$r['duties']}<br />"; }
print "\nGender: {$r['gender']}<br />
Signed Up: $sup<br />
Last Active: $lon<br />
Last Action: $la $unit ago<br />
Online: $on<br />
Days Old: {$r['daysold']}<br />
Location: {$r['cityname']} $travel<br />
Posts: {$r['posts']}<br />
Married: $marital</td><td valign=top>
Money: \${$r['money']}<br />
Crystals: {$r['crystals']}<br />
Property: {$r['hNAME']}{$partner}<br />
Crimes Comitted: {$total}<br />
Referals: ";
$rr=mysql_query("SELECT * FROM referals WHERE refREFER={$r['userid']}",$c);
print mysql_num_rows($rr);
$q_y=mysql_query("SELECT * FROM friendslist WHERE fl_ADDED={$r['userid']}",$c);
$q_z=mysql_query("SELECT * FROM blacklist WHERE bl_ADDED={$r['userid']}",$c);
$q_x=mysql_query("SELECT * FROM cars_playercars WHERE cpcPLAYER={$r['userid']}",$c);
print "<br />
Friends: ".mysql_num_rows($q_y)."<br />
Enemies: ".mysql_num_rows($q_z)."<br />
Cars: ".mysql_num_rows($q_x)."<br />
</td> <td valign=top>";
if($r['display_pic'])
{
print "<img src='{$r['display_pic']}' width='200' height='200' alt='User Display Pic' title='User Display Pic' />";
}
else
{
print "This user has no display pic!";
}
print "</td></tr>
<tr style='background:gray'><th>Physical Info</th><th>Contact</th><th>Links</th></tr>
<tr><td valign=top>Level: {$r['level']}<br />
Game Rank: ".get_gamerank($r['level'],$r['hPRICE'],$r)."<br />
Health: {$r['hp']}/{$r['maxhp']}<br />
Gang: ";
if($r['gang'])
{
print "<a href='gangs.php?action=view&ID={$r['gang']}'>{$r['gangNAME']}</a>";
}
else
{
print "N/A";
}
if($r['fedjail'])
{
print "<br /><b><font color=red>In federal jail for {$r['fed_days']} day(s).<br />
{$r['fed_reason']}</font>";
}
if($r['hospital'])
{
print "<br /><b><font color=red>In hospital for {$r['hospital']} minutes.<br />{$r['hospreason']}</font></b>";
}
if($r['travelling'])
{
print "<br /><b><font color=red>Currently travelling</font></b>";
}
if($ir['user_level'] > 1)
{
print "<br />IP Address: {$r['lastip']}";
print "<form action='staffnotes.php' method='post'>
Staff Notes: <br />
<textarea rows=7 cols=40 name='staffnotes'>{$r['staffnotes']}</textarea>
<br /><input type='hidden' name='ID' value='{$_GET['u']}' />
<input type='submit' value='Change' /></form>";
}
print "</td><td valign=top>
Email Address: ".(($r['public_email']) ? $r['public_email'] : "Undisclosed") . "<br />
MSN: ".(($r['public_msn']) ? $r['public_msn'] : "Undisclosed") . "<br />
YIM: ".(($r['public_yim']) ? $r['public_yim'] : "Undisclosed") . "<br />
AIM: ".(($r['public_aim']) ? $r['public_aim'] : "Undisclosed") . "<br />
ICQ: ".(($r['public_icq']) ? $r['public_icq'] : "Undisclosed") . "</td>
<td valign=top>[<a href='mailbox.php?action=compose&ID={$r['userid']}'>Send Mail</a>] <br /><br />
[<a href='sendcash.php?ID={$r['userid']}'>Send Cash</a>]<br /><br />

[<a href='attack.php?ID={$r['userid']}'>Attack</a>]<br /><br />
[<a href='hackpc.php?ID={$r['userid']}'>Hack Users PC</a>]<br /><br />
[<a href='hirespy.php?ID={$r['userid']}'>Hire Spy</a>]";
if ( $ir['user_level'] == 2)
{
print "<br /><br />
[<a href='admin.php?action=stafflog&ID={$r['userid']}'>Staff Log</a>]";
}
if($ir['donatordays'] > 0)
{
print "<br /><br />
[<a href='friendslist.php?action=add&ID={$r['userid']}'>Add Friends</a>]<br /><br />
[<a href='blacklist.php?action=add&ID={$r['userid']}'>Add Enemies</a>]<br />";
}
$rank=forums_rank($r['posts']);
if($r['forums_avatar']) { $av="<img src='{$r['forums_avatar']}' width='100' height='100' />"; } else { $av="<img src='noav.gif' />"; }
if(!$r['forums_signature']) { $r['forums_signature']="No Signature"; } else {$r['forums_signature']=$bbc->bbcode_parse($r['forums_signature']); }
print "</td></tr>
<tr style='background:gray'><th colspan='2'>Signature</th></tr>
<tr>
<td colspan='2'>
{$r['forums_signature']}</td>
</tr></table>";
}
}
$h->endpage();
?>