网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > DedeCMS
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 65.49.2.191
Old 2014-05-01, 09:23 PM
Quamba Quamba is offline
初级会员
 
Join Date: 2009-09-02
Posts: 1
Quamba 现在声名狼藉
Default DedeV5.6分类信息按联动类别筛选的实现方法

温馨提醒:本教程适用于DedeCMS V5.6
实现方法:

1. 修改include\taglib\infolink.lib.php,找到:
require_once(DEDEROOT.'/data/enums/infotype.php');

在其下面添加:
Code:
    require_once(DEDEROOT.'/data/enums/自定义联动类别字段名.php');   
      
    function lib_infolink($ctag,$refObj)   
    {   
        global $dsql,$nativeplace,$infotype,$自定义联动类别字段名,$hasSetEnumJs,$cfg_cmspath,$cfg_mainsite;   
        global $em_nativeplaces,$em_infotypes,$em_自定义联动类别字段名s;  //看清楚,这里后面的个S   
      
      
    $fields = array('nativeplace'=>'','infotype'=>'','自定义联动类别字段名'=>'','typeid'=>$typeid, 'channelid'=>$channelid,'linkallplace'=>'','linkalltype'=>'','linkeall自定义联动类别字段名'=>'');   
           
    $fields['nativeplace'] = $fields['infotype'] = $fields['自定义联动类别字段名'] = '';    
找到:
if(is_array($ctp->CTags))

在其下面添加:

Code:

    $fields['linkalltype'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}'>不限</a>";      
         
    //下面添加一行      
         
    $fields['linkeall自定义联动类别字段名'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}'>不限</a>";      
         
         
         
             
        //自定义联动类别字段链接      
        if(emptyempty($自定义联动类别字段名))      
        {      
            foreach($em_自定义联动类别字段名s as $eid=>$em)      
            {      
                if($eid % 500 != 0) continue;      
                $fields['自定义联动类别字段名'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&自定义联动类别字段名={$eid}&nativeplace={$nativeplace}'>{$em}</a>";      
            }      
        }      
        else     
        {      
            $sontype = ( ($自定义联动类别字段名 % 500 != 0) ? $自定义联动类别字段名 : 0 );      
          $toptype = ( ($自定义联动类别字段名 % 500 == 0) ? $自定义联动类别字段名 : ( $自定义联动类别字段名-($membertype%500) ) );      
            $fields['自定义联动类别字段名'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&自定义联动类别字段名={$toptype}&nativeplace={$nativeplace}'><b>{$em_自定义联动类别字段名s[$toptype]}</b></a> ";      
            foreach($em_自定义联动类别字段名s as $eid=>$em)      
            {      
                if($eid < $toptype+1 || $eid > $toptype+499) continue;      
                if($eid == $自定义联动类别字段名) {      
                    $fields['自定义联动类别字段名'] .= " <b>{$em}</b>";      
                }      
                else {      
                    $fields['自定义联动类别字段名'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&自定义联动类别字段名={$eid}&nativeplace={$nativeplace}'>{$em}</a>";      
              }      
          }      
        }      
3. 修改 include\arc.sglistview.class.php ,找到:
if(!emptyempty($this->searchArr['keyword']))

Code:
    //自定义联动类别           
                   
          if(!emptyempty($this->searchArr['自定义联动类别字段名']))   
                {   
                    if($this->searchArr['自定义联动类别字段名'] % 500 ==0 )   
                    {   
                        $naddQuery .= " And arc.自定义联动类别字段名 >= '{$this->searchArr['自定义联动类别字段名']}' And arc.自定义联动类别字段名 < '".($this->searchArr['自定义联动类别字段名']+500)."'";   
                    }   
                    else  
                    {   
                        $naddQuery .= "And arc.自定义联动类别字段名 = '{$this->searchArr['自定义联动类别字段名']}'";   
                    }   
                }   
4 . 修改 include\taglib\infoguide.lib.php,找到
$fields['infotype'] .= '<script language="javascript">MakeTopSelect("infotype", '.$infotype.');</script>'."\r\n";
在其下面添加:
Code:

    $fields['自定义联动类别字段名'] .= "<input type='hidden' id='hidden_自定义联动类别字段名' name='自定义联动类别字段名' value='{$自定义联动类别字段名}' />\r\n";   
        $fields['自定义联动类别字段名'] .= "<span class='infosearchtxt'>类型:</span><span id='span_自定义联动类别字段名'></span>\r\n";   
        $fields['自定义联动类别字段名'] .= "<span id='span_自定义联动类别字段名_son'></span><br />\r\n";   
        $fields['自定义联动类别字段名'] .= "<script language='javascript' type='text/javascript' src='{$cfg_mainsite}{$cmspath}data/enums/自定义联动类别字段名.js'></script>\r\n";   
        $fields['自定义联动类别字段名'] .= '<script language="javascript">MakeTopSelect("自定义联动类别字段名", '.$自定义联动类别字段名.');</script>'."\r\n";  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 04:08 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.