Jump to content

mark1million

Moderators
  • Posts

    2283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by mark1million

  1. I am getting the map but its just not displaying the map controls or listing the pilots flying, sorry should have made that clearer.
  2. It must be something in my skin folder as i went back to the crystal skin and the error went away, i then copied over the acarsmap.tpl from the core to replace the one in my skins folder but still the same, is there any other files that would effect the map that i have in my skin folder, its easier to post a pic of all the files i have modified than try to list,( Sorry about the size)
  3. Is there any progress on this one? i still cant display the mat controls with ie?
  4. This is where the times get difficult, get it to read server time and make sure server time is set to utc.
  5. Maybe some behind the scened post to rslink to populate a route would be good.
  6. Oh by the way i managed to get the recaptcha working, i forgot the require_once in the Registration.php
  7. suggestion...... Addition for route finders, when you look at a schedule you can click a button "find route" and off that goes to get the latest route which can be downloaded to your acars system? Just a thought.
  8. This is what i have, <?php /** * Codon PHP Framework * www.nsslive.net/codon * Software License Agreement (BSD License) * * Copyright (c) 2008 Nabeel Shahzad, nsslive.net * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.nsslive.net/codon * @license BSD License * @package codon_core */ class CodonWebService { protected $type = 'curl'; protected $curl = null; protected $curl_exists = true; public $_separator = '&'; public $errors = array(); public $options = array( /*CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0',*/ CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true); public function __construct() { # Make sure cURL is installed if(!function_exists('curl_init')) { $this->curl_exists = false; $this->error('cURL not installed'); } if($this->curl_exists == true) { if(!$this->curl = curl_init()) { $this->error(); $this->setType('fopen'); $this->curl = null; } $this->setType('curl'); @curl_setopt_array($this->curl, $this->options); } else { $this->curl = null; $this->setType('fopen'); } } public function __destruct() { if($this->curl) curl_close($this->curl); } /** * Internal error handler * * @param string $txt Error text */ protected function error($txt='') { if($txt != '') $last = $txt; else $last = curl_error($this->curl) .' ('.curl_errno($this->curl).')'; $this->errors[] = $last; } /** * Set the transfer type (curl or fopen). cURL is better * POST cannot be done by fopen, it will be ignored * * @param string $type curl or fopen * @return unknown */ public function setType($type = 'curl') { if($type != 'curl' && $type !='fopen') { $this->error('Invalid connection type'); return false; } $this->type = $type; } /** * Set the curl options, that are different from the default * * @param unknown_type $opt * @return unknown */ public function setOptions($opt) { if(!$this->curl) { $this->error('No valid cURL session'); return false; } curl_setopt_array($this->curl, $opt); } /** * Grab a URL, but use SSL. Returns the reponse * * @param url $url * @param array $params Associative array of key=value * @param string $type post or get (get by default) */ public function getSSL($url, $params, $type='get') { // set SSL options and then go curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0); $this->get($url, $params, $type); } /** * Grab a URL, return the reponse * * @param url $url * @param array $params Associative array of key=value */ public function get($url, $params='') { # Builds the parameters list if(is_array($params)) { $q_string = ''; foreach($params as $name=>$value) { $q_string .= $name.'='.urlencode($value).$this->_separator; } $q_string = substr($q_string, 0, strlen($q_string)-1); $url = $url.'?'.$q_string; } if($this->type == 'fopen') { if(strtolower(ini_get('allow_url_fopen')) == 'on') { return file_get_contents($url); } } if(!$this->curl || $this->curl == null) { $this->error('cURL not installed or initialized!'); return false; } curl_setopt ($this->curl, CURLOPT_RETURNTRANSFER, true); curl_setopt ($this->curl, CURLOPT_URL, $url); if(($ret = curl_exec($this->curl)) === false) { $this->error(); return false; } return $ret; } /** * Grab a URL, return the reponse, POST params * * @param url $url * @param array $params Associative array of key=value */ public function post($url, $params='') { if(!$this->curl) { $this->error('cURL not initialized'); return false; } //encode our url data properly if(is_array($params)) { foreach($params as $key=>$value) { $cleaned_params[$key] = urlencode($value); } } else { $cleaned_params = urlencode($params); } curl_setopt($this->curl, CURLOPT_POST, 1); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $cleaned_params); curl_setopt ($this->curl, CURLOPT_RETURNTRANSFER, true); curl_setopt ($this->curl, CURLOPT_URL, $url); if(($ret = curl_exec($this->curl)) === false) { $this->error(); return false; } return $ret; } /** * Download a file from $url to the $tofile * * @param url $url URL of file to download * @param path $tofile Path of file to download to * @return unknown */ public function download($url, $tofile) { if($this->type == 'fopen') { if(strtolower(ini_get('allow_url_fopen')) == 'on') { if(file_put_contents($tofile, file_get_contents($url)) == false) { $this->error('Error getting file'); return false; } } } if(!$this->curl || $this->curl == null) return false; if(($fp = fopen($tofile, 'wb')) == false) { $this->error('Error opening '.$tofile); return false; } curl_setopt($this->curl, CURLOPT_BINARYTRANSFER, true); curl_setopt($this->curl, CURLOPT_FILE, $fp); curl_setopt ($this->curl, CURLOPT_URL, $url); if(($ret = curl_exec($this->curl)) === false) { $this->error(); unlink($tofile); return false; } } }
  9. I get the following, Checking PHP version [OK] PHP version is 5.2.x Checking connectivity... [OK] Can contact outside servers Checking for SimpleXML module... [OK] SimpleXML module exists! Checking file hashes for corrupt or mismatched files [Checksum failed] /core/classes/CodonWebService.class.php did not match, possibly corrupt or out of date [Error] /lib/js/jquery.form.js doesn't exist I would really like to get to grips with git but after watching that quick demo im still not confidant.
  10. Thanks for that, i will give that a go...
  11. Is there a way of not listing new pilots until they have been approved?
  12. Have a look at your hard coded paths, they are possibly different than your old server.
  13. What are you trying to access?
  14. Top man!!!!! What a fantastic addition.... Thank you very much, this is now on my site. Easy to install and customise.
  15. Maybe this might help http://www.devx.com/getHelpOn/10MinuteSolution/20356
  16. OK this is really basic and i mean basic. Your html form, <form enctype="multipart/form-data" action="upload_file.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form> Your upload script Change the target to your folder you want to upload to <<?php $target = "test/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } ?> Just tested the above example and it works OK on my test server
  17. If its complaining about the file type then remove the checking from the loop and add one at a time back in to it see whats happening, sorry i dont have much time at the mo or i would test for you.
  18. Yeh we get that but if you check they are already on there
  19. Now that will be impressive!!!! Cant wait for the release. To say im excited is a understatement. If i can help along the way some how just let me know.
  20. I think i see what you have done, clear that file and use, <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("/wp-content/uploads/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "/wp-content/uploads/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?> Try that see how you get on.
  21. All you should need is the form in the post above and the script below, <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?> What that is doing is going to do is allow the upload a, "image/gif" "image/jpeg" "image/pjpeg" To a folder on your server called "upload/" change to what you want and you will need to allow write permissions
  22. Whats on your line 39 of upload_file.php?
  23. Just a quick demo from w3 schools, <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> This will explain everything, http://www.w3schools.com/PHP/php_file_upload.asp
  24. Nabeel, would it be possible to capture in the database the ipaddress of the user registering and have this displayed in the admin pilots list?
×
×
  • Create New...