Jump to content
MakeWebGames

Seker

Members
  • Posts

    579
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Seker

  1. I'm trying to do a visual update on my city page to include some images. Been tinkering to keep the cities only showing if the level requirement is met. Now, the level requirement part is actually working. But, the problem is, I have 19 cities, and it shows each row 19 times. I know I'm missing something in the if statements. Any ideas? How my if's are set up: $lev = $ir['level']; if ($lev >= 0) { print " <tr> <td><img src='images/tentcity.png'></td> <td>{$r['citydesc']}</td> <td><img src='images/0.png'></td> <td><a href='monorail.php?to={$r['cityid']}'><img src='images/go.php'></a></td> </tr>"; }   Example of how it shows up on the page: |------------------------------------------| |"cityname1" | "citydesc1" | "Go" | |------------------------------------------| |"cityname1" | "citydesc1" | "Go" | |------------------------------------------| |"cityname1" | "citydesc1" | "Go" | |------------------------------------------| |"cityname2" | "citydesc2" | "Go" | |------------------------------------------| |"cityname2" | "citydesc2" | "Go" | |------------------------------------------| |"cityname2" | "citydesc2" | "Go" | |------------------------------------------|
  2. Ahh makes sense, it being text. It's always the simple things. Thanks for that!
  3. Since V1 doesn't come with a stock jail, I've added one in. I've also added columns to the crimes for jail reason and jail time. My problem is, the jail reason isn't updating, no matter what I change it to in the crimeJREASON table. It still keeps saying "Failed a crime," as I had that set as the reason before I started learning about using DB tables. The jail time updates correctly, and I just used another $ to update the reason the same way: if(rand(1, 2) == 1) { print $r['crimeFTEXT']; $jailtime=$r['crimeJTIME']; $jailreason=$r['crimeJREASON']; mysql_query("UPDATE users SET jail=$jailtime WHERE userid=$userid", $c); mysql_query("UPDATE users SET jailreason=$jailreason WHERE userid=$userid", $c); }   Any ideas why the reason isn't updating?
  4. Yep, thought it would be another table. :P Thanks again. Been tinkering with this for a bit, now.
  5. ANOTHER EDIT: Working as far as, it does update the count in the DB, so thank you for that HD! Just not showing anything but "0" on the viewuser. Obviously just a display problem. I can figure that out. :P Then, I just need to add a check to see if $ir has alread rated $r. Thanks for the help!
  6. Still getting this: Parse error: syntax error, unexpected ';' in /home/district/public_html/ratings.php on line 21   Doesn't really make sense to me, since that is: $user = (isset($_GET['u']) ? intval($_GET['u']) : FALSE;
  7. ratings.php: <?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=crystals_formatter($ir['crystals']); $cm=crystals_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $user = (isset($_GET['u']) ? intval($_GET['u']) : FALSE; if(!$user) { echo 'No user selected!'; exit($h->endpage()); } $user = mysql_query('SELECT `userid`,`username` FROM `users` WHERE `userid` = '.$user); if(!mysql_num_rows($user)) { echo 'No user found!'; exit($h->endpage()); } $user = mysql_fetch_assoc($user); switch ($_GET['action']) { case 'plus_rate': do_plus_rating($user); break; case 'minus_rate': do_minus_rating($user); break; default: wrong(); break; } function wrong() { echo 'You have not selected to rate up or down!'; } function do_plus_rating($us) { if($us['userid'] == $_SESSION['userid']) { echo 'You can not rate yourself!'; } else { mysql_query('UPDATE `users` SET `prate` = (`prate` + 1) WHERE `userid` = '.$us['userid']); echo 'You have rated '.$u['useranme'].' up!<a href="viewuser.php?u='.$us['userid'].'">Back</a>'; } } function do_minus_rating($us) { if($us['userid'] == $_SESSION['userid']) { echo 'You can not rate yourself!'; } else { mysql_query('UPDATE `users` SET `mrate` = (`mrate` + 1) WHERE `userid` = '.$us['userid']); echo 'You have rated '.$u['useranme'].' down!<a href="viewuser.php?u='.$us['userid'].'">Back</a>'; } } $h->endpage(); ?>   In viewuser: $rupp = mysql_query("SELECT prate FROM users WHERE prate={$r['userid']}", $c); $rup = mysql_num_rows($rupp); $rdownn = mysql_query("SELECT prate FROM users WHERE prate={$r['userid']}", $c); $rdown = mysql_num_rows($rdownn); Ratings: Up - <a href='ratings.php?action=plus_rate'>$rup</a> Down - <a href='ratings.php?action=minus_rate'>$rdown</a>
  8. That gives me this: Parse error: syntax error, unexpected ';' in /home/district/public_html/ratings.php on line 20   All I changed was the header info to work with V1. Lines 17-22:   $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $user = (isset($_GET['u']) ? intval($_GET['u']) : FALSE; if(!$user) { echo 'No user selected!';
  9. prate and mrate are both in the users table. Gives no errors. Just says: "You have rated up! Back" And it doesn't update the table, or the count on the viiewuser.
  10. Okay, been tinkering. The Invalid ID is gone, but now, it just says "You have rated up!" (No user id or name if I try that) and it doesn't update the ratings count. viewuser.php: Ratings: Up - <a href='ratings.php?plus_rate={$r['userid']}'>{$r['prate']}</a> Down - <a href='ratings.php?minus_rate={$r['userid']}'>{$r['mrate']}</a>   ratings.php: <?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(); global $r,$ir,$c; $action = $_GET['action']; $opdata = $r['userid']; switch ($_GET['action']) { case 'plus_rate': do_plus_rating(); break; case 'minus_rate': do_minus_rating(); break; } if(!$action) { echo "Error - invalid action."; $h->endpage(); exit; } function do_plus_rating() { global $r,$ir,$c; if ($r['userid'] == $ir['userid']) { print "You cannot rate yourself!<br /> <a href='viewuser.php?u={$r['userid']}'>Back</a>"; } else { mysql_query("UPDATE users SET prate=prate+1 WHERE userid={$r['userid']}"); print "You have rated {$r['userid']} up!<br /> <a href='viewuser.php?u={$r['userid']}'>Back</a>"; } } function do_minus_rating() { global $r,$ir,$c; if ($r['userid'] == $ir['userid']) { print "You cannot rate yourself!<br /> <a href='viewuser.php?u={$r['userid']}'>Back</a>"; } else { mysql_query("UPDATE users SET mrate=mrate+1 WHERE userid={$r['userid']}"); print "You have rated {$r['userid']} down!<br /> <a href='viewuser.php?u={$r['userid']}'>Back</a>"; } } $h->endpage(); ?>
  11. I've created a Hall Of Fame type page which displays users by their total amount of attacks done. The list is made using ORDER BY: $q = mysql_query( "SELECT username,userid FROM users WHERE user_level != 0 ORDER BY atotal DESC,userid ASC LIMIT 20", $c);   The problem is, I'm trying to set up a cron that rewards the players based on their position on that list. How do I go about doing this? Do I need to make a whole new table, and code out each rank reward by hand? Any insight would be appreciated.
  12. Still don't see how you can justify selling something you bought for $5 for $25. You're not a pawn shop. Wouldn't even say it's worth that much in the first place.
  13. My mistake on that one. Was browsing the "Recently Added" section. Views still seem low. Doesn't seem worth it to me.
  14. Clone or not, the claim of getting "lots of earnings" seems, from appearances, to be a fabrication. There are about nine total images with about 15-45 views, each. I highly doubt it gets anything but auto traffic. Not worth spending, in my opinion.
  15. Something about a pot and a kettle comes to mind...
  16. Though, I just had a thought. Say, I wanted to have a link in the "You were hospitalize by blah blah.." event to exact revenge. If you're attacked five times by five different people, it would still only be calling the last attacker, right? That means if, say, someone is attacked by user Bob, and then attacked by user Fred, if they click revenge on Bob, it would still be calling Fred. Any ideas on how to get around this?
  17. Ah once again, sniko, you've enlightened me. That does make sense. Thank you for the response!
  18. Made it as far as right after you log in. As, after that, it's not clear at all what to do. Read your quick description when you log in, though. You need mash to make mash? Erm.
  19. Murderers get deals everyday. So, by YOUR logic, HIS logic is sound. No offense. Just saying. A;) :D
  20. Any time I just go to open IE on ANY machine, I have to wait about five minutes while it tries to decide if it wants to actually load itself or just crash. If it DOES crash, it may just lock up the entire computer and make me reboot. Once in IE, the page loading time is ridiculously awful, averaging 5-7 seconds per page where, with Chrome, I can comfortably expect a max of about 2-3 seconds. I've never had memory issues with Chrome, but with IE, my CPU spikes for the entire time it's trying to load and/or crash, usually causing something else I'm running to also crash. Community informed.
  21. Chrome is the way to go. IE's basically been just a place-holder for the past three years. Kind of like Notepad.
  22. I'm finally trying my first mod from scratch. I don't think it's anything too special, but I am trying my best. What this is supposed to do, is, give the option of exacting revenge on the player who attacked you. It's definitely not complete, and I'm sure there is a lot I could do cleaner/more efficient. I'm not all too worried about that right this second. At the moment, I'm at the point where I'm trying to add the option in the user's event to attempt a revenge kill. I just have no idea how to do this so it picks up the user who attacked you. Would I pull it from the attack log (If V1 has one :/)? I'm just at a loss. Could anyone just point me in the right direction? Here is revenge.php (So far. Not complete.) <?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(); $limit = mysql_query("SELECT drevkills FROM users WHERE userid={$ir['userid']}", $c); $od = mysql_query("SELECT * FROM users WHERE userid={$r['userid']}", $c); if (mysql_num_rows($od)) { $r = mysql_fetch_array($od); if ($r['hospital'] >= 1) { print "<a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a> is already in the hospital!"; } } else if($limit = 10) { print "You have exacted all the revenge you can today! Try again tomorrow!</ br> <a href='index.php'>> Back</a>"; else { $revsucc = rand(1,4) if($revsucc = 1) { $expgain = 200; mysql_query("UPDATE users SET revkills=revkills+1,drevkills=drevkills+1 WHERE userid={$ir['userid']}",$c); mysql_query("UPDATE users SET hp=1,hospital=hospital+30,hospreason='Killed for revenge' WHERE userid={$r['userid']}",$c); event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> exacted their revenge! You've been hospitalized for {$r['hospital']}!", $c); print "You exacted your revenge on <a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a>! You've earned 200 experience!" mysql_query( "UPDATE users SET exp=exp+$expgain WHERE userid={$ir['userid']}", $c); $warq = mysql_query( "SELECT * FROM gangwars WHERE (warDECLARER={$ir['gang']} AND warDECLARED={$r['gang']}) OR (warDECLARED={$ir['gang']} AND warDECLARER={$r['gang']})", $c); if (mysql_num_rows($warq) > 0) { $war = mysql_fetch_array($warq); mysql_query( "UPDATE gangs SET gangRESPECT=gangRESPECT-10 WHERE gangID={$r['gang']}", $c); mysql_query( "UPDATE gangs SET gangRESPECT=gangRESPECT+5 WHERE gangID={$ir['gang']}", $c); print "<br />You also earned 5 respect for your gang!"; } } else { $expgain = 500; mysql_query("UPDATE users SET revfails=revfails+1,hp=1,hospital=hospital+30,hospreason='Failed to take revenge' WHERE userid={$ir['userid']}",$c); event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> failed to exact their revenge! You have gained 500 experience, and {$ir['username']} has been hospitalized for {$ir['hospital']}", $c); print "You have failed to exact your revenge! You have been hospitalized for {$ir['hospital']}!" mysql_query( "UPDATE users SET exp=exp+$expgain WHERE userid={$r['userid']}", $c); $warq = mysql_query( "SELECT * FROM gangwars WHERE (warDECLARER={$ir['gang']} AND warDECLARED={$r['gang']}) OR (warDECLARED={$ir['gang']} AND warDECLARER={$r['gang']})", $c); if (mysql_num_rows($warq) > 0) { $war = mysql_fetch_array($warq); mysql_query( "UPDATE gangs SET gangRESPECT=gangRESPECT-5 WHERE gangID={$ir['gang']}", $c); mysql_query( "UPDATE gangs SET gangRESPECT=gangRESPECT+10 WHERE gangID={$r['gang']}", $c); print "<br />You also lost 5 respect for your gang!"; } } } $h->endpage(); ?>
  23. Honestly can't tell if that was meant to be a snide remark about using the search function or you found something and the link doesn't work. In any case, I have searched. All I seem to find is V2 IPN's. Problem with that, I'm told, is there's no way to make the V2 IPN work with V1. Again, that's just what I was told. If it's possible, I've had my eye on a certain donate mod for a while.
  24. I'm looking to purchase a donator system with IPN. Preference would be to be able to change the donator packs through the staff menu, but if I must do it through files, that would be fine, as well. If anyone has a working system for a reasonable price, please PM me.
  25. You are correct. Just need to define the $gangmsg somewhere outside of the table, I'm assuming. Throwing errors so far, but I'll figure it out. Thanks for the help!
×
×
  • Create New...