Multiple arclist columns of dedecms do not display the sub-columns called by arclist

Source: Internet
Author: User
Tags explode


The sub-topic for calling Zhimeng arclist is not displayed. There are many solutions to this problem on the Internet, one of which is:

Open/include/taglib/arclist. lib. php with the code in lines 295-296 and find the following two lines of code:
If ($ CrossID = '') $ orwheres [] = 'Arc. typeid IN ('. GetSonIds ($ typeid ).')';
Else $ orwheres [] = 'Arc. typeid IN ('. GetSonIds ($ typeid).', '. $ CrossID .')';
Replace it with the following code:
If ($ CrossID = '') $ orwheres [] = '(arc. typeid IN ('. getSonIds ($ typeid ). ') OR arc. typeid2 IN ('. getSonIds ($ typeid ). '))';
Else $ orwheres [] = '(arc. typeid IN ('. getSonIds ($ typeid ). ','. $ CrossID. ') OR arc. typeid2 IN ('. getSonIds ($ typeid ). ','. $ CrossID. '))';

This method can solve the problem of not displaying secondary columns in the case of typeid = "2". If typeid = "2, 3, 8", it will not work if multiple columns need to be called.

To solve this problem, find row 262, $ orwheres [] = "arc. typeid IN ($ typeid )";

Directly Replace with: $ orwheres [] = "arc. typeid IN ($ typeid) or arc. typeid2 IN ($ typeid )";


For the cause of the problem, see the original code of arclist. lib. php: (typeid is the primary column id, and typeid2 is the secondary column id)

Find row 246:
 
// If multiple columns are specified, the subclass id is no longer obtained.
If (preg_match ('#, #', $ typeid) // if the typeid field matches a comma, that is, typeid calls multiple columns, for example, typeid = "2, 3, 8"
             {
// If the getall attribute or homepage template is specified
If ($ getall = 1 | empty ($ refObj-> Fields ['typeid'])
                {
$ Typeids = explode (',', $ typeid );
Foreach ($ typeids as $ ttid ){
$ Typeidss [] = GetSonIds ($ ttid );
                    }
$ TypeidStr = join (',', $ typeidss );
$ Typeidss = explode (',', $ typeidStr );
$ Typeidssok = array_unique ($ typeidss );
$ Typeid = join (',', $ typeidssok );
                }
 
$ Orwheres [] = "arc. typeid IN ($ typeid)"; // the problem where the secondary topic issue cannot be called when typeid = '2,'
            }
Else // if the typeid does not match a comma, it is to call a topic such as typeid = "2"
            {
// Process cross columns
$ CrossID = '';
If ($ ctag-> GetAtt ('cross ') = '1 ')
                {
$ Arr = $ dsql-> GetOne ("SELECT 'id', 'topid', 'cross ', 'crossid', 'ispart ', 'typename' FROM 'dede _ arctype 'WHERE id =' $ typeid '");
If ($ arr ['cross '] = 0 | ($ arr ['cross'] = 2 & trim ($ arr ['crossid '] ='' )))
                    {
$ Orwheres [] = 'Arc. typeid IN ('. GetSonIds ($ typeid ).')';
                  }
Else
                    {
$ Selquery = '';
If ($ arr ['cross '] = 1 ){
$ Selquery = "SELECT id, topid FROM 'dede _ arctype 'WHERE typename LIKE' {$ arr ['typename']} 'AND id <>' {$ typeid} 'AND topid <>' {$ typeid} '";
                        }
Else {
$ Arr ['crossid '] = preg_replace (' # [^ 0-9,] # ', '', trim ($ arr ['crossid']);
If ($ arr ['crossid ']! = '') $ Selquery =" SELECT id, topid FROM 'dede _ arctype 'Where id IN ('{$ arr ['crossid']} ') AND id <> '{$ typeid}' AND topid <> '{$ typeid }'";
                        }
If ($ selquery! = '')
                        {
$ Dsql-> SetQuery ($ selquery );
$ Dsql-> Execute ();
While ($ arr = $ dsql-> GetArray ())
                            {
$ CrossID. = ($ CrossID = ''? $ Arr ['id']: ','. $ arr ['id']);
                            }
                        }
                    }
                }
If ($ CrossID = '') $ orwheres [] = 'Arc. typeid IN ('. GetSonIds ($ typeid ).')';
Else $ orwheres [] = 'Arc. typeid IN ('. getSonIds ($ typeid ). ','. $ CrossID. ')'; // the problem where the secondary topic cannot be called due to typeid = '2'
            }

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.