Jump to content
MakeWebGames

Recommended Posts

Posted
<?php
/*-----------------------------------------------------
-- Mono Country v1.0 BETA
-- A product of DBS-entertainment
-- Copyright held 2005 by Dabomstew
-- INDEX.php
-----------------------------------------------------*/
session_start();
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']);
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{
$q=mysql_query("SELECT u.*,us.*,c.*,h.*,g.*,f.* 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 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['user_level'] == 1) { $userl="Member"; } else if($r['user_level'] == 2) { $userl="Admin"; } else if ($r['user_level'] == 3) { $userl="Secretary"; } else if($r['user_level'] == 0) { $userl="NPC"; } else if($r['user_level']==4) { $userl="IRC Mod"; } else {$userl="Assistant"; }
$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['donatordays']) { $r['username'] = "{$r['username']}";$d="[img=donator.gif]"; }
if($r['laston'] >= time()-15*60) { $on="[b]Online[/b]"; } else { $on="[b]Offline[/b]"; }
print "Profile for {$r['username']}
</pre>
<table width="75%">General InfoFinancial Info Display PicName: {$r['username']} [{$r['userid']}] $d

User Level: $userl

Duties: {$r['duties']}

Gender: {$r['gender']}

Signed Up: $sup

Last Active: $lon

Last Action: $la $unit ago

Online: $on

Days Old: {$r['daysold']}

Location: {$r['cityname']}
Money: \${$r['money']}

Crystals: {$r['crystals']}

Property: {$r['hNAME']}

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);
print "

Friends: ".mysql_num_rows($q_y)."

Enemies: ".mysql_num_rows($q_z)."
 ";
if($r['display_pic'])
{
print "[img={$r[]";
}
else
{
print "This user has no display pic!";
}
print "Physical InfoLinksLevel: {$r['level']}

Health: {$r['hp']}/{$r['maxhp']}

Gang: ";
if($r['gang'])
{
print "[url='gangs.php?action=view&ID={$r[']{$r['gangNAME']}[/url]";
}
else
{
print "N/A";
}
if($r['fedjail'])
{
print "
[b]In federal jail for {$r['fed_days']} day(s).

{$r['fed_reason']}";
}
if($r['hospital'])
{
print "
[b]In hospital for {$r['hospital']} minutes.
{$r['hospreason']}[/b]";
}
if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5) || $ir['user_level'] == 6) || $ir['user_level'] == 8) || $ir['user_level'] == 4)
{
print "
IP Address: {$r['lastip']}";
print "
Staff Notes: 

{$r['staffnotes']}


";
}
print "[[url='mailbox.php?action=compose&ID={$r[']Send Mail[/url]]


[[url='sendcash.php?ID={$r[']Send Cash[/url]]


[[url='attack.php?ID={$r[']Attack[/url]]";
if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5) || $ir['user_level'] == 6) || $ir['user_level'] == 8) || $ir['user_level'] == 4)
{
print "


[[url='jailuser.php?userid={$r[']Jail[/url]]


[[url='mailban.php?userid={$r[']MailBan[/url]]";
}
if($ir['donatordays'] > 0)
{
print "


[[url='friendslist.php?action=add&ID={$r[']Add Friends[/url]]


[[url='blacklist.php?action=add&ID={$r[']Add Enemies[/url]]
";
}
print "</table>";<br>}<br>}<br>$h->endpage();<br>?&g

 

This above is my code for viewuser.php, It comes out as Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/ie3/public_html/viewuser.php on line 118, Could someone help me! The user levels I have are 2 , 3 , 5 , 6, 8, 4)

Posted

Re: viewusers.php

You had way to many ( in your user levels. Try this..........


<?php
/*-----------------------------------------------------
-- Mono Country v1.0 BETA
-- A product of DBS-entertainment
-- Copyright held 2005 by Dabomstew
-- INDEX.php
-----------------------------------------------------*/
session_start();
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']);
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{
$q=mysql_query("SELECT u.*,us.*,c.*,h.*,g.*,f.* 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 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['user_level'] == 1) { $userl="Member"; } else if($r['user_level'] == 2) { $userl="Admin"; } else if ($r['user_level'] == 3) { $userl="Secretary"; } else if($r['user_level'] == 0) { $userl="NPC"; } else if($r['user_level']==4) { $userl="IRC Mod"; } else {$userl="Assistant"; }
$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['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; }
if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; }
print "<h3>Profile for {$r['username']}</h3>
<table width=75%><tr style='background:gray'><th>General Info</th><th>Financial Info</th> <th>Display Pic</th></tr>
<tr><td>Name: {$r['username']} [{$r['userid']}] $d

User Level: $userl

Duties: {$r['duties']}

Gender: {$r['gender']}

Signed Up: $sup

Last Active: $lon

Last Action: $la $unit ago

Online: $on

Days Old: {$r['daysold']}

Location: {$r['cityname']}</td><td>
Money: \${$r['money']}

Crystals: {$r['crystals']}

Property: {$r['hNAME']}

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);
print "

Friends: ".mysql_num_rows($q_y)."

Enemies: ".mysql_num_rows($q_z)."
</td> <td rowspan='2'>";
if($r['display_pic'])
{
print "[img={$r[]";
}
else
{
print "This user has no display pic!";
}
print "</td></tr>
<tr style='background:gray'><th>Physical Info</th><th>Links</th></tr>
<tr><td>Level: {$r['level']}

Health: {$r['hp']}/{$r['maxhp']}

Gang: ";
if($r['gang'])
{
print "[url='gangs.php?action=view&ID={$r[']{$r['gangNAME']}[/url]";
}
else
{
print "N/A";
}
if($r['fedjail'])
{
print "
[b]<font color=red>In federal jail for {$r['fed_days']} day(s).

{$r['fed_reason']}</font>";
}
if($r['hospital'])
{
print "
[b]<font color=red>In hospital for {$r['hospital']} minutes.
{$r['hospreason']}</font>[/b]";
}
if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5 || $ir['user_level'] == 6 || $ir['user_level'] == 8 || $ir['user_level'] == 4)
{
print "
IP Address: {$r['lastip']}";
print "<form action='staffnotes.php' method='post'>
Staff Notes: 

<textarea rows=7 cols=40 name='staffnotes'>{$r['staffnotes']}</textarea>

<input type='hidden' name='ID' value='{$_GET['u']}' />
<input type='submit' value='Change' /></form>";
}
print "</td><td>[[url='mailbox.php?action=compose&ID={$r[']Send Mail[/url]]


[[url='sendcash.php?ID={$r[']Send Cash[/url]]


[[url='attack.php?ID={$r[']Attack[/url]]";
if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5 || $ir['user_level'] == 6 || $ir['user_level'] == 8 || $ir['user_level'] == 4)
{
print "


[[url='jailuser.php?userid={$r[']Jail[/url]]


[[url='mailban.php?userid={$r[']MailBan[/url]]";
}
if($ir['donatordays'] > 0)
{
print "


[[url='friendslist.php?action=add&ID={$r[']Add Friends[/url]]


[[url='blacklist.php?action=add&ID={$r[']Add Enemies[/url]]
";
}
print "</td></tr></table>";
}
}
$h->endpage();
?>



