PDA

View Full Version : New Thread/Post Image Verification for Guests


AN-net
11-21-2004, 10:00 PM
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 (http://www.animationation.net/community/newreply.php?do=newreply&noquote=1&p=6251)
-New Thread Demo (http://www.animationation.net/community/newthread.php?do=newthread&f=53)

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

$phrasegroups = array('threadmanage', 'posting'

-------------------------------------
After add:

, 'register'

-------------------------------------
Find:

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

-------------------------------------
Underneath add:

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_imageche ck'));
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:

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

-------------------------------------
Underneath add:

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:

$phrasegroups = array('threadmanage', 'posting'

-------------------------------------
After add:

, 'register'

-------------------------------------
Find:

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

-------------------------------------
Underneath add:

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_imageche ck'));
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:

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'], 1, true);
$show['attachmentlist'] = true;
eval('$attachments .= "' . fetch_template('newpost_attachmentbit') . '";');
}
}
$attachurl = "t=$threadid";
eval('$attachmentoption = "' . fetch_template('newpost_attachment') . '";');
}
else
{
$attachmentoption = '';
}

-------------------------------------
Underneath add:

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:

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

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

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

<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/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=72026).

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
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
Anyone have this working for 3.6.X??? This is absolutely perfect for guest forums...

Good question does this work in 3.5.7?