Fixed. It is because this JS code was copy/pasted from the form_edit.tpl; In the "new post" and "new thread" forms, the attachments can't be edited because the post is not created in the database yet.
mov eax, LIMIT_POST_LENGTH
stdcall GetParam, 'max_post_length', gpInteger ; => not found in DB setting??
stdcall StrByteUtf8, [.source], eax
stdcall StrTrim, [.source], eax
I'm learning Asmbb source code so please don't mind my beginner questions
The mechanism here is the following: GetParam will keep all registers not changed, if a parameter with the given name is not located in the database. (It returns CF=1 in this case, but it is not important right here) or will return the value of the parameter in EAX if this parameter exists in the database.
So, here, first the hard coded fall-back parameter LIMIT_POST_LENGTH is loaded in EAX, then an attempt to read the user limit, stored in the max_post_length in the database is made.
If the attempt succeed, the value in EAX will be changed. If not, the values in EAX will remain unchanged, equal to the hard-coded LIMIT_POST_LENGTH.
mov eax, LIMIT_POST_LENGTH
stdcall GetParam, 'max_post_length', gpInteger ; => not found in DB setting??
stdcall StrByteUtf8, [.source], eax
stdcall StrTrim, [.source], eax
I'm learning Asmbb source code so please don't mind my beginner questions
The mechanism here is the following: GetParam will keep all registers not changed, if a parameter with the given name is not located in the database. (It returns CF=1 in this case, but it is not important right here) or will return the value of the parameter in EAX if this parameter exists in the database.
So, here, first the hard coded fall-back parameter LIMIT_POST_LENGTH is loaded in EAX, then an attempt to read the user limit, stored in the max_post_length in the database is made.
If the attempt succeed, the value in EAX will be changed. If not, the values in EAX will remain unchanged, equal to the hard-coded LIMIT_POST_LENGTH.
Thanks johnfound, clear as crystal, so we can set the max_post_length param by SQL console since it's not exist in default Database.