PDA

View Full Version : Require a post icon on new thread creation (or on every post)


sblum
09-20-2004, 10:00 PM
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:
// 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:
// 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:

// 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:

// 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 ;)

* turbidblue click install happily :)

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 :)


// 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?