vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forbid Users from Posting Links or Images if They Have Fewer than 15 Posts (https://vborg.vbsupport.ru/showthread.php?t=96018)

davidw 10-06-2006 12:40 PM

I don't know if this works or not, but this is what I have on one of the forums I am an admin at:

I did this to both postdata_presave and threadfpdata_presave hooklocations.

Code:

global $vbulletin;
                $pagetext =& $this->fetch_field('pagetext', 'post');
                if (($vbulletin->userinfo[posts] < 7) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'[email') or stristr($pagetext,'[EMAIL') or stristr($pagetext,'www.') or stristr($pagetext,'mailto:') or stristr($pagetext,'http://')))
    {
                    //eval(standard_error(fetch_error('error_nourlallowed')));
                                $this->error('error_nourlallowed');
                                $return_value = false;
    }


mpage 10-06-2006 12:47 PM

yes thats what i have tried above,
but on testing you can still post emails (as one spamer has already found out!)

but I haveny tried the :

or stristr($pagetext,'mailto:')

Ill give it a go!

mpage 10-06-2006 12:57 PM

nope it doesnt work, people can still pst spam and add attach emails to it, as they have already done on my site!

davidw 10-06-2006 12:59 PM

are you using
Code:

or stristr($pagetext,'[email') or stristr($pagetext,'[EMAIL')
or just
Code:

or stristr($pagetext,'[email')
EDIT: I just noticed a typo in my own code :P
EDIT2: Fixed typo

mpage 10-06-2006 01:09 PM

opps my mistake

you have to add:

or stristr($pagetext,'[email')
or stristr($pagetext,'[EMAIL')
or stristr($pagetext,'[ url')
or stristr($pagetext,'mailto:')
or stristr($pagetext,'@')

to both :
<hookname>postdata_presave</hookname> and <hookname>threadfpdata_presave</hookname>

works a treat now :)

HUMMERh3 11-13-2006 06:38 PM

err I'm lost on getting the plugin to work with emails...

I add this code:
Quote:


or stristr($pagetext,'[email')
or stristr($pagetext,'[EMAIL')
or stristr($pagetext,'[ url')
or stristr($pagetext,'mailto:')
or stristr($pagetext,'@')

to both :
<hookname>postdata_presave</hookname> and <hookname>threadfpdata_presave</hookname>
to where? Am I suppose to use Erwins for 3.0 ??

davidw 11-13-2006 10:19 PM

Edit Amy's plugin

syjech 11-14-2006 01:42 PM

I hope this wont sound stupid. But I am still learning all this. WHere do I upload it to? What directory? Please help

davidw 11-14-2006 02:44 PM

You don't upload it - it is a product. For product installation, go to your admin control panel, Plugin System, Manage Products, Add/Import Product

HUMMERh3 11-15-2006 07:44 PM

There is no
Quote:

<hookname>postdata_presave</hookname> and <hookname>threadfpdata_presave</hookname>
in amy's plugin.... Here is the entire code below.where do I add the code to includ EMAILS ?
Quote:

or stristr($pagetext,'[email')
or stristr($pagetext,'[EMAIL')
or stristr($pagetext,'[ url')
or stristr($pagetext,'mailto:')
or stristr($pagetext,'@')

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="amykhar_09082005" title="No Links or Images Allowed for People with Fewer t" description="Throws an error message for spammers." version="1.1" active="1">
        <codes>
        </codes>
        <templates>
        </templates>
        <plugins>
                <plugin active="1">
                        <title>No Links for People with fewer than 15 posts.</title>
                        <hookname>newthread_post_start</hookname>
                        <phpcode><![CDATA[$pagetext = $vbulletin->GPC['message'];
if (($vbulletin->userinfo[posts] < 15) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) {
                    eval(standard_error(fetch_error('error_nourlallowed')));
            }]]></phpcode>
                </plugin>
                <plugin active="1">
                        <title>No Links for People with fewer than 15 posts.</title>
                        <hookname>newreply_post_start</hookname>
                        <phpcode><![CDATA[$pagetext = $vbulletin->GPC['message'];
if (($vbulletin->userinfo[posts] < 15) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) {
                    eval(standard_error(fetch_error('error_nourlallowed')));
            }]]></phpcode>
                </plugin>
                <plugin active="1">
                        <title>No Links for People with fewer than 15 posts.</title>
                        <hookname>editpost_update_start</hookname>
                        <phpcode><![CDATA[$pagetext = $vbulletin->GPC['message'];
if (($vbulletin->userinfo[posts] < 15) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) {
                    eval(standard_error(fetch_error('error_nourlallowed')));
            }]]></phpcode>
                </plugin>
        </plugins>
        <phrases>
                <phrasetype name="Front-End Error Messages" fieldname="error">
                        <phrase name="error_nourlallowed"><![CDATA[You are only allowed to post URLs to other sites after you have made 15 posts or more. Sorry but this includes Smiley faces as well
                        ]]></phrase>
                </phrasetype>
        </phrases>
        <options>
        </options>
</product>



All times are GMT. The time now is 01:07 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.01381 seconds
  • Memory Usage 1,752KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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