Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

同城 同学录 插件

[复制链接]
uto258 发表于 2009-5-7 17:50:20 | 显示全部楼层 |阅读模式
UCHome插件
语言编码:  
插件名称:
插件作者:
适用版本:
版权不是我的,我只是提供下载
大家安装插件时注意一定要备份好文件。


先覆盖文件 再进行修改!

--------------------------



1,升级数据库  uchome_ 按照你的数据库名称改!
ALTER TABLE `uchome_spacefield` ADD `univs_name` varchar(80) NOT NULL AFTER `birthcity` ;
ALTER TABLE `uchome_spacefield` ADD `univs_year` varchar(80) NOT NULL AFTER `univs_name` ;
ALTER TABLE `uchome_spacefield` ADD `univs_degree` varchar(80) NOT NULL AFTER `univs_name` ;
ALTER TABLE `uchome_spacefield` ADD `univs_department` varchar(80) NOT NULL AFTER `univs_degree` ;
ALTER TABLE `uchome_spacefield` ADD `highschool` varchar(80) NOT NULL AFTER `univs_department` ;
ALTER TABLE `uchome_spacefield` ADD `highschool_year` varchar(80) NOT NULL AFTER `highschool` ;
ALTER TABLE `uchome_spacefield` ADD `juniorhighSchool` varchar(80) NOT NULL AFTER `highschool_year` ;
ALTER TABLE `uchome_spacefield` ADD `juniorhighSchool_year` varchar(80) NOT NULL AFTER `juniorhighSchool` ;
ALTER TABLE `uchome_spacefield` ADD `elementarySchool` varchar(80) NOT NULL AFTER `juniorhighSchool_year` ;
ALTER TABLE `uchome_spacefield` ADD `elementarySchool_year` varchar(80) NOT NULL AFTER `elementarySchool` ;

2,修改文件cp.php('userapp', 'task', 'credit','city','school');-----发现没有增加了,'school')
查找
$acs = array('space', 'doing', 'upload', 'comment', 'blog', 'album', 'relatekw', 'common', 'class',
'swfupload', 'thread', 'mtag', 'poke', 'friend',
'avatar', 'profile', 'theme', 'import', 'feed', 'privacy', 'pm', 'share', 'advance', 'invite','sendmail',
'userapp', 'task', 'credit','city');

修改为:$acs = array('space', 'doing', 'upload', 'comment', 'blog', 'album', 'relatekw', 'common', 'class',
'swfupload', 'thread', 'mtag', 'poke', 'friend',
'avatar', 'profile', 'theme', 'import', 'feed', 'privacy', 'pm', 'share', 'advance', 'invite','sendmail',
'userapp', 'task', 'credit','city','school');

3,修改文件api\class\MyBase.php
查找:
'resideCity' => $space['residecity'],

下面增加:

'univs_name' => $space['univs_name'],
'univs_degree' => $space['univs_degree'],
'univs_year' => $space['univs_year'],
'univs_department' => $space['univs_department'],
'highschool' => $space['highschool'],
'highschool_year' => sprintf('%04d-%02d-%02d', $space['highschool_year']),
'juniorhighSchool' => $space['juniorhighSchool'],
'juniorhighSchool_year' => sprintf('%04d-%02d-%02d', $space['juniorhighSchool_year']),
'elementarySchool' => $space['elementarySchool'],
'elementarySchool_year' => sprintf('%04d-%02d-%02d', $space['elementarySchool_year']),

4,修改文件template/default/cp_header.htm(注:修改你网站所用模板下的cp_header.htm)

查找:
<li$actives[profile]><a href="cp.php?ac=profile">个人资料</a></li>

下方增加:

<li$actives[school]><a href="cp.php?ac=school">学校信息</a></li>

5,修改template/default/cp_privacy.htm
查找:
<tr>
<th width="100">个人基本资料</th>
<td><select name="privacy[view][profile]">
<option value="0"$sels[view][profile][0]>全站用户可见</option>
<option value="1"$sels[view][profile][1]>仅好友可见</option>
<option value="2"$sels[view][profile][2]>仅自己可见</option>
</select></td>
</tr>

下方增加:

<tr>
<th width="100">学校信息资料</th>
<td><select name="privacy[view][school]">
<option value="0"$sels[view][school][0]>全站用户可见</option>
<option value="1"$sels[view][school][1]>仅好友可见</option>
<option value="2"$sels[view][school][2]>仅自己可见</option>
</select></td>
</tr>

6,修改template/default/network_space.htm
查找:
<!--{if $value[resideprovince]}-->

