Discuz picture order confusion solution, discuz solution_PHP tutorial

WBOY
Release: 2016-07-13 09:45:42
Original
964 people have browsed it

discuz 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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1039205.htmlTechArticlediscuz picture order confusion solution, discuz solution explains that when publishing a post, discuz adds multiple pictures, and then Post directly, the order of pictures will sometimes get messed up even though...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template