/** * Function to ping servers */ function art_ping($server, $id) { if (is_array($server)) { foreach ($server as $serv) { art_ping($serv, $id); } } include_once XOOPS_ROOT_PATH . "/modules/" . $GLOBALS["artdirname"] . "/class/class-IXR.php"; // using a timeout of 3 seconds should be enough to cover slow servers $client = new IXR_Client($server, false); $client->timeout = 3; $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION; // when set to true, this outputs debug messages by itself $client->debug = false; $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar("name")); $home = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/"; $rss2_url = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/xml.php" . URL_DELIMITER . "rss2.0/" . $id; if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping $client->query('weblogUpdates.ping', $blogname, $home); } }
} foreach ($tb_new as $tb) { $article_handler->addTracked($article_obj, $tb); } if ($article_obj->getVar("art_time_publish") > 0 && count($tb_untracked) > 0) { $article_handler->updateTracked($article_obj, $tb_untracked); } } // Clear caches load_functions("cache"); $dirname = $GLOBALS["artdirname"]; $pattern_uri = urlencode("/modules/{$dirname}/view.article.php?article=" . $article_obj->getVar("art_id")); mod_clearSmartyCache("/^{$dirname}\\^.*{$pattern_uri}.*{$dirname}_article\\.html\$/"); if ($isPublished && $article_isNew && !empty($xoopsModuleConfig["do_ping"]) && !empty($xoopsModuleConfig["pings"])) { $pings = array_map("trim", preg_split("/[\\s,\r\n]+/", $xoopsModuleConfig["pings"])); art_ping($pings, $article_obj->getVar("art_id")); } if (!empty($_POST["save"])) { if (empty($from)) { $redirect = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/view.article.php" . URL_DELIMITER . "c" . $cat_id . "/" . $article_obj->getVar("art_id") . "/p" . (empty($newpage) ? $page : $newpage - 1); } else { $redirect = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/admin/admin.article.php"; } $message = art_constant("MD_SAVED"); } if (!empty($_POST["save_edit"])) { $redirect = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/edit.article.php?category=" . $cat_id . "&article=" . $article_obj->getVar("art_id"); $redirect .= "&page=" . $page; if (!empty($from)) { $redirect .= "&from=" . $from; }