vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to make THREAD TAGS required field when posting thread? (https://vborg.vbsupport.ru/showthread.php?t=277158)

mmllc 01-17-2012 09:33 PM

How to make THREAD TAGS required field when posting thread?
 
Hello everyone,

I moved my vbulletin to a new server, and for some reason the auto Make Tags from threads feature in the admincp isn't working; I click on it and an empty page loads in the main frame, I will troubleshoot this on my own, but it gave me an idea.

How can we make the THREAD TAG field when creating a new Thread "required" for anyone making a new discussion? I don't see it deterring most people from posting at all, but will certainly make tags more efficient if the author tags it him or herself, potentially.

Thanks!

:)

kh99 01-23-2012 11:09 AM

I haven't tested it much, but you could try this: create a new plugin using hook location newpost_process and this code:

PHP Code:

if ($type == 'thread')
{
   
$checktags split_tag_list($post['taglist']);
   if (!
count($checktags))
      
$errors[] = "At least one tag is required.";


Edit: I fixed the above, what I originally posted was for vb4.

JabirA 06-04-2012 12:38 PM

Hey kh99,

What was the code for VB4?

kh99 06-05-2012 08:26 AM

Hmm... I guess it would have been a good idea to leave the original code there, because now I can't remember what was there. But maybe something like this:

Code:

if ($type == 'thread')
{
  require_once(DIR . '/includes/class_taggablecontent.php');
  $checktags = vB_Taggable_Content_Item::split_tag_list($post['taglist']);
  if (!count($checktags))
      $errors[] = "At least one tag is required.";
}


JabirA 06-05-2012 09:35 AM

No, doesn't work. Too bad..

kh99 06-05-2012 09:40 AM

I just tried it an it seems to work. I created a new plugin using hook newpost_process and I copied and pasted the above code, and when I try to create a new thread I get an error if the tags field is blank.

JabirA 06-05-2012 09:57 AM

You are right! It does work..I am sorry. Confused with something else. :)


All times are GMT. The time now is 01:15 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.02389 seconds
  • Memory Usage 1,720KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete