mio Publish time 14-5-2009 10:56:47

同城-同学

同城-同学
先覆盖文件 再进行修改!

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



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><a href="cp.php?ac=profile">个人资料</a></li>

下方增加:

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

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

下方增加:

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

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

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

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

下方增加:

<!--{if ckprivacy('school')}-->
<div class="box">
<h3><!--{if $space}--><a href="cp.php?ac=school" class="r_option">编辑学校信息</a><!--{/if}-->学校信息</h3>
<table cellspacing="2" cellpadding="2" class="infotable">
<!--{if $space}-->
<tr>
<th style="width:60px;">大学:</th>
<td><a href="network.php?ac=space&searchmode=1&univs_name=$space" title="寻找来自 $space 的校友" target="_blank">$space</a><!--{if $space}--> - $space级<!--{/if}--><!--{if $space}--> - $space<!--{/if}--></td>
</tr>
<!--{/if}-->
<!--{if $space}-->
<tr>
<th>高中:</th>
<td><a href="network.php?ac=space&searchmode=1&highschool=$space" title="寻找来自 $space 的校友" target="_blank">$space</a><!--{if $space}--> - $space级<!--{/if}--></td>
</tr>
<!--{/if}-->
<!--{if $space}-->
<tr>
<th>初中:</th>
<td><a href="network.php?ac=space&searchmode=1&juniorhighSchool=$space" title="寻找来自 $space 的校友" target="_blank">$space</a><!--{if $space}--> - $space级 <!--{/if}--></td>
</tr>
<!--{/if}-->
<!--{if $space}-->
<tr>
<th>小学:</th>
<td><a href="network.php?ac=space&searchmode=1&elementarySchool=$space" title="寻找来自 $space 的校友" target="_blank">$space</a><!--{if $space}--> - $space级 <!--{/if}--></td>
</tr>
<!--{/if}-->
</table>
</div>
<!--{else}-->
<div class="box">
<h3><a href="cp.php?ac=friend&op=add&uid=$space" 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</a>":'').($space['residecity']?" <a href=\"network.php?ac=space&residecity=".rawurlencode($space['residecity'])."&searchmode=1\">$space</a>":''));

下方增加:
//学校信息搜索开始
    $space['univs'] = trim(($space['univs_name']?"<a href=\"network.php?ac=space&univs_name=".rawurlencode($space['univs_name'])."&searchmode=1\">$space</a>":'').($space['univs_year']?" <a href=\"network.php?ac=space&univs_year=".rawurlencode($space['univs_year'])."&searchmode=1\">$space</a>":''));
    $space['high'] = trim(($space['highschool']?"<a href=\"network.php?ac=space&highschool=".rawurlencode($space['highschool'])."&searchmode=1\">$space</a>":'').($space['highschool_year']?" <a href=\"network.php?ac=space&highschool_year=".rawurlencode($space['highschool_year'])."&searchmode=1\">$space</a>":''));
    $space['juniorhigh'] = trim(($space['juniorhighSchool']?"<a href=\"network.php?ac=space&juniorhighSchool=".rawurlencode($space['juniorhighSchool'])."&searchmode=1\">$space</a>":'').($space['juniorhighSchool_year']?" <a href=\"network.php?ac=space&juniorhighSchool_year=".rawurlencode($space['juniorhighSchool_year'])."&searchmode=1\">$space</a>":''));
    $space['elementary'] = trim(($space['elementarySchool']?"<a href=\"network.php?ac=space&elementarySchool=".rawurlencode($space['elementarySchool'])."&searchmode=1\">$space</a>":'').($space['highschool_year']?" <a href=\"network.php?ac=space&elementarySchool_year=".rawurlencode($space['elementarySchool_year'])."&searchmode=1\">$space</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]'";
                }
        }//增加搜索字段
Pages: [1]
View full version: 同城-同学