Jump to content
MakeWebGames

Magictallguy

Administrators
  • Posts

    2,124
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by Magictallguy

  1. More information requested. Screenshot contains the result of a call to var_dump(), but no error message. Is `US_shotBy` a valid key?
  2. Unless you're on PHP 7.4 and typesetting is standard
  3. Player classes + player class-based locations? System factions (not gangs)?
  4. On a semi-related note, I'm diggin' your console management
  5. You've got a random closing {/if}, but I see no relative opening one
  6. 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 )); }
  7. Loving the middle-button "autostory" there
  8. 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; });
  9. Sure. Whaddaya want?
  10. You certainly have a flair for diplomacy..
  11. Ah, that's your angle. In that case, yes! There's almost always a call for content creators in this world πŸ˜‰
  12. On the rare occasion that I need content for projects (freelancing in primarily backend dev), I'll just write it myself - doesn't mean it's any good, mind!
  13. You are [loved/stalked] by many here! (Pick the adjective that best fits)
  14. Magictallguy

    Smart rings

    The only footprint I leave is the one I don't mind leaving. You can keep your tracking device to yourself, kthx!
  15. One well-done derail later.. Hi there! Welcome (back) to MWG πŸ™‚
  16. From reading the code originally posted in 2015 and if I understand correctly (edit: I did not) See this post for the fix
  17. That is a considerable upgrade on your previous theme. Nicely done! Pet peeve of green on red (or vicΓ© versa), but you aren't catering to me πŸ˜‰
  18. Both directly to @m1ll1k3n and in general to anyone using a framework - it it's there and it's supposed to be; use it!
  19. As do you! Why should @MNG explain why @Paulvanegmond should explain?! .. Yeah!
  20. Great attempt and interesting approach to things. However, I strongly recommend that you use the framework readily available to make any additions like this; not only is it "the proper way" (debate in a different topic if you wish), but it usually eases future maintenance
  21. #allLimesMatter With PDO, you can pass an array of key-pair parameters to an execute() call. $stmt = $pdo->query('INSERT INTO users (username, level) VALUES (:name, :level)'); $stmt->execute([ ':name' => $someName, ':level' => $nextLevelMaybe ]); Alternatively, you can also use question-mark placeholders and pass parameters in the same order $stmt = $pdo->query('UPDATE some_table SET some_value = ?, some_other_value = ? WHERE some_criteria = ?'); $stmt->execute([$firstVal, $secondVal, $criteriaVal]); Perhaps this information may be useful to you during your wrapper writes
  22. Just gonna direct you here And you, stop flaming people for the shit of it. If you have a professional review of someone, you are welcome to share it in the relevant area.
×
×
  • Create New...