@@ 354-378 (lines=25) @@ | ||
351 | * @param $server |
|
352 | * @param $id |
|
353 | */ |
|
354 | public static function planetGetPing($server, $id) |
|
355 | { |
|
356 | if (is_array($server)) { |
|
357 | foreach ($server as $serv) { |
|
358 | PlanetUtility::planetGetPing($serv, $id); |
|
359 | } |
|
360 | } |
|
361 | require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php'; |
|
362 | ||
363 | // using a timeout of 3 seconds should be enough to cover slow servers |
|
364 | $client = new IXR_Client($server, false); |
|
365 | $client->timeout = 3; |
|
366 | $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION; |
|
367 | ||
368 | // when set to true, this outputs debug messages by itself |
|
369 | $client->debug = false; |
|
370 | ||
371 | $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name')); |
|
372 | $home = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/'; |
|
373 | $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id; |
|
374 | ||
375 | if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping |
|
376 | $client->query('weblogUpdates.ping', $blogname, $home); |
|
377 | } |
|
378 | } |
|
379 | ||
380 | /** |
|
381 | * Function to respond to a trackback |
@@ 344-368 (lines=25) @@ | ||
341 | * @param $server |
|
342 | * @param $id |
|
343 | */ |
|
344 | function planetGetPing($server, $id) |
|
345 | { |
|
346 | if (is_array($server)) { |
|
347 | foreach ($server as $serv) { |
|
348 | planetGetPing($serv, $id); |
|
349 | } |
|
350 | } |
|
351 | require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php'; |
|
352 | ||
353 | // using a timeout of 3 seconds should be enough to cover slow servers |
|
354 | $client = new IXR_Client($server, false); |
|
355 | $client->timeout = 3; |
|
356 | $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION; |
|
357 | ||
358 | // when set to true, this outputs debug messages by itself |
|
359 | $client->debug = false; |
|
360 | ||
361 | $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name')); |
|
362 | $home = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/'; |
|
363 | $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id; |
|
364 | ||
365 | if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping |
|
366 | $client->query('weblogUpdates.ping', $blogname, $home); |
|
367 | } |
|
368 | } |
|
369 | ||
370 | /** |
|
371 | * Function to respond to a trackback |