Changeset 349
- Timestamp:
- 10/19/08 15:49:55 (14 years ago)
- Location:
- dev/cron
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/cron/cron_fetcher.php
r343 r349 16 16 17 17 // Has to be run from the KB main directory for nested includes to work 18 $KB_HOME = "location/of/your/kb/main/dir"; 18 echo "Edit the \$KB_HOME and remove this line and the next\n"; 19 die(); 20 $KB_HOME = "/your/killboard/path"; 19 21 chdir($KB_HOME); 20 22 21 23 require_once('kbconfig.php'); 22 require_once('common/includes/class.db_memcache.php');23 $mc = new Memcache();24 $mc->connect("127.0.0.1", 11211);25 24 require_once('common/includes/globals.php'); 26 25 require_once('common/includes/class.config.php'); … … 30 29 require_once('common/admin/feed_fetcher.php'); 31 30 31 $config = new Config(KB_SITE); 32 if (((bool)config::get('cfg_memcache')) === true) 33 { 34 require_once('common/includes/class.db_memcache.php'); 35 $mc = new Memcache(); 36 $mc->connect(config::get('cfg_memcache_server'), config::get('cfg_memcache_port')); 37 } 38 32 39 $validurl = "/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}((:[0-9]{1,5})?\/.*)?$/i"; 33 40 34 41 // load the config from the database 35 $config = new Config(KB_SITE);36 42 if (config::get('fetch_feed_count')) 37 43 $feedcount = config::get('fetch_feed_count'); … … 90 96 for ($l = $week - 1; $l <= $week; $l++) 91 97 { 92 $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str)) ;93 $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str . "&losses=1")) ;98 $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str)). "\n"; 99 $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str . "&losses=1")) . "\n"; 94 100 } 95 101 } -
dev/cron/cron_import.php
r343 r349 10 10 11 11 // Edit the path below with your webspace directory to the killboard root folder - also check your php folder is correct as defined by the first line of this file 12 $KB_HOME = "location/of/your/kb/main/dir"; 12 echo "Edit the \$KB_HOME and remove this line and the next\n"; 13 die(); 14 $KB_HOME = "/your/killboard/path"; 13 15 //chdir($KB_HOME); 14 chdir('/../../'); // finds Killboard root assuming that the we've started where we're supposed to start (<kb root>/mods/api_mod) - if this fails comment out and uncomment two lines above and edit path to correct path16 //chdir('/../../'); // finds Killboard root assuming that the we've started where we're supposed to start (<kb root>/mods/api_mod) - if this fails comment out and uncomment two lines above and edit path to correct path 15 17 16 18 $path = ini_get("include_path"); … … 22 24 require_once( "common/includes/class.eveapi.php" ); 23 25 require_once( "common/includes/db.php" ); 24 require_once( "common/includes/class.db_memcache.php" );25 26 $mc = new Memcache();27 $mc->connect("127.0.0.1", 11211);28 26 29 27 $config = new Config(KB_SITE); 28 if (((bool)config::get('cfg_memcache')) === true) 29 { 30 require_once('common/includes/class.db_memcache.php'); 31 $mc = new Memcache(); 32 $mc->connect(config::get('cfg_memcache_server'), config::get('cfg_memcache_port')); 33 } 34 30 35 define('KB_TITLE', config::get('cfg_kbtitle')); 31 36