
Karlos
Members-
Posts
951 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Karlos
-
Well it's a new view user......Hence the subject name Notes: No * in it at all.... Screenshot taken on a basic MC Codes V2 header, so it will change aslong as you have changed the CSS which I believe most of you have. Spaced Out. Stuff to do: Edit 1 PHP File How easy is that? Lets go. replace viewuser.php with: <?php require_once (DIRNAME(__FILE__) . '/globals.php'); $_GET['u'] = abs((INT) $_GET['u']); if(!$_GET['u']) { echo 'Invalid use of file'; $h->endpage(); exit; } else { $Select = sprintf( "SELECT u.userid, u.username, u.level, u.money, u.crystals, u.laston, u.lastip, u.energy, u.will, u.maxwill, u.brave, u.maxbrave, u.maxenergy, u.hp, u.maxhp, u.location, u.hospital, u.jail, u.jail_reason, u.fedjail, u.user_level, u.gender, u.daysold, u.signedup, u.gang, u.donatordays, u.email, u.display_pic, u.duties, u.staffnotes, u.hospreason, u.lastip_login, u.lastip_signup, u.last_login, u.friend_count, u.enemy_count, c.cityid, c.cityname, h.hID, h.hWILL, g.gangID, g.gangNAME, f.fed_userid, f.fed_days, f.fed_jailedby, f.fed_reason " . "FROM users u " . "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=('%u')", $_GET['u']); $q = $db->query($Select); if($db->num_rows($q) == 0) { echo 'Sorry, we could not find a user with that ID, check your source.'; $h->endpage(); exit; } else { $r = $db->fetch_row($q); if($r['user_level'] == 1) { $UserLevel = "Member"; } else if($r['user_level'] == 2) { $UserLevel = "Admin"; } else if ($r['user_level'] == 3) { $UserLevel = "Secretary"; } else if($r['user_level'] == 5) { $UserLevel = "Assistant"; } else if($r['user_level'] == 0) { $UserLevel = "NPC"; } else { $UserLevel = "Report To Admin."; } $LastOn = ($r['laston'] > 0) ?date('F j, Y g:i:s a',$r['laston']) : "Never"; $SignedUp = date('F j, Y g:i:s a',$r['signedup']); $d=""; if($r['laston'] > 0) { $LA = time() - $r['laston']; $Unit1 = "Seconds"; if($LA >= 60) { $LA = (int) ($LA/60); $Unit1 = "Minutes"; } if($LA >= 60) { $LA = (int) ($LA/60); $Unit1 = "Hours"; if($LA >= 24) { $LA = (int) ($LA/24); $Unit1 = "Days"; } } $LastAction = "$LA $Unit1 ago."; } else { $LastAction="--"; } if($r['donatordays']) { $r['username'] = '<font color=red>'.$r['username'].'</font>'; $D = '[img=donator.gif]'; } if($r['laston'] >= time()-15*60) { $On = "<blink><font color='green'>[b]Online[/b]</font></blink>"; } else { $On = "<font color='red'>[b]Offline[/b]</font>"; } $DaysOld = number_format($r['daysold']); $Money = number_format($r['money']); $Crystals = number_format($r['crystals']); $Level = number_format($r['level']); $HP = number_format($r['hp']); $MaxHP = number_format($r['maxhp']); $Friends = number_format($r['friend_count']); $Enemies = number_format($r['enemy_count']); echo '<h3>Profile for '.$r['username'].'</h3> <table width="98%" cellspacing="1" class="table"> <tr style="background:gray"> <th>General Info</th> <th>Display Pic</th> </tr> <tr> <td width="50%"> Name: '.$r['username'].' ['.$r['userid'].'] '.$D.' User Level: '.$UserLevel.' Duties: '.$r['duties'].' Level: '.$Level.' Money: $'.$Money.' Crystals: '.$Crystals.' Property: '.$r['hNAME'].' Gender: '.$r['gender'].' Days Old: '.$DaysOld.' Location: '.$r['cityname'].' Friends: '.$Friends.' Enemies: '.$Enemies.' Health: '.$HP.'/'.$MaxHP.' Gang: '; if($r['gang']) { echo '[url="gangs.php?action=view&ID='.$r['gang'].'"]'.$r['gangNAME'].'[/url] '; } else { echo 'Not in a gang. '; } echo ' Signed Up: '.$SignedUp.' Last Action: '.$LastAction.' Online: '.$On.' '; if($r['fedjail']) { echo ' [b]<font color="red">In federal jail for '.$r['fed_days'].' day(s). '.$r['fed_reason'].' Jailed By: '.$r['fed_jailedby'].'</font>'; } if($r['hospital']) { echo ' [b]<font color=red>In hospital for '.$r['hospital'].' minutes. Reason: '.$r['hospreason'].'</font>[/b]'; } if($r['jail']) { echo ' [b]<font color=red>In jail for '.$r['jail'].' minutes. Reason: '.$r['jail_reason'].'</font>[/b]'; } echo ' </td> <td width="50%" style="text-align:center;">'; if($r['display_pic']) { echo '[img='.$r['display_pic'].']'; } else { echo 'This user has not added a display picture!'; } echo ' </td> </tr> <tr> <th colspan="2">Links</th> </tr> <tr> <td colspan="2"> <table width="98%" cellspacing="0" class="table"> <tr> <td style="text-align:center;">[[url="attack.php?ID='.$r['userid'].'"]Attack[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="mailbox.php?action=compose&ID='.$r['userid'].'"]Send Mail[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="contactlist.php?action=add&ID='.$r['userid'].'"]Add Contact[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="sendcash.php?ID='.$r['userid'].'"]Send Cash[/url]]</td> </tr> <tr> <td>?</td> <td style="text-align:center;">[[url="sendcrys.php?ID='.$r['userid'].'"]Send Crystals[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="sendbank.php?ID='.$r['userid'].'"]Bank Xfer[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="sendcyber.php?ID='.$r['userid'].'"]CyberBank Xfer[/url]]</td> <td>?</td> </tr> <tr>'; if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5) { echo '<td>?</td><td>?</td> <td style="text-align:center;">[[url="jailuser.php?userid='.$r['userid'].'"]Jail[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="mailban.php?userid='.$r['userid'].'"]Mail Ban[/url]]</td> <td>?</td><td>?</td>'; } if($ir['donatordays'] > 0) { echo ' </tr> <tr> <td>?</td><td>?</td> <td style="text-align:center;">[[url="friendslist.php?action=add&ID='.$r['userid'].'"]Add Friends[/url]]</td> <td>?</td> <td style="text-align:center;">[[url="blacklist.php?action=add&ID='.$r['userid'].'"]Add Enemies[/url]]</td> <td>?</td><td>?</td>'; } echo ' </tr> </table> </td> </tr>'; $Viewable = ($ir['user_level'] >= 2) ? 'Staff Information' : ' '; echo ' <tr> <th colspan="2">'.$Viewable.'</th> </tr> <tr> <td style="text-align:center;" colspan="2">'; if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5) { $r['lastiph'] = @gethostbyaddr($r['lastip']); $r['lastiph'] = checkblank($r['lastiph']); $r['lastip_loginh'] = @gethostbyaddr($r['lastip_login']); $r['lastip_loginh'] = checkblank($r['lastip_loginh']); $r['lastip_signuph'] = @gethostbyaddr($r['lastip_signup']); $r['lastip_signuph'] = checkblank($r['lastip_signuph']); echo ' <h3>Internet Info</h3> <table width="98%" border="0" cellspacing="1" class="table"> <tr> <th></th> <th>IP</th> <th>Hostname</th> </tr> <tr> <td>Last Hit</td> <td>'.$r['lastip'].'</td> <td>'.$r['lastiph'].'</td> </tr> <tr> <td>Last Login</td> <td>'.$r['lastip_login'].'</td> <td>'.$r['lastip_loginh'].'</td> </tr> <tr> <td>Signup</td> <td>'.$r['lastip_signup'].'</td> <td>'.$r['lastip_signuph'].'</td> </tr> </table>'; echo ' <form action="staffnotes.php" method="post"> Staff Notes: <textarea rows="7" cols="100" name="staffnotes">'.$r['staffnotes'].'</textarea> <input type="hidden" name="ID" value="'.$_GET['u'].'" /> <input type="submit" value="Change" /></form>'; } else { echo ' '; } echo ' </td> </tr> </table>'; } } function checkblank($in) { if(!$in) { return 'N/A'; } return $in; } $h->endpage(); ?> Save it. Your done Screenshot: Link
-
Re: How to use sprintf? Maybe it is but my personal preference now is spacing it all as it's much easier to read and fix errors
-
Re: Crystal Smuggling (V2) made by me Maybe you could benefit from learning sprintf() sprintf() Link
-
Re: Query Problem... Thanks. Killah put me on the right direction but there is more I needed to add, but my final result that worked and all I needed was: $JobQuery = sprintf( "SELECT u.userid, u.username, u.money, u.crystals, u.level, u.job, u.jobrank, u.email, u.energy, u.brave, u.will, u.hp, u.maxenergy, u.maxbrave, u.maxwill, u.maxhp, us.userid, us.strength, us.labour, us.IQ, j.jID, jr.jrID " . "FROM users u " . "LEFT JOIN userstats us " . "ON u.userid=us.userid " . "LEFT JOIN jobs j " . "ON j.jID=u.job " . "LEFT JOIN jobranks jr " . "ON jr.jrID=u.jobrank " . "WHERE u.userid=('%u')", $userid); $is = $db->query($JobQuery);
-
Well...the basic v2 globals.php have a query for jobs..and I'm trying to get only what is needed and I have done the SQL but now I get the error on the v2 header saying: Your account may be broken. Please mail help@localhost stating your username and player ID. can anyone help to try and help me to get this to work. i currecntly have : $JobQuery = sprintf( "SELECT u.userid, u.job, u.jobrank, us.userid, us.strength, us.labour, us.IQ, j.jID, jr.jrID " . "FROM users u " . "LEFT JOIN userstats us " . "ON u.userid=us.userid " . "LEFT JOIN jobs j " . "ON j.jID=u.job " . "LEFT JOIN jobranks jr " . "ON jr.jrID=u.jobrank " . "WHERE u.userid=('%u')", $userid); $is = $db->query($JobQuery);
-
mccode-v2 Shops item stock - as requested (Not Tested)
Karlos replied to radio_active's topic in Free Modifications
Re: [MCcode v2] Shops item stock - as requested (Not Tested) I read both of your explanations and it makes more sense to me. Thanks Pog and Zero -
McCodes - Banners for 3 Pounds - PAYPAL ONLY
Karlos replied to CainFool's topic in General Discussion
Re: McCodes - Banners for 3 Pounds - PAYPAL ONLY Is it me or does the font look similar in all of them? -
Re: Referal in HOF 2 Tables? 1 Query? .... LEFT JOIN ?
-
mccode-v2 Shops item stock - as requested (Not Tested)
Karlos replied to radio_active's topic in Free Modifications
Re: [MCcode v2] Shops item stock - as requested (Not Tested) Can you explain the following in a bit more detail please? $_GET['ID'] = (isset($_GET['ID']) AND !ereg('[^0-9]', $_GET['ID'])) ? abs(@intval($_GET['ID'])) : FALSE ; $_GET['qty'] = (isset($_GET['qty']) AND !ereg('[^0-9]', $_GET['qty'])) ? abs(@intval($_GET['qty'])) : FALSE ; -
Re: Happy New Year Merry New Year :-P
-
Re: How to use sprintf? I know, you did and i thank you for that..i was just pointing out i space it all out now as i find it easier to read.
-
Re: How to use sprintf? I space all my code out...queries and everything, i just find it a hell lot easier to read and find errors personally.
-
Re: Shops Item Quantity? Hit me up on MSN: [email protected]
-
Re: Shops Item Quantity? Yea, don't stop anyone making a free version... :roll:
-
Re: Shops Item Quantity? Try looking at it now....should make more sense....im not with it atm, but should be correct aswell now.
-
Re: Shops Item Quantity? Why do that? Maybe start off like 500 defaultQTY why not use a rand() like: $QuantRand = rand(100, 250); $AddQuant = sprintf("UPDATE `shops` SET `QTY` = ('%u')" ,$QuantRand); $db->query ($AddQuant); Reason Why? Then you don't have a definite QTY that comes back. Personally add it to something which would suit your games economy..
-
Re: Shops Item Quantity? Hmmm, nice idea..
-
Re: [mccode v2] Annoucements Upgrade! It's the way I space it out...my preferred way of coding
-
Re: How to use sprintf? Being a bit difficult? This is only really to show how sprintf() can be used..
-
Re: Include or Require? Well I always use it because it better to have a direct path I personally believe.
-
Re: [mccode v2] Annoucements Upgrade! I always sprintf() queries now, just a habit I guess
-
Re: [mccode v2] Annoucements Upgrade! Thank you gurpreet for having the time to post screenshots. Thank you Crazy-T for the add-on idea you gave me and thanks for the comment.
-
Re: template engine Fair enough. :lol: +1 gave me a laugh
-
Re: How to use sprintf? Fixed.. I'm not with it this morning, new year, already been drunk and puked :lol: Thanks for spotting it for me..
-
What do people use? I use require_once (DIRNAME(__FILE__) . '/globals.php'); why? Give the excat path to the file :wink: