本帖最后由 wzjh 于 2009-8-1 10:30 编辑
请大家多关注这个页面http://blog.13980.com/download,很多补丁就都在那里发布了!
所有补丁更新在二楼,请关注!
申明:
咱程序不是原创,是山寨国外的。原站(http://www.symbaloo.com)
请大家支持原创!
介绍:
13980是一个个人网络浏览页面,按一下就可以找到您最喜爱的网站,如百度,谷歌,淘宝,开心网等。也可以听在线广播!
版本:1.0 (Beta)
演示:
http://www.13980.com
功能:
目前只支持以下内容:
1、分为Rss订阅列表和书签两部分。
2、书签包括:系统(常用网址,在线广播,搜索模块,Rss订阅,以及小组件),也可以用户自己添加。
3、用户个性域名添加。
4、整图上传功能。
5、桌面格子连连看游戏。
说明:
当时为了速度开发,没有自己写框架,直接拿来uchome搞了二次开发,由于开发时间短(不到20天(每天2~3小时)),所以没有考虑到性能方面,如果以后更新的话,会把程序独立出来!或者有喜欢的朋友,可以一起开发!
用法:
整合安装包(安装方法)
1、配置config.php文件,打开该文件找到$_SC['cookiedomain'],这个默认为空,想要同步二级域名,那么必须配置,格式如:$_SC['cookiedomain'] = ‘.13980.com’;,然后找到$_SC['default_domain'],在里面写你的域名,如:www.13980.com
2、开始安装Ucenter, http://www.yourdomian.com/ucenter/install/index.php,按照上面的提示装吧,很简单!
3、装完后,进入Ucenter后台,点应用管理,然后点添加新应用,在应用程序安装地址:写上http://www.yourdomain/install/index.php,
直接进入Uchome安装,跟着上面的提示安装,注:建议用同一个数据库吧,只是前缀名不同!
4、让icon目录以及下面的子目录有写权限。这个是上传格子图标目录!另外在icon目录下有个tmp目录,这个上传图片的临时目录,没有自动清除功能,会留临时文件,建议隔几天清除一下,以后版本会改进!
5、上步完成后,恭喜您,安装成功!
6、回到首页看看,哇~~,奇迹诞生了!如使用中有Bug,请在此页回复,谢谢!
备注:首页默认桌面在config.php中定义:
$_SC['default_desktop'] = 1; //书签默认页
$_SC['default_rss_desktop'] = 2; //Rss默认页
它们是系统默认uid为1的用户(也就是高级管理员)的桌面,默认页可以随便定义,但会随着你定义用户改变而改变!
如:你把他定义为某个会员的桌面,那么会员改变了格局,你首页也就变了,哈哈,还是建议用自己建立的!
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目录!
10、上步完成后,恭喜您,安装成功!
11、访问site.php看看,哇~~,奇迹诞生了!如使用中有Bug,请到http://blog.13980.com/download这里回复说明,谢谢!
备注:首页默认桌面在config.php中定义:
默认的uchome_site_bar表中只有两条数据,如果想修改下面两个参数,请建立新桌面,然后手动设置!
$_SC['default_desktop'] = 1; //书签默认页
$_SC['default_rss_desktop'] = 2; //Rss默认页
它们是系统默认uid为1的用户(也就是高级管理员)的桌面,默认页可以随便定义,但会随着你定义用户改变而改变!
如:你把他定义为某个会员的桌面,那么会员改变了格局,你首页也就变了,哈哈,还是建议用自己建立的!
下载:
为了方便用户的安装使用,此次提供了两种程序包供不同用户选择使用:
1、整合安装包:
说明:UCenter1.5+UCenter Home1.5+13980
下载地址:13980
2、插件安装包(仅限UTF-8)
说明:以插件形式安装13980(前提用户已经安装UCenter1.5+UCenter Home1.5)
下载地址:13980-Plugin
PS:我直接从我blog里复制的,安装方法下载文件里有,这里的有点乱,看文件里的吧! |