3 require_once('include/Scrape.php');
4 require_once('include/follow.php');
6 function repair_ostatus_content(App $a) {
9 notice( t('Permission denied.') . EOL);
10 goaway($_SESSION['return_url']);
14 $o = "<h2>".t("Resubscribing to OStatus contacts")."</h2>";
20 $counter = intval($_REQUEST['counter']);
22 $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE
23 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)",
25 dbesc(NETWORK_OSTATUS),
26 intval(CONTACT_IS_FRIEND),
27 intval(CONTACT_IS_SHARING));
30 return($o.t("Error"));
32 $total = $r[0]["total"];
34 $r = q("SELECT `url` FROM `contact` WHERE
35 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)
39 dbesc(NETWORK_OSTATUS),
40 intval(CONTACT_IS_FRIEND),
41 intval(CONTACT_IS_SHARING), $counter++);
48 $o .= "<p>".$counter."/".$total.": ".$r[0]["url"]."</p>";
50 $o .= "<p>".t("Keep this window open until done.")."</p>";
52 $result = new_contact($uid,$r[0]["url"],true);
54 $a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.App::get_baseurl().'/repair_ostatus?counter='.$counter.'">';