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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

庆祝1.5正式版发布,学校信息 for 1.5正式版 发布

[复制链接]
cfking 发表于 2008-12-12 12:10:16 | 显示全部楼层 |阅读模式
UCHome插件
语言编码:  
插件名称:
插件作者:
适用版本:
本帖最后由 cfking 于 2008-12-21 21:32 编辑

本插件免费共享
1.5版本升级了一个重要功能:可以自动创建或加入学校群组
,不包含同校功能,需要者可密我。


安装前请注意:

12.12 20:35更新network_space.php,直接下载覆盖解决搜索问题。
查找network_space.php:
  1. foreach (array('sex', 'birthyear', 'birthmonth', 'birthday', 'marry','blood', 'birthprovince', 'birthcity', 'resideprovince', 'residecity', 'qq', 'msn'
复制代码
修改为:
  1. 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'
复制代码
12.12 19:21 更新
忘了上传css文件,将ccuchs.rar下载后解压上传到template/default下,同时更新了cp_school.htm,大家可以覆盖下这两个文件。

关于提交成功后英文提示的bug:
修改cp_school.php
查找:
  1. update_on_successful_profile
复制代码
替换为:
  1. update_on_successful_individuals
复制代码
就OK了!

全新安装(以前未安装过学校信息插件):如是uch1.5正式版可以直接覆盖,然后升级数据库即可;也可以手动修改文件(请仔细修改);非1.5版本请勿用。
升级安装(以前安装过学校信息插件):如是uch1.5正式版可以直接覆盖,不需升级数据库;也可以手动修改文件);非1.5版本请勿用。。

1,升级数据库:

  1. ALTER TABLE `uchome_spacefield` ADD `univs_name` varchar(20) NOT NULL
  2. AFTER `residecity` ;
  3. ALTER TABLE `uchome_spacefield` ADD `univs_year` varchar(20) NOT NULL
  4. AFTER `univs_name` ;
  5. ALTER TABLE `uchome_spacefield` ADD `univs_degree` varchar(20) NOT
  6. NULL AFTER `univs_name` ;
  7. ALTER TABLE `uchome_spacefield` ADD `univs_department` varchar(20) NOT
  8. NULL AFTER `univs_degree` ;
  9. ALTER TABLE `uchome_spacefield` ADD `highschool` varchar(20) NOT NULL
  10. AFTER `univs_department` ;
  11. ALTER TABLE `uchome_spacefield` ADD `highschool_year` varchar(20) NOT
  12. NULL AFTER `highschool` ;
  13. ALTER TABLE `uchome_spacefield` ADD `juniorhighSchool` varchar(20) NOT
  14. NULL AFTER `highschool_year` ;
  15. ALTER TABLE `uchome_spacefield` ADD `juniorhighSchool_year` varchar
  16. (20) NOT NULL AFTER `juniorhighSchool` ;
  17. ALTER TABLE `uchome_spacefield` ADD `elementarySchool` varchar(20) NOT
  18. NULL AFTER `juniorhighSchool_year` ;
  19. ALTER TABLE `uchome_spacefield` ADD `elementarySchool_year` varchar
  20. (20) NOT NULL AFTER `elementarySchool` ;
复制代码
2,修改cp.php
查找:
  1. 'userapp', 'task', 'credit', 'password', 'domain'
复制代码
在其后加入:
  1. ,'school'
复制代码

3,修改api/class/MyBase.php
查找:
  1. 'resideCity' => $space['residecity'],
复制代码
下方增加:

  1. //Add by chengfei from www.doufou.com
  2.             'univs_name' => $space['univs_name'],
  3.             'univs_degree' => $space['univs_degree'],
  4.             'univs_year' => $space['univs_year'],
  5.             'univs_department' => $space['univs_department'],
  6.             'highschool' => $space['highschool'],
  7.             'highschool_year' => sprintf('%04d-%02d-%02d', $space
  8. ['highschool_year']),
  9.             'juniorhighSchool' => $space['juniorhighSchool'],
  10.             'juniorhighSchool_year' => sprintf('%04d-%02d-%02d',
  11. $space['juniorhighSchool_year']),
  12.             'elementarySchool' => $space['elementarySchool'],
  13.             'elementarySchool_year' => sprintf('%04d-%02d-%02d',
  14. $space['elementarySchool_year']),
  15.             //Add by chengfei from www.doufou.com
复制代码

4,修改source/space_index.php
查找:

  1. $space['reside'] = trim(($space['resideprovince']?"<a
  2. href="network.php?ac=space&resideprovince=".rawurlencode($space
  3. ['resideprovince'])."&searchmode=1">$space[resideprovince]</a>":'').
  4. ($space['residecity']?" <a href="network.php?
  5. ac=space&residecity=".rawurlencode($space
  6. ['residecity'])."&searchmode=1">$space[residecity]</a>":''));
复制代码
下方增加:

  1. //学校信息搜索开始 add by chengfei doufou.com
  2.     $space['univs'] = trim(($space['univs_name']?"<a
  3. href="network.php?ac=space&univs_name=".rawurlencode($space
  4. ['univs_name'])."&searchmode=1">$space[univs_name]</a>":'').($space
  5. ['univs_year']?" <a href="network.php?
  6. ac=space&univs_year=".rawurlencode($space
  7. ['univs_year'])."&searchmode=1">$space[univs_year]</a>":''));
  8.     $space['high'] = trim(($space['highschool']?"<a
  9. href="network.php?ac=space&highschool=".rawurlencode($space
  10. ['highschool'])."&searchmode=1">$space[highschool]</a>":'').($space
  11. ['highschool_year']?" <a href="network.php?
  12. ac=space&highschool_year=".rawurlencode($space
  13. ['highschool_year'])."&searchmode=1">$space[highschool_year]
  14. </a>":''));
  15.     $space['juniorhigh'] = trim(($space['juniorhighSchool']?"<a
  16. href="network.php?ac=space&juniorhighSchool=".rawurlencode($space
  17. ['juniorhighSchool'])."&searchmode=1">$space[juniorhighSchool]
  18. </a>":'').($space['juniorhighSchool_year']?" <a href="network.php?
  19. ac=space&juniorhighSchool_year=".rawurlencode($space
  20. ['juniorhighSchool_year'])."&searchmode=1">$space
  21. [juniorhighSchool_year]</a>":''));
  22.     $space['elementary'] = trim(($space['elementarySchool']?"<a
  23. href="network.php?ac=space&elementarySchool=".rawurlencode($space
  24. ['elementarySchool'])."&searchmode=1">$space[elementarySchool]
  25. </a>":'').($space['highschool_year']?" <a href="network.php?
  26. ac=space&elementarySchool_year=".rawurlencode($space
  27. ['elementarySchool_year'])."&searchmode=1">$space
  28. [elementarySchool_year]</a>":''));
  29. //学校信息搜索结束
复制代码

5,修改source/network_space.php
查找:

  1. $gets['residecity'] = empty($_GET
  2. ['residecity'])?'':stripsearchkey($_GET['residecity']);
复制代码
下方增加:


  1. //学校信息搜索开始 add by chengfei doufou.com
  2. $gets['univs_name'] = empty($_GET
  3. ['univs_name'])?'':stripsearchkey($_GET['univs_name']);
  4. $gets['univs_year'] = empty($_GET
  5. ['univs_year'])?'':stripsearchkey($_GET['univs_year']);
  6. $gets['univs_degree'] = empty($_GET
  7. ['univs_degree'])?'':stripsearchkey($_GET['univs_degree']);
  8. $gets['univs_department'] = empty($_GET
  9. ['univs_department'])?'':stripsearchkey($_GET['univs_department']);
  10. $gets['highschool'] = empty($_GET
  11. ['highschool'])?'':stripsearchkey($_GET['highschool']);
  12. $gets['highschool_year'] = empty($_GET
  13. ['highschool_year'])?'':stripsearchkey($_GET['highschool_year']);
  14. $gets['juniorhighSchool'] = empty($_GET
  15. ['juniorhighSchool'])?'':stripsearchkey($_GET['juniorhighSchool']);
  16. $gets['juniorhighSchool_year'] = empty($_GET
  17. ['juniorhighSchool_year'])?'':stripsearchkey($_GET
  18. ['juniorhighSchool_year']);
  19. $gets['elementarySchool'] = empty($_GET
  20. ['elementarySchool'])?'':stripsearchkey($_GET['elementarySchool']);
  21. $gets['elementarySchool_year'] = empty($_GET
  22. ['elementarySchool_year'])?'':stripsearchkey($_GET
  23. ['elementarySchool_year']);
  24. //学校信息搜索结束
复制代码
继续查找:
  1. foreach (array('sex', 'birthyear', 'birthmonth', 'birthday', 'marry', 'blood', 'birthprovince', 'birthcity', 'resideprovince', 'residecity', 'qq', 'msn'
复制代码
修改为:
  1. 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'
复制代码

6,修改template/default/cp_header.htm
查找:

  1.   <li$actives[profile]><a href="cp.php?
  2. ac=profile"><span>个人资料</span></a></li>
复制代码
下方增加:

  1.   <li$actives[school]><a href="cp.php?ac=school"><span>
  2. 学校信息</span></a></li>
复制代码

7,修改template/default/space_index.htm
查找:

  1. <!--{loop $fields $fieldid
  2. $value}-->
  3.      <!--{if $space
  4. ["field_$fieldid"] && empty($value['invisible'])}-->
  5.      <!--{eval $fieldvalue =
  6. $space["field_$fieldid"]; $urlvalue = rawurlencode($fieldvalue);}-->
  7.      <li>$value[title]:<!--{if
  8. $value[allowsearch]}-->
  9.      <a href="network.php?
  10. ac=space&field_$fieldid=$urlvalue&searchmode=1">$fieldvalue</a>
  11.      <!--{else}-->$fieldvalue<!--
  12. {/if}--></li>
  13.      <!--{/if}-->
  14.      <!--{/loop}-->
  15.     </ul>
  16.     <!--{/if}-->   
  17.    
  18.    </div>
复制代码

下方增加:

  1. <!--{if $space[univs_name]}-->
  2.   <!--{if ckprivacy('school')}-->
  3.                         <div id="space_feed" class="feed">
  4.                                 <h3 class="feed_header">
  5.                                         <span class="r_option">
  6.                                         <!--{if $space[self]}--><a
  7. href="cp.php?ac=school" class="action">编辑学校信息</a><!--{/if}-->
  8.                                         </span>
  9.                                         <span class="entry-title">学校
  10. 信息</span>
  11.                                 </h3>               
  12.                                 <div class="box_content">
  13. <table cellspacing="2" cellpadding="2" class="infotable">
  14. <!--{if $space[univs_name]}-->
  15. <tr>
  16. <th width="54"><div align="right">大学:</div></th>
  17. <td width="509"><a href="network.php?
  18. ac=space&searchmode=1&univs_name=$space[univs_name]" title="寻找来自
  19. $space[univs_name] 的校友" target="_blank">$space[univs_name]</a><!--
  20. {if $space[univs_year]}--> - $space[univs_year]级<!--{/if}--><!--{if
  21. $space[univs_department]}--> - $space[univs_department]<!--{/if}--
  22. ></td>
  23. </tr>
  24. <!--{/if}-->
  25. <!--{if $space[highschool]}-->
  26. <tr>
  27. <th><div align="right">高中:</div></th>
  28. <td><a href="network.php?ac=space&searchmode=1&highschool=$space
  29. [highschool]" title="寻找来自 $space[highschool] 的校友"
  30. target="_blank">$space[highschool]</a><!--{if $space
  31. [highschool_year]}--> - $space[highschool_year]级<!--{/if}--></td>
  32. </tr>
  33. <!--{/if}-->
  34. <!--{if $space[juniorhighSchool]}-->
  35. <tr>
  36. <th><div align="right">初中:</div></th>
  37. <td><a href="network.php?
  38. ac=space&searchmode=1&juniorhighSchool=$space[juniorhighSchool]"
  39. title="寻找来自 $space[juniorhighSchool] 的校友"
  40. target="_blank">$space[juniorhighSchool]</a><!--{if $space
  41. [juniorhighSchool_year]}--> - $space[juniorhighSchool_year]级 <!--
  42. {/if}--></td>
  43. </tr>
  44. <!--{/if}-->
  45. <!--{if $space[elementarySchool]}-->
  46. <tr>
  47. <th><div align="right">小学:</div></th>
  48. <td><a href="network.php?
  49. ac=space&searchmode=1&elementarySchool=$space[elementarySchool]"
  50. title="寻找来自 $space[elementarySchool] 的校友"
  51. target="_blank">$space[elementarySchool]</a><!--{if $space
  52. [elementarySchool_year]}--> - $space[elementarySchool_year]级 <!--
  53. {/if}--></td>
  54. </tr>
  55. <!--{/if}-->
  56. </table>
  57. <!--{else}-->
  58.                         <div id="space_feed" class="feed">
  59.                                 <h3 class="feed_header">
  60.                                         <span class="r_option">
  61.                                         <a href="cp.php?
  62. ac=friend&op=add&uid=$space[uid]" target="_blank" title="未公
  63. 开!"><img  src="image/lock01.gif" /></a>
  64.                                         </span>
  65.                                         <span class="entry-title">学校
  66. 信息</span>
  67.                                 </h3>
  68.                                 <div class="box_content">
  69.                                         <ul>
  70.                                         </ul>

  71. <!--{/if}-->
  72.                                 </div>
  73.                         </div>
  74. <!--{/if}-->
复制代码

8,修改template/default/cp_privacy.htm
查找:

  1.   <tr>
  2.    <th width="100">个人基本资料</th>
  3.    <td><select name="privacy[view][profile]">
  4.     <option value="0"$sels[view][profile]
  5. [0]>全站用户可见</option>
  6.     <option value="1"$sels[view][profile]
  7. [1]>仅好友可见</option>
  8.     <option value="2"$sels[view][profile]
  9. [2]>仅自己可见</option>
  10.     </select></td>
  11.   </tr>

复制代码
下方增加:

  1.   <tr>
  2.    <th width="100">学校信息资料</th>
  3.    <td><select name="privacy[view][school]">
  4.     <option value="0"$sels[view][school]
  5. [0]>全站用户可见</option>
  6.     <option value="1"$sels[view][school]
  7. [1]>仅好友可见</option>
  8.     <option value="2"$sels[view][school]
  9. [2]>仅自己可见</option>
  10.     </select></td>
  11.   </tr>
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
大力色狼 发表于 2008-12-12 12:12:02 | 显示全部楼层
修改的还真多
回复

使用道具 举报

 楼主| cfking 发表于 2008-12-12 12:15:05 | 显示全部楼层
本帖最后由 cfking 于 2008-12-12 21:05 编辑

如不需要自动创建或加入群组的,请下载这个附件覆盖cp_school.php

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

 楼主| cfking 发表于 2008-12-12 12:16:05 | 显示全部楼层
2# 大力色狼

还好了 ,不算太复杂
回复

使用道具 举报

天涯客栈 发表于 2008-12-12 12:16:19 | 显示全部楼层

兄弟
免费发布
感动呀
支持多卖点金币
回复

使用道具 举报

天涯客栈 发表于 2008-12-12 12:16:52 | 显示全部楼层
等几天有时间了
还是需要买你的服务
帮我修改些东西
回复

使用道具 举报

 楼主| cfking 发表于 2008-12-12 12:19:23 | 显示全部楼层
6# 天涯客栈

只是简单的创建和加入群组功能,不含同校、班级等群组功能。
回复

使用道具 举报

天涯客栈 发表于 2008-12-12 12:23:58 | 显示全部楼层
6# 天涯客栈

只是简单的创建和加入群组功能,不含同校、班级等群组功能。
cfking 发表于 2008-12-12 12:19




晓得了
需要做点区别
不然哪里卖的动
你得喝西北风了
回复

使用道具 举报

sys01 发表于 2008-12-12 12:38:18 | 显示全部楼层
hi~~~~~~~~
回复

使用道具 举报

kuku5 发表于 2008-12-12 12:44:41 | 显示全部楼层
路过来顶一下
回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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