vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   [req] Min, word count to submit post [/req] (https://vborg.vbsupport.ru/showthread.php?t=44701)

Mathiau 10-17-2002 06:05 PM

[req] Min, word count to submit post [/req]
 
Hey all

Was curious, if someone has any free time, pending on how simple this would be

To make a hack were there has to be a minimum amount of words / characters in a reply, before it can be posted?

So lets say you have to post 30 characters or more, if you don't, when you try to post that reply, you will be told,

"sorry, your post has to have at least 30 characters"

or something like that...?

Xenon 10-17-2002 06:20 PM

shouldnt be very hard (at least the char counter):

open newreply.php

find
PHP Code:

    $title=censortext($title);
    
$message=censortext($message); 

below add:
PHP Code:

if(strlen($message)<30) {
  eval(
"standarderror(\"Your message is too short!\");");
  exit;



Erwin 10-17-2002 06:29 PM

Or instead of letting the message go through and redirect to the error template, you can modify the javascript in the template that checks the message length by adding this:

Code:

        if (postmaxchars != 0) {
                if (theform.message.value.length < 30) {
                        alert("Your message is too short.\n\nIncrease your message to 5.\nIt is currently "+theform.message.value.length+" characters long.");
                        return false; }
                else { return true; }
        } else { return true; }
}

Untested, but should work. Advantage is that a message pops up if the post is too short (just like if it's too long) instead of redirecting the whole page. Disadvantage is that you have to change the code in newreply, newthread and quickreply. :)

Xenon 10-17-2002 07:02 PM

anotzher disadvantage is that some which haven't enabled javascript won't see that ;)

my code works for all users

Erwin 10-17-2002 07:10 PM

Quote:

Originally posted by Xenon
anotzher disadvantage is that some which haven't enabled javascript won't see that ;)

my code works for all users

True. Maybe a combination of the 2 then. :) Isn't that how the max char allowed works?

Xenon 10-18-2002 11:12 AM

yes, you're right, the combination is used for maxchars too :)

and yes a combination would be best ;)

Mathiau 10-18-2002 12:51 PM

^^^^

sweet guys!, okay, shall try this out :)

Mathiau 11-20-2002 03:10 PM

Hey guys

is there any special way i should put both of them together? or just copy and paste one after the other?

Also where exactly should i paste this code?

Xenon 11-20-2002 03:17 PM

well, copy and paste them one after th other is impossible.

my change is a codechange to newreply.php
erwins instead is a change of the newreply template

Mathiau 11-21-2002 05:23 AM

AHAH okay ke kew - so just put each in it's correct template / file :)

easy enough! althought knowing me i will be back..lol


All times are GMT. The time now is 09:35 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01473 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete