phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file checklatest.php

Documentation is available at checklatest.php

  1. <?php
  2. require_once './include/version.php';
  3. require_once './lib/core.php';
  4.  
  5. require('smarty/libs/Smarty.class.php');
  6. $smarty = new Smarty();
  7.  
  8. $smarty->plugins_dir[] = 'include';
  9. require_once $smarty->_get_plugin_filepath('function', 'html_doctype');
  10.  
  11. $new_ini = file_get_contents('http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI');
  12.  
  13. if ($_GET['update'] == 'browscap') {
  14.     $handle = fopen(dirname(__FILE__) . '/include/browscap.ini', "w");
  15.     fwrite($handle, $new_ini);
  16. }
  17.  
  18. try {
  19.     $login = new login(true);
  20.     $smarty->assign('login', $login);
  21. } catch (LoginException $e) {
  22.     header( 'Location: login.php' ) ;
  23. } 
  24.  
  25. $pattern = '/[\d]+(\.[\d]+)*(-[\w]*[\d])?/';
  26. preg_match($pattern, file_get_contents('http://svn.chatetheory.com/phpusertrack/trunk/include/version.php'), $version);
  27.  
  28. $ini_array = parse_ini_file("include/browscap.ini", true);
  29. $new_ini_pattern = "/[Rr]eleased=.*/";
  30. preg_match($new_ini_pattern, $new_ini, $new_ini_string);
  31. $new_ini_array = explode('=', $new_ini_string[0]);
  32.  
  33. $smarty->assign('newestVersion', $version[0]);
  34. $smarty->assign('thisVersion', PHPUSERTRACK_VERSION);
  35.  
  36. $smarty->assign('thisBrowscapVersion', $ini_array['GJK_Browscap_Version']['Released']);
  37. $smarty->assign('newBrowscapVersion', $new_ini_array[1]);
  38.  
  39. $smarty->display('header.tpl');
  40. $smarty->display('checklatest.tpl');
  41. $smarty->display('footer.tpl');
  42.  
  43. ?>

Documentation generated on Tue, 06 Nov 2007 09:21:35 -0800 by phpDocumentor 1.4.0a2