Minimum chars on new topic

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
olsserik
Registered User
Posts: 154
Joined: Tue Aug 21, 2007 6:18 am

Minimum chars on new topic

Post by olsserik » Fri Dec 16, 2016 12:49 pm

Hi,

Minimum chars only when posting a new topic? I dont want to add this function to replies, possible?

Thanks!
Last edited by olsserik on Thu Dec 22, 2016 1:35 pm, edited 1 time in total.

User avatar
KevC
Support Team Member
Support Team Member
Posts: 67236
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Prevent members to start new topics containing only links?

Post by KevC » Fri Dec 16, 2016 12:59 pm

Put them on a moderation queue. If they can't learn you have to treat them like children. It's your board, the rules are the rules.

MOD requests for 3.0 are no longer allowed so if you can't find a MOD out there to do it already you'll need to think about going to 3.1 and requesting an extension.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

User avatar
canonknipser
Registered User
Posts: 1137
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Prevent members to start new topics containing only links?

Post by canonknipser » Fri Dec 16, 2016 1:41 pm

KevC wrote:going to 3.1 and requesting an extension.
No need to request an extension, just install
Greetings
Frank
phpbb.de support team member
English is not my native language
New arrival - Extensions and scripts for phpBB
no support via PM or mail

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20371
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Prevent members to start new topics containing only links?

Post by RMcGirr83 » Fri Dec 16, 2016 2:57 pm

There is also the 3.0 MOD
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

olsserik
Registered User
Posts: 154
Joined: Tue Aug 21, 2007 6:18 am

Re: Minimum chars on new topic

Post by olsserik » Tue Dec 20, 2016 8:02 am

Thanks!
Last edited by olsserik on Thu Dec 22, 2016 1:36 pm, edited 1 time in total.

olsserik
Registered User
Posts: 154
Joined: Tue Aug 21, 2007 6:18 am

Re: Minimum chars on new topic

Post by olsserik » Tue Dec 20, 2016 9:07 am

Ok, I have an edit that might work, if someone is willing to find pitfalls in this feel free.

I made edits to posting.php (line ~792) find:

Code: Select all

$error[] = $user->lang['EMPTY_SUBJECT'];
}
Add after (on a new line):

Code: Select all

		// Check for minimum length of text with URLs excluded and only on new topic
		if ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))
		{
			$stringg = preg_replace('/\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $message_parser->message);
			$lengthh = utf8_strlen($stringg);
			if (!$lengthh || $lengthh < (int) $config['min_post_chars'])
			{
				$message_parser->warn_msg[] = (!$lengthh) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $lengthh, (int) $config['min_post_chars']);
			}
		}
Open inlcudes/message_parser.php (on line ~1100) find:

Code: Select all

if (!$message_length || $message_length < (int) $config['min_post_chars'])
Replace with:

Code: Select all

//Altered statement for replies only, choose the integer of your likings
if (!$message_length || $message_length < 3)
Set $config['min_post_chars'] to an amount of your likings (in admin panel) for creating a new topic.

Locked

Return to “[3.0.x] Support Forum”

Who is online

Users browsing this forum: No registered users and 105 guests

cron