Members Vangelis Posted October 7, 2015 Members Report Posted October 7, 2015 You did something wrong check in core/modules folder is there a folder named LOA ? if not then the installation is not correct Quote
Iraklis Posted October 7, 2015 Report Posted October 7, 2015 the LOA module is installed...the HubTranfer module is installed in the correct directory but it doesn't works.... after 3 installations it worked!!! <_< SOLVED Quote
OmerAslan Posted December 17, 2016 Report Posted December 17, 2016 Hi, I have those codes on front page : Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 9 Warning: mysql_query(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 9 Warning: mysql_query(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 9 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 10 and on admin page Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 86 Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 86 Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/core/common/HubTransferData.class.php on line 86 Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 please help thanks. Quote
Members Vangelis Posted December 17, 2016 Members Report Posted December 17, 2016 (edited) wich phpvms version do you have ? and also what is your php version Edited December 17, 2016 by Vangelis Quote
OmerAslan Posted December 18, 2016 Report Posted December 18, 2016 4 hours ago, Vangelis said: wich phpvms version do you have ? and also what is your php version phpVMS 5.5.2 , php version 5.6 my friend Quote
Members Vangelis Posted December 20, 2016 Members Report Posted December 20, 2016 Did you changed your mysql password ? and can you provide a link ? Quote
TAV1702 Posted December 20, 2016 Report Posted December 20, 2016 On 1/7/2014 at 1:00 PM, joeri said: to all with the error try the following in your commen change the husstransfer class the part for the get all requests to the following $sql = "SELECT h.pilotid, p.firstname, p.lastname, p.email, p.hub, h.hub_initial, h.hub_req, h.date_submitted, h.reason, h.status FROM ".TABLE_PREFIX."hubtransfer h LEFT JOIN ".TABLE_PREFIX."pilots p ON p.pilotid = h.pilotid"; $ret = DB::get_results($sql); return $ret; this fixzd mine thanks to the help of manuel from crazy creatives This an option still? Quote
TAV1702 Posted December 20, 2016 Report Posted December 20, 2016 On 12/17/2016 at 1:26 PM, OmerAslan said: Deprecated: mysql_affected_rows(): On 12/17/2016 at 1:26 PM, OmerAslan said: Deprecated: mysql_query(): The mysql extension is deprecated That is the explanation. Those functions are garbage now. They are useless. Have ti step up to sqli or PDO one of the two. If the last post I quoted don't fix this, the module file needs rewritten as was done for the LoA module that had the exact same issue. Quote
TAV1702 Posted December 20, 2016 Report Posted December 20, 2016 On 12/17/2016 at 1:26 PM, OmerAslan said: Deprecated: mysql_affected_rows(): On 12/17/2016 at 1:26 PM, OmerAslan said: Deprecated: mysql_query(): The mysql extension is deprecated That is the explanation. Those functions are garbage now. They are useless. Have ti step up to sqli or PDO one of the two. If the last post I quoted don't fix this, the module file needs rewritten as was done for the LoA module that had the exact same issue. On second thought, that last fix will not work. it is the same identical code that is in the file direct from github. I'm gonna get back on the side and wait for Sava. My skills are not that great and I don't want to stear anyone in the wrong direction. Quote
OmerAslan Posted December 20, 2016 Report Posted December 20, 2016 1 hour ago, TAV1702 said: That is the explanation. Those functions are garbage now. They are useless. Have ti step up to sqli or PDO one of the two. If the last post I quoted don't fix this, the module file needs rewritten as was done for the LoA module that had the exact same issue. On second thought, that last fix will not work. it is the same identical code that is in the file direct from github. I'm gonna get back on the side and wait for Sava. My skills are not that great and I don't want to stear anyone in the wrong direction. So if i understand you correctly, we have to wait for a while right? Quote
TAV1702 Posted December 20, 2016 Report Posted December 20, 2016 Probably will. I am right now as we speak looking in to it. I got all errors fixed but one. I am trying to figure out how Sava fixed it in the LoA Module. I am real close. Just not close enough to say here is a fix. My php skills kind of suck so if I even remotely come close to getting it working, that was a win lol. Now if I fix this last error and it all works, I'm going to celebrate with a beer! Quote
TAV1702 Posted December 20, 2016 Report Posted December 20, 2016 (edited) I think I might have it. I am final testing now. **EDIT** Please understand,m i am NOT a php expert. I don't pretend to be and not sure if my changes are safe to use live. I don't know php Security very much. With that said, I am willing to share my code changes that made this module work. I STRONGLY urge you to have someone look in to the changes to make sure they are safe to use. With that said, this module now works 100% A-ok on my website. Admin/modules/HubTransfer/HubTransfer.php Find: public function delete() { $id = $this->get->id; $get_msg = HubTransferData::delete($id); if (mysql_affected_rows() == -1) { $requests = HubTransferData::GetAllRequests(array()); $this->set('all', $requests); $this->set('msg', 'Request wasn\'t de;eted. Please use the phpVMS forums to get support.'); $this->render('hubtransfer/hubtransfer_admin_index.tpl'); }else { $requests = HubTransferData::GetAllRequests(array()); $this->set('all', $requests); $this->set('msg', 'Request successfuly deleted.'); $this->render('hubtransfer/hubtransfer_admin_index.tpl'); } } Change To: public function delete() { $id = $this->get->id; $get_msg = HubTransferData::delete($id); $this->set('msg', 'Request was de;eted.'); $this->render('hubtransfer/hubtransfer_admin_index.php'); } Save File! Open Core/Common/HubTransferDataClass.php Find: $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$pilotid'"; $sql = mysql_query($query); $count = mysql_num_rows($sql); return $count; Change To: $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$pilotid'"; $count = DB::num_rows(DB::get_results($query)); return $count; Find: public static function delete($id) { $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$id'"; $query = DB::query($sql); return mysql_affected_rows(); } Change To: public static function delete($id) { $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid='$id'"; $query = DB::query($sql); return $count; } Save File! And I believe that will get you in the game. All my functions work as they should including pending, delete and approve and all email functions. Use at your own risk! If someone comes along who actually knows what they are talking about, please feel free to correct me. This was just a honest try is all. if i am wrong I apologize. Edited December 20, 2016 by TAV1702 Added Info Quote
web541 Posted December 20, 2016 Report Posted December 20, 2016 (edited) Just confirming that those errors are mainly to do with the core/common/HubTransferData.class.php Delete function should look like this now public static function delete($id) { $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$id'"; DB::query($sql); } And the new CheckRequest function public static function CheckRequest($pilotid) { $pilotid = intval($pilotid); $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$pilotid'"; $count = DB::num_rows(DB::get_results($query)); return $count; } Or if that last function doesn't work, try swapping out the DB::get_results for DB::get_row as I can't tell whether it is being used to get one or more results. Edited December 20, 2016 by web541 Quote
TAV1702 Posted December 20, 2016 Report Posted December 20, 2016 Ah ya ninja posted me lol. I just edited my post with the fixes I had to do to make it work. please feel free to look at my post and tell me how wrong it is lol but it actually works. Quote
OmerAslan Posted December 20, 2016 Report Posted December 20, 2016 (edited) 24 minutes ago, web541 said: Just confirming that those errors are mainly to do with the core/common/HubTransferData.class.php Delete function should look like this now public static function delete($id) { $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$id'"; DB::query($sql); } And the new CheckRequest function public static function CheckRequest($pilotid) { $pilotid = intval($pilotid); $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$pilotid'"; $count = DB::num_rows(DB::get_results($query)); return $count; } Or if that last function doesn't work, try swapping out the DB::get_results for DB::get_row as I can't tell whether it is being used to get one or more results. yes it works. only i get this code on admin page but not important at all... Thanks a lot. Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Edited December 20, 2016 by OmerAslan Quote
web541 Posted December 20, 2016 Report Posted December 20, 2016 (edited) 27 minutes ago, TAV1702 said: Ah ya ninja posted me lol. I just edited my post with the fixes I had to do to make it work. please feel free to look at my post and tell me how wrong it is lol but it actually works. No, not a problem at all, everyone has a right to contribute and coding can be done in many different ways, some cleaner than others, some not so clean, but in the end it still works and that's what counts! I have also made my revisions on my Github account if you want to take a look. 17 minutes ago, OmerAslan said: yes it works. only i get this code on admin page but not important at all... Thanks a lot. Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Feel free to change out your admin/modules/HubTransfer/HubTransfer.php file for mine here and that should fix the problem above. I have just removed the mysql_affected_rows check as you really don't need to know whether it has been deleted or not, because in the end it will show up (or not if it has just been deleted) in the AllRequests list anyway. Edited December 20, 2016 by web541 2 Quote
OmerAslan Posted December 20, 2016 Report Posted December 20, 2016 1 hour ago, web541 said: Just confirming that those errors are mainly to do with the core/common/HubTransferData.class.php Delete function should look like this now public static function delete($id) { $sql = "DELETE FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$id'"; DB::query($sql); } And the new CheckRequest function public static function CheckRequest($pilotid) { $pilotid = intval($pilotid); $query = "SELECT * FROM ".TABLE_PREFIX."hubtransfer WHERE pilotid = '$pilotid'"; $count = DB::num_rows(DB::get_results($query)); return $count; } Or if that last function doesn't work, try swapping out the DB::get_results for DB::get_row as I can't tell whether it is being used to get one or more results. yes it works. only i get this code on admin page but not important at all... Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): Access denied for user 'pilotomeraslan'@'localhost' (using password: NO) in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 Warning: mysql_affected_rows(): A link to the server could not be established in /home/pilotomeraslan/erisair.com/crew/admin/modules/HubTransfer/HubTransfer.php on line 90 woow totally fixed. Thanks. Quote
flyalaska Posted November 19, 2017 Report Posted November 19, 2017 Anyone have this file. The download link is broken. Quote
in2tech Posted November 20, 2017 Report Posted November 20, 2017 (edited) On 11/19/2017 at 1:14 PM, flyalaska said: Anyone have this file. The download link is broken. I found this link by searching on GitHub, not sure who it is by or if it works. I downloaded it and will run on test server to see! https://github.com/elfrost/phpvms_hubtransfer Apparently Sava was also elffrost Edited November 20, 2017 by jnascar Quote
VIELMA16 Posted October 13, 2020 Report Posted October 13, 2020 (edited) Hi everyone! I have downloaded and installed the "Hub Transfer Request" module and it works perfectly but I get the following error (view image) https://i.ibb.co/NN9bTrk/Screenshot-2.png Deprecated: Non-static method HubTransferData::GetAllHubs() should not be called statically in /home/level/public_html/phpvms/core/modules/HubTransfer/HubTransfer.php on line 30 This is the code: <?php /** * Hub Transfer Request v.1.0 * * phpVMS Module for pilots to submit a Hub Transfer request that is stored in a database * and an option for staff to view all the requests through the admin panel and decide to reject/approve the request. * This module is released under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License * Note: Please play fair. I will act immediately upon receiving information of copyright infringement. Thank you. * @author Sava Markovic - airserbiavirtual.com * @copyright Copyright (c) 2012, Sava Markovic * @link http://www.airserbiavirtual.com * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class HubTransfer extends CodonModule { public $title = "Hub Transfer Request"; public function index () { if (!Auth::LoggedIn()) { $this->set('error', 'You are not logged in.'); $this->render('hubtransfer/hubtransfer_error.php'); } else { $hubs = HubTransferData::GetAllHubs(array()); //have to set the values for populating the drop down list $this->set('all_hubs', $hubs); $this->render('hubtransfer/hubtransfer_index.php'); } } public function submit() { if ($this->post->reason == '') //checking if the reason filed is empty, you can change == '' to something like > 20 to require more than 20 characters { $this->set('error', 'You haven\'t specified a reason for your hub transfer request. Please supply one below. Thank you.'); $this->render('hubtransfer/hubtransfer_error.php'); $hubs = HubTransferData::GetAllHubs(array()); $this->set('all_hubs', $hubs); $this->render('hubtransfer/hubtransfer_index.php'); } else { $reqcheck = HubTransferData::CheckRequest(Auth::$userinfo->pilotid); //checking if there is already a request with the logged in pilot's id if ($reqcheck > 0) { $this->set('error', 'You already have a hub transfer request submitted for your ID.'); $this->render('hubtransfer/hubtransfer_error.php'); $hubs = HubTransferData::GetAllHubs(array()); $this->set('all_hubs', $hubs); $this->render('hubtransfer/hubtransfer_index.php'); } else { $data = array( 'pilotid' => Auth::$userinfo->pilotid, 'hub_initial' => Auth::$userinfo->hub, 'hub_req' => $this->post->desired_hub, 'date_submitted' => date("F jS, Y"), 'reason' => $this->post->reason ); //loaded the array, do the magic HubTransferData::AddRequest($data); $this->SendMail(); } } } protected function SendMail() { //sending email to pilot $subject = SITE_NAME . ' Hub Transfer Request Submitted'; $email = Auth::$userinfo->email; $message = "This is an automated message sent by our system. <br> Your request has been submitted and processed by our system. You will be contacted when our staff team reviews your request. <Br> Thank you."; Util::SendEmail($email, $subject, $message); //send email to admin $subject_admin = SITE_NAME . ' A pilot has submitted a Hub Transfer Request'; $email_admin = ADMIN_EMAIL; $message_admin = "A pilot has submitted a Hub Transfer Request. Review the request from the administration panel."; Util::SendEmail($email_admin, $subject_admin, $message_admin); //after all is done, render the submitted tpl file $this->render('hubtransfer/hubtransfer_submitted.php'); } } I really appreciate the help to fix this error. I am using: Version 5.5.2.72 simpilot / php7.2. Thank you so much. Edited October 13, 2020 by VIELMA16 Quote
Members Vangelis Posted October 13, 2020 Members Report Posted October 13, 2020 You need to go to the function and remove the static in front of GetAllHubs(array()) function Quote
Administrators ProAvia Posted October 13, 2020 Administrators Report Posted October 13, 2020 Search the forums for "Non-static method" - it's been covered many times before. If you search for that, you will learn how to fix it - as it will probably occur in other modules as well. If we fix it for you, you won't ever learn how to fix it yourself. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.