3 require_once('include/Scrape.php');
4 require_once('include/follow.php');
6 if(! function_exists('repair_ostatus_content')) {
7 function repair_ostatus_content(&$a) {
10 notice( t('Permission denied.') . EOL);
11 goaway($_SESSION['return_url']);
15 $o = "<h2>".t("Resubscribing to OStatus contacts")."</h2>";
21 $counter = intval($_REQUEST['counter']);
23 $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE
24 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)",
26 dbesc(NETWORK_OSTATUS),
27 intval(CONTACT_IS_FRIEND),
28 intval(CONTACT_IS_SHARING));
31 return($o.t("Error"));
33 $total = $r[0]["total"];
35 $r = q("SELECT `url` FROM `contact` WHERE
36 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)
40 dbesc(NETWORK_OSTATUS),
41 intval(CONTACT_IS_FRIEND),
42 intval(CONTACT_IS_SHARING), $counter++);
49 $o .= "<p>".$counter."/".$total.": ".$r[0]["url"]."</p>";
51 $o .= "<p>".t("Keep this window open until done.")."</p>";
53 $result = new_contact($uid,$r[0]["url"],true);
55 $a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.$a->get_baseurl().'/repair_ostatus?counter='.$counter.'">';