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)
-   -   New Thread/Post Image Verification for Guests (https://vborg.vbsupport.ru/showthread.php?t=72026)

AN-net 11-21-2004 10:00 PM

New Thread/Post Image Verification for Guests
 
New Thread/Post Image Verification

Description:
This hack will add new a feature to new posts and new threads. When a guest is posting or making a new thread they will be asked to type in the text displayed in the image provided right of the text box. This image is the same exact kind of image used for image verification in vb's registration(its the exact code so i take no rights to saying the code is mine hehe:D ). Anyways this is useful for forums that allow posting for guests such as for feedback etc. and not letting bots being able to and not having to approve every single post. I made this hack personally stop this ad bot who kept posting on my site;)

Credits:
-original concept ~ AN-net(Antonbomb22; Anthony Scudese)
-code ~ vB Team/Jelsoft

Requirements:
This does not require GD to be on via options or image verficiation to be on for registration. However, this does require GD library:)

Support Policy:
I have the right to deny support to anyone for any reason at any time.

Where to Get Support?:
-http://www.animationation.net
-AIM: Antonbomb22
-email: antonbomb22@animationation.net
-this thread

Demo:
-New Reply Demo
-New Thread Demo

File Edits(2):
-------------------------------------
Open: /forumroot/newthread.php
-------------------------------------
Find:
PHP Code:

$phrasegroups = array('threadmanage''posting' 

-------------------------------------
After add:
PHP Code:

'register' 

-------------------------------------
Find:
PHP Code:

    if (!($forumperms CANPOSTPOLL))
    {
        unset(
$_POST['postpoll']);
    } 

-------------------------------------
Underneath add:
PHP Code:

    if($bbuserinfo['userid']=="0")
    {
        
$imagestamp trim(str_replace(' '''$_POST['imagestamp']));
        
$ih $DB_site->query_first("SELECT imagestamp FROM " TABLE_PREFIX "regimage WHERE regimagehash = '" addslashes($_POST['imagehash']) . "'");
        if ((!
$imagestamp) OR (strtoupper($imagestamp) != $ih['imagestamp']))
        {
              
//eval(print_standard_error('error_register_imagecheck'));
              
eval('$errors[140] = "' fetch_phrase('register_imagecheck'PHRASETYPEID_ERROR) . '";');
              
$DB_site->query("DELETE FROM " TABLE_PREFIX "regimage WHERE regimagehash = '" addslashes($_POST['imagehash']) . "'");
              unset(
$imagestamp);
              unset(
$_POST['imagehash']);
              unset(
$_POST['imagestamp']);
        }
    } 

-------------------------------------
Find:
PHP Code:

    if (!isset($newpost['polloptions']))
    {
        
$polloptions 4;
    }
    else
    {
        
$polloptions intval($newpost['polloptions']);
    } 

-------------------------------------
Underneath add:
PHP Code:

    if($bbuserinfo['userid']=="0")
    {
        require_once(
'./includes/functions_user.php');
        
$string fetch_registration_string(6);
        
$imagehash md5(uniqid(rand(), 1));
        
$DB_site->query("INSERT INTO " TABLE_PREFIX "regimage (regimagehash, imagestamp, dateline) VALUES ('" addslashes($imagehash) . "', '" addslashes($string) . "', " TIMENOW ")");
        
$show['imageverf']= true;
        eval(
'$imageregbit = "' fetch_template('register_imagebit') . '";');
    }
    else
    {
        
$show['imageverf']= false;
    } 

-------------------------------------
Save and upload: /forumroot/newthread.php
-------------------------------------


-------------------------------------
Open: /forumroot/newreply.php
-------------------------------------
Find:
PHP Code:

$phrasegroups = array('threadmanage''posting' 

-------------------------------------
After add:
PHP Code:

'register' 

-------------------------------------
Find:
PHP Code:

if ($_POST['do'] == 'postreply')
{
    
globalize($_POST, array(
        
'posthash' => STR_NOHTML,
        
'poststarttime' => STR_NOHTML
    
)); 

-------------------------------------
Underneath add:
PHP Code:

    if($bbuserinfo['userid']=="0")
    {
        
$imagestamp trim(str_replace(' '''$_POST['imagestamp']));
        
$ih $DB_site->query_first("SELECT imagestamp FROM " TABLE_PREFIX "regimage WHERE regimagehash = '" addslashes($_POST['imagehash']) . "'");
        if ((!
$imagestamp) OR (strtoupper($imagestamp) != $ih['imagestamp']))
        {
              
//eval(print_standard_error('error_register_imagecheck'));
              
eval('$errors[140] = "' fetch_phrase('register_imagecheck'PHRASETYPEID_ERROR) . '";');
              
$DB_site->query("DELETE FROM " TABLE_PREFIX "regimage WHERE regimagehash = '" addslashes($_POST['imagehash']) . "'");
              unset(
$imagestamp);
              unset(
$_POST['imagehash']);
              unset(
$_POST['imagestamp']);
        }
    } 

-------------------------------------
Find:
PHP Code:

    if ($forumperms CANPOSTATTACHMENT AND $bbuserinfo['userid'])
    {
        if (!
$posthash OR !$poststarttime)
        {
            
$poststarttime TIMENOW;
            
$posthash md5($poststarttime $bbuserinfo['userid'] . $bbuserinfo['salt']);
        }
        else
        {
            
$currentattaches $DB_site->query("
                SELECT filename, filesize
                FROM " 
TABLE_PREFIX "attachment
                WHERE posthash = '" 
addslashes($newpost['posthash']) . "'
                    AND userid = 
$bbuserinfo[userid]
            "
);

            while (
$attach $DB_site->fetch_array($currentattaches))
            {
                
$attach['extension'] = strtolower(file_extension($attach['filename']));
                
$attach['filename'] = htmlspecialchars_uni($attach['filename']);
                
$attach['filesize'] = vb_number_format($attach['filesize'], 1true);
                
$show['attachmentlist'] = true;
                eval(
'$attachments .= "' fetch_template('newpost_attachmentbit') . '";');
            }
        }
        
$attachurl "t=$threadid";
        eval(
'$attachmentoption = "' fetch_template('newpost_attachment') . '";');
    }
    else
    {
        
$attachmentoption '';
    } 

-------------------------------------
Underneath add:
PHP Code:

    if($bbuserinfo['userid']=="0")
    {
        require_once(
'./includes/functions_user.php');
        
$string fetch_registration_string(6);
        
$imagehash md5(uniqid(rand(), 1));
        
$DB_site->query("INSERT INTO " TABLE_PREFIX "regimage (regimagehash, imagestamp, dateline) VALUES ('" addslashes($imagehash) . "', '" addslashes($string) . "', " TIMENOW ")");
        
$show['imageverf']= true;
        eval(
'$imageregbit = "' fetch_template('register_imagebit') . '";');
    }
    else
    {
        
$show['imageverf']= false;
    } 

-------------------------------------
Save and upload: /forumroot/newreply.php
-------------------------------------



Template Edits(2):
~~~~~~~~~~~~~~~~~~~~~~~~
Edit template: newreply
~~~~~~~~~~~~~~~~~~~~~~~~
Find:
HTML Code:

                <tr>
                        <td><input type="text" class="bginput" name="title" value="$title" size="50" maxlength="85" tabindex="1" title="$vbphrase[optional]" /></td>
                        <td>&nbsp;&nbsp;</td>
                        <td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
                </tr>

~~~~~~~~~~~~~~~~~~~~~~~~
Underneath add:
HTML Code:

<if condition="$show[imageverf]">
<tr>
<td class="smallfont" colspan="2">Image Verification Text: <br /><input type="text" class="bginput" name="imagestamp" size="50" maxlength="6" value="$imagestamp" title="$vbphrase[enter_text_image_right]" /><input type="hidden" name="imagehash" value="$imagehash" /></td>
<td><img src="image.php?$session[sessionurl]type=regcheck&amp;imagehash=$imagehash" alt="$vbphrase[registration_image]" width="201" height="61" border="0" /></td>
</tr>
</if>

~~~~~~~~~~~~~~~~~~~~~~~~
Save: newreply
~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~
Edit Template: newthread
~~~~~~~~~~~~~~~~~~~~~~~~
Find:
HTML Code:

                <tr>
                        <td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
                        <td>&nbsp;&nbsp;</td>
                        <td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>                </tr>

~~~~~~~~~~~~~~~~~~~~~~~~
Underneath add:
HTML Code:

<if condition="$show[imageverf]">
<tr>
<td class="smallfont" colspan="2">Image Verification Text: <br /><input type="text" class="bginput" name="imagestamp" size="50" maxlength="6" value="$imagestamp" title="$vbphrase[enter_text_image_right]" /><input type="hidden" name="imagehash" value="$imagehash" /></td>
<td><img src="image.php?$session[sessionurl]type=regcheck&amp;imagehash=$imagehash" alt="$vbphrase[registration_image]" width="201" height="61" border="0" /></td>
</tr>
</if>

~~~~~~~~~~~~~~~~~~~~~~~~
Save: newthread
~~~~~~~~~~~~~~~~~~~~~~~~

I have also attached 3 screenshots:)

Please click install https://vborg.vbsupport.ru/.

Boofo 11-22-2004 08:37 AM

Can you please put this in a txt file for easier download? ;)

AN-net 11-22-2004 11:12 AM

sure ill do this when i get home from school today;)

