`
rexcn
  • 浏览: 87384 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

修改drupal的ping模块以便ping中文搜索引擎

阅读更多
Ping:Ping 是针对 blog内容的提交方式,实时通知搜索引擎blog上有新内容产生。
目前主流的博客程序都支持 ping,您只需要将百度的 ping服务地址
http://ping.baidu.com/ping/RPC2加入博客后台并开启 ping功能即可。





将ping模块下的文件中的ping_ping()模块作如下修改:
function ping_ping($name = '', $url = '') {
  // google.com
  // ----------------------
  $result = xmlrpc('http://blogsearch.google.com/ping/RPC2', 'weblogUpdates.ping', $name, $url);
  if ($result === FALSE) {
    watchdog('directory ping', t('Failed to notify pingomatic.com (site).'), array(), WATCHDOG_WARNING);
  } else {
     watchdog('directory ping', t('Successfully notified pingomatic.com (site).'), array(), WATCHDOG_NOTICE);
  }
  // iask.com
  // ----------------------
  $result = xmlrpc('http://blog.iask.com/RPC2', 'weblogUpdates.ping', $name, $url);
  if ($result === FALSE) {
    watchdog('directory ping', t('Failed to notify Technorati.com (site).'), array(), WATCHDOG_WARNING);
  } else {
    watchdog('directory ping', t('Successfully notified Technorati.com (site).'),  array(), WATCHDOG_NOTICE);
  }
  // qikoo.com
  // --------------------------
  $result = xmlrpc('http://ping.blog.qikoo.com/rpc2.php', 'weblogUpdates.ping', $name, $url);
  if ($result === FALSE) {
    watchdog('directory ping', t('Failed to notify Feedburner.com (site).'),  array(), WATCHDOG_WARNING);
  } else {
    watchdog('directory ping', t('Successfully notified Feedburner.com (site).'),  array(), WATCHDOG_NOTICE);
  }
}

ping不用設定,只要啟動這模組後,它就會自動通知一個叫做Ping-o-Matic的網站,該網站會幫你通知多個ping server,包括technorati





如果你希望通知的站点没有使用 ping-o-matic,你可以使用下面的更新。

来自: http://drupal.org/node/29704

替换 ping.module:ping_ping 为下面的代码。 兼容 drupal 4.6.3




function ping_ping($name = '', $url = '') {
$result = xmlrpc('http://rpc.pingomatic.com', 'weblogUpdates.ping', $name, $url);
if ($result === FALSE) {
watchdog('directory ping', t('Failed to notify pingomatic.com (site).'), WATCHDOG_WARNING);
} else {
watchdog("directory ping", t('successfully notified pingomatic.com (site).'), WATCHDOG_NOTICE);
}
unset($result);
$result = xmlrpc('http://rpc.technorati.com/rpc/ping', 'weblogUpdates.ping', $name, $url);
if ($result === FALSE) {
watchdog('directory ping', t('Failed to notify technorati.com (site).'), WATCHDOG_WARNING);
} else {
watchdog("directory ping",t('successfully notified technorati.com (site).'), WATCHDOG_NOTICE);
}
unset($result);
$result = xmlrpc('http://ping.blo.gs', 'weblogUpdates.ping', $name, $url);
if ($result === FALSE) {
watchdog('directory ping', t('Failed to notify blo.gs (site).'), WATCHDOG_WARNING);
} else {
watchdog("directory ping", t('successfully notified blo.gs (site).'), WATCHDOG_NOTICE);
}
unset($result);
}
分享到:
评论

相关推荐

    drupal7模块开发教程

    drupal7模块开发实例,这里用一个简单的模块开发实例来讲述drupal7模块开发

    Drupal Guestbook模块

    Drupal Guestbook模块配置 Guestbook是一个留言板模块

    Drupal views模块教程

    优秀开源cms Drupal 的重要模块views教程

    drupal 的smtp模块

    这是drupal的一个完整的 smtp模块,以前老是被此问题所困,现在好了。您只需要下载即可。偶也。

    Drupal CAPTCHA模块配置

    Drupal 如何配置CAPTCHA模块; Captcha模块用于表单验证码的配置,开启即可在发表留言,发布文章,用户注册等行为上加载验证码安全校验。

    drupal 7.15 统计模块使用(15)

    drupal 7.15 统计模块使用(15)

    Drupal6模块开发

    学习_Drupal6模块开发. 前一部分介绍Drupal 后一部分介绍模块的开发 可以看看

    Drupal模块分类

    将模块分类,并提供过滤功能。对于越来越多的模块,这是个十分方便的管理模块的工具。

    入门到熟悉Drupal6.x模块开发简明实用教程

    中文入门到熟悉Drupal6.x基本模块开发简明实用教程

    Drupal UserDashboard模块

    Drupal UserDashboard 模块; User Dashboard模块可以提供“个人信息面板定制”功能,类似于“用户中心”这样的功能

    drupal中常用的26个模块

    为了方便,包括了drupal中常用的一些第三方模块,其中包括ctools captcha panels date cck webform wysiwyg views rules link imce ubercart等26个

    Drupal模块功能一览

    Drupal的模块化设计使得整个系统的功能扩展更灵活更规范,安装使用也很方便,只要将相应文件复制到modules目录下,就可以在‘管理-设置’里面方便地开启使用了。除了drupal自带的标准模块外,还有很多用户使用过程中...

    Drupal常用第三方模块使用手册

    Drupal常用第三方模块使用手册,详细介绍Drupal第三方模块的使用方法和技巧。

    Drupal 7模块开发

    这本书更侧重于Drupal的实际动手能力,几位作者都是专业Drupal开发者或Drupal项目的贡献者。书中提供了大量示例代码和分析,以及资深Drupal开发者的宝贵经验。

    Drupal ModuleFilter模块

    Drupal ModuleFilter模块; Module Filter模块,可以对后台安装的模块进行分类,并提供过滤功能。

    完美解决windows环境下drupal的webfm模块不支持中文的问题

    完美解决windows环境下drupal的webfm模块不支持中文的问题,只需将附件中的两个文件替换掉源文件即可,小弟是在为导师做网站的时候用的webfm模块,在导师强大的压力下,花了半个月时间,几乎把webfm源码看了个遍,...

    drupal7与drupal6版本修改内容

    drupal7 vs drupal6 详细的列出了从drupal6升级到drupal7所做的一些改动。 从代码,配置,UI,API等全方面的诠释drupal7与drupal6 的不同之处。

    drupal菜单模块文档

    此文档详细介绍drupal中如何创建一个菜单和一个模块,自定义请求路径执行你想要的php方法。

    Drupal7中文附件乱码解决

    解决Drupal7中文附件和图片乱码问题。中文附件使用的原生态处理方式,上传什么文件名显示什么...安装启用附件中的transliteration模块,该附件在原版基础上修改过,对附件不做处理,对图片字段采用汉字转拼音处理。

    Drupal7模块Views实站教程

    Views实站教程,适合初学者。欢迎下载,很好的哦。

Global site tag (gtag.js) - Google Analytics