Jump to content

Karamellwuerfel

Members
  • Posts

    91
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Karamellwuerfel

  1. Hey, does anyone know how to add external Classes to phpvms? I tried to add the folder to the core/common/ folder so it looks like this: Now I want to use this Classes and files in - for example "edit_profile". I added the required files with "require" like this: require __DIR__.'/../../../core/common/elephant.io/Client.php'; require __DIR__.'/../../../core/common/elephant.io/Engine/SocketIO/Version2X.php'; Now, if I refresh the page I got an 500 error (HTTP ERROR 500). How do I include and use the files correctly? Thank you
  2. Hey! I guess you have to do it in a WP plugin instead. This is a phpVMS module and is (I think) not compatible with WordPress. Kind regards, Philipp
  3. Hello, is it possible to create own CodonEvents and then add Listeners to this created event? For example the existing event "bid_added". I want to create a new one "updated_flight". Is there anywhere a Codon documentation? I can't find one. I tried to just Dispatch an event and listen to it but this doesn't work for me... CodonEvent::Dispatch('updated_flight', 'ACARSData', $flight_info); public function __construct() { CodonEvent::addListener('Test', array('bid_added', 'updated_flight')); } public function EventListener($eventinfo) { if($eventinfo[0] == 'bid_added') { //something } if($eventinfo[0] == 'updated_flight') { TestData::test($eventinfo[2]); } } Thanks!
  4. Hello @miniarma, programmically there is always a way to do something Yes. But it's not implemented in this module. Regards.
  5. Hi @Lausitzaircargo, just try the github repo. There is also a documentation in the readme https://github.com/Karamellwuerfel/InstantWeather Have a nice day
  6. Hi @djtiger76, you can use the option to show the weather on a special airport. Get the pilot's hub and insert it in the function. logged in pilot's hub: Auth::$pilot->hub If you guys give me features you like fo this module, I can write a version 2.0 in the next days and give it to you with that requests :-) features (?): display the weather on specific airport display weather on hub of pilot display weather inline, not only on specific url anything else? Thanks! :)
  7. Hey, there's no SSL Certificate on this page I guess - or something else:
  8. I tried with cacars free, smartCARS and kacars. ususally we use smartCARS
  9. Is there a way to increase the interval of updating the acars data on phpvms? I think the current intervall is 15 seconds. Thank you all!
  10. @FSVKenny It's also important not to use the absolute path to the file written by yourself. You can use the magic constants from php to solve this. __DIR__ for example points to the directory of the file you're using this constant. In map_in.php it will be something like include(__DIR__.'/FSV_phpvms/core/codon.config.php'); With this you have a dynamic absolute path.
  11. Wow, thanks for this awesome long explanation! :) I'll try it at home. jQuery says: So I think (in my admin theme I use jquery 3.x) I just have to replace the .live() function? Also I had problems with the "modal" funtion phpvms uses. There are some errors with '.fpq' or something like that. I'll check it later. Thanks again!
  12. Okay - so now after a week no reply. I have done a workaround. got all links from $MODULE_NAV_INC and explode them with PHP into an array on the "<li>" element. create a empty array for save my results loop all $links (first "link" is empty - so check if empty and jump over empty links) for each link I strip the tags and save it as name; and save the link as url I save this array in my result array Now I can loop the result array and use the links and names The code (not the right way I think, but I don't know how to do it in phpvms...): <?php $links = explode("<li>", $MODULE_NAV_INC); $result_array = array(); foreach ($links as $link) { if(empty($link)) continue; preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $link, $match); $res = array( "name" => strip_tags($link), "url" => $match[0][0] ); $result_array[] = $res; } ?> Thanks.
  13. + 1 year - no change 😉 I think it will be returning when phpvms 7 is released
  14. Hey, what stats do sou want to dispaly? 🙂 Maybe I can help you. Regards.
  15. Hi @Miggel, what do you want to display? Maybe there's already a function. Regards.
  16. Hello, in the admin navigation is a variable to show the addons installed on the page: $MODULE_NAV_INC It will echo this: <li><a href="http://xxxxxxx.xxxxxxxxxxx.xx/admin/index.php/FAQ">FAQ</a></li> Is there a way to change the content's design? Like removing the <li></li> or add classes to the <li>? It's defined in the "admin/index.php": Template::Set('MODULE_NAV_INC', $NAVBAR); But I dont find more... Or is there a other way to get the addons (url and name) of the site? Thanks!!
  17. Hello, I want to edit the function and add some extra functionallity. So when the CodonEvent::Dispatch('pirep_accepted', 'PIREPAdmin', $pirep_details); code is called, the extra code should be executed. How do I do this? There is no function "pirep_accepted" in PIREPAdmin.php... Thank you
    looks exact like https://www.windy.com
  18. Well, why does the admin comment his own product ("Good Product") ? The shop page looks good by the way.
  19. Hey pilots and devs! I'm watching an issue with an acars system and it says that an error occurs in the "DoWork" function. I found this function in the past and know that it exists, but I can't find it anymore. Does anyone has an idea where I can find the php function called something with "DoWork" or "filepirep_DoWork"? Thanks!
  20. Hello folks! I thought about to edit categories in the default download module and changed it to my needs. After you deactivate a download category, it wont show up in your list. Important information: BEFORE do this tutorial, backup the database tables and files you'll edit. lib/skins/pandaair_theme/downloads_list.php admin/modules/Downloads/Downloads.php admin/templates/downloads_categoryform.php core/common/DownloadData.class.php database table phpvms_downloads 1. Open your database and run the following command. It will add a column to your downloads table. Be sure to add the right prefix for the table: ALTER TABLE `phpvms_downloads` ADD `active` INT NOT NULL DEFAULT '1' AFTER `hits`; 2. Replace the content of the file "admin/templates/downloads_categoryform.php" with following: <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?> <h3><?php echo $title?></h3> <form id="form" method="post" action="<?php echo adminaction('/downloads/overview'); ?>"> <dl> <dt>Category Name</dt> <dd><input name="name" type="text" value="<?php echo $category->name; ?>" /></dd> <dt>Category Active? <input name="active" type="checkbox" <?= ($category->active) ? "checked":"" ?> <?= (empty($category->name)) ? "checked":"" ?> style="margin-bottom: 20px;" /></dt> <dt></dt> <dd><input type="hidden" name="id" value="<?php echo $category->id;?>" /> <input type="hidden" name="action" value="<?php echo $action;?>" /> <input type="submit" name="submit" value="<?php echo $title;?>" /> </dd> </dl> </form> We added the checkbox to enable/disable the category. 3. Edit the file "core/common/DownloadData.class.php" The following two functions have to be replaced: "AddCategory" and "EditAsset": public static function AddCategory($name, $link = '', $image = '', $active = 1) { if ($name == '') return false; $sql = "INSERT INTO " . TABLE_PREFIX . "downloads (pid, name, link, image) VALUES (0, '$name', '$link', '$image', '$active')"; $res = DB::query($sql); if (DB::errno() != 0) return false; return true; } public static function EditAsset($data) { /*$data = array( 'id' => '' 'parent_id' => '', 'name' => '', 'description' => '', 'link' => '', 'image' => '', ); */ if ($data['id'] == '' || $data['name'] == '') return false; $data['id'] = intval($data['id']); $data['name'] = DB::escape($data['name']); $data['parent_id'] = intval($data['parent_id']); $sql = "UPDATE " . TABLE_PREFIX . "downloads SET `pid`={$data['parent_id']}, `name`='{$data['name']}', `active`='{$data['active']}', `description`='{$data['description']}', link='{$data['link']}', image='{$data['image']}' WHERE id={$data['id']}"; $res = DB::query($sql); if (DB::errno() != 0) return false; return true; } Well, we included there the "active" parameter from the checkbox, so it will be changed in the database. 4. The file "admin/modules/Downloads/Downloads.php" contains two functions "AddCategoryPost" and "EditCategoryPost". We have to replace them with the following: protected function AddCategoryPost() { $this->checkPermission(EDIT_DOWNLOADS); if ($this->post->name == '') { $this->set('message', 'No category name entered!'); $this->render('core_error.php'); return; } if (DownloadData::FindCategory($this->post->name)) { $this->set('message', 'Category already exists'); $this->render('core_error.php'); return; } if(!empty($this->post->active)){ $active = 1; } else { $active = 0; } DownloadData::AddCategory($this->post->name, '', '', $active); $this->set('message', 'Category added!'); $this->render('core_success.php'); } protected function EditCategoryPost() { $this->checkPermission(EDIT_DOWNLOADS); if ($this->post->name == '') { $this->set('message', 'No category name entered!'); $this->render('core_error.php'); return; } if(!empty($this->post->active)){ $active = 1; } else { $active = 0; } $data = array('id' => $this->post->id, 'name' => $this->post->name, 'parent_id' => '', 'description' => '', 'link' => '', 'image' => '', 'active' => $active); DownloadData::EditAsset($data); $this->set('message', 'Category edited!'); $this->render('core_success.php'); } That's it for the "tricky" part. Now let's hide the deactivated categories in the core/templates/downloads_list.php. Just search for the "foreach" loop of the categories and check if the category has "1" in the active parameter. If it doesn't, don't show the category: foreach($allcategories as $category) { if(!$category->active) { continue; } // more stuff..... Have fun and howdy!
×
×
  • Create New...