Jump to content

mark1million

Moderators
  • Posts

    2283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by mark1million

  1. Why didnt i think of that, cheers Nabeel.
  2. If you are using tables in the mysql code you need to echo 'put your table sizes etc here';
  3. HI just add that above to your css and change the colors to suite your needs. For boarders go in to the tp_index.tpl (which should be in your skins folder) and you can add boarders there, <table width="680px" border="1" cellspacing="1" cellpadding="1"> standard stuff
  4. Its a style in your css. Add the value to table headers, All headers will then appear as red, As you exampled my site here is the entry for all table headers, th { color: #FFFFFF; border: 1px solid #4C4C4C; background: #FF6600; padding: 2px; text-align: center; } Change to your requirements, plus you will have to change all your tables to contain a header. One last thing, add those divs to that page <div class="mcright"> </div>
  5. If you have a fast server you can just import schedules say 100 at a time and phpvms will add the airports if they dont exist
  6. Check the file its isnt there.
  7. AMEN!!!! Servetas just give it up.
  8. Check that file because its reporting it isnt there.
  9. Just try filing the pirep with out the airline code, just the numbers.
  10. Sorry Nabeel i missed your post on the 6th, yes its dynamic currently updating by dyndns, its on my windows dedicated server. I run a script via http request that displays its current ip address so even if it does change its always updated.
  11. Get rid of all that script from that page, add some divs at the bottom of the page, well quite a lot of closing divs and youll be sorted.
  12. Mine works fine with the latest beta release Been heavily modded though
  13. HI there is a mod here on the forums that show you where you aircraft are and how many times they have flown, example. http://www.easyjetva.com/index.php/fleet
  14. OK so this works a treat, /* * Script that posts multiple RSS feeds to twitter * * Use this with crontab (it works with CLI too) * to post your feed's content to twitter * * A tutorial by: * http://www.webdigity.com/ * */ $settings ['twitter-username'] = 'YOUR USERNAME';// Your twitter username $settings ['twitter-password'] = 'YOUR PW';// Your twitter password $settings ['feed-url'] ='YOURURL/lib/rss/latestpilots.rss';//The url of the feed we are going to post to twitter or latestpireps.rss set_time_limit(0);//We need this because otherwise php will probably time out //Let's see if we have the curl library if (!extension_loaded('curl') && !dl('curl.' . (stristr(php_OS, 'WIN')?'dll':'so'))) die( 'Curl is not loaded' ); //Now we need a file to log the last entry so we wont post it again $file = dirname(__FILE__) . '/feed.log.txt'; if ( !file_exists( $file ) ){ $fp = @fopen( $file, 'w'); if (! $fp ) die( 'Could not write to log file. Check your permissions.' ); fclose( $fp ); } else if ( !is_writable( $file ) ) die( 'Could not write to log file. Check your permissions.' ); //Fetch the RSS feed $ch = curl_init( $settings['feed-url'] ); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $feed = simplexml_load_string ( curl_exec($ch) ); curl_close($ch); //Parse the feed $messages = array();//Here we will store all the messages that we are going to post to twitter foreach( $feed->channel->item as $item ){ $title = $item->title; // If you want to fetch the description instead use $item->description $url = $item->link; //Have we already posted that? if ( $url == file_get_contents($file) ) break; //Now do the actual posting. //First we need to shorten the url $ch = curl_init( 'http://twt.gs/?url='.$url.'&user='.$settings['twitter-username'].'&pass='.$settings['twitter-password'] ); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $shortURL = curl_exec($ch); $resp = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ( $resp != '200' ) die('Problem with the url shortening service. Check back later. Error: '.$shortURL); //Now Calculate the twit message $cnt = 140 - strlen($shortURL) - 1; $messages [] = strlen($title) <= $cnt ? $title . ' ' . $shortURL : substr($title,0,$cnt-3).'... '.$shortURL; $lastURL = empty($lastURL) ? $url : $lastURL; } //Post to twitter while( $message = array_pop($messages) ){ $ch = curl_init('http://twitter.com/statuses/update.xml'); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'status='.urlencode($message)); curl_setopt($ch, CURLOPT_USERPWD, $settings['twitter-username'].':'.$settings['twitter-password']); $response = curl_exec($ch); $resp = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ( $resp != '200' ) die('Problem with twitter. We should try later. Twitter reported: '.$response); else sleep(5);//Sleep 5 seconds before the next update } $fp = fopen($file, 'w'); fwrite($fp, $lastURL); fclose($fp); ?> Just need to put this is to a listener for a pirep filed and a new user registered.
  15. This seems more adaptable, <?php /* This class is compatible with >= PHP 5 only due to the use of: SimpleXML: http://uk2.php.net/simplexml Used to parse XML feeds SimpleXML is enabled by default. If it appears not to be, contact your host. cURL is also required for this script to operate. http://uk.php.net/curl The Twitter API documentation used to create this class can be found: http://groups.google.com/group/twitter-development-talk/web/api-documentation Written by Matt Jewell http://mediascratch.com */ class twitterAPI { public $twitter_base = 'http://twitter.com/statuses/'; private $twitter_username = 'your username'; private $twitter_password = 'your password'; public function fetch_latest_status() { /* user_timeline Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user. It's also possible to request another user's timeline via the id parameter below. Parameters used: id count */ $buffer = file_get_contents($this -> twitter_base . 'user_timeline/' . $this -> twitter_username . '.xml?count=1'); // Grab the contents of the XML file and store it in the variable. $xml = new SimpleXMLElement($buffer); // Creating a new XML string for use with the SimpleXML extension. $status_item = $xml -> status; // Creating a new variable using SimpleXML with "status" as the Node. return $status_item -> text; // Grab the current status as the Element. } function update_status($message){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $this -> twitter_base . 'update.xml?status=' . stripslashes(urlencode($message))); // The variable could also be substituded by the use of CURLOPT_POSTFIELDS curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // Enables us to return the result as a string instead of outputting to browser. curl_setopt($curl, CURLOPT_POST, 1); // From the Twitter API docs: "Request must be a POST". CURLOPT_POST ensures this./ $username = $this -> twitter_username; $pass = $this -> twitter_password; curl_setopt($curl, CURLOPT_USERPWD, "$username:$pass"); // Authenticates the user (you) in the post request. $exec = curl_exec($curl); // Execute the cURL request. // echo curl_error($curl); // Used to debug cURL. $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); // Return the HTTP headers so we can confirm the request. // A list of what the status codes are and mean can be found here: // http://www.seoconsultants.com/tools/headers.asp#code-200 curl_close($curl); // Terminate the cURL session return ($httpcode == 200) ? 'Updated!' : 'Error!'; /* Ternary operator equivelant to: IF httpcode equals 200 Return done ELSE Return error */ } } ?>
  16. Im thinking i could modify this to suite, <?php /* ---------------------------------------- */ // Change these parameters with your Twitter // user name and Twitter password. /* ---------------------------------------- */ $twitter_username ='yourTwitterUserName'; $twitter_psw ='yourTwitterPassword'; /* ---------------------------------------- */ /* Don't change the code belove /* ---------------------------------------- */ require('twitterAPI.php'); if(isset($_POST['twitter_msg'])){ $twitter_message=$_POST['twitter_msg']; if(strlen($twitter_message)<1){ $error=1; } else { $twitter_status=postToTwitter($twitter_username, $twitter_psw, $twitter_message); } } /* ---------------------------------------- */ ?> Don't touch the rest of the code! In insertTwitterMsg.php you have a form that you can reuse in your web projects: <!-- Send message to Twitter --> <?php if(isset($_POST['twitter_msg']) && !isset($error)){?> <div class="msg"><?php echo $twitter_status ?></div> <?php } else if(isset($error)){?> <div class="msg">Error: please insert a message!</div> <?php }?> <p><strong>What are you doing?</strong></p> <form action="insertTwitterMsg.php" method="post"> <input name="twitter_msg" type="text" id="twitter_msg" size="40" maxlength="140"/> <input type="submit" name="button" id="button" value="post" /> </form>
  17. Hi Nabeel, Im just looking now on Google, what i thought i could do is post new registrations and pireps using the existing rss feed of phpvms. basically thats it
  18. Has anyone managed to get this working and willing to share their code?
  19. Look in you local config, if not, copy the setting from your app.config to teh local config file
  20. Nabeel is there a quick fix for the status column to be sortable?
  21. Hi, Have you set a timezone for your server? You can define this within the php.ini or failing that via apache.
  22. How much of a delay and also what acars system are your pilots using? There is about a 30 second to a minute delay if you use kACARS it depends really.
  23. PM Me your details and i can have a look via teamviewer if you like?
×
×
  • Create New...