Bad Bunny 11-25-2004 12:42 PM

Quote:

Originally Posted by AN-net
sure ill do this when i get home from school today;)

You know...this axtually sounds very nice! It'll be a practical but annoying addition for guests, that doesn't take away their features, but still encourages registration!

T3MEDIA 03-05-2005 10:15 PM

Hey can you have this set for ever odd amount? like every three times or something?

I also would LOVE to have this for private messages

T3MEDIA 03-17-2005 09:39 PM

I know it was old but any ideas?

T3MEDIA 09-23-2005 01:53 AM

no ideas on every X post image v pops up? or doing this on private messages?

I have the first part but the second paste I am not sure where to put it (doing myself) for private messages.

f1vlad 09-15-2006 03:31 PM

Great hack, thanks! Works perfect for my project.

interfx 01-03-2007 09:50 AM

Anyone have this working for 3.6.X??? This is absolutely perfect for guest forums...

firewoofer 01-08-2007 09:26 PM

Quote:

Originally Posted by interfx (Post 1149760)
Anyone have this working for 3.6.X??? This is absolutely perfect for guest forums...

Good question does this work in 3.5.7?


All times are GMT. The time now is 12:35 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.02191 seconds
  • Memory Usage 1,841KB
  • 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_html_printable
  • (12)bbcode_php_printable
  • (2)bbcode_quote_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