Please login or register.

Login with username, password and session length
Advanced search  


You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Google sitemap pinger for sNews V1.7  (Read 2434 times)

sNews Chinese

  • Newbie
  • *
  • Karma: 4
  • Posts: 34
    • sNewsCMS Network
Google sitemap pinger for sNews V1.7
« on: November 24, 2008, 04:38:30 pm »

0. Backup

1.Put this definition and function somewhere in snews.php
Code: [Select]
//ping google sitemap
define('SITEMAP_URI', ''._SITE.'googlesitemap.php');
  function ping_sitemap($sitemap_uri) {
    $uri = '' . urlencode($sitemap_uri);
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $uri);
    curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 1);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($handle, CURLOPT_TIMEOUT, $timeout);     
    $buffer = curl_exec($handle);
    echo $buffer;
    return $buffer;

Code: [Select]
echo notification(0,'',$link);

Add this:
Code: [Select]
ping_sitemap(SITEMAP_URI);//ping google sitemap

OK! Done.