本帖最后由 cfking 于 2009-3-30 12:42 编辑
鉴于许多同学问学校信息的有关问题,现将完美版放出,并附上安装方法,只要按照安装方法进行安装,必不会出现任何问题,否则请发帖询问,不要加我Q每个询问,谢谢。
本版本为1.2版本,解决了以下BUG:
1,创建空群组的bug;
2,css错乱的bug;
3,IE6.0下学校信息浮动框不能覆盖select的入学年份的巨大bug;
本版本增加自动安装升级数据库程序school_install.php,不会升级数据库的直接安装即可。
本版本包括两个版本:自动创建学校群组版和不自动创建群组纯净版,大家根据需要安装即可。
升级方法:
下载本插件后直接覆盖后更新缓存即可。
全新安装方法:
如是1.5正式版未改动过任何文件,直接下载本插件上传覆盖然后执行school_install.php即可;
如已改动本插件需要改动的文件,需按照一下手动修改方法进行修改。
手动修改安装方法:
下载本插件,删除cp.php,source/space_index.php,source/network_space.php,api/class/MyBase.php,template/default/space_index.htm,template/default/cp_header.htm,template/default/cp_privacy.htm 然后安装修改说明修改即可。
1,修改cp.php
查找:- 'userapp', 'task', 'credit', 'password', 'domain'
复制代码 在其后加入:2,修改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 [url=http://www.doufou.com
复制代码 ]www.doufou.com[/code][/url]
3,修改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>":''));
- //学校信息搜索结束
复制代码 4,修改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']);
- //学校信息搜索结束
复制代码 5,修改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>
复制代码 6,修改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}-->
复制代码 7,修改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>
复制代码 8,升级数据库
执行数据库升级文件:school_install.php。 |