Daily Lucky Numbers:
1
14
15
26
35
40

Recent posts

#21
General Code/Script Inquiries / Re: MySQL decrement number wit...
Last post by Aaron - February 21, 2026, 01:57:17 PM


Okay so do I put 4678 where it says UNSIGNED, and thus -1 will start from there?
#22
Banner Bar / Re: SMF Banner Bar
Last post by Chen Zhen - February 21, 2026, 02:29:58 AM
Version 1.8.2 has been released which includes a small fix for an undefined error.
#23
Site Discussion / Re: Messages Read
Last post by Chen Zhen - February 19, 2026, 04:09:57 PM
It filters posts/topics content prior to saving it to the DB.
That shouldn't affect the link for flagging all posts as being read by a member.
#24
Site Discussion / Re: Messages Read
Last post by Dave - February 19, 2026, 11:43:33 AM
Quote from: Chen Zhen on February 19, 2026, 08:56:21 AMTo my knowledge, I don't have any mods installed that are altering the behavior of that SMF default feature.
The recycle bin and the link to mark all messages read are part of the SMF core.

Thanks for reporting this & I will attempt to figure out why it's behaving incorrectly.


What about your 'Spam Police modification' could that do it?
#25
Site Discussion / Re: Messages Read
Last post by Chen Zhen - February 19, 2026, 08:56:21 AM
To my knowledge, I don't have any mods installed that are altering the behavior of that SMF default feature.
The recycle bin and the link to mark all messages read are part of the SMF core.

Thanks for reporting this & I will attempt to figure out why it's behaving incorrectly.
#26
Site Discussion / Re: Messages Read
Last post by Dave - February 19, 2026, 02:31:27 AM
UPDATE:

Yesterday I used the button to delete the latest posts in the 'Spam' and 'Recycled' topics. The Spam email was removed straight away but the recycled post remained even after 2 attempts.

Today the recycled post was still showing as unread so I pressed the button again and the post was marked as read.

Is there a time limit set in the mod that means that post in the recycled topic cannot be marked as read?
#27
General Code/Script Inquiries / Re: MySQL decrement number wit...
Last post by Chen Zhen - February 18, 2026, 10:01:19 PM
The example I provided was supposed to decrement by -500 because that's the info you provided. If that wasn't literal you can change that number to -1 or whatever it should be.
I will run some tests to get it to work as intended but I might not have time until Friday.
#28
General Code/Script Inquiries / Re: MySQL decrement number wit...
Last post by Aaron - February 18, 2026, 05:54:10 PM
Quote from: Chen Zhen on February 17, 2026, 06:14:46 PMAssuming this is just for altering what's within your custom BBCode tags for: messages -> body
You can use custom server side code to manipulate MySQL data (ie. PHP) or you can use regexp on a MySQL command line.

MySQL command line (assuming the prefix is "smf_") :
UPDATE `smf_messages` SET `body` = CONCAT(
    SUBSTRING_INDEX(body, '[embed]', 1),
    '[/embed]',
    CAST(REGEXP_SUBSTR(body, '(?<=[embed])[0-9]+') AS UNSIGNED) - 500,
    '[/embed]',
    SUBSTRING_INDEX(body, '[embed]', -1)
)
WHERE body REGEXP '[embed][0-9]+[/embed]';


I have no idea if the above will work but it might give you something to test on a copy of the database to make sure it works as intended. If you can't figure it out with the above then I can delve into it further by running some tests on a localhost.
If you're using PHPMyAdmin, keep in mind that it's written in PHP & will time out for long queries unless you increase some PHP limits. Another option is to use MySQL via Bash which should avoid any script timeouts.

Basically I have a .csv file with strings on each line, the numbers will pull the string from that corresponding line number:

[embed]3055[/embed] will post the string on line 3055 within the embed tag on the forum. At the moment I basically just have line breaks on those current lines in the .csv file but would like to "clean it up" and not have the line breaks, but I need to decrement the line numbers accordingly.

If it helps I have one single line (4677) that I have removed (line break), so now I want line 4678 to become 4677, and everything above to be -1. If we can figure this one out I should be able to do it for the rest of the ones I need to adjust. I tried your regexp code but it didn't match up. I made a DB backup, if its easier I could do it in notepad++ or something and then upload/overwrite.

Thanks.
#29
Site Discussion / Re: Messages Read
Last post by Dave - February 18, 2026, 02:22:51 AM
The button worked this morning and made all messages read
#30
General Code/Script Inquiries / Re: MySQL decrement number wit...
Last post by Chen Zhen - February 17, 2026, 06:14:46 PM
Make sure you have a copy of the DB prior to any changes.

I'm not sure if I understand precisely what you're attempting to accomplish.

Are you trying to alter the custom embed BBCode content in every current post/topic, alter the actual topic ID's or both?

Assuming this is just for altering what's within your custom BBCode tags for: messages -> body
You can use custom server side code to manipulate MySQL data (ie. PHP) or you can use regexp on a MySQL command line.

MySQL command line (assuming the prefix is "smf_") :
UPDATE `smf_messages` SET `body` = CONCAT(
    SUBSTRING_INDEX(body, '[embed]', 1),
    '[/embed]',
    CAST(REGEXP_SUBSTR(body, '(?<=[embed])[0-9]+') AS UNSIGNED) - 500,
    '[/embed]',
    SUBSTRING_INDEX(body, '[embed]', -1)
)
WHERE body REGEXP '[embed][0-9]+[/embed]';


I have no idea if the above will work but it might give you something to test on a copy of the database to make sure it works as intended. If you can't figure it out with the above then I can delve into it further by running some tests on a localhost.
If you're using PHPMyAdmin, keep in mind that it's written in PHP & will time out for long queries unless you increase some PHP limits. Another option is to use MySQL via Bash which should avoid any script timeouts.