MyBB Community Forums

Full Version: CraKteR's plugin list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
wops forgot another thing aswell, try this. lol *deleeted*

And thanks for testing for me Big Grin
Hehe Toungue That works fine Toungue Can it be modified so only posts by users are checked? So admins and/or mods can post ????????? as many as they want to Toungue If i ask to much forget i asked it Toungue
Well, It can be done, ofcourse.
Is it really needed tho? If an user was isen't doing it an admin shoulden't be able to either in my opinion, I can however do it if you really want it.
Okey, maybe I was too quick on that last one. here is 1.3 of Stupid posts.

- Bug fixes.

Download:
*deleeted*
*testing* Toungue Yeah you're right, no need to modify it then Toungue

EDIT ::

*works* Big Grin
Just noticed I deleted the wordcount plugin (by mistake ofcourse), however it is buggy so updating it as I write, however need some sleep, gonna try finishing it up tomorrow and an new version of the resize textareas with options, and I said I was gonna do an minimum chars thingy so stay tuned Smile
CraKteR Wrote:and I said I was gonna do an minimum chars thingy so stay tuned Smile

Can't it be done by replacing

PHP Code:
        if(strlen(trim($mybb->input['message'])) == 0)
        {
            
error($lang->error_nomessage);
        } 

into

PHP Code:
        if(strlen(trim($mybb->input['message'])) == || strlen(trim($mybb->input['message'])) < )
        {
            
error($lang->error_nomessage);
        } 

change in newthread.php and newreply.php, the minimum chars in a message is set to 5 ... Probably not the best way to do it but it "works" i suppose Toungue Only problem i think is that you don't have admin-settings Toungue But that can't be too hard to integrate Toungue

Update ::

----- [ ADD SETTING GROUP] ------------------

Group Name: MessageLength
Display Order: 1

----- [ ADD SETTING ] ------------------

Setting Title: Minimum Characters Enabled?
Description: Do you want to enable minimum character limit?
Setting Name: min_char_check
Setting Type: yesno
Setting Value: yes
Display Order: 1
Setting Group: MessageLength

----- [ ADD SETTING ] ------------------

Setting Title: Minimum Characters
Description: What is the minimum characters you must use in a post?
Setting Name: min_char_post
Setting Type: text
Setting Value: 15
Display Order: 2
Setting Group: MessageLength

Open newthread.php

Find

PHP Code:
        if(strlen(trim($mybb->input['message'])) == 0)
        {
            
error($lang->error_nomessage);
        } 

Replace By

PHP Code:
        if($mybb->settings['min_char_check'] != "no"){
        if(
strlen(trim($mybb->input['message'])) == || strlen(trim($mybb->input['message'])) < $mybb->settings['min_char_post'] )
        {
            
error($lang->error_nomessage);
        }
        }else{

        if(
strlen(trim($mybb->input['message'])) == 0)
        {
            
error($lang->error_nomessage);
        }
        } 

Open newreply.php

Find

PHP Code:
        if(strlen(trim($mybb->input['message'])) == 0)
        {
            
error($lang->error_nomessage);
        } 

Replace By

PHP Code:
        if($mybb->settings['min_char_check'] != "no"){
        if(
strlen(trim($mybb->input['message'])) == || strlen(trim($mybb->input['message'])) < $mybb->settings['min_char_post'] )
        {
            
error($lang->error_nomessage);
        }
        }else{

        if(
strlen(trim($mybb->input['message'])) == 0)
        {
            
error($lang->error_nomessage);
        }
        } 

Open editpost.php

Find

PHP Code:
    if (strlen(trim($mybb->input['message'])) == 0)
    {
        
error($lang->error_nomessage);
    } 

Replace By

PHP Code:
        if($mybb->settings['min_char_check'] != "no"){
        if(
strlen(trim($mybb->input['message'])) == || strlen(trim($mybb->input['message'])) < $mybb->settings['min_char_post'] )
        {
            
error($lang->error_nomessage);
        }
        }else{

        if(
strlen(trim($mybb->input['message'])) == 0)
        {
            
error($lang->error_nomessage);
        }
        } 

If you also want it to be checked if a user previews the post

----- [ ADD SETTING ] ------------------

Setting Title: Minimum Characters In Preview
Description: Checks If The Limit Of Characters Is Fine In PreviewMode ( Min. Char. Must Be Enabled! )
Setting Name: min_char_preview
Setting Type: yesno
Setting Value: yes
Display Order: 3
Setting Group: MessageLength

Open newthread.php

Find
PHP Code:
    ������������ $previewmessage $mybb->input['message'];
    
$post['message'] = $previewmessage;
������    $post['subject'] = $mybb->input['subject'];
��������    $post['icon'] = $mybb->input['icon'];
    
$post['smilieoff'] = $postoptions['disablesmilies'];
    
$post['dateline'] = time(); 

Replace with

PHP Code:
                        $previewmessage $mybb->input['message'];

        if(
$mybb->settings['min_char_preview'] != "no" && $mybb->settings['min_char_check'] != "no"){
        if(
strlen(trim($previewmessage)) == || strlen(trim($previewmessage)) < $mybb->settings['min_char_post'])
        {
            
error($lang->error_nomessage);
        }else 
        {
        
$post['message'] = $previewmessage;
          
$post['subject'] = $mybb->input['subject'];
            
$post['icon'] = $mybb->input['icon'];
        
$post['smilieoff'] = $postoptions['disablesmilies'];
        
$post['dateline'] = time();
        }
        }else{
                
$post['message'] = $previewmessage;
          
$post['subject'] = $mybb->input['subject'];
            
$post['icon'] = $mybb->input['icon'];
        
$post['smilieoff'] = $postoptions['disablesmilies'];
        
$post['dateline'] = time();
        } 

Open newreply.php

Find
PHP Code:
    $previewmessage $mybb->input['message'];
    
$post['message'] = $previewmessage;
������    $post['subject'] = $mybb->input['subject'];
��������    $post['icon'] = $mybb->input['icon'];
    
$post['smilieoff'] = $postoptions['disablesmilies'];
    
$post['dateline'] = time(); 

Replace with

PHP Code:
                        $previewmessage $mybb->input['message'];

        if(
$mybb->settings['min_char_preview'] != "no" && $mybb->settings['min_char_check'] != "no"){
        if(
strlen(trim($previewmessage)) == || strlen(trim($previewmessage)) < $mybb->settings['min_char_post'])
        {
            
error($lang->error_nomessage);
        }else 
        {
        
$post['message'] = $previewmessage;
          
$post['subject'] = $mybb->input['subject'];
            
$post['icon'] = $mybb->input['icon'];
        
$post['smilieoff'] = $postoptions['disablesmilies'];
        
$post['dateline'] = time();
        }
        }else{
                
$post['message'] = $previewmessage;
          
$post['subject'] = $mybb->input['subject'];
            
$post['icon'] = $mybb->input['icon'];
        
$post['smilieoff'] = $postoptions['disablesmilies'];
        
$post['dateline'] = time();
        } 

Open editpost.php

Find

PHP Code:
        $postinfo['message'] = $previewmessage;
        
$postinfo['subject'] = $subject;
        
$postinfo['icon'] = $icon;
        
$postinfo['smilieoff'] = $postoptions['disablesmilies'];
        
$postinfo['dateline'] = time(); 

Replace By

PHP Code:
        if($mybb->settings['min_char_preview'] != "no" && $mybb->settings['min_char_check'] != "no"){
        if(
strlen(trim($previewmessage)) == || strlen(trim($previewmessage)) < $mybb->settings['min_char_post'])
        {
            
error($lang->error_nomessage);
        }else 
        {
        
$postinfo['message'] = $previewmessage;
        
$postinfo['subject'] = $subject;
        
$postinfo['icon'] = $icon;
        
$postinfo['smilieoff'] = $postoptions['disablesmilies'];
        
$postinfo['dateline'] = time();
        }
        }else{
        
$postinfo['message'] = $previewmessage;
        
$postinfo['subject'] = $subject;
        
$postinfo['icon'] = $icon;
        
$postinfo['smilieoff'] = $postoptions['disablesmilies'];
        
$postinfo['dateline'] = time();
        } 
Hehe. Not bad LeX-, actually I was thinking about an javascript version (which should be a couple of lines), something like the one used for the signature in the ucp, however my other project needs attention aswell ( http://mcdcpp.net/ ), so maybe I have to stop making mods for a while, however gonna release my last versions and fixes for some of the mods.
Okey. Resizeable textareas is in it's final version (I think) If not any bugs are found that is. Next mod is Wordcount.
Resizeable textareas 1.3 is out Smile.
Remeber to deactivate your plugin BEFORE you upload the new one, and remember to upload the js file again aswell.

- Added ACP options.
- Better template searches.
- Minimized code a bit.

Download:
As I said, Wordcount was buggy like hell. should be good now however. Tested it and tested it. Hopefully no more nasty bugs.
Oh forgot, the recount_wc.php needs to be in the forum directory not the admin. no user can access it.

Wordcount 1.3

- Fixed editing posts
- Fixed users which do not got access to ini_set
- Fixed an recount page aswell.
- Cleanup.

Download:
*deleeted*