Please login or register.

Login with username, password and session length
Advanced search  

News:

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

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

sNews Chinese

  • Newbie
  • *
  • Karma: 4
  • Posts: 34
  • www.snewscms.net
    • 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 = 'http://www.google.com/webmasters/sitemaps/ping?sitemap=' . 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;
    curl_close($handle);
    return $buffer;
  }


3.After
Code: [Select]
echo notification(0,'',$link);
unset($_SESSION[_SITE.'temp']);

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

OK! Done.

http://snewscms.cn/extend/mods/google-sitemap-pinger-for-snews-v17/
Logged