74cms分站職位發佈只能在一個分站顯示

1.首先在這幾張表裏面把subsite_id這個字段改爲char類型,長度100。
74cms分站職位發佈只能在一個分站顯示 - 永不放棄 - 原創php教程|php博客|php樂園 php

2.修改企業發佈職位,找到user/company下company_jobs.php這個文件中72和403行下分別添加$smarty->assign('subsite',get_subsite_all()),找到$setsqlarr['subsite_id']=intval($_CFG['subsite_id'])這行替換成 sql

 $subsite_id=!empty($_POST['subsite_id'])?$_POST['subsite_id']:array();
 $subsite_id=!empty($subsite_id)?implode(',',$subsite_id):0; 函數

3.在include下找到common.fun.php這個文件,在文件中添加函數 htm

function get_subsite_all()
{
 global $db;
 $sql = "select * from ".table('subsite');
 return $db->getall($sql);
} 教程

4.在/templates/default/member_company/找到company_addjobs.htm這個模板中添加 get

 <tr>
      <td height="23" align="right">職位發佈到:</td>
      <td>{#if $QISHI.subsite_id=="0"#}{#/if#}
         <!-- <label><input name="subsite_id" type="radio" value="0" checked />全站</label>
    &nbsp;&nbsp;-->
    {#foreach from=$subsite item=li#}
    <label ><input name="subsite_id[]" type="checkbox" value="{#$li.s_id#}" />{#$li.s_districtname#}</label>
    &nbsp;&nbsp;&nbsp;
    {#/foreach#}
    
     </td>
      </tr>
    {#/if#} input

在company_editjobs.htm這個模板中添加 博客

 {#if $QISHI.subsite=="1"#}
  <tr>
      <td height="23" align="right"><strong  style="color:#FF0000">*</strong>職位發佈到:</td>
      <td><!--{#if $QISHI.subsite_id=="0"#}{#/if#}
          <label><input name="subsite_id" type="radio" value="0"  {#if $jobs.subsite_id=="0"#}checked="checked"{#/if#}/>全站</label>
    &nbsp;&nbsp;-->
    {#foreach from=$subsite item=li#}
    <label ><input name="subsite_id[]" type="checkbox" value="{#$li.s_id#}" {#if strstr($jobs.subsite_id,$li.s_id) #}checked="checked"{#/if#} />{#$li.s_districtname#}</label>
    &nbsp;&nbsp;&nbsp;
    {#/foreach#}
    
     </td>
      </tr>
    {#/if#} it

5.找到/include/template_lite/plugins/這個目錄下function.qishi_jobs_list.php和function.qishi_company_list.php這個文件中找到 io

$wheresql.=" AND (subsite_id=0 OR subsite_id in (".intval($_CFG['subsite_id'])."))";這個替換成

$wheresql.=" AND (subsite_id=0 OR FIND_IN_SET(".intval($_CFG['subsite_id']).",subsite_id))";

6.完成代碼改動就能夠試試調用了。

相關文章
相關標籤/搜索