


Discuz picture order confusion solution, discuz solution_PHP tutorial
Jul 13, 2016 am 09:45 AMdiscuz picture order confusion solution, discuz solution
Instructions
When discuz publishes a post, it adds multiple pictures and then publishes the post directly. The order of the pictures sometimes gets messed up
Even if the order of the images in the upload image window is correct, they will still be messed up after publishing
Analysis
Look at the url, you can’t see anything in the program code
Change the picture name to serial number and upload it. The order is messed up. Note the order of the messed up pictures in the post: 76123458
Then find the bbs_forum_attachment_1 table in the database and find that the default order is also this:
I don’t even sort by aid. When I could pick it up, I just picked it up without ordering by
Find the php that directly operates this table: sourceclasstabletable_forum_attachment_n.php
Through the writelog('filename','log') method, it is found that every time the post is refreshed, fetch_all_by_id, this method is executed once
It turns out that when viewing a post, the attachment address that is not inserted into the post must be read from the database every time
Solution
Modify the default parameters passed in the fetch_all_by_id method: order_by='aid'
Refresh the post where the order of the pictures was messed up and found that the order is normal
The above is all about the modification of discuz. I hope it can be helpful to everyone.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to solve the problem of automatically saving pictures when publishing on Xiaohongshu? Where is the automatically saved image when posting?

How to post pictures in TikTok comments? Where is the entrance to the pictures in the comment area?

How to make ppt pictures appear one by one

What should I do if the images on the webpage cannot be loaded? 6 solutions

How to arrange two pictures side by side in wps document

A must-have for Discuz users! Comprehensive analysis of renaming props!

How to set pencil grayscale artistic effect on PPT pictures