上方增加: <!--{if $value[univs_name]}--> <p><span class="gray">大学:</span><a href="network.php?ac=space&searchmode=1&univs_name=$value[univs_name]" title="寻找来自 $value[univs_name] 的校友" target="_blank">$value[univs_name]</a><!--{if $value[univs_department]}--> - $value[univs_department]<!--{/if}--><!--{if $value[univs_year]}-->($value[univs_year]年入学)<!--{/if}--></p>
<!--{/if}-->

7,修改template/default/space_index.htm
查找:
<tr>
<th width="80">主页:</th>
<td><a href="$space[domainurl]" onclick="javascript:setCopy('$space[domainurl]');return false;" class="spacelink domainurl">$space[domainurl]</a></td>
</tr>
</table>
</div>
<!--{/if}-->
</div>
<!--{/if}-->

下方增加:

<!--{if ckprivacy('school')}-->
<div class="box">
<h3><!--{if $space[self]}--><a href="cp.php?ac=school" class="r_option">编辑学校信息</a><!--{/if}-->学校信息</h3>
<table cellspacing="2" cellpadding="2" class="infotable">
<!--{if $space[univs_name]}-->
<tr>
<th style="width:60px;">大学:</th>
<td><a href="network.php?ac=space&searchmode=1&univs_name=$space[univs_name]" title="寻找来自 $space[univs_name] 的校友" target="_blank">$space[univs_name]</a><!--{if $space[univs_year]}--> - $space[univs_year]级<!--{/if}--><!--{if $space[univs_department]}--> - $space[univs_department]<!--{/if}--></td>
</tr>
<!--{/if}-->
<!--{if $space[highschool]}-->
<tr>
<th>高中:</th>
<td><a href="network.php?ac=space&searchmode=1&highschool=$space[highschool]" title="寻找来自 $space[highschool] 的校友" target="_blank">$space[highschool]</a><!--{if $space[highschool_year]}--> - $space[highschool_year]级<!--{/if}--></td>
</tr>
<!--{/if}-->
<!--{if $space[juniorhighSchool]}-->
<tr>
<th>初中:</th>
<td><a href="network.php?ac=space&searchmode=1&juniorhighSchool=$space[juniorhighSchool]" title="寻找来自 $space[juniorhighSchool] 的校友" target="_blank">$space[juniorhighSchool]</a><!--{if $space[juniorhighSchool_year]}--> - $space[juniorhighSchool_year]级 <!--{/if}--></td>
</tr>
<!--{/if}-->
<!--{if $space[elementarySchool]}-->
<tr>
<th>小学:</th>
<td><a href="network.php?ac=space&searchmode=1&elementarySchool=$space[elementarySchool]" title="寻找来自 $space[elementarySchool] 的校友" target="_blank">$space[elementarySchool]</a><!--{if $space[elementarySchool_year]}--> - $space[elementarySchool_year]级 <!--{/if}--></td>
</tr>
<!--{/if}-->
</table>
</div>
<!--{else}-->
<div class="box">
<h3><a href="cp.php?ac=friend&op=add&uid=$space[uid]" target="_blank" title="未公开!" style="float:right;padding-top:6px;"><img  src="image/lock01.gif" /></a>学校信息</h3>
</div>
<!--{/if}-->



8,修改source/space_index.php
查找:
        $space['reside'] = trim(($space['resideprovince']?"<a href=\"network.php?ac=space&resideprovince=".rawurlencode($space['resideprovince'])."&searchmode=1\">$space[resideprovince]</a>":'').($space['residecity']?" <a href=\"network.php?ac=space&residecity=".rawurlencode($space['residecity'])."&searchmode=1\">$space[residecity]</a>":''));

下方增加:
//学校信息搜索开始
    $space['univs'] = trim(($space['univs_name']?"<a href=\"network.php?ac=space&univs_name=".rawurlencode($space['univs_name'])."&searchmode=1\">$space[univs_name]</a>":'').($space['univs_year']?" <a href=\"network.php?ac=space&univs_year=".rawurlencode($space['univs_year'])."&searchmode=1\">$space[univs_year]</a>":''));
    $space['high'] = trim(($space['highschool']?"<a href=\"network.php?ac=space&highschool=".rawurlencode($space['highschool'])."&searchmode=1\">$space[highschool]</a>":'').($space['highschool_year']?" <a href=\"network.php?ac=space&highschool_year=".rawurlencode($space['highschool_year'])."&searchmode=1\">$space[highschool_year]</a>":''));
    $space['juniorhigh'] = trim(($space['juniorhighSchool']?"<a href=\"network.php?ac=space&juniorhighSchool=".rawurlencode($space['juniorhighSchool'])."&searchmode=1\">$space[juniorhighSchool]</a>":'').($space['juniorhighSchool_year']?" <a href=\"network.php?ac=space&juniorhighSchool_year=".rawurlencode($space['juniorhighSchool_year'])."&searchmode=1\">$space[juniorhighSchool_year]</a>":''));
    $space['elementary'] = trim(($space['elementarySchool']?"<a href=\"network.php?ac=space&elementarySchool=".rawurlencode($space['elementarySchool'])."&searchmode=1\">$space[elementarySchool]</a>":'').($space['highschool_year']?" <a href=\"network.php?ac=space&elementarySchool_year=".rawurlencode($space['elementarySchool_year'])."&searchmode=1\">$space[elementarySchool_year]</a>":''));
