本帖最后由 hnyic 于 2009-2-23 11:23 编辑
演示地址 www.yy730.com
岳阳730家园
学校信息 1.5 修改说明
本插件免费共享,1.5版本升级了一个重要功能:可以自动创建或加入学校群组,不包含同校功能
安装前请注意:
全新安装:如是uch1.5正式版可以直接覆盖,然后升级数据库即可;也可以手动修改文件。
升级安装:如是uch1.5正式版可以直接覆盖,不需升级数据库;也可以手动修改文件。
演示地址:www.yy730.com
1,升级数据库:
ALTER TABLE `uchome_spacefield` ADD `univs_name` varchar(20) NOT NULL AFTER `residecity` ;
ALTER TABLE `uchome_spacefield` ADD `univs_year` varchar(20) NOT NULL AFTER `univs_name` ;
ALTER TABLE `uchome_spacefield` ADD `univs_degree` varchar(20) NOT NULL AFTER `univs_name` ;
ALTER TABLE `uchome_spacefield` ADD `univs_department` varchar(20) NOT NULL AFTER `univs_degree` ;
ALTER TABLE `uchome_spacefield` ADD `highschool` varchar(20) NOT NULL AFTER `univs_department` ;
ALTER TABLE `uchome_spacefield` ADD `highschool_year` varchar(20) NOT NULL AFTER `highschool` ;
ALTER TABLE `uchome_spacefield` ADD `juniorhighSchool` varchar(20) NOT NULL AFTER `highschool_year` ;
ALTER TABLE `uchome_spacefield` ADD `juniorhighSchool_year` varchar(20) NOT NULL AFTER `juniorhighSchool` ;
ALTER TABLE `uchome_spacefield` ADD `elementarySchool` varchar(20) NOT NULL AFTER `juniorhighSchool_year` ;
ALTER TABLE `uchome_spacefield` ADD `elementarySchool_year` varchar(20) NOT NULL AFTER `elementarySchool` ;
2,修改cp.php
查找:
'userapp', 'task', 'credit', 'password', 'domain'
在其后加入:
,'school'
3,修改api/class/MyBase.php
查找:
'resideCity' => $space['residecity'],
下方增加:
//Add by chengfei from www.doufou.com
'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']),
//Add by chengfei from www.doufou.com
4,修改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>":''));
下方增加:
//学校信息搜索开始 add by chengfei doufou.com
$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>":''));
//学校信息搜索结束
5,修改source/network_space.php
查找:
$gets['residecity'] = empty($_GET['residecity'])?'':stripsearchkey($_GET['residecity']);
下方增加:
//学校信息搜索开始 add by chengfei doufou.com
$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']);
//学校信息搜索结束
6,修改template/default/cp_header.htm
查找:
<li$actives[profile]><a href="cp.php?ac=profile"><span>个人资料</span></a></li>
下方增加:
<li$actives[school]><a href="cp.php?ac=school"><span>学校信息</span></a></li>
7,修改template/default/space_index.htm
查找:
<!--{loop $fields $fieldid $value}-->
<!--{if $space["field_$fieldid"] && empty($value['invisible'])}-->
<!--{eval $fieldvalue = $space["field_$fieldid"]; $urlvalue = rawurlencode($fieldvalue);}-->
<li>$value[title]:<!--{if $value[allowsearch]}-->
<a href="network.php?ac=space&field_$fieldid=$urlvalue&searchmode=1">$fieldvalue</a>
<!--{else}-->$fieldvalue<!--{/if}--></li>
<!--{/if}-->
<!--{/loop}-->
</ul>
<!--{/if}-->
</div>
下方增加:
<!--{if $space[univs_name]}-->
<!--{if ckprivacy('school')}-->
<div id="space_feed" class="feed">
<h3 class="feed_header">
<span class="r_option">
<!--{if $space[self]}--><a href="cp.php?ac=school" class="action">编辑学校信息</a><!--{/if}-->
</span>
<span class="entry-title">学校信息</span>
</h3>
<div class="box_content">
<table cellspacing="2" cellpadding="2" class="infotable">
<!--{if $space[univs_name]}-->
<tr>
<th width="54"><div align="right">大学:</div></th>
<td width="509"><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><div align="right">高中:</div></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><div align="right">初中:</div></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><div align="right">小学:</div></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>
<!--{else}-->
<div id="space_feed" class="feed">
<h3 class="feed_header">
<span class="r_option">
<a href="cp.php?ac=friend&op=add&uid=$space[uid]" target="_blank" title="未公开!"><img src="image/lock01.gif" /></a>
</span>
<span class="entry-title">学校信息</span>
</h3>
<div class="box_content">
<ul>
</ul>
<!--{/if}-->
</div>
</div>
<!--{/if}-->
8,修改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> |