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) {
31 $r = q("SELECT * FROM user WHERE uid = %d",
32 intval($dphoto['uid'])
35 logger("diaspora photo queue: user " . $dphoto['uid'] . " not found");
39 $ret = diaspora_dispatch($r[0],unserialize($dphoto['msg']),$dphoto['attempt']);
40 q("DELETE FROM dsprphotoq WHERE id = %d",
47 if (array_search(__file__,get_included_files())===0){
48 dsprphotoq_run($argv,$argc);