| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 4623|Reply: 7
Collapse the left

How is increase the group title character from 20 to up

[Copy link]
Post time: 2012-02-17 19:38
| Show all posts |Read mode
Hi everybody, the group title maximum is 20 character. how can i improve that?

 Russia

Post time: 2012-02-17 20:53
| Show all posts
Will check...
 Author| Post time: 2012-02-21 02:35
| Show all posts
i solved.  
forum_group.php in source\module\forum

find this (line 281)
  1.         $name = censor(addslashes(dhtmlspecialchars(cutstr(stripslashes(trim($_G['gp_name'])), 20, ''))));
Copy the Code
this
  1.         $name = censor(addslashes(dhtmlspecialchars(cutstr(stripslashes(trim($_G['gp_name'])), whatever number you want, ''))));
Copy the Code
and
line 368 in the same way 20 to what do you want

at last
find
  1. $typenumlimit = 20;
Copy the Code
and change like the others

 Russia

Post time: 2012-02-21 08:10
| Show all posts
About the length limit:
The group (forum) name field is 255 bytes of length (only in X2ML!).
So the max length must be limited to 255 bytes.
But for UTF-8 encoding every character can consist of up to 6 bytes! (average ~ 3 bytes).
So it is reasonable to limit the max name length to 80 characters.

at last
find
    $typenumlimit = 20;
and change like the others


This is wrong!!!
It is NOT a length at all.
It is a number of thread types in the forum.

 Russia

Post time: 2012-02-21 08:34
| Show all posts
About the current cutting name algorithm.
I think, the algorihm is very bad:
  1. $name = censor(addslashes(dhtmlspecialchars(cutstr(stripslashes(trim($_G['gp_name'])), 20, ''))));
Copy the Code
The name is just stupidly cutted without any warnings.
It would be nice to NOT cut, but warn about very long name!

 Russia

Post time: 2012-02-21 08:41
| Show all posts
Moreover, there exists more group name length checks!
I.e. in module/forum/forum_ajax.php, line 140:
  1.         $tmpname = cutstr($groupname, 20, '');
Copy the Code

 Russia

Post time: 2012-02-21 08:55
| Show all posts
Moreover, it would be nice to limit a group name in a template,
i.e. like this:
  1. <input type="text" name="name" id="name" class="px" maxsize="80" ...
Copy the Code

 Russia

Post time: 2012-02-21 09:56
| Show all posts
My complex solution:
1) Auto-cutting of group name removed
2) Length check algorithm modified
3) Ajax Length check algorithm modified
4) Added maxlength in templates
5) Group Name length limit is set to 2...80 characters and not more than 255 bytes.
6) The meaning of 'group_name_oversize' key in lang_message.php changed:
  1. 'group_name_oversize' => 'Group name length must be in range of 2 ~ 80 characters.',
Copy the Code
This new meaning must be applied to ALL the languages!!!

Fix:
http://code.google.com/p/discuzx-en/source/detail?r=367
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-05-17 13:57 GMT+3 , Processed in 0.076462 sec., 9 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list