//学校信息搜索结束

9,继续修改source/network_space.php
查找:
$gets['birthcity'] = empty($_GET['birthcity'])?'':stripsearchkey($_GET['birthcity']);

下方增加:
//学校信息搜索开始
        $gets['univs_name'] = empty($_GET['univs_name'])?'':stripsearchkey($_GET['univs_name']);
        $gets['univs_year'] = empty($_GET['univs_year'])?'':stripsearchkey($_GET['univs_year']);
        $gets['univs_degree'] = empty($_GET['univs_degree'])?'':stripsearchkey($_GET['univs_degree']);
        $gets['univs_department'] = empty($_GET['univs_department'])?'':stripsearchkey($_GET['univs_department']);
        $gets['highschool'] = empty($_GET['highschool'])?'':stripsearchkey($_GET['highschool']);
        $gets['highschool_year'] = empty($_GET['highschool_year'])?'':stripsearchkey($_GET['highschool_year']);
        $gets['juniorhighSchool'] = empty($_GET['juniorhighSchool'])?'':stripsearchkey($_GET['juniorhighSchool']);
        $gets['juniorhighSchool_year'] = empty($_GET['juniorhighSchool_year'])?'':stripsearchkey($_GET['juniorhighSchool_year']);
        $gets['elementarySchool'] = empty($_GET['elementarySchool'])?'':stripsearchkey($_GET['elementarySchool']);
        $gets['elementarySchool_year'] = empty($_GET['elementarySchool_year'])?'':stripsearchkey($_GET['elementarySchool_year']);
        //学校信息搜索结束


查找:

        $wherearr = array();
        foreach (array('sex', 'birthyear', 'birthmonth', 'birthday', 'marry', 'blood', 'birthprovince', 'birthcity', 'resideprovince', 'residecity', 'qq', 'msn') as $value) {
                if($gets[$value]) {
                        $wherearr[] = "spacefield.$value='$gets[$value]'";
                }
        }

用以下代码替换:
$wherearr = array();
        foreach (array('sex', 'birthyear', 'birthmonth', 'birthday', 'marry', 'blood', 'birthprovince', 'birthcity', 'resideprovince', 'residecity', 'qq', 'msn','univs_name','univs_year','highschool','highschool_year','juniorhighSchool','juniorhighSchool_year','elementarySchool','elementarySchool_year') as $value) {
                if($gets[$value]) {
                        $wherearr[] = "spacefield.$value='$gets[$value]'";
                }
        }//增加搜索字段
krisy 发表于 2009-5-7 19:05:54 | 显示全部楼层
没钱下啊!!!!!!!!!!!!!!!!!
回复

使用道具 举报

krisy 发表于 2009-5-7 19:06:41 | 显示全部楼层
楼主修改成功了吗???QQ:83339916教我下啊!!
回复

使用道具 举报

krisy 发表于 2009-5-7 20:51:30 | 显示全部楼层
在到别的地方找找吧!!!
回复

使用道具 举报

鸟瞰 发表于 2009-5-7 21:09:10 | 显示全部楼层
谁装好的给个演示看看
回复

使用道具 举报

cn256 发表于 2009-5-7 22:21:45 | 显示全部楼层
有免费的下载。。。
回复

使用道具 举报

jacky0920 发表于 2009-5-8 01:33:24 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

templetan 发表于 2009-5-8 09:27:56 | 显示全部楼层
要改的东西太多啦,暂时好不敢装
回复

使用道具 举报

sisiforyou 发表于 2009-5-8 22:08:24 | 显示全部楼层
钱钱钱,...演示演示演示
回复

使用道具 举报

zzhxjh 发表于 2009-5-9 01:03:21 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-21 17:43 , Processed in 0.118551 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表