Guest User

profile.php

a guest
Dec 16th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 46.60 KB | None | 0 0
  1. <?php
  2. /*------------includes--------------*/
  3. include('./includes/connections.php');
  4. include('./includes/brain_file.php');
  5. include('./includes/style_top.php');
  6. include('./includes/bbcode_parser.php');
  7. include('./includes/post_bbcode.php');
  8. /*------------includes--------------*/
  9.  
  10. $_GET['XID'] = abs(intval($_GET['XID']));
  11. if (!$_GET['XID']) {
  12.     echo "<center>Error, Invalid ID!
  13.           <hr width = '75%'>
  14.           &gt;<a href='javascript:history.back()'>Back</a>
  15.           <hr width = '75%'>";
  16. } else {
  17.     $q_ry = "SELECT m.playerid,m.playername,m.am_i_staff,m.my_duties,m.my_level,m.my_rank,m.my_property,
  18.                       m.my_gender,m.my_country,m.my_jail,m.my_hosp,m.my_dondays,m.vipday,m.my_forumscore,m.my_forumposts,m.laston,m.jail_reason,
  19.                       m.hosp_reason,m.my_partner,m.my_partner_days,m.my_life,m.my_maxlife,m.my_faction,
  20.                       m.signup_time,m.last_login_time,m.my_traveltime,m.my_city,
  21.                       m.my_mailban,m.mban_reason,m.my_forumban,m.fban_reason,
  22.                       me.my_daysold,me.my_sig_nature,me.my_job,me.my_job_rank,me.my_comp,me.my_married_times,me.shop_status,me.display_case,
  23.                       mp.my_timesbusted,mp.my_timesjailed,mp.my_crimesdone
  24.                FROM members m
  25.                INNER JOIN members_extra AS me
  26.                ON m.playerid = me.playerid
  27.                INNER JOIN members_personal AS mp
  28.                ON m.playerid = mp.playerid
  29.                WHERE m.playerid = " . $_GET['XID'] . " ";
  30.     $who  = mysql_query($q_ry);
  31.     if (!mysql_num_rows($who)) {
  32.         echo "<center>Error, Invalid ID!
  33.                <hr width = '75%'>
  34.                &gt;<a href='javascript:history.back()'>Back</a>
  35.                <hr width = '75%'>";
  36.     } else {
  37.         $me = mysql_fetch_array($who);
  38.         echo "<center>
  39.                      <br>
  40.                         <font size='4' face='Arial, Helvetica, sans-serif'>
  41.                            <main>
  42.                               Profile for " . htmlentities($me['playername']) . "
  43.                            </main>
  44.                         </font>
  45.                            <br>
  46.                               <hr width='750px'>";
  47.         $q_ry = "SELECT *
  48.                      FROM profile_skins
  49.                      WHERE ps_playerid = " . $_GET['XID'] . " ";
  50.         $pros = mysql_query($q_ry);
  51.         if (mysql_num_rows($pros)) {
  52.             $ps = mysql_fetch_array($pros);
  53.             if ($ps['ps_bgimage'] || $ps['ps_bgcolor']) {
  54.                 $style = "style = 'background: ";
  55.                 if ($ps['ps_bgcolor']) {
  56.                     $style .= $ps['ps_bgcolor'];
  57.                     if (!$ps['ps_bgimage']) {
  58.                         $style .= ";";
  59.                     }
  60.                 }
  61.                 if ($ps['ps_bgimage']) {
  62.                     $bgimagecheck = array();
  63.                     $bgimagecheck = $ps['ps_bgimage'];
  64.                     $bgimage      = array();
  65.                     $bgimage      = getimagesize($bgimagecheck);
  66.                     if ($bgimage) {
  67.                         $style .= " url(\"" . $bgimagecheck . "\") no-repeat center top;";
  68.                     } else {
  69.                         $style .= ";";
  70.                     }
  71.                 }
  72.                 $style .= "'";
  73.             }
  74.             if ($ps['ps_sigbgcolor'] != '') {
  75.                 $sigcolor = "bgcolor = '" . $ps['ps_sigbgcolor'] . "'";
  76.             } else {
  77.                 $sigcolor = "";
  78.             }
  79.             $table = $style;
  80.             $font  = $ps['ps_fontcolor'];
  81.         } else {
  82.             $sigcolor = "bgcolor = '#DFDFDF'";
  83.             $table    = "";
  84.             $font     = "black";
  85.         }
  86.         echo "<table width = '750px' " . $table . ">
  87.                                     <tr>
  88.                                        <td align = 'left' valign = 'top'>
  89.                                           <font color = 'white'><b><u>Information</b></u></font>
  90.                                              <br>";
  91.        
  92.         if ($me['laston'] >= time() - 15 * 60) {
  93.             $onstatus = "online";
  94.         } else {
  95.             $onstatus = "offline";
  96.         }
  97.         echo "<img src='images/" . $onstatus . ".png' title='" . $onstatus . "'/> ";
  98.         echo "<img src='images/" . $me['my_gender'] . ".gif'> ";
  99.        
  100.         if ($me['my_dondays']) {
  101.             echo "<img src='images/donator.gif' alt = 'Donator: " . $me['my_dondays'] . " days' title = 'Donator: " . $me['my_dondays'] . " days'> ";
  102.         }
  103.         if ($me['vipday']) {
  104.             echo "<img src='images/vip.jpg' alt = 'VIP: " . $me['vipday'] . " days' title = 'VIP: " . $me['vipday'] . " days'> ";
  105.         }
  106.         if ($me['am_i_staff'] > '1') {
  107.             echo "<img src='images/staff.png'> ";
  108.         }
  109.         echo " <br><font color = '" . $font . "'><b>Name:</b> " . user_name($_GET['XID']) . " ";
  110.         echo "<br><b>Online:</b> ";
  111.         if ($onstatus == 'online') {
  112.             echo "<font color=#009900>Online</font>";
  113.         } else {
  114.             echo "Offline";
  115.         }
  116.         $sttus = array(
  117.             'NPC',
  118.             'Civilian',
  119.             '<b><font color=#660099>Helper</font></b>',
  120.             '<b><font color=#0085A3>Moderator</font></b>',
  121.             '<b><font color=#006633>Secretary</font></b>',
  122.             '<b><font color=#AA0000>Admin</font></b>'
  123.         );
  124.         $ranks = array(
  125.             'Absolute beginner',
  126.             'Beginner',
  127.             'Inexperienced',
  128.             'Rookie',
  129.             'Novice',
  130.             'Below Average',
  131.             'Average',
  132.             'Reasonable',
  133.             'Above Average',
  134.             'Competent',
  135.             'Highly competent',
  136.             'Veteran',
  137.             'Distinguished',
  138.             'Highly distinguished',
  139.             'Professional',
  140.             'Star',
  141.             'Master',
  142.             'Outstanding',
  143.             'Celebrity',
  144.             'Supreme',
  145.             'Idol',
  146.             'Champion'
  147.         );
  148.         echo "<br><b>Status:</b> " . $sttus[$me['am_i_staff']] . "
  149.                   <br><b>Duties:</b> " . $me['my_duties'] . "
  150.                   <br><b>Gender:</b> ";
  151.         if ($me['my_gender'] == 'Male') {
  152.             echo "Male";
  153.         } else {
  154.             echo "Female";
  155.         }
  156.         echo "<br><b>Age:</b> " . $me['my_daysold'] . " days
  157.                   <br><b>Level:</b> <a href='newspaper.php?page=hof&type=level'><font color = '" . $font . "'>" . $me['my_level'] . "</font></a>
  158.                   <br><b>Rank:</b> <a href='newspaper.php?page=hof&type=rank'><font color = '" . $font . "'>#" . $me['my_rank'] . " " . $ranks[($me['my_rank'] - 1)] . "</font></a>
  159.                   <br><b>Faction:</b> ";
  160.         if ($me['my_faction']) {
  161.             $q_ry  = "SELECT fac_id,fac_name
  162.                         FROM faction_s
  163.                         WHERE fac_id = " . $me['my_faction'] . " ";
  164.             $fname = mysql_query($q_ry);
  165.             $fn    = mysql_fetch_array($fname);
  166.            
  167.             echo "<a href='view_faction.php?XID=" . $fn['fac_id'] . "'><font color = '" . $font . "'>" . htmlentities($fn['fac_name']) . "</font></a>";
  168.         } else {
  169.             echo "N/A";
  170.         }
  171.         echo "<br><b>Property:</b> ";
  172.        
  173.         $q_ry    = "SELECT p_id,house_name
  174.                      FROM members_properties
  175.                      LEFT JOIN properties p
  176.                      ON mp.p_property = p.house_id
  177.                      WHERE mp.p_id = " . $me['my_property'] . " ";
  178.         $myhouse = mysql_query($q_ry);
  179.         $h       = mysql_fetch_array($myhouse);
  180.         echo "<a href='viewproperties.php?XID=" . $_GET['XID'] . "'><font color = '" . $font . "'>" . htmlentities($h['house_name']) . "</font></a>
  181.                     [<a href='viewproperties.php?XID=" . $_GET['XID'] . "'><font color = '" . $font . "'>View all</font></a>]
  182.                   <br><b>Job:</b> ";
  183.         if ($me['my_job']) {
  184.             $q_ry  = "SELECT job_NAME
  185.                         FROM system_jobs
  186.                         WHERE job_ID = " . $me['my_job'] . " ";
  187.             $myjob = mysql_query($q_ry);
  188.             $myj   = mysql_fetch_array($myjob);
  189.             echo "<a href='job.php'><font color = '" . $font . "'>" . htmlentities($myj['job_NAME']) . "</font></a>";
  190.         } else if ($me['my_comp']) {
  191.             $q_ry  = "SELECT c_owner,c_name
  192.                         FROM members_companies
  193.                         WHERE c_id = " . $me['my_comp'] . " ";
  194.             $myjob = mysql_query($q_ry);
  195.             $myj   = mysql_fetch_array($myjob);
  196.             if ($_GET['XID'] == $myj['c_owner']) {
  197.                 echo "Director";
  198.             } else {
  199.                 echo "Employee";
  200.             }
  201.             echo " (<a href='companies.php?action=view&XID=" . $me['my_comp'] . "'><font color = '" . $font . "'>" . htmlentities($myj['c_name']) . "</font></a>)";
  202.         } else {
  203.             echo "None";
  204.         }
  205.         echo "<br><b>Life:</b> " . $me['my_life'] . " / " . $me['my_maxlife'] . "
  206.                         <br><b>Marital Status: </b>";
  207.         if (!$me['my_partner']) {
  208.             echo "Single";
  209.         } else {
  210.             $q_ry    = "SELECT playername
  211.                               FROM members
  212.                               WHERE playerid = " . $me['my_partner'] . " ";
  213.             $partner = mysql_query($q_ry);
  214.             $pnr     = mysql_fetch_array($partner);
  215.             echo " Married to <a href='profile.php?XID=" . $me['my_partner'] . "'><font color = '" . $font . "'>" . htmlentities($pnr['playername']) . "</font></a> (" . number_format($me['my_partner_days']) . " days)";
  216.         }
  217.         echo "<br><b>Married:</b> " . $me['my_married_times'] . " times
  218.                         <br><b>Friends:</b> ";
  219.         $q_ry = "SELECT mf_id
  220.                                  FROM members_friends
  221.                                  WHERE mf_playerid = " . $_GET['XID'] . " ";
  222.         echo mysql_num_rows(mysql_query($q_ry));
  223.         echo "<br><b>Enemies:</b> ";
  224.         $q_ry = "SELECT me_id
  225.                                  FROM members_enemies
  226.                                  WHERE me_enemy = " . $_GET['XID'] . " ";
  227.         echo mysql_num_rows(mysql_query($q_ry));
  228.         echo "<br><b>Posts:</b> " . $me['my_forumposts'] . " (" . $me['my_forumscore'] . " score)
  229.                               <br><b>Last action:</b> ";
  230.         if ($me['laston'] != '0') {
  231.             $la   = (time() - $me['laston']);
  232.             $unit = "Seconds";
  233.             if ($la >= 60) {
  234.                 $la   = (int) ($la / 60);
  235.                 $unit = "Minutes";
  236.             }
  237.             if ($la >= 60) {
  238.                 $la   = (int) ($la / 60);
  239.                 $unit = "Hours";
  240.                 if ($la >= 24) {
  241.                     $la   = (int) ($la / 24);
  242.                     $unit = "Days";
  243.                 }
  244.             }
  245.             echo "<b>$la $unit ago</b>";
  246.         } else {
  247.             echo "<b>Never</b>";
  248.         }
  249.        
  250.         echo "<br><b>Signed Up:</b> " . date('F j Y', $me['signup_time']) . " at " . date('g:i:s a', $me['signup_time']) . "
  251.                          <br><b>Last Login:</b> " . date('F j Y', $me['last_login_time']) . " at " . date('g:i:s a', $me['last_login_time']) . "
  252.                          <br><b>Referrals:</b> ";
  253.         $q_ry = array();
  254.         $q_ry = "SELECT ref_id
  255.                                   FROM referals_accepted
  256.                                   WHERE ref_referer = " . $_GET['XID'] . " ";
  257.         echo mysql_num_rows(mysql_query($q_ry));
  258.         echo "<br><br>";
  259.         if ($me['my_jail'] > time()) {
  260.             echo "<font color = 'red'><b>In jail for " . gettimeleft($me['my_jail']) . "<br/>Reason: " . $me['jail_reason'] . "</b></font><br/><br/>";
  261.         }
  262.         if ($me['my_hosp'] > time()) {
  263.             echo "<font color = 'red'><b>In hospital for " . gettimeleft($me['my_hosp']) . "<br/>Reason: " . $me['hosp_reason'] . "</b></font><br/><br/>";
  264.         }
  265.         if ($me['my_traveltime'] > time() || $me['my_city'] > '0') {
  266.             if ($me['my_city'] > '0') {
  267.                 $q_ry                 = "SELECT city_name
  268.                               FROM other_cities
  269.                               WHERE city_id = " . $me['my_city'] . " ";
  270.                 $citname              = mysql_fetch_array(mysql_query($q_ry));
  271.                 $citname['city_name'] = explode(":", $citname['city_name']);
  272.                 $citname['city_name'] = $citname['city_name'][0];
  273.             } else {
  274.                 $citname['city_name'] = "Mafia Town";
  275.             }
  276.             if ($me['my_traveltime'] > time()) {
  277.                 echo "<font color = 'green'><b>Currently traveling to " . $citname['city_name'] . "</b></font><br/><br/>";
  278.             } else {
  279.                 echo "<font color = 'green'><b>Currently in " . $citname['city_name'] . "</b></font><br/><br/>";
  280.             }
  281.         }
  282.         if ($me['my_mailban']) {
  283.             echo "<font color = 'red'><b>Mail banned for " . $me['my_mailban'] . " day(s).<br/>Reason: " . $me['mban_reason'] . "</b></font><br/><br/>";
  284.         }
  285.         if ($me['my_forumban']) {
  286.             echo "<font color = 'red'><b>Forum banned for " . $me['my_forumban'] . " day(s).<br/>Reason: " . $me['fban_reason'] . "</b></font><br/><br/>";
  287.         }
  288.                
  289.         $q_ry  = "SELECT *
  290.                             FROM fed_jailed
  291.                             WHERE fj_playerid = " . $_GET['XID'] . " ";
  292.         $infed = mysql_query($q_ry);
  293.         if (mysql_num_rows($infed)) {
  294.     $q_ry = "SELECT *
  295.                             FROM `fed_jailed`
  296.                             WHERE `fj_playerid` = '".mysql_real_escape_string($_GET['XID'])."'";
  297.                     $infed = mysql_query($q_ry);
  298.                     if(mysql_num_rows($infed))
  299.                     {
  300.                        $if = mysql_fetch_array($infed);
  301.                        echo "<font color = 'red'><b><small>In federal jail for " . gettimeleft($if['fj_time']) . "<br/>
  302.                             Reason: " . $if['fj_reason'] . "</small></b></font><br/><br/>";
  303.         }
  304.         echo "</font>
  305.                             <font color = 'white'><b><u>Criminal Statistics</b></u></font>
  306.                                <font color = '" . $font . "'>
  307.                                   <br>
  308.                                      <b>Offences:</b> <a href='newspaper.php?page=hof&type=offences'>";
  309.         echo "<font color = '" . $font . "'>" . number_format($me['my_crimesdone']) . "</font></a>
  310.                            <br><b>Busted:</b> <a href='newspaper.php?page=hof&type=busts'><font color = '" . $font . "'>" . number_format($me['my_timesbusted']) . " people</font></a>
  311.                            <br><b>Jailed:</b> " . number_format($me['my_timesjailed']) . " times
  312.                               <br>
  313.                                  <br>
  314.                                     </font>
  315.                                        <font color = 'white'><b><u>Personal Information</b></u></font>
  316.                                     <font color = '" . $font . "'>";
  317.         $q_ry  = "SELECT *
  318.                             FROM members_profile_info
  319.                             WHERE mp_playerid = " . $_GET['XID'] . " ";
  320.         $persi = mysql_query($q_ry);
  321.         if (!mysql_num_rows($persi)) {
  322.             echo "<br><b>" . htmlentities($me['playername']) . " does not wish to share this information.</b>";
  323.         } else {
  324.             $pi = mysql_fetch_array($persi);
  325.             echo "<br><b>Real name:</b> " . htmlentities($pi['mp_name']) . "
  326.                          <br><b>Country:</b> " . htmlentities($pi['mp_country']) . "
  327.                          <br><b>City:</b> " . htmlentities($pi['mp_city']) . "
  328.                          <br><b>Age:</b> " . ($pi['mp_age']) . "
  329.                          <br><b>MSN:</b> " . stripslashes($pi['mp_msn']) . "
  330.                          <br><b>AIM:</b> " . stripslashes($pi['mp_aim']) . "
  331.                          <br><b>ICQ:</b> " . stripslashes($pi['mp_icq']) . "
  332.                          <br><b>Yahoo:</b> " . stripslashes($pi['mp_yahoo']) . "";
  333.         }
  334.        
  335.        
  336.        
  337.         echo "</td>
  338.                            <td align=left valign=top>
  339.                               <font color = 'white'><b><u>Profile Image:</u></b></font><br/>
  340. <img src='images/flags/bigflags/" . $me['my_country'] . ".png' title = 'This Player Citizens Of " . $me['my_country'] . "'> ";
  341.         $q_ry   = "SELECT t_team
  342.                             FROM member_turfs
  343.                             WHERE t_playerid = " . $_GET['XID'] . "
  344.                             LIMIT 1";
  345.         $inteam = mysql_query($q_ry);
  346.         if (mysql_num_rows($inteam)) {
  347.             $myc = array();
  348.             $myc = mysql_fetch_array($inteam);
  349.             $myc = $myc['t_team'];
  350.             echo "<br/><a href = 'turfwars.php'><img src = 'images/team-" . $myc . ".png' border = '0'></a>";
  351.         }
  352.         $q_ry = "SELECT i_image
  353.                             FROM member_images
  354.                             WHERE i_playerid = " . $_GET['XID'] . "
  355.                             AND i_profile = 1";
  356.         $im   = mysql_query($q_ry);
  357.         if (!mysql_num_rows($im)) {
  358.             echo "<br/>
  359.                             <img src='images/blank_man.jpg' alt = 'No images' title = 'No images' width = '200px' border = '0'>";
  360.         } else {
  361.             $mi       = mysql_fetch_array($im);
  362.             $imgcheck = "images/uploads/id" . $_GET['XID'] . "/" . $mi['i_image'] . "";
  363.             $size     = getimagesize($imgcheck);
  364.             if ($size) {
  365.                 echo "<br/>
  366.                                <a href=userimages.php?XID=" . $_GET['XID'] . "><img src = '" . $imgcheck . "' width = '200px' height = '200' border = '0' onmouseover=\"zxcZoom(this,'" . $imgcheck . "',400,'',3,'C');\" onmouseout=\"javascript:zxcZoom(this);\"></a>";
  367.             } else {
  368.                 // error
  369.                 echo "<br/>
  370.                                   <font color = 'red'><br/><b>Error while loading image</b></font>.";
  371.             }
  372.         }
  373.         $q_ry = "SELECT i_id
  374.                                   FROM member_images
  375.                                   WHERE i_playerid = " . $_GET['XID'] . " ";
  376.         $cnt  = mysql_query($q_ry);
  377.         $no   = mysql_num_rows($cnt);
  378. ?>
  379.     <style type="text/css">
  380.     #alt_text {
  381.     background: url('images/profiles/alt_text_bg.png') no-repeat center top;
  382.     width: 205px;
  383.     height: 25px;
  384.     line-height: 25px;
  385.     margin: 0 0 5px 0;
  386.     color: black;
  387.     text-align: center;
  388.     font-weight: bold;
  389.     margin: 0 0 5px 0;
  390.     }
  391.     .drop_into_page {
  392.     display: none;
  393.     }
  394.  
  395.     </style>
  396.         <img src = '/images/profiles/attack-h.gif' class = 'drop_into_page'>
  397.         <img src = '/images/profiles/mail-h.gif' class = 'drop_into_page'>
  398.         <img src = '/images/profiles/cash-h.gif' class = 'drop_into_page'>
  399.         <img src = '/images/profiles/trade-h.gif' class = 'drop_into_page'>
  400.         <img src = '/images/profiles/bounty-h.gif' class = 'drop_into_page'>
  401.         <img src = '/images/profiles/stall-h.gif' class = 'drop_into_page'>
  402.         <img src = '/images/profiles/display-h.gif' class = 'drop_into_page'>
  403.         <img src = '/images/profiles/stats-h.gif' class = 'drop_into_page'>
  404.         <img src = '/images/profiles/player-report-h.gif' class = 'drop_into_page'>
  405. <?php
  406.         echo "<br/>
  407.                                   <br/>
  408.                                      <br/>
  409.                                      <font color = '" . $font . "'>[</font><a href='userimages.php?XID=" . $_GET['XID'] . "'><font color = '" . $font . "'>" . $no . " uploaded images</font></a><font color = '" . $font . "'>]</font>
  410.                                         <br>
  411.                                            <br>
  412.                                               <div id='alt_text'>Choose an option.</div>
  413.                                                  <table width = '220px'>
  414.                                                     <tr>
  415.                                                        <td align = 'left'>
  416.                                                           <a href='attack.php?PID=" . $_GET['XID'] . "'
  417.                                                           onmouseover=\"document.attack.src='images/profiles/attack-h.gif';altText('Attack " . htmlentities($me['playername']) . "');\"
  418.                                                           onmouseout=\"document.attack.src='images/profiles/attack.gif';altText('');\">
  419.                                                              <img src='images/profiles/attack.gif' name = 'attack' border='0'>
  420.                                                           </a>";
  421.         echo "<span class = 'openPopup1' rel = 'popup' id = '1'
  422.                                onmouseover=\"document.mail.src='images/profiles/mail-h.gif';this.style.cursor='pointer';altText('Message " . htmlentities($me['playername']) . "');\"
  423.                                onmouseout=\"document.mail.src='images/profiles/mail.gif';altText('');\">
  424.                                <img src='images/profiles/mail.gif' name = 'mail' border='0'>
  425.                                </span>";
  426.         echo "<a href='sendcash.php?XID=" . $me['playerid'] . "'
  427.                                                           onmouseover=\"document.cash.src='images/profiles/cash-h.gif';altText('Send " . htmlentities($me['playername']) . " cash');\"
  428.                                                           onmouseout=\"document.cash.src='images/profiles/cash.gif';altText('');\">
  429.                                                              <img src='images/profiles/cash.gif' name = 'cash' border='0'>
  430.                                                           </a>
  431.                                                           <a href='trade.php?XID=" . $me['playerid'] . "'
  432.                                                           onmouseover=\"document.trade.src='images/profiles/trade-h.gif';altText('Initiate a trade with " . htmlentities($me['playername']) . "');\"
  433.                                                           onmouseout=\"document.trade.src='images/profiles/trade.gif';altText('');\">
  434.                                                              <img src='images/profiles/trade.gif' name = 'trade' border='0'>
  435.                                                           </a>
  436.                                                           <a href='newspaper.php?page=place&XID=" . $me['playerid'] . "'
  437.                                                           onmouseover=\"document.bounty.src='images/profiles/bounty-h.gif';altText('Place a bounty on " . htmlentities($me['playername']) . "');\"
  438.                                                           onmouseout=\"document.bounty.src='images/profiles/bounty.gif';altText('');\">
  439.                                                              <img src='images/profiles/bounty.gif' name = 'bounty' border='0'>
  440.                                                           </a>
  441.                                                           <a href='stats.php?XID=" . $_GET['XID'] . "'
  442.                                                           onmouseover=\"document.stats.src='images/profiles/stats-h.gif';altText('View the stats of " . htmlentities($me['playername']) . "');\"
  443.                                                           onmouseout=\"document.stats.src='images/profiles/stats.gif';altText('');\">
  444.                                                              <img src='images/profiles/stats.gif' name = 'stats' border='0'>
  445.                                                           </a>
  446.                                                           <a href='player_report.php'
  447.                                                           onmouseover=\"document.reports.src='images/profiles/player-report-h.gif';altText('Report " . htmlentities($me['playername']) . " To Staff');\"
  448.                                                           onmouseout=\"document.reports.src='images/profiles/player-report.gif';altText('');\">
  449.                                                              <img src='images/profiles/player-report.gif' name = 'reports' border='0'>
  450.                                                           </a>";
  451.        
  452.         if ($me['display_case'] == 'yes') {
  453.             echo "<a href='display.php?XID=" . $me['playerid'] . "'
  454.                                                           onmouseover=\"document.display.src='images/profiles/display-h.gif';altText('View " . htmlentities($me['playername']) . "\'s display case');\"
  455.                                                           onmouseout=\"document.display.src='images/profiles/display.gif';altText('');\">
  456.                                                              <img src='images/profiles/display.gif' name = 'display' border='0'>
  457.                                                           </a>";
  458.         }
  459.         if ($me['shop_status'] == 'open' || $_GET['XID'] == $_SESSION['playerid'] && $me['shop_status'] != 'none') {
  460.             echo "<a href='stall.php?XID=" . $me['playerid'] . "'
  461.                                                           onmouseover=\"document.stall.src='images/profiles/stall-h.gif';altText('View " . htmlentities($me['playername']) . "\'s stall');\"
  462.                                                           onmouseout=\"document.stall.src='images/profiles/stall.gif';altText('');\">
  463.                                                              <img src='images/profiles/stall.gif' name = 'stall' border='0'>
  464.                                                           </a>";
  465.         }
  466.         if ($pl['am_i_staff'] >= '3') {
  467.             echo "<br/>
  468.                                     <br/>
  469.                                        <font color = '" . $font . "'>[</font><a href='s-t_a-f_f-_-o-n_l-y/mail_bans.php?action=manage&XID=" . $me['playerid'] . "'><font color = '" . $font . "'>Mail ban</font></a><font color = '" . $font . "'>]</font>
  470.                                           <br/>
  471.                                              <br/>
  472.                                                 <font color = '" . $font . "'>[</font><a href='s-t_a-f_f-_-o-n_l-y/forum_bans.php?action=manage&XID=" . $me['playerid'] . "'><font color = '" . $font . "'>Forum ban</font></a><font color = '" . $font . "'>]</font>";
  473.         }
  474.        
  475.         {
  476.             $cl = 0;
  477.             while ($fd = mysql_fetch_array($frnd)) {
  478.                 echo "<tr>
  479.                                                  <td align = 'left' width = '20%'>
  480.                                                     <div id = 'down" . $fd['pc_id'] . "'>
  481.                                                     <table cellspacing = '3' border = '0'>
  482.                                                        <tr>
  483.                                                           <td align = 'center' valign = 'top' rowspan = '2'>
  484.                                                              <a href = 'profile.php?XID=" . $fd['pc_playerid'] . "'>" . profile_image($fd['pc_playerid'], 40) . "</a>
  485.                                                           </td>
  486.                                                           <td align = 'left' valign = 'top'>
  487.                                                              <a href = 'profile.php?XID=" . $fd['pc_playerid'] . "'><font color = '$font'>" . user_name($fd['pc_playerid']) . "</font></a>
  488.                                                           </td>
  489.                                                        </tr>
  490.                                                        <tr>
  491.                                                           <td align = 'left' valign = 'top'>
  492.                                                              <font color = '" . $font . "'>" . stripslashes($pbbc->post_bbcode_parse(htmlentities($fd['pc_message']))) . "<br/>
  493.                                                              " . date('F j Y', $fd['pc_time']) . " - " . date('g:i:s a', $fd['pc_time']) . "</font>";
  494.                 if ($fd['pc_playerid'] == $_SESSION['playerid'] || $fd['pc_to'] == $_SESSION['playerid']) {
  495.                     echo "<font color = '" . $font . "'> - <a onClick = 'deleteRow(\"c\", " . $fd['pc_id'] . ",\"\")' style = 'cursor:pointer;'><font color = '" . $font . "'>Delete</font></a></font>";
  496.                 }
  497.                 echo "</td>
  498.                                                        </tr>
  499.                                                     </table>
  500.                                                     </div>
  501.                                                  </td>
  502.                                               </tr>
  503.                                               <tr>
  504.                                                  <td align = 'left' valign = 'top'>";
  505.                 $q_ry = "SELECT *
  506.                                                           FROM profile_replies
  507.                                                           WHERE pr_comment = " . $fd['pc_id'] . "
  508.                                                           ORDER BY pr_time ASC";
  509.                 $reps = mysql_query($q_ry);
  510.                 if (!mysql_num_rows($reps)) {
  511.                     echo "<div id = 'c" . $fd['pc_id'] . "'>";
  512.                    
  513.                     if (mysql_num_rows($friendofmine) || $_SESSION['playerid'] == $_GET['XID']) {
  514.                         echo "<table>
  515.                                                              <tr>
  516.                                                              <td>
  517.                                                                 <form name = 'com" . $fd['pc_id'] . "' method = 'post'>
  518.                                                                    <textarea name = 'comment" . $fd['pc_id'] . "' id = 'comment" . $fd['pc_id'] . "' style = 'width:300px;height:18px;' onKeyUp = 'EnterSub(event, " . $fd['pc_id'] . ")' onClick = 'this.value=\"\"'>Write a comment...</textarea><br/>
  519.                                                                    <input type = 'button' name = 'sub" . $fd['pc_id'] . "' id = 'sub" . $fd['pc_id'] . "' value = 'Reply' onClick = 'PostReply(" . $fd['pc_id'] . ")'>
  520.                                                                 </form>  
  521.                                                              </td>
  522.                                                           </tr>
  523.                                                           </table>";
  524.                     }
  525.                     echo "<hr></div>";
  526.                 } else {
  527.                     echo "<div id = 'c" . $fd['pc_id'] . "'><table border = 0' width = '100%'>";
  528.                     $i = 0;
  529.                     while ($rs = mysql_fetch_array($reps)) {
  530.                         $i++;
  531.                         if ($i % 2) {
  532.                             $color = "#e3e3e3";
  533.                         } else {
  534.                             $color = "#D8D8D8";
  535.                         }
  536.                         echo "<tr>
  537.                                                                 <td width = '40px'>
  538.                                                                 </td>
  539.                                                                    <td align = 'left' valign = 'top' bgcolor = $color>
  540.                                                                       <table>
  541.                                                                          <tr>
  542.                                                                             <td align = 'center' width = '40px'>
  543.                                                                                <a href = 'profile.php?XID=" . $rs['pr_playerid'] . "'>" . profile_image($rs['pr_playerid'], 30) . "</a>
  544.                                                                             </td>
  545.                                                                                <td align = 'left' valign = 'top'>
  546.                                                                                   <a href = 'profile.php?XID=" . $rs['pr_playerid'] . "'>" . user_name($rs['pr_playerid']) . "</a>:
  547.                                                                                   " . stripslashes($pbbc->post_bbcode_parse(htmlentities($rs['pr_reply']))) . "<br/>
  548.                                                                                   " . date('F j Y', $fd['pc_time']) . " - " . date('g:i:s a', $rs['pr_time']);
  549.                         if ($rs['pr_playerid'] == $_SESSION['playerid'] || $fd['pc_to'] == $_SESSION['playerid']) {
  550.                             echo " - <a onClick = 'deleteRow(\"r\", " . $fd['pc_id'] . ", " . $rs['pr_id'] . ")' style = 'cursor:pointer;'>Delete</a>";
  551.                         }
  552.                         echo "</td>
  553.                                                                          </tr>
  554.                                                                       </table>
  555.                                                                    </td>
  556.                                                              </tr>";
  557.                     }
  558.                     if (mysql_num_rows($friendofmine) || $_SESSION['playerid'] == $_GET['XID']) {
  559.                         echo "<tr>
  560.                                                              <td>
  561.                                                              </td>
  562.                                                              <td>
  563.                                                                 <form name = 'com" . $fd['pc_id'] . "' method = 'post'>
  564.                                                                    <textarea name = 'comment" . $fd['pc_id'] . "' id = 'comment" . $fd['pc_id'] . "' style = 'width:300px;height:18px;' onKeyUp = 'EnterSub(event, " . $fd['pc_id'] . ")' onClick = 'this.value=\"\"'>Write a comment...</textarea><br/>
  565.                                                                    <input type = 'button' name = 'sub" . $fd['pc_id'] . "' id = 'sub" . $fd['pc_id'] . "' value = 'Reply' onClick = 'PostReply(" . $fd['pc_id'] . ")'>
  566.                                                                 </form>
  567.                                                              </td>
  568.                                                           </tr>";
  569.                     }
  570.                     echo "</table><hr></div>";
  571.                 }
  572.                 echo "</td>
  573.                                               </tr>";
  574.             }
  575.         }
  576.         echo "</table>
  577.                                   </td>
  578.                                      </tr>
  579.                                         <tr>
  580.                                            <td colspan = '2'>
  581.                                         <br>
  582.                                            <hr width = '100%'>
  583.                                               <br>
  584.                                                  <table width = '100%'>
  585.                                                     <tr align = 'center' bgcolor = '#999999'>
  586.                                                        <td align = 'center'>
  587.                                                           <b>Profile signature</b>
  588.                                                        </td>
  589.                                                     </tr>
  590.                                                     <tr " . $sigcolor . ">
  591.                                                        <td align=center>";
  592.         $sig = array();
  593.         $sig = !$me['my_sig_nature'] ? "None" : stripslashes($bbc->bbcode_parse(htmlentities($me['my_sig_nature'])));
  594.         echo $sig;
  595.         echo "</td>
  596.                                                     </tr>
  597.                                                  </table>
  598.                                                     <br>
  599.                                                        <hr width = '100%'>
  600.                                                           <br>
  601.                                                              <table width = '100%'>
  602.                                                                 <tr align = 'center' bgcolor = '#999999'>
  603.                                                                    <td align = 'center'>
  604.                                                                       <b>Awards</b>
  605.                                                                    </td>
  606.                                                                 </tr>
  607.                                                                 <tr bgcolor = '#DFDFDF'>
  608.                                                                    <td align = 'center'>";
  609.         $q_ry  = "SELECT ma.*,a.*
  610.                                                                                FROM members_awards ma
  611.                                                                                LEFT JOIN awards a
  612.                                                                                ON ma.ma_award = a.a_id
  613.                                                                                WHERE ma.ma_playerid = " . $_GET['XID'] . "
  614.                                                                                ORDER BY a.a_id ASC";
  615.         $myaws = mysql_query($q_ry);
  616.         if (!mysql_num_rows($myaws)) {
  617.             echo "<b>This user has no awards.</b>";
  618.         } else {
  619.             while ($aw = mysql_fetch_array($myaws)) {
  620.                 $q_ry = "SELECT ac_alt
  621.                                                                                                  FROM award_checks
  622.                                                                                                  WHERE ac_number = " . $aw['ma_tier'] . "
  623.                                                                                                  AND ac_award_id = " . $aw['a_id'] . " ";
  624.                 $alt  = mysql_fetch_array(mysql_query($q_ry));
  625.                 echo "<img src = 'awards-png.php?XID=" . $aw['a_id'] . "&tier=" . $aw['ma_tier'] . "' border = '1'
  626.                                                                                               alt = '" . $aw['a_name'] . ": " . $alt['ac_alt'] . "' title = '" . $aw['a_name'] . ": " . $alt['ac_alt'] . "'> ";
  627.             }
  628.         }
  629.         echo "</td>
  630.                                                                                      </tr>
  631.                                                                                   </table>
  632.                                                                                </td>
  633.                                                                             </tr>
  634.                                                                          </table>
  635.                                                                             <br>
  636.                                                                                <hr width = '750px'>";
  637.     }
  638. }
  639. include('./includes/style_bottom.php');
  640. ?>
  641. <script type="text/javascript" language="JavaScript">
  642.           function GetXmlHttpObject() {
  643.           var xmlhttp=null;
  644.                try {
  645.                // Opera 8.0+, Firefox, Safari
  646.                xmlhttp=new XMLHttpRequest();
  647.                }
  648.                catch (e) {
  649.                try {
  650.                //IE
  651.                xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  652.                }
  653.                catch (e) {
  654.                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  655.                }
  656.                }
  657.                return xmlhttp;
  658.                              }
  659.  
  660.     function postFormPopup(formname, url, did)
  661.     {
  662.     var xmlhttp=GetXmlHttpObject();
  663.  
  664.           if(xmlhttp==null) {
  665.           alert("Sorry, Your browser doesnt support HTTP Requests");
  666.           return;
  667.           }
  668.     if(xmlhttp)
  669.     {
  670.     var fields = new Array();
  671.     if(formname)
  672.     {
  673.      var ajax = formname;
  674.     }
  675.       for(var x = 0; x < eval("document."+ajax+".elements.length"); x++)
  676.       {
  677.          eval("fields.push(document."+ajax+".elements[x].name+'='+document."+ajax+".elements[x].value)");
  678.       }
  679.     var sendf = fields.join('&');
  680.     xmlhttp.open("POST", url, true);
  681.     xmlhttp.onreadystatechange = function()
  682.     {
  683.       if(xmlhttp.readyState == 4)
  684.       {
  685.         if(xmlhttp.status == 200)
  686.         {
  687.               document.getElementById(did).innerHTML = xmlhttp.responseText;
  688.         }
  689.       }
  690.     }
  691.     xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  692.     xmlhttp.send(sendf);
  693.    }
  694.   }
  695.                  function EnterSub(e, id)
  696.                  {
  697.                         var key = (e.keyCode ? e.keyCode : e.which);
  698.                         if(key == 13) {
  699.                         if(id != '')
  700.                         {
  701.                            var clicker = 'sub' + id;
  702.                            var empty = 'comment' + id;
  703.                         }
  704.                         else
  705.                            {
  706.                               var clicker = 'submit';
  707.                               var empty = 'post';
  708.                            }
  709.                        document.getElementById(clicker).click();
  710.                            document.getElementById(empty).value = 'Write a comment...';
  711.                     }
  712.                  }
  713.                      function PostReply(id)
  714.                      {
  715.                         var xmlhttp=GetXmlHttpObject();
  716.                            if(xmlhttp==null) { alert("Sorry, Your browser doesnt support HTTP Requests");
  717.                               return;
  718.                            }
  719.                         if(xmlhttp) { var fields = new Array();
  720.                         if(id != '')
  721.                         {
  722.                         var ajax = 'com' + id;
  723.                         }
  724.                         else
  725.                            {
  726.                               var ajax = 'postnew';
  727.                            }
  728.                               for(var x = 0; x < eval("document."+ajax+".elements.length"); x++)
  729.                               {
  730.                                  eval("fields.push(document."+ajax+".elements[x].name+'='+document."+ajax+".elements[x].value)");
  731.                               }
  732.                         if(id != '')
  733.                         {
  734.                         var load = 'profile_comms.php?action=reply&XID=' + id;
  735.                         var refresh = 'c' + id;
  736.                         }
  737.                         else
  738.                            {
  739.                               var load = 'profile_comms.php?action=comment';
  740.                               var refresh = 'postn';
  741.                            }
  742.                            var sendf = fields.join('&');
  743.                               xmlhttp.open("POST", load, true);
  744.                                  xmlhttp.onreadystatechange = function() {
  745.                                     if(xmlhttp.readyState == 4) {
  746.                                        if(xmlhttp.status == 200) {
  747.                                           document.getElementById(refresh).innerHTML = xmlhttp.responseText;
  748.                                        }
  749.                                     }
  750.                                  }
  751.                         xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  752.                         xmlhttp.send(sendf);
  753.                         }
  754.                      }
  755.                      function deleteRow(type, comm, reply) {
  756.                         var xmlhttp=GetXmlHttpObject();
  757.                            if(xmlhttp==null) { alert("Sorry, Your browser doesnt support HTTP Requests");
  758.                               return;
  759.                            }
  760.                         if(type == 'r')
  761.                         {
  762.                         var load = 'profile_comms.php?action=deleter&XID=' + reply + '&comm=' + comm;
  763.                         var elem = 'c' + comm;
  764.                         }
  765.                         else
  766.                            {
  767.                               var load = 'profile_comms.php?action=deletec&XID=' + comm;
  768.                               var elem = 'down' + comm;
  769.                               var elem2 = 'c' + comm;
  770.                            }
  771.                            xmlhttp.onreadystatechange=function() {
  772.                               if(xmlhttp.readyState==4) {
  773.                                  document.getElementById(elem).innerHTML = xmlhttp.responseText;
  774.                                  if(elem2)
  775.                                  {
  776.                                  document.getElementById(elem2).innerHTML = '';
  777.                                  }
  778.                               }
  779.                            }
  780.                         xmlhttp.open("GET", load, true);
  781.                         xmlhttp.send(null);
  782.                      }
  783.     function altText(text)
  784.         {
  785.     if(text == '')
  786.         {
  787.            jQuery('#alt_text').html('Choose an option.');
  788.     }
  789.     else
  790.            {
  791.           jQuery('#alt_text').html(text);
  792.        }
  793.     }
  794.         function addwithEase(smileToAdd)
  795.         {
  796.            document.reply.message.value += smileToAdd;document.reply.message.focus();
  797.         }
  798. </script>
  799.                           <div class = 'popUp' id = 'popup1'>
  800.                           <?php
  801. echo round_table('450');
  802. ?>
  803.                           <table width = '430px' border = '0' cellspacing = '0'>
  804.                           <tr bgcolor = '#999999'><td colspan=2 align = 'right'><span id = '1' rel = 'closepopup'>X</span><center><b>Send a message</b></center></td></tr>
  805.                           <form name = 'popform1' method = 'post' id = 'popform1'><tr>
  806.                           <input type = 'hidden' name = 'action' id = 'action' value = 'sendmsg'>
  807.                           <input type = 'hidden' name = 'to' id = 'to' size = '5' maxlength = '10' value = '<?= $_GET['XID'] ?>'>
  808.                           <td width=25% bgcolor=#E3E3E3><b>Subject:</b></td>
  809.                           <td bgcolor=#E3E3E3 align = 'left'><input type = 'text' name = 'subject' id = 'subject' size = '50' maxlength = '50' value=''>
  810.                           <i><font size=2>(Example. Hello)</font></i></td>
  811.                           </tr><tr><td bgcolor = '#E3E3E3' colspan = '2' align = 'center'>
  812.                          
  813.                           </td></tr>
  814.                           <tr>
  815.                           <td bgcolor = '#E3E3E3'><b>Message:</b></td>
  816.                           <td width = '90%' bgcolor = '#E3E3E3'>
  817.                           <textarea name = 'message' id = 'message' rows = '10' cols = '50'></textarea></td>
  818.                           </tr><tr bgcolor = '#E3E3E3'>
  819.                           <td colspan = '2'><center><input type = 'button' value = 'Send' name = 'popsub' id = '1'></center></td>
  820.                           </tr></form></table>
  821.                           <?php
  822. echo end_round();
  823. ?>
  824.                                    </div>
Advertisement
Add Comment
Please, Sign In to add comment