[Hack]给XOOPS的Transfer服务书签应用增加几种在线书签

xoops中的transfer API非常好,但是其书签功能中支持的在线书签服务实在太少,我添加了几种现在流行的在线书签服务,当然我们还可以添加更多。

修改htdocs\Frameworks\transfer\plugin\bookmark\language\schinese_utf8.php文件如下,支持google书签、美味书签、Sina Vivi、365Key、BlogChina、Poco、Sohu、天极、和讯、QQ、百度。如果采用gb2312编码或者gbk编码则编辑htdocs\Frameworks\transfer\plugin\bookmark\language\schinese.php这个文件。

<?php
/*
Transfer handler for XOOPS

This is intended to handle content intercommunication between modules as well as components
There might need to be a more explicit name for the handle since it is always confusing

@copyright The XOOPS project http://www.xoops.org/
@license http://www.fsf.org/copyleft/gpl.html GNU public license
@author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
@since 3.00
@version $Id$
@package Frameworks::transfer
*/

define(“_MD_TRANSFER_BOOKMARK”, “书签”);
define(“_MD_TRANSFER_BOOKMARK_DESC”, “添加到书签”);

/ Chinese /
define(“_MD_TRANSFER_BOOKMARK_ITEMS”,
“<span id=\”article-bookmarkit\”><ul class=\”list-bookmark\” id=\”bookmarkit\”>”
. “<li><a href=\”javascript:void(google = window.open(‘http://www.google.com/bookmarks/mark?op=edit&output=popup&title=‘ + encodeURIComponent(‘%1\$s’)+ ‘&bkmk=’ + encodeURIComponent(‘%2\$s’) , ‘google’)); google.focus();\”>[<strong style=’color:red’>Google</strong>]</a> </li>”
. “<li><a title=\”Delicious\” href=\”javascript:void(delicious=window.open(‘http://del.icio.us/post?url='+encodeURIComponent('%2\$s')+'&title='+encodeURIComponent('%1\$s‘), ‘delicious’));delicious.focus();\”>[<strong style=’color:#0000FF’>del.icio.us</strong>]</a> </li>”
. “<li><a href=\”javascript:void(vivi = window.open(‘http://vivi.sina.com.cn/collect/icollect.php?pid=28&title=‘ + encodeURIComponent(‘%1\$s’) + ‘&url=’ + encodeURIComponent(‘%2\$s’) + ‘&desc=’ + encodeURIComponent(t), ‘vivi’)); vivi.focus();\”>[<strong style=’color:red’>新浪 VIVI</strong>]</a> </li>”
. “<li><a href=\”javascript:void(365key = window.open(‘http://www.365key.com/storeit.aspx?t=‘ + encodeURIComponent(‘%1\$s’) +’&u=’ + encodeURIComponent(‘%2\$s’) + ‘&c=’ + encodeURIComponent(t), ‘keyit’)); 365key.focus();\”>[<strong style=’color:#a287be’>365k</strong><strong style=’color:#00CC00’>e</strong><strong style=’color:#9575B6’>y</strong>]</a> </li>”
. “<li><a href=\”javascript:void(blogchina = window.open(‘http://blogmark.blogchina.com/jsp/key/quickaddkey.jsp?k=‘ + encodeURI(‘%1\$s’) + ‘&u=’+encodeURI(‘%2\$s’) + ‘&c=’+encodeURI(t), ‘blogchina’)); keyit.focus();\”>[<strong style=’color:#74B779’>博采中心</strong>]</a> </li>”
. “<li><a href=\”javascript:void(poco = window.open(‘http://my.poco.cn/fav/storeIt.php?t=‘ + encodeURIComponent(‘%1\$s’) + ‘&u=’ + encodeURIComponent(‘%2\$s’) + ‘&c=’ + encodeURIComponent(t), ‘keyit’)); poco.focus();\”>[<strong style=’color:#29B5DE’>Poco</strong>]</a> </li>”
. “<li><a href=\”javascript:void(sohu = window.open(‘http://z.sohu.com/storeit.do?t=‘ + encodeURIComponent(‘%1\$s’) + ‘&u=’ + encodeURIComponent(‘%2\$s’) +’&c=’ + encodeURIComponent(t), ‘sohu’)); sohu.focus();\”>[<strong style=’color:#505050’>SOHU狐摘</strong>]</A> </li>”
. “<li><a href=\”javascript:void(yesky = window.open(‘http://hot.yesky.com/dp.aspx?t=‘ + encodeURIComponent(‘%1\$s’) + ‘&u=’ + encodeURIComponent(‘%2\$s’) + ‘&c=’ + encodeURIComponent(t) + ‘&st=2’, ‘yesky’)); yesky.focus();\”>[<strong style=’color:#99CF17’>天极</strong><strong style=’color:#FF7F00’>网摘</strong>]</a> </li>”
. “<li><a href=\”javascript:void(hexun = window.open(‘http://bookmark.hexun.com/post.aspx?title=‘ + encodeURIComponent(t) + ‘&url=’ + encodeURIComponent(u) + ‘&excerpt=’ + encodeURIComponent(e), ‘HexunBookmark’)); hexun.focus();\”>[<strong style=’color:#3366CC’>和讯网摘</strong>]</a> </li>”
. “<li><a href=\”javascript:void(qq = window.open(‘http://shuqian.qq.com/post?title=‘ + encodeURIComponent(‘%1\$s’)+ ‘&uri=’ + encodeURIComponent(‘%2\$s’) +’&jumpback=2&noui=1’, ‘qq’)); qq.focus();\”>[QQ<strong style=’color:#74B779’>书签</strong>]</a> </li>”
. “<li><a href=\”javascript:void(baidu = window.open(‘http://cang.baidu.com/do/add?it=‘ + encodeURIComponent(‘%1\$s’)+ ‘&iu=’ + encodeURIComponent(‘%2\$s’) +’&dc=&fr=ien#nw=1’’, ‘baidu’)); baidu.focus();\”>[<strong style=’color:red’>百度搜藏</strong>]</a> </li>”
. “</ul></span>”
);
?>