Dede Custom linkage category invocation and modification method in new model

Source: Internet
Author: User
Tags urlencode

Search for a long time, did not find a good way, just to utilize this method. Maybe this is the only way.

In the background of "linkage category Management" added "category group", "category name" in Chinese, "cache group name" to fill in the English alphabet.

Add categories after category name

Then in content Model Management, point to category information, in the Point field Management, click Add New field. "Form prompt text" Fill in Chinese, "Field name" fill in the English alphabet

In this way, when you add text in the classification information, there is a corresponding choice.

Then it is displayed at the front desk.

Modify the include\taglib\infolink.lib.php file first

Search require_once (dededata. ' /enums/infotype.php ');

Add the following

require_once (Dederoot. ' /data/enums/the custom Linkage category field name. php ');

Modify

function lib_infolink (&$ctag,&$refObj) {    global$ Dsql,$nativeplace,$infotype,$ custom Linkage category field name ,$hasSetEnumJs,$cfg _ Cmspath,$cfg _mainsite;     Global $em _nativeplaces,$em _infotypes,$em _ Custom Linkage category field name S;  // look clearly, the one behind here s

Search $fields = Array (' nativeplace ' = = ', ' infotype ' = ' = ')

Modify

$fields Array (' nativeplace ' = ' + ', ' infotype ' + ', ' "The Custom Linkage category field name ' = ' = '", ' typeid ' =$typeid,                    ' channelid ' = >$channelid, ' linkallplace ' + ', ' linkalltype ' = ', ' Linkall Custom linkage category field name ' = ';      $fields $fields $fields [' Custom Linkage category field name '] = ';

Search $fields[' linkalltype '] =

Add the following

$fields [' Linkall Custom linkage category field name '] = ' <a href= ' {$baseurl}plus/list.php?channelid={$channelid}&tid={ $typeid} & Custom linkage category field name ={$ custom Linkage category field name } ' > Unlimited </a> ';

Search if (Is_array ($CTP->ctags)) on this sentence add

//Custom Linkage category field linkif(Empty($ custom Linkage category field name)){    foreach($em _ Custom Linkage category field name S  as $eid=$em)    {        if($eid% 500! = 0)Continue; $fields[' Custom Linkage category field name ']. = "<a href= ' {$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}& Custom linkage category field name ={$eid}&nativeplace={$nativeplace} ' >{$em}</a> "; }}Else{    $sontype= ( ($ custom Linkage category field name% 500! = 0)?$ custom Linkage category field name: 0 ); $toptype= ( ($ custom Linkage category field name% 500 = = 0)?$ custom Linkage category field name: ($ custom Linkage category field name-($membertype%500) ) ); $fields[' Custom Linkage category field name '] = ' <a href= ' {$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}& Custom linkage category field name ={$toptype}&nativeplace={$nativeplace} ' ><b>{$em _ Custom Linkage category field name S[$toptype]}</b></a> "; foreach($em _ Custom Linkage category field name S  as $eid=$em)    {        if($eid<$toptype+1 | |$eid>$toptype+499)Continue; if($eid==$ custom Linkage category field name) {            $fields[' Custom Linkage category field name ']. = "<b>{$em}</b> "; }        Else {            $fields[' Custom Linkage category field name ']. = "<a href= ' {$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}& Custom linkage category field name ={$eid}&nativeplace={$nativeplace} ' >{$em}</a> "; }  }}

Modify the plus\list.php file again

Search $infotype = ((Empty ($infotype) | |!is_numeric ($infotype))? 0: $infotype); add a sentence below

$ custom Linkage category field Name = ((empty($ custom Linkage category field name ) | |!  Is_numeric($ custom Linkage category field name $ custom Linkage category field name );

Then search for if (!empty ($infotype)) $CARR [' infotype '] = $infotype;, add

if (! Empty ($ custom Linkage category field name $cArr$ custom Linkage category field name ;

Locate include\arc.sglistview.class.php File

The Search if (!empty ($this->searcharr[' keyword ')) is added above

 //Custom Linkage Category                         if(!Empty($this->searcharr[' Custom linkage category field name ']))            {                if($this->searcharr[' Custom linkage category field name ']% 500 ==0 )                {                    $naddQuery. = "and arc. Custom linkage category field name >= ' {$this->searcharr[' Custom linkage category field name '} ' and arc. Custom linkage category field name < ' ". ($this->searcharr['Custom linkage category field name']+500 '). "'"; }                Else                {                    $naddQuery. = "and arc. Custom linkage category Field name = ' {$this->searcharr[' Custom linkage category field name '} ' "; }            }

Foreground template Calls

[Field:linkall Custom linkage category field name/] [Field: Custom linkage category Word]

At this point, you can already use the linkage filter, but the paging label will be problematic.

Workaround:

Modify the/include/arc.sglistview.class.php file

Find function Getpagelistdm

Add the following code

Global $nativeplace,$infotype,$keyword;

Replaced by

Global $nativeplace,$infotype,Custom linkage category field name ,$keyword;

Copy a sentence

if (empty($infotype$infotype = 0;

Switch

if (empty($ custom Linkage category field name $ custom Linkage category field name = 0;

Will

  $geturl = "tid=". $this->typeid. " &totalresult= ". $this->totalresult. " &nativeplace=$nativeplace&infotype=$infotype&keyword= ". UrlEncode ($keyword). " & ";

Switch

  $geturl = "tid=". $this->typeid. " &totalresult= ". $this->totalresult. " &nativeplace=$nativeplace&infotype=$infotype& Custom linkage category Field name =Custom linkage category field name &keyword= ". UrlEncode ($keyword). " & ";

Dede Custom linkage category invocation and modification method in new model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.