本帖最后由 yom5 于 2009-9-7 14:54 编辑
UCHome插件 升级版
昨天发布的晚,忘记了,不收金币了,谁要就直接下吧!!UTF8的,没有GBK!有兴趣自己转一下!
研究好会安装的告诉我一声,我安装一下!呵呵
====================================
语言编码 UTF8
插件名称 13980桌面导航
适用版本 UCHome 1.5+2.0
最新版2009.9.06
13980桌面导航 Plugin插件版(utf8)是一款个性化的桌面网址导航,为方便站长拥有一个款强大的桌面网址导航服务、功能而开发的用户个性桌面导航平台。作为uch的有力补充,13980桌面导航能够让您的用户可以按自己的想法、创意定制自己的桌面网址导航,让你的社区活动来,更具动感,更个性,吸引更多的用户增加社区粘性
同时您可以利用网站用户添加的网址而做成一个强大的、拥有详细分类的网址导航网站,为您的网站带来强劲的流量。
功能简介:
1、用户可以选择自己的个性桌面布局。
2、可以自由添加收藏网站
3、用户修改、删除不需要的网站
4、用户可以为每个收藏的网址自定义名称、链接颜色、背景色等等
5、用户可以自定义自己桌面的名称
6、用户可以为自己的收藏自由地进行排版,按自己的喜好进行设置
7、增加:您可以增加自己的桌面
8、增加:可以RSS订阅和共享RSS
9、增加:自由拖动桌面方块,像自己的电脑一样!
10、增加:新闻阅读功能。
11、增加:自由添加书签功能
12、增加:自由增加删除桌面组件
13、增加:模块添加及搜索功能
14、增加:共享桌面功能,把自己的桌面分享给你的朋友!
15、增加:UCH2.0整合功能!
安装说明里边有!!自己安装!别来问我,我也在研究呢!!
欢迎大家多多交流!我的小站:www.yom5.com/bbs/ 刚做,没人气!呵呵
=======================
Uchome插件安装包(安装方法):
1、配置config.php文件,打开该文件找到$_SC['cookiedomain'],如果你已经设置那么跳过此步!如果没有,那么设置格式为$_SC['cookiedomain'] = '.13980.com';,这个是导航支持用户二级域名同步!
2、找到$_SC['allowedittpl'] = 0;在下面增加以下代码:
$_SC['site_key'] = '';
$_SC['domain'] = false;
$_SC['domain_uid'] = 0;
$_SC['domain_desktop_id'] = 0;
$_SC['domain_name'] = '';
$_SC['default_desktop'] = 1;
$_SC['default_rss_desktop'] = 2;
$_SC['default_domain'] = ''; //格式如:www.13980.com , 必填!
3、然后找到$_SC['default_domain'],在里面写你的域名,如:www.13980.com
4、打开common.php文件在?>前面增加以下代码:
$life = 86400 * 365;
$var = 'sitekey';
if ( !$_COOKIE[$_SC['cookiepre'].$var] )
{
$value = md5($_SGLOBAL['timestamp']);
setcookie($_SC['cookiepre'].$var, $value, $life?($_SGLOBAL['timestamp']+$life):0, $_SC['cookiepath'], $_SC['cookiedomain'], $_SERVER['SERVER_PORT']==443?1:0);
$setarr = array(
'cookie' => $value,
'createtime' => $_SGLOBAL['timestamp']
);
$aid = inserttable('site_visitor', $setarr, 1);
$_SC['site_key'] = $value;
}
else
{
$_SC['site_key'] = $_COOKIE[$_SC['cookiepre'].$var];
}
$host = explode('.',$_SERVER['HTTP_HOST']);
if ( count($host) == 3 )
{
if ( $host[0] != 'www' )
{
$domain = addslashes(strip_tags(trim(strtolower($host[0]))));
if ( !ereg("^[a-z0-9]*$",$domain) )
{
header("Location: http://".$_SC['default_domain']);
exit;
}
if ( strlen($domain) < 4 )
{
header("Location: http://".$_SC['default_domain']);
exit;
}
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('site_domain')." WHERE domain='".$domain."' limit 1");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$member[] = $value;
}
if( $member )
{
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('site_desktop')." WHERE uid=".$member[0]['uid']." and active=1 limit 1");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$desktop[] = $value;
}
$_SC['domain_desktop_id'] = $desktop[0]['desktop_id'];
$_SC['domain_uid'] = $member[0]['uid'];
$_SC['domain'] = true;
$_SC['domain_name'] = $domain;
}
else
{
header("Location: http://".$_SC['default_domain']);
exit;
}
}
else
{
if( !empty($_SGLOBAL['supe_uid']) )
{
$query = $_SGLOBAL['db']->query("SELECT domain FROM ".tname('site_domain')." WHERE uid=".$_SGLOBAL['supe_uid']." limit 1");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$member[] = $value;
}
if( $member )
{
$_SC['domain_name'] = $member[0]['domain'];
}
}
}
}
else
{
if( !empty($_SGLOBAL['supe_uid']) )
{
$query = $_SGLOBAL['db']->query("SELECT domain FROM ".tname('site_domain')." WHERE uid=".$_SGLOBAL['supe_uid']." limit 1");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$member[] = $value;
}
if( $member )
{
$_SC['domain_name'] = $member[0]['domain'];
}
}
}
5、首先打开/source/function_common.php,找到multi这个function,在其函数结束后(}花括号后),增加以下代码:
//分页
function site_multi($num, $perpage, $curpage, $mpurl, $keyword) {
global $_SCONFIG;
$page = 5;
$multipage = '';
$mpurl .= strpos($mpurl, '?') ? '&' : '?';
$realpages = 1;
if($num > $perpage) {
$offset = 2;
$realpages = @ceil($num / $perpage);
$pages = $_SCONFIG['maxpage'] && $_SCONFIG['maxpage'] < $realpages ? $_SCONFIG['maxpage'] : $realpages;
if($page > $pages) {
$from = 1;
$to = $pages;
} else {
$from = $curpage - $offset;
$to = $from + $page - 1;
if($from < 1) {
$to = $curpage + 1 - $from;
$from = 1;
if($to - $from < $page) {
$to = $page;
}
} elseif($to > $pages) {
$from = $pages - $page + 1;
$to = $pages;
}
}
$multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href=\'javascript: publishResearch("'.$keyword.'", "users", "1","us");\' class="first">1 ...</a>' : '').
($curpage > 1 ? '<a href=\'javascript: publishResearch("'.$keyword.'", "users", "'.($curpage - 1).'","us");\' class="prev">prev</a>' : '');
for($i = $from; $i <= $to; $i++) {
$multipage .= $i == $curpage ? '<strong>'.$i.'</strong>' :
'<a href=\'javascript: publishResearch("'.$keyword.'", "users", "'.$i.'","us");\'>'.$i.'</a>';
}
$multipage .= ($curpage < $pages ? '<a href=\'javascript: publishResearch("'.$keyword.'", "users", "'.($curpage + 1).'","us");\' class="next">next</a>' : '').
($to < $pages ? '<a href=\'javascript: publishResearch("'.$keyword.'", "users", "'.$pages.'","us");\' class="last">... '.$realpages.'</a>' : '');
$multipage = $multipage ? ('<em> '.$num.' </em>'.$multipage):'';
}
$maxpage = $realpages;
return $multipage;
}
//分页
function site_multi_browse($num, $perpage, $curpage, $mpurl, $cat) {
global $_SCONFIG;
$page = 5;
$multipage = '';
$mpurl .= strpos($mpurl, '?') ? '&' : '?';
$realpages = 1;
if($num > $perpage) {
$offset = 2;
$realpages = @ceil($num / $perpage);
$pages = $_SCONFIG['maxpage'] && $_SCONFIG['maxpage'] < $realpages ? $_SCONFIG['maxpage'] : $realpages;
if($page > $pages) {
$from = 1;
$to = $pages;
} else {
$from = $curpage - $offset;
$to = $from + $page - 1;
if($from < 1) {
$to = $curpage + 1 - $from;
$from = 1;
if($to - $from < $page) {
$to = $page;
}
} elseif($to > $pages) {
$from = $pages - $page + 1;
$to = $pages;
}
}
$multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href=\'javascript: publishReselect("'.$cat.'", "users", "1","us");\' class="first">1 ...</a>' : '').
($curpage > 1 ? '<a href=\'javascript: publishReselect("'.$cat.'", "users", "'.($curpage - 1).'","us");\' class="prev">prev</a>' : '');
for($i = $from; $i <= $to; $i++) {
$multipage .= $i == $curpage ? '<strong>'.$i.'</strong>' :
'<a href=\'javascript: publishReselect("'.$cat.'", "users", "'.$i.'","us");\'>'.$i.'</a>';
}
$multipage .= ($curpage < $pages ? '<a href=\'javascript: publishReselect("'.$cat.'", "users", "'.($curpage + 1).'","us");\' class="next">next</a>' : '').
($to < $pages ? '<a href=\'javascript: publishReselect("'.$cat.'", "users", "'.$pages.'","us");\' class="last">... '.$realpages.'</a>' : '');
$multipage = $multipage ? ('<em> '.$num.' </em>'.$multipage):'';
}
$maxpage = $realpages;
return $multipage;
}
其次找到:
obclean();
if($_SGLOBAL['inajax']) {
xml_out($content);
} else{
if($_SCONFIG['headercharset']) {
@header('Content-Type: text/html; charset='.$_SC['charset']);
}
echo $content;
if(D_BUG) {
@include_once(S_ROOT.'./source/inc_debug.php');
}
}
改为:
obclean();
if($_SGLOBAL['inajax'] == 1) {
xml_out($content);
}elseif($_SGLOBAL['inajax'] == 2){
xml_out_site($content);
}elseif($_SGLOBAL['inajax'] == 3){
xml_out_site_links($content);
}elseif($_SGLOBAL['inajax'] == 4){
xml_out_site_custom_icon($content);
}elseif($_SGLOBAL['inajax'] == 5){
xml_out_site_custom_upload($content);
}else{
if($_SCONFIG['headercharset']) {
@header('Content-Type: text/html; charset='.$_SC['charset']);
}
echo $content;
if(D_BUG) {
@include_once(S_ROOT.'./source/inc_debug.php');
}
}
第三:在xml_out这个function 和rewrite_url这个function中间加入以下函数:
function xml_out_site_custom_upload($content) {
global $_SC;
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("Content-type: application/xml; charset=$_SC[charset]");
echo '<'."?xml version=\"1.0\" encoding=\"$_SC[charset]\"?>\n";
echo $content;
exit();
}
function xml_out_site($content) {
global $_SC;
$content = str_replace('****----****','<![CDATA[',$content);
$content = str_replace('####----####',']]>',$content);
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("Content-type: application/xml; charset=$_SC[charset]");
echo '<'."?xml version=\"1.0\" encoding=\"$_SC[charset]\"?>\n";
echo "<taconite>".trim($content)."</taconite>";
exit();
}
function xml_out_site_custom_icon($content) {
global $_SC;
$content = str_replace('****----****','<![CDATA[',$content);
$content = str_replace('####----####',']]>',$content);
$template = sreadfile(S_ROOT.'./template/default/default_icon.htm');
$content = str_replace('XXXXXXXXXXXXXXXXXXX_icon',$template,$content);
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("Content-type: application/xml; charset=$_SC[charset]");
echo '<'."?xml version=\"1.0\" encoding=\"$_SC[charset]\"?>\n";
echo "<taconite>".trim($content)."</taconite>";
exit();
}
function xml_out_site_links($content) {
global $_SC;
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("Content-type: application/xml; charset=$_SC[charset]");
echo '<'."?xml version=\"1.0\" encoding=\"$_SC[charset]\"?>\n";
echo "<root>".trim($content)."</root>";
exit();
}
6、打开admincp.php找到:
array('index','config', 'privacy', 'spam', 'network', 'usergroup', 'credit', 'profilefield', 'profield', 'ad', 'sitefeed', 'userapp', 'app'),
在'app'后加 , 'site', 'site_search', 'site_links', 'site_feeds', 'site_radio', 'site_desktop'
7、打开/admin/tpl/header.htm,找到:
'app' => 'UCenter应用',
在下面加入:
'site' => '桌面设置',
'site_search' => '搜索模块',
'site_links' => '书签模块',
'site_feeds' => '订阅模块',
'site_radio' => '电台模块',
'site_desktop' => '用户桌面',
8、解压文件后,将文件覆盖到你的uchome根目录!
9、运行http://www.yourdomain.com/13980/install.php建表和初始化数据,提示完成后,请删除13980目录!
备注:首页默认桌面在config.php中定义:
默认的uchome_site_bar表中只有两条数据,如果想修改下面两个参数,请建立新桌面,然后手动设置!
$_SC['default_desktop'] = 1; //书签默认页
$_SC['default_rss_desktop'] = 2; //Rss默认页
它们是系统默认uid为1的用户(也就是高级管理员)的桌面,默认页可以随便定义,但会随着你定义用户改变而改变!
如:你把他定义为某个会员的桌面,那么会员改变了格局,你首页也就变了,哈哈,还是建议用自己建立的! |