Jump to content

Tom

Members
  • Posts

    1517
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Tom

  1. Around the variable you want to round, use: round($var, 2); to round to 2 d.p. or just: round($var); to round to the nearest whole number
  2. This code prevents known spammers (checked against the stopforumspam.com email database) from registering. I've used it in core/modules/Registration/Registration.php within the ProcessRegistration function, as so: // Check email for known spammer $url = 'http://www.stopforumspam.com/api?email='.$data['email']; $file = new CodonWebService(); $contents = $file->get($url); $response = simplexml_load_string($contents); if($response->appears == 'yes'){ $spammer = true; } else { $spammer = false; } if($spammer){ $this->set('message', 'Your email appears on our spam database, we therefore assume you are a spammer and are rejecting your registration request. If you feel this is incorrect please contact us.'); $this->render('core_error.tpl'); return false; } It could be condensed a little, but I feel this makes it easier to understand.
  3. Ah, they appeared to be having problems with their strict xml output, without that last variable it seems to be working fine. Got it working as expected now. Thanks a lot I'm going to post my code in the snippets forum just in case anyone else is having a spam problem
  4. Because you can only visit the alphabetical list by visiting the toplist first if you've gone to another page. That's 1 pageload too many.
  5. $url = 'http://www.stopforumspam.com/api?email='.$data['email'].'&f=xmlcdata'; //$params = array('email' => $data['email'], 'f' => 'xmlcdata'); $file = new CodonWebService(); $contents = $file->get($url); $response = simplexml_load_string($contents); echo $contents; Moved where it is so I'm now using $data['email'], but echoing contents still just returns nothing :?
  6. I have some feedback regarding the navigation... On the toplist the second link is "Alphabetical", then everywhere else it's "Top voted" - this is really annoying. Please make your navigation consistent. Put both links on all pages.
  7. Bit pointless though really isn't it? Everyone here is either 1. a phpVMS VA owner or 2. used to phpVMS.
  8. That sounds messy and probably wouldnt work best. Which template do you want to be different exactly?
  9. You could do that, but it probably wouldn't work with the way the system does... Alternatively you could just get them to use the contact form? www.yoursite.com/index.php/contact
  10. Ok so, following this I've got this far: // Check email for known spammer $url = 'http://www.stopforumspam.com/api?email='.$email.'&f=xmlcdata'; $file = new CodonWebService(); $contents = @$file->get($url); echo $contents; With that last echo being there to see what I'm getting back. Currently I'm getting nothing at all. Yes, $email has a value... Where am I going wrong? In addition, once I've loaded the xml, how am I supposed to do anything with it?
  11. Tom

    2.1 Released!

    This has been around for a year now... you will have already been using it... Thread diggers -.-
  12. Cool. Could you not keep everything in a single thread though? It doesn't really have context here on its own.
  13. Download that and you'll see why I pasted what I pasted.
  14. For the fleet page I use this: http://forum.phpvms.net/topic/1522-fleet-table/ , with a query like this: $sql = 'SELECT a.*, a.name AS aircraft, COUNT(p.pirepid) AS routesflown, SUM(p.distance) AS distance, SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime, AVG(p.distance) AS averagedistance, AVG(p.flighttime) as averagetime FROM '.TABLE_PREFIX.'aircraft a LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id) GROUP BY a.icao ORDER BY a.registration'; in the php page. Modules are either on the admin panel or pilot/public side, not both at the same time. You will need to create a separate module for the admin panel.
  15. He edited his post out just as I posted...
  16. Check the folder lib/signatures/background/ exists... if it doesn't create it. OH OK NEVER MIND. IM JUST SO FAST.
  17. Dont bother to be honest, there's hundreds of 'empty space' threads here and there, would be a waste of time to delete them. People will just have to get used to reading a thread rather than posing and receiving an annoyed response
  18. ^ that's way too confusing if they don't know SQL, and they can really mess it up if they make errors. Best bet is to make an excel spreadsheet with the headings along the top row: icao, name, fullname, registration, downloadlink, imagelink, range, weight, cruise, maxpax, maxcargo, minrank, ranklevel, enabled In the next row add the data for one registration of an aircraft type and then copy the row, changing the registrations. Repeat for the other type. Save as a csv, import to the aircraft table using the import tab, choosing csv as the file type.
  19. Tom

    PHPVMS Skin.

    I do them for £35. Which is around $58. Details on my site (see sig)
  20. Tom

    Basic Blues

    Considering it's a year and a half old, I wouldn't expect it to still be up...
×
×
  • Create New...