vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Users can not use IMG tag if they have less than 20 posts (https://vborg.vbsupport.ru/showthread.php?t=36971)

Zzed 04-03-2002 10:00 PM

Users can not use IMG tag if they have less than 20 posts
 
This hack will prevent new users from posting any images using the UBB IMG
tag until they have 20 posts.

This hack was requested by Remi.

New templates: 1 --> error_noimagesallowed
Modified files: 2 --> newthread.php and newreply.php

################################################## ####################

Create a new template by the name of: error_noimagesallowed

Copy the following information in it:
Quote:

You do not have enough post count to post images in your signature or in your previous post. Please go back and correct the problem and then continue again. You need a minimum of $posts_needed_for_img to post images.</p>
################################################## ####################

In newthread.php:

Look for:
PHP Code:

    // check max images
    
if ($maximages!=0) {
      
$parsedmessage=bbcodeparse($message,$foruminfo[forumid],$allowsmilie);
      if (
countchar($parsedmessage,"<img")>$maximages) {
        eval(
"standarderror(\"".gettemplate("error_toomanyimages")."\");");
        exit;
      }
    } 

Add the following code directly below it:
PHP Code:

    $posts_needed_for_img 20;
    if(
$bbuserinfo[posts] < $posts_needed_for_img) {
      if (
countchar($parsedmessage,"<img")>0) {
        eval(
"standarderror(\"".gettemplate("error_noimagesallowed")."\");");
        exit;
      }
    } 

In newreply.php:

Look for the following code:
PHP Code:

    // check max images
    
if ($maximages!=0) {
      
$parsedmessage=bbcodeparse($message,$forumid,$allowsmilie);
      if (
countchar($parsedmessage,"<img")>$maximages) {
        eval(
"standarderror(\"".gettemplate("error_toomanyimages")."\");");
        exit;
      }
    } 

Add the following code directly below it:
PHP Code:

    $posts_needed_for_img 20;
    if(
$bbuserinfo[posts] < $posts_needed_for_img) {
      if (
countchar($parsedmessage,"<img")>0) {
        eval(
"standarderror(\"".gettemplate("error_noimagesallowed")."\");");
        exit;
      }
    } 

You are done. :)

Erwin 04-04-2002 10:23 AM

Works fine! Thanks a lot! I was needing this!

Admin 04-04-2002 10:24 AM

I'd replace the [img] tag with "I am a fool", but that's just me. ;) Good work.

E 04-04-2002 10:26 AM

^^LMAO

Remi 04-04-2002 10:35 AM

Zzed

YOU are GREAT https://vborg.vbsupport.ru/external/2011/01/19.gif https://vborg.vbsupport.ru/external/2011/01/19.gif

Thank you very much, this is wounderfurll :D

MrLister 04-04-2002 01:31 PM

Thanks for the hack. Great job on it!

Zzed 04-04-2002 02:42 PM

Thank you guys for all the kind words. :)

Psychdrone 04-04-2002 05:30 PM

I think I am sure, but what would you have to change ezactly to make it count for other VbTags??

Erwin 04-04-2002 08:52 PM

One big problem - it doesn't allow users to post normal smilies too.

Any way around this?

Zzed 04-04-2002 09:03 PM

Sorry. :( I'll work on it.


All times are GMT. The time now is 10:08 AM.

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.01130 seconds
  • Memory Usage 1,745KB
  • 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_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