vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Require a post icon on new thread creation (or on every post) (https://vborg.vbsupport.ru/showthread.php?t=69683)

sblum 09-20-2004 10:00 PM

Require a post icon on new thread creation (or on every post)
 
Create a new phrase in the category "Front-End Error Messages" titled "noicon", with the text "You must choose a post icon before posting a new thread."

Open includes/functions_newpost.php

Find:
Code:

        // check for subject/message
        if (($post['message'] == '' AND $vboptions['postminchars'] > 0) OR ($type == 'thread' AND empty($post['title'])))
        {
                eval('$errors[] = "' . fetch_phrase('nosubject', PHRASETYPEID_ERROR) . '";');
        }

Add Below:
Code:

        // check for post icon
        if ($type == 'thread' AND $post['iconid'] == 0)
        {
                eval('$errors[] = "' . fetch_phrase('noicon', PHRASETYPEID_ERROR) . '";');
        }

That's it. If you want to make it required on all posts instead of just new thread creation, change the phrase accordingly and add the following code instead:

Code:

        // check for post icon
        if ($post['iconid'] == 0)
        {
                eval('$errors[] = "' . fetch_phrase('noicon', PHRASETYPEID_ERROR) . '";');
        }


sblum 09-20-2004 10:43 PM

You can see a demo at http://www.postfarm.net/ and, as always, please click install :)

marcel-ea 09-21-2004 01:15 AM

Thx very much

Zoints 09-25-2004 11:12 PM

Great hack. It does however break the "report post" hack where the report is posted as a new thread in a forum of your choice. I fixed it by changing it to this:

Code:

// check for post icon
        if (THIS_SCRIPT != 'report') {
                if ($type == 'thread' AND $post['iconid'] == 0)
                {
                        eval('$errors[] = "' . fetch_phrase('noicon', PHRASETYPEID_ERROR) . '";');
                }
        }


turbidblue 09-26-2004 12:07 AM

awesome!

this is cool, because I get so tired of seeing just the default icon used, esp when I have a ton just sitting there ;)

[high]* turbidblue click install happily :)[/high]

Snifter 02-13-2005 12:06 AM

Is there anyway to set this up so that it won't require an icon for forums with icons turned off?

Snifter 02-13-2005 12:56 AM

Figured it out, this should work :)


PHP Code:

        // check for post icon
        
if ($foruminfo['allowicons']) { 
                if (
$type == 'thread' AND $post['iconid'] == 0)
                {
                        eval(
'$errors[] = "' fetch_phrase('noicon'PHRASETYPEID_ERROR) . '";');
                }
        } 


ZGeek 10-04-2005 04:30 AM

Anyone updating this for vb 3.5?

Hawk7173 01-29-2006 09:58 PM

How would I get rid of the no icon option? Have this installed, but it's confusing as the message when not having a icon checked is

Could not find phrase 'noicon'.

would that require a phraze change?

3DPiMp 09-09-2008 03:32 PM

will this mod work in Version 3.7.2?


All times are GMT. The time now is 10:40 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.04273 seconds
  • Memory Usage 1,741KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete