all
a
/
b
/
c
/
f
/
h
/
j
/
jp
/
l
/
o
/
q
/
s
/
sw
/
lounge
cgi
up
wiki
Heyuri!
Bulletin Boards
2D Cute
2D Ero
2D Lolikon
3D Girls
Anime/Manga
Flash
Girl Talk
日本語/Japan
Lounge
Oekaki
Off-Topic
Site Discussion
Strange World
Overboard
Heyuri★CGI
Heyuri★CGI
@PartyII
Battle Royale R
Chat
Chinsouki★
Dating
DevChat
Drama Club
Hakoniwa Islands PvE
Hakoniwa Islands PvP
Polls
Slime Breeder
Web Banana
Web Shiritori
Yumemiru Gambler
Kakiko Checker
Other
Anime Nominations
Banners
Cytube
Heyuri Calendar
Heyuri Wiki
MAL Club
Museum
Steam Group
Uploader
[
Settings
]
[
Home
] [
Contact
] [
Catalog
] [
Search
] [
Thread list
] [
Stats
] [
Reports
] [
Watcher
] [
PMs
] [
Admin
]
Site Discussion@Heyuri
it's the place to be!
[
Return
]
Report a post
Preview
Anonymous
2023/05/28(Sun)21:46:34 ID:ZNerDg.c
No.
63955
[
Report
]
▶
I found that link as the first result on google. Thanks for the source link. Google didn't want to give it to me!
From a quick glance it looks like anything we need is already here: the db field md5chksum already saves the image checksum, all that's left is to use this as the internal filename instead of the timestamp (or use both together, which will basically guarantee no conflict ever, to do that simply concatenate the two keys instead of using just md5chksum in the below).
The db IO code (pio stuff, for each backend) already gives you all the rows in the db for each post, so you already receive the checksum. You have to go in koko.php and find the instances of $tim $ext usages (this reconstitutes imagenames) and replace this by using $md5chksum instead of $tim everywhere this is used (including for the thumbnail that will involve just passing the $tim part to a function that resolves the name, or appending s to the name... anyway, straightforward).
The variables corresponding to the database columns are made local to the functions (in for example
https://github.com/Heyuri/kokonotsuba/blob/eb09e6777fe329bd6788ebbb0bad68e6e0fd89fe/koko.php#L1026
) through the 'extract' method that just imports symbols into the local namespace. Hence, there's no need for any extra work to access any arbitrary column.
The caveat is that unless you write a script to rename all files currently on the server to their md5 (which you can access via the db at least), you will either need to wipe or get broken files.
Post number
No.
63955
Board
Site Discussion@Heyuri
Reason
Optional. Describe what's wrong with it.
Style: