12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- require dirname(__FILE__).'/lib.php';
- $img_check_on = '<img src="images/check_on.png" alt="ok" />';
- $img_check_off = '<img src="images/check_off.png" alt="failed" />';
- $url = "http://".$_SERVER['SERVER_NAME'].dc_blog_url;
- $name = dc_blog_name;
- $feed = "http://".$_SERVER['SERVER_NAME'].dc_blog_rss;
- $objPing = new basicPing($name,$url);
- $ping_sites = array(
- 'Weblogues.com' => array('www.weblogues.com','/RPC/',array($objPing,'weblogPing')),
- 'Weblogs.com' => array('rpc.weblogs.com','/RPC2',array($objPing,'weblogPing')),
- 'Blo.gs' => array('ping.blo.gs','/',array($objPing,'weblogPing')),
- 'Technorati' => array('rpc.technorati.com','/rpc/ping',array($objPing,'weblogPing')),
- 'Syndic8' => array('www.syndic8.com','/xmlrpc.php',array($objPing,'weblogPing')),
- 'RootBlog' => array('ping.rootblog.com','/rpc.php',array($objPing,'weblogPing'))
- );
- buffer::str( '<h2>Ping</h2>' );
- if (!empty($_POST['ping']))
- {
- foreach ($_POST['ping'] as $k => $v)
- {
- $ping_server = $ping_sites[$k][0];
- $ping_path = $ping_sites[$k][1];
- $ping_function = $ping_sites[$k][2];
-
- $res = call_user_func($ping_function,$ping_server,$ping_path);
- if ($res === true)
- {
- buffer::str(
- '<p>'.$img_check_on.' <strong>'.$k.'</strong> : '.
- __('ping ok').'</p>'
- );
- }
- else
- {
- buffer::str('<p>'.$img_check_off.' <strong>'.$k.'</strong> : '.
- __('ping error').' ('.$res.')</p>');
- }
- }
- }
- buffer::str( '<h3>'.__('Sites to ping').'</h3>' );
- buffer::str('
- <form id="pform" method="post" action="tools.php?p=ping">'
- );
- foreach ($ping_sites as $k => $v)
- {
- buffer::str(
- '<p><input type="checkbox" id="'.$k.'" name="ping['.$k.']" value="1" />'.
- '<label class="inline" for="'.$k.'">'.$k.'</label></p>'
- );
- }
- buffer::str(
- '<p><input type="submit" class="submit" value="'.__('Submit Pings').'" /></p>'.
- '</form>'
- );
- ?>
|