Posted

Re: viewusers.php

Sever104 can you please before you put the code do [ code] and at the end put [/ code] with no space please :) easy for all fo us in the forum

  • 2 weeks later...
Guest Sniko`
Posted

Re: viewusers.php

TRY THIS

 

<?php

session_start();
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']);
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm);
$h->menuarea();
$_GET['u'] = abs((int) $_GET['u']);
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{
$q=mysql_query("SELECT u.*,us.*,c.*,h.*,f.* 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 fedjail f ON f.fed_userid=u.userid 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['user_level'] == 1) { $userl="Member"; } else if($r['user_level'] == 2) { $userl="Admin"; } else if($r['user_level'] == 0) { $userl="NPC"; }
$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['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; }
print "<h3>Profile for {$r['username']}</h3>
<table width=85%><tr style='background:gray'><th>General Info</th><th>Financial Info</th> <th>Display Pic</th></tr>
<tr><td>Name: {$r['username']} [{$r['userid']}] $d

User Level: $userl

Duties: {$r['duties']}

Gender: {$r['gender']}

Signed Up: $sup

Last Active: $lon

Last Action: $la $unit ago

Online: $on

[b]Days Old:[/b] {$r['daysold']} Days Old
";
$w=mysql_query("SELECT * FROM warnings WHERE user={$r['userid']}",$c);
print "
<font color=red>Warnings: ".mysql_num_rows($w)." ";

if($ir['user_level'] > 1)
{
print "|| [<a href=warnings.php?action=index&user={$r['userid']}>Manage</a>]";
}
print "
Location: {$r['cityname']}</td><td>
Money: \${$r['money']}

Crystals: {$r['crystals']}

Property: {$r['hNAME']}

</td> <td rowspan='1'>";
if($r['display_pic'])
{
print "[img={$r[]";
}
else
{
print "This user has no display pic!";
}
if($ir['user_level']==2) { $sh="<th>Staff</th>"; } else { $sh=""; }
print "</td></tr>
<tr style='background:gray'><th>Physical Info</th><th>Links</th>{$sh}</tr>
<tr><td>Level: {$r['level']}

Health: {$r['hp']}/{$r['maxhp']}
";
if($ir['user_level'] == '2' || $ir['user_level'] == '3')	{
echo "<form action='admin.php?action=maillogs2' method='post'>
<input type='hidden' name='userid' value='{$r['userid']}'>
<input type='submit' value='Mail' /></form>";
		}
if($r['fedjail'])
{
print "
[b]<font color=red>In federal jail for {$r['fed_days']} day(s).

{$r['fed_reason']}</font>";
}
if($r['hospital'])
{
print "
[b]<font color=red>In hospital for {$r['hospital']} minutes.
{$r['hospreason']}</font>[/b]";
}
print "</td><td>[[url='mailbox.php?action=compose&ID={$r[']Send Mail[/url]]


[[url='sendcash.php?ID={$r[']Send Cash[/url]]


[[url='sendcrystals.php?ID={$r[']Send Crystals[/url]]


[[url='attack.php?ID={$r[']Attack[/url]]</td>";
if($ir['user_level'] == 2)
{
print "<td>
IP Address: {$r['lastip']}<form action='staffnotes.php' method='post'>
Staff Notes: 

<textarea rows=7 cols=40 name='staffnotes'>{$r['staffnotes']}</textarea>

<input type='hidden' name='ID' value='{$_GET['u']}' />
<input type='submit' value='Change' /></form></td>";
}
print "</tr>
<tr style='background:gray'><th colspan='2'>Profile Signature</th></tr>
<tr><td colspan='2'>{$r['signature']}</td></tr></table>";
}
}
$h->endpage();
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...