2 require_once("boot.php");
3 require_once('include/diaspora.php');
5 function dsprphotoq_run($argv, $argc){
13 @include(".htconfig.php");
14 require_once("include/dba.php");
15 $db = new dba($db_host, $db_user, $db_pass, $db_data);
16 unset($db_host, $db_user, $db_pass, $db_data);
19 logger("diaspora photo queue: running", LOGGER_DEBUG);
21 $r = q("SELECT * FROM dsprphotoq");
27 logger("diaspora photo queue: processing " . count($dphotos) . " photos");
29 foreach($dphotos as $dphoto) {
33 if ($dphoto['uid'] == 0)
34 $r[0] = array("uid" => 0, "page-flags" => PAGE_FREELOVE);
36 $r = q("SELECT * FROM user WHERE uid = %d",
37 intval($dphoto['uid']));
40 logger("diaspora photo queue: user " . $dphoto['uid'] . " not found");
44 $ret = diaspora_dispatch($r[0],unserialize($dphoto['msg']),$dphoto['attempt']);
45 q("DELETE FROM dsprphotoq WHERE id = %d",
52 if (array_search(__file__,get_included_files())===0){
53 dsprphotoq_run($_SERVER["argv"],$_SERVER["argc"]);