Thread Rating:
  • 12 Vote(s) - 4.17 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CraKteR's plugin list
#41
wops forgot another thing aswell, try this. lol *deleeted*

And thanks for testing for me Big Grin
Reply
#42
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
Reply
#43
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.
Reply
#44
Okey, maybe I was too quick on that last one. here is 1.3 of Stupid posts.

- Bug fixes.

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

EDIT ::

*works* Big Grin
Reply
#46
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
Reply
#47
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();
        } 
Reply
#48
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.
Reply
#49
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:


Attached Files
.zip   resize1.3.zip (Size: 3.14 KB / Downloads: 278)
Reply
#50
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*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)