2010-08-19 11:59:31 +00:00
|
|
|
<?php
|
2011-01-28 13:04:18 +00:00
|
|
|
require_once("boot.php");
|
|
|
|
|
2012-11-05 08:28:54 +00:00
|
|
|
function directory_run(&$argv, &$argc){
|
2011-06-30 08:15:18 +00:00
|
|
|
global $a, $db;
|
2011-01-28 13:04:18 +00:00
|
|
|
|
2011-06-30 08:15:18 +00:00
|
|
|
if(is_null($a)) {
|
|
|
|
$a = new App;
|
|
|
|
}
|
2011-01-28 13:04:18 +00:00
|
|
|
|
2011-06-30 08:15:18 +00:00
|
|
|
if(is_null($db)) {
|
|
|
|
@include(".htconfig.php");
|
|
|
|
require_once("dba.php");
|
|
|
|
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
|
|
|
unset($db_host, $db_user, $db_pass, $db_data);
|
|
|
|
};
|
|
|
|
|
|
|
|
load_config('config');
|
|
|
|
load_config('system');
|
|
|
|
|
2010-08-19 11:59:31 +00:00
|
|
|
|
|
|
|
if($argc != 2)
|
2011-01-24 21:01:56 +00:00
|
|
|
return;
|
2010-08-19 11:59:31 +00:00
|
|
|
|
|
|
|
load_config('system');
|
|
|
|
|
2012-05-21 23:40:11 +00:00
|
|
|
load_hooks();
|
|
|
|
|
|
|
|
|
2010-08-19 11:59:31 +00:00
|
|
|
$a->set_baseurl(get_config('system','url'));
|
|
|
|
|
|
|
|
$dir = get_config('system','directory_submit_url');
|
|
|
|
|
|
|
|
if(! strlen($dir))
|
2011-01-28 13:04:18 +00:00
|
|
|
return;
|
2010-08-19 11:59:31 +00:00
|
|
|
|
2012-05-21 23:40:11 +00:00
|
|
|
$arr = array('url' => $argv[1]);
|
|
|
|
|
|
|
|
call_hooks('globaldir_update', $arr);
|
|
|
|
|
|
|
|
if(strlen($arr['url']))
|
|
|
|
fetch_url($dir . '?url=' . bin2hex($arr['url']));
|
2010-08-19 11:59:31 +00:00
|
|
|
|
2011-01-24 21:01:56 +00:00
|
|
|
return;
|
2011-01-28 13:04:18 +00:00
|
|
|
}
|
2010-08-19 11:59:31 +00:00
|
|
|
|
2011-01-28 13:04:18 +00:00
|
|
|
if (array_search(__file__,get_included_files())===0){
|
|
|
|
directory_run($argv,$argc);
|
|
|
|
killme();
|
|
|
|
}
|