Discuzx3 sorting of personal data, adding custom fields, modifying column names and descriptions

Source: Internet
Author: User
The first time I wrote an article, I hope it will be convenient for anyone. at the same time, don't miss it. if you find something wrong, please reply or notify me directly. thank you, I wanted to post it on the discuz forum. I don't know the version rules, and I don't have time to read the version rules. I'm afraid I will make a mistake. what should I do when JJ is down? (1) solutions to the sorting of personal data items

The first time I wrote an article, I hope it will be convenient for anyone. at the same time, don't miss it. if you find something wrong, please reply or notify me directly. thank you, I wantedDiscuzI posted on the forum. I don't know the version rules, and I don't have time to read the version rules. I'm afraid I will make a mistake. what should I do when JJ is away?

(1) solutions to the sorting of personal data items

First, let me explain the situation. when I set my personal data items for the website yesterday, I found that the number () that can be sorted in the background is bigger and bigger, but the user page () remains unchanged, for example, if you want to rank first in a newly added field, you haven't found it on the Internet for a long time (maybe I won't search). after reading it for a long time, you can understand it. x2 How to solve the sorting problem of personal data items, add custom fields, modify the column name, and introduce "title =" discuz X2 How to solve the sorting problem of personal data items, add custom fields, modify the topic name, and introduce "id =" image_operate_77791323311658031 "/>

()

X2 How to solve the sorting problem of personal data items, add custom fields, modify the column name, and introduce "title =" discuz X2 How to solve the sorting problem of personal data items, add custom fields, modify the topic name, and introduce "id =" image_operate_33291323311658264 "/>

(Modified effect)

Principle of personal data sorting and modification: the data items under each tag (baby data in the middle) are stored in the database in the serial number method after the array, in this way, you can no longer sort the files (sorting is also difficult to process by letter or something in the array). check the file include/spacecp/spacecp_profile.php. we observe that, it first obtains each small item under each major item in the form of an array, and then obtains the html code of each small item based on the small item (that is, the text box and the drop-down box below ), after getting a small item, we sort each small item in the array again according to the sort set in the background of the principle, and let it get the html code.

Step: Open the spacecp_profile.php file

Search for the following code to keep close to the bottom of around 423 lines)

$ Htmls = $ settings = array ();

Add the following code:

// Secondary development <solve the sorting problem of various options on the personal data modification page

$ Noorder = array ('idcardtype', 'idcard ', 'zipcode', 'sightml', 'customstatus', 'timeoffset ');

$ Jiaoji = array_intersect ($ noorder, $ allowitems); // calculates the intersection of two arrays. if not calculated, the personal signature and time zone are not displayed.

 If (empty ($ jiaoji) {$ query = DB: query ('selectfieldid FROM '. DB: table ('Common _ member_profile_setting '). "WHEREfieldid IN (". dimplode ($ allowitems ). ") order by displayorderASC ");

 $ Allowitems = array (); // clear the array of the original small item to sort the new array

 While ($ value = DB: fetch ($ query) {$ allowitems [$ value ['fieldid'] = $ value ['fieldid'];}

 // Secondary development >>> */

Computing intersection problem $ jiaojiThe reason is that if it is not calculated, the personal signature and region do not seem to be displayed, and I do not know the other elements in the datasets. I understand the above, and my results are actually achieved, you can see where you need it and modify it.

(2) add N multiple custom fields

In the past, discu x2 had only eight user-defined items. for example, I am not happy today, and my mind is quite abnormal. what should I do if I want to add dozens of them? in the data table

(3) modify the topic name and topic introduction

The topic and topic introduction provided by the discux system cannot be modified, and the newly added fieldN cannot be modified. if you want to modify the topic, you can change it in the database, which is troublesome, modification method:

Open source/admincp/admincp_members.php

Search:

$ Field ['customable'] = preg_match ('/^ field [1-8] $/I', $ fieldid );

Only the newly added field custom field can be modified to modify the column name and description (change [1-8] To \ d +)

$ Field ['customable'] = preg_match ('/^ field \ d + $/I', $ fieldid );

Modify all fields of the system;

$ Field ['customable'] = preg_match ('/. */I', $ fieldid );

In this way, you can easily modify the topic name and introduce O (Partition _ partition) O ~

X2 How to solve the sorting problem of personal data items, add custom fields, modify the column name, and introduce "title =" discuz X2 How to solve the sorting problem of personal data items, add custom fields, modify the topic name, and introduce "id =" image_operate_55921323311190743 "/> (you can modify the original academic level of the system)

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.