Jump to content
MakeWebGames

KyleMassacre

Members
  • Posts

    2,921
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by KyleMassacre

  1. What do you mean by security? Since this is editing real php files it’s only as safe as the person editing the file can be. This does not interact with a database whatsoever so you wouldn’t have any db vulnerabilities if that is what you are asking.
  2. You were actually one of the main reasons I created this lol. I know you program a lot (if not 100%) on your phone
  3. Im sure it could be fixed up a bit. I don't have the files myself though
  4. $query = $mysql->query("SELECT `usr_id`, `usr_stat` AS offenses FROM `usr_tbl` ORDER BY `offenses` DESC LIMIT 25"); $result = $mysql->fetch($query); $offenses = explode($result['offenses]); print $offenses[6]; You can't really do what you want to do in MySQL unless you create a function and I don't know if that is possible for everyone to do depending on your hosting. But if it is something you would want to look into you can look here
  5. Thanks for the support
  6. I would have personally serialized it but I guess you could explode it and get the index number you want
  7. Thank you but this one isn’t free. If you really want to tip me you can do it here though https://paypal.me/kyleisboss
  8. Hello MWG, I just uploaded a new module to the market place and figured I would showcase it a little for once it gets approved. This is a file editor for your ACP and uses Ace Editor to modify your files. It acts similar to most of your IDEs in regards to some keyboard shortcuts like saving, find/replace, etc and also has a little helper by pressing Ctrl+h or cmd+h. I also tried to make it so you don't accidentally lose any unsaved changes by navigating away since your last save and I also added some screenshots fo you to take a look Code View Navigating away with a dirty editor File Saved Help Prompt Syntax Error Just showing that it supports other file types
  9. I wouldn’t think in an application like a web based game it matters all that much. Now if your handling 10s of thousands of transactions at a time, then maybe 1 hit to the database would be easier on your resources and be more efficient.
  10. How about an update to the templating system? Instead of the template data being a property you could make a method be the "view" since you have limited ability with a property. So in *.admin.php: $this->page->buildElement('templateData', $vars) Would render in *.tpl.php public function templateData() { //in here I can access the $vars array data } I think that would provide much more flexibility in the long run
  11. Its not a "file editor", more like a "file generator" Pushed an update Zip/download modules Updated dockblocks A bug fix with some of the stubs Added a few more core features for the module.json file For people who want to see what it does:
  12. This seems all messed up. You are saying you cant have a blank message if you are not setting a title and saying you can have a blank title if you are not setting a message. This whole thing is wonky
  13. Quick Update I think I finally got the admin part of the module creation done. You are able to add multiple methods and a Menu Group. The admin section only shows if you select the "Admin" stub as well. Maybe tomorrow I can upload it and let you guys mess around with it and maybe make it better. Like I mentioned before, its an eye sore and needs some better validation since I am pretty sure it is relatively easy to break. Upon approval the module should be found here:
  14. You mean to actually install this module? No, not yet. I can shoot it over to you if you’d like to take a look but warning, it’s a little rough around the edges lol
  15. I've been working on this plugin for the past day or two and just wanted to show my progress. Its actually pretty basic but I think it will help a lot of people out when it is complete. There are still some features that I would like to add which basically revolves around "Admin" modules. What this does, if you cant tell by the screenshots is creates a module for you and installs it into the disabled directory so that you can work on it without having it "live" for everyone else to see an empty module. As you can see, there are some "stubs" which can be hooked by another developer or if Dayo adds other important files to the engine (still needs a little work) that will populate your files that you chose to add.
  16. Nope, all good. Looks like we're on the same page
  17. I probably would have just stored all these in a database and just do some rough query searches for questions and answers. Plus it would probably condense your code by like 75% $db->query("select * from `faq` where `question` like '%{$ask}%' or where `answer` like '%{$ask}%'"); Something like that
  18. I use Adonis every now and then when I get the urge for something new but usually stick to V4
  19. That is clean looking. Ive always wanted to try something with AdonisJs myself but my js skills are not up to par
  20. Hello everyone, I am starting back up again developing some mods and stumbled upon a post for gang kidnapping which I believe was from MTG. That mod brought up some memories of a game I first started playing that had that and thought to myself, what other cool mods did they have? I remembered that they had a mailbomb module that allows you to send a user a mailbomb if the user has the item. The receiver then has "X" amount of time to diffuse the bomb otherwise it blows up and when they attempt to diffuse it, they must pick the correct wire. I searched the forum and only found one mailbomb mod from back in '09 which is extremely outdated and made for V1 and looks like it has a bunch of unnecessary crap in it 😉. This module just hooks into your current mail system so if you want to send a user a bomb, you just check the box, type your message and hit send.
  21. I’m thinking maybe by hooking into this user property: https://github.com/ChristopherDay/Gangster-Legends-V2/blob/master/modules/installed/crimes/crimes.inc.php#L145
  22. This just sounds like a fancy version of Gang Crimes. I can see if I can whip something up and I can get a rough idea of a price afterwards depending on how much work I put in. Odds are it wouldnt be more than your asking price. I only ask for time since I only do this stuff mainly on my already busy weekends.
  23. KyleMassacre

    Hooks

    Hello everyone, I forked over a basic hook system that I generally use in my Laravel projects to make it I guess "Framework Agnostic" and figured that some other people on here may find it useful. Its very easy to use, just require the file somewhere in a global file ie global_func.php if you're a MCC user and just instantiate the class require('Hook.php') $hook = Hook::getInstance(); Then you can use the get method anywhere that you would like your hook ran. For example, in index.php: $hooks->get('index_loaded', [$ir['userid']], function ($user) { return $user; }, 'Hello World'); Then somewhere in an autoloaded file you can listen for the hook /** * In this example we are listening for the 'index_loaded' hook, * if found, will replace 'Hello World' with $ir['userid'] and * print it to the screen */ $hooks->listen('index_loaded', function ($callback, $output, $user) { if(empty($output)) { $output = $user; } echo $output; },1); Hook.php <?php /** * Class Hook * Forked from https://github.com/esemve/Hook * @license MIT * @copyright 2016 Bence Kádár */ class Hook { protected $watch = []; protected $stop = []; private static $instance = null; public static function getInstance() { if (self::$instance == null) { self::$instance = new Hook; } return self::$instance; } /** * Return the hook answer. * * @param string $hook Hook name * @param array $params * @param callable|null $callback * @param string $htmlContent content wrapped by hook * * @return null|void */ public function get(string $hook, $params = [], callable $callback = null, $htmlContent = '') { return $this->run($hook, $params, $callback, $htmlContent); } /** * Stop all another hook running. * * @param string $hook Hook name */ public function stop(string $hook) { $this->stop[$hook] = true; } /** * Subscribe to hook. * * @param string $hook Hook name * @param $priority * @param $function */ public function listen(string $hook, $function, $priority = null) { $caller = debug_backtrace(null, 3)[0]; if (empty($this->watch[$hook])) { $this->watch[$hook] = []; } if (!is_numeric($priority)) { $priority = null; } $this->watch[$hook][$priority] = [ 'function' => $function, 'caller' => [ 'file' => $caller['file'], 'line' => $caller['line'], 'class' => $caller['class'], ], ]; ksort($this->watch[$hook]); } /** * Return all registered hooks. * * @return array */ public function getHooks() { $hookNames = (array_keys($this->watch)); ksort($hookNames); return $hookNames; } /** * Return all listeners for hook. * * @param string $hook * * @return array */ public function getEvents($hook) { $output = []; foreach ($this->watch[$hook] as $key => $value) { $output[$key] = $value['caller']; } return $output; } /** * Run hook events. * * @param string $hook Hook name * @param array $params Parameters * @param $callback * @param null $output html wrapped by hook * * @return mixed */ protected function run(string $hook, array $params, $callback, $output = null) { array_unshift($params, $output); array_unshift($params, $callback); if (array_key_exists($hook, $this->watch)) { if (is_array($this->watch[$hook])) { foreach ($this->watch[$hook] as $function) { if (!empty($this->stop[$hook])) { unset($this->stop[$hook]); break; } $output = call_user_func_array($function['function'], $params); $params[1] = $output; } } } return $output; } /** * Return the listeners. * * @return array */ public function getListeners() { return $this->watch; } }
      • 2
      • Like
  24. Dont know why I didnt spot it before but you need to add the $msg to the textarea. <textarea name='msg' id='editor1' rows='10' cols='80' style='z-index:-100;'>$msg</textarea>
×
×
  • Create New...