Jump to content

kryoxis

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kryoxis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. is your index.php in the correct folder?
  2. I don't know how to turn it on, and yes the output looks like 1040 (1) The 1040 is the item code and (1) is the quantity.. Before I put getItemName in front of it, it puts out the items and the quantity. After I put that before content, it messes up.. What the getitemname function is supposed to do.. Is take the 1040 that's being output or in other words the item number, scanning through the items table and comparing the id column to the item number then combining it with the name column that correlates with the item number and outputs that instead of the raw item number code.. ^ I hope that makes sense... lol
  3. Here's the code with the function that won't work! $itemsRaw = explode(" ", $player['inventory']); foreach ($itemsRaw as $inv){ $contents = explode("-", $inv); if(strlen($contents[0]) > 0 && strlen($contents[1]) > 0 && $contents[1] > 0) echo getItemName($contents[0]) . " (" . number_format($contents[1]) . ")<br />"; } Here's my function: function getItemName($id_raw){ $id = $id_raw - 1; $q = $db->query("SELECT * FROM items WHERE id = $id") or die(mysql_error()); $f = $db->fetch_assoc($q); return $f['name']; } It stops the page when it gets to that point and won't load anything else and the function doesn't even work with it :/ What's wrong with it? If anything..
  4. Hmm... Well it's weird because the function that's right below it seems to work perfectly, heres the code for it function getName($id){ $other = $db->fetch_assoc($db->query("SELECT name FROM ibf_members WHERE id = ". $id)); $otherName = $other['name']; if(preg_match("[a-zA-Z0-9_]", $otherName)){ $otherName.=" (valid)"; } return $otherName; } any idea?
  5. It's not doing what the "querys" are telling it to do.. (sending the message) Would you like me to post my whole page? It's kinda big.. the $db is fine it's just connecting to the database previously mentioned at the top of the page (not posted on here though) Shouldn't make any difference I don't believe.. I came here looking for help because I'm not that experienced.
  6. All the tables are correct and it's making the connect to the database fine it's just not working, did I write it wrong? function newPm($to, $from, $title, $text){ $q = $db->query("SELECT * FROM ibf_message_topics ORDER BY mt_id DESC"); $lastMsg = $db->fetch_assoc($q); $mid = $lastMsg['mt_id'] + 1; $msgId = $lastMsg['mt_msg_id'] + 1; $db->query("INSERT INTO ibf_message_topics SET mt_id=$mid, mt_msg_id=$msgId, mt_date=". time(). ", mt_title='$title', mt_from_id=$from, mt_to_id=". $to. ", mt_vid_folder='in', mt_read=0, mt_owner_id=$to, mt_user_read=0") or die(mysql_error()); $db->query("INSERT INTO ibf_message_text SET msg_id=$msgId, msg_date=". time() .", msg_post='$text', msg_sent_to_count=1, msg_author_id=$from") or die(mysql_error()); $userq = $db->query("SELECT new_msg FROM ibf_members WHERE id = $to"); $userData = $db->fetch_assoc($userq); $msgCount = $userData['new_msg'] + 1; $db->query("UPDATE ibf_members SET new_msg=$msgCount, show_popup=1 WHERE id = $to") or die(mysql_error()); } Here's how that function is being called in the beginning of the page: if($action =="banUser"){ $expire = time() + (3600000 * 24 * $_GET['duration']); $q = $db->query("SELECT * FROM ibf_message_topics ORDER BY mt_id DESC"); $lastMsg = $db->fetch_assoc($q); $mid = $lastMsg['mt_id'] + 1; $msgId = $lastMsg['mt_msg_id'] + 1; $title = "Notification"; $duration = $_GET['duration'] ." days"; if($_GET['duration'] == "1"){ $duration = "1 day"; } if($_GET['duration'] == "Forever"){ $duration = "forever"; } $temp = 0; if($expire > time()){ $temp = 1; } $body = "This automated message has been sent to notify you that your account has been banned $duration. To appeal this ban, click on Irc from the menu on the homepage and ask to speak to a moderator. If this ban is temporary, your account will be reinstated automatically at the appropriate time"; newPm($id, 3017, $title, $body); $msgCount = $_GET['msg'] + 1; $db->query("UPDATE ibf_members SET ban_level = $level, tempbanned = $temp, banned = 1, ban_expire='$expire', ban_reason='". $_GET['reason']."', ban_by='". $name."' WHERE id=$id") or die(mysql_error()); ?> <center><b>User banned!</b> (<a href="index.php?code=plyrmgmt">Back to Player Management</a>)</center>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.