Discuz Image order disorder solution, discuz solution _ PHP Tutorial

Source: Internet
Author: User
Discuz Image order disorder solution, discuz solution. Discuz Image order disorder solution. discuz solution description: when posting a post, discuz adds multiple images and then directly posts the post, the image order is sometimes messy, even if the discuz Image order is chaotic, the discuz solution

Description

When posting a post, discuz adds multiple images and then publishes the post directly. The image order is sometimes messy.
Even if the image order in the uploaded image window is correct, the image will still be out of order after the image is published.

Analysis

Look at the url, the program code does not see anything
Change the image name to the serial number for uploading. The order of the disordered images in the post is: 76123458.
Then find the bbs_forum_attachment_1 table in the database, and find the default order as follows:

It is not sorted by aid. it is possible that order by is not obtained directly.
Find the php: source \ class \ table \ table_forum_attachment_n.php directly operating on this table.
Through the writelog ('filename ', 'log') method, it is found that every time a post is refreshed, fetch_all_by_id, this method is executed once
When viewing the post, the attachments that are not inserted into the post must be read from the database every time.

Solution

Modify the input default parameters of the fetch_all_by_id method:Order_by = 'aid'

Refresh the posts with disordered Image order and find that the order is normal.

The above is all about discuz modification, and I hope it will be helpful to you.

When posting a post, discuz adds multiple images and then publishes the post directly. The image order sometimes gets out of order even if...

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.