Jump to content

Magictallguy

Administrators
  • Content Count

    1,846
  • Joined

  • Last visited

  • Days Won

    56

Magictallguy last won the day on June 1

Magictallguy had the most liked content!

Community Reputation

253 Excellent

About Magictallguy

  • Rank
    Intermediate
  • Birthday 08/07/1991

Personal Information

  • Location
    Bolton, UK
  • Occupation
    Freelance Website Developer

Recent Profile Visitors

16,158 profile views
  1. Speaking in a broader sense than GL; Why pass 50+ arrays when you can pass 1 multi-dimensional array? Make it easier on yourself at runtime!
  2. If you're manually passing 50+ arrays to something, you've missed the point of arrays
  3. Reppin' that NPC energy man ;)
  4. Just doing a drive by on yo 🙂

    1. Magictallguy

      Magictallguy

      Wutever floats your goat! 🙂

  5. More information requested. Screenshot contains the result of a call to var_dump(), but no error message. Is `US_shotBy` a valid key?
  6. Unless you're on PHP 7.4 and typesetting is standard
  7. Player classes + player class-based locations? System factions (not gangs)?
  8. On a semi-related note, I'm diggin' your console management
  9. You've got a random closing {/if}, but I see no relative opening one
  10. I don't know the engine that well, but those arrays have caught my attention. Humour me, change to public function constructModule() { //get user inventory first $rec = $this->db->prepare(" SELECT IV_id AS 'id', IV_quantity AS 'amount', IT_name as 'type', I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage' FROM inventory JOIN items JOIN itemTypes WHERE IV_userID=:user AND I_id = IV_itemID AND IT_id = I_type "); $rec->bindParam(":user", $this->user->id); $rec->execute(); //$allItems = array(); $inv = $rec->fetchAll(PDO::FETCH_ASSOC); //get item types $types = $this->db->prepare(" SELECT IT_id AS 'id', IT_name as 'type' FROM itemTypes ORDER BY IT_id ASC "); $types->execute(); $allItems = array(); while($type = $types->fetchObject()) { $allItems["type"][] = $type->type; $items = $this->db->prepare(" SELECT I_id AS id, I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage' FROM items WHERE I_type=:typeID "); $items->bindParam(":typeID", $type->id); $items->execute(); while($item = $items->fetchObject()) { $allItems["item"]["name"][] = $item->name; $allItems["item"]["id"][] = $item->id; } } $this->html .= $this->page->buildElement("blackMarket", array( "location" => $this->user->getLocation(), "inventory" => $inv, "itemType" => $allItems )); }
  11. Loving the middle-button "autostory" there
  12. Move event.preventDefault(); above return false So this // process the form $('form').submit(function(event) { // get the form data var form = $('#ajaxItem'); var post_url = $(this).attr("action"); // process the form $.ajax({ type : 'POST', url : post_url, data : formData, dataType : 'json', encode : true }) return false; // stop the form refrshing event.preventDefault(); }); becomes this // process the form $('form').submit(function(event) { // stop the form refrshing event.preventDefault(); // get the form data var form = $('#ajaxItem'); var post_url = $(this).attr("action"); // process the form $.ajax({ type : 'POST', url : post_url, data : formData, dataType : 'json', encode : true }) return false; });
  13. Sure. Whaddaya want?
  14. You certainly have a flair for diplomacy..
×
×
  • Create New...