vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - NoSpam! - an alternative to CAPTCHA images (https://vborg.vbsupport.ru/showthread.php?t=124828)

carbide 02-14-2007 08:15 PM

excellent=installed:)
gr8 hack

derfelix 02-14-2007 09:14 PM

Ok i looked a little into the multilingual support.. as I was not satisfied with the solution above. I am using the hack https://vborg.vbsupport.ru/showthread.php?t=98904 by JoergZ for translating customfields and i thought that i could use a few lines of code here. (actually it is a code snippet I posted in that thread to adapt his hack)

The basic idea is: You only need the question translated, you can define the answers in different languages.. so you give the answers in all installed languages.

3 steps to make it work multilanguage with phrases.

Step one:
Modify the product xml:
find:
PHP Code:

$nospamquestion $qanda[0]; 

below add:
PHP Code:

// ########### Lang hack  ---start ########  
      
$questionphrase ''
      
$testforphrase substr(trim($nospamquestion), 01);  
      if (
$testforphrase == '$')  
      {  
            
$questionphrase substr(trim($nospamquestion), 1);  
            
$nospamquestion $vbphrase[$questionphrase];  
      } 
// ########### Lang hack  ---end ######## 

Now reinstall the product.xml (with overwrite of course)

Step two:
Go to your phrase manager in the ACP and add a new phrase:

Phrase Type: GLOBAL
Product: vBulletin
Varname: nospam_question_01
Text: How much is 2+2

Then insert the translation for all istalled languages (in my case english, german and french)

German: Wieviel ist 2+2
Fran?ais: Combien font 2+2

Now save the phrase.

Repeat for all your questions using the variables:

Varname: nospam_question_02
Varname: nospam_question_03
Varname: nospam_question_04
Varname: nospam_question_05
............. and so on

IMPORTANT!!!: Write down the question number and the question on a piece of paper !!!! (happened to me.. i didnt remember which variable number was which question)

Now comes step three:

go to your nospam settings and define the questions the following way:
(in our example: How much is 2+2)

$nospam_question_01:4:four:vier:quatre

IMPORTANT: in your nospam setting you MUST set a $ sign in front of the varname you used in the phrases
other example: in your phrases you use the varname nospam_question_04 in your nospam settings you use $nospam_question_04

I hope it is clear.

I tested it on 3.64 and it works for me... THANK YOU for the great hack!!

Felix

Forgot to say, that if you dont use the $ in the nospam settings for the question, the question will appear as you entered it. (Like in the original hack)

Hope this helps someone

d1150488 02-14-2007 09:18 PM

Quote:

Originally Posted by d1150488 (Post 1182591)
I can't get this to appear at all, i've tried several of the fixes, including the manual template edits. I tried restoring the tempate and product and re-tried, but with no luck :(

I've checked i've got the nospam template, i've got the reference in the reg template. I've got the hooks enabled, i've gone over and over the code, and i'm completely confused as to why it shouldn't work. I've had a good read through this thread, and i just can't find a fix :(

Just an update to that, i manually added the content of the template 'nospam' to the main reg template and all i got were the static elements. No variables were passed. So no question etc. just a box and a border.

The thing will process when submitted suggesting the feild is incorrect. However its not pulling the information through.

Any help would be greatly appreciated. :)

Or if you let me know how the 'nospamnumber' works, i can just statically write the submitting form on the reg page (i think) :lol:

*Edit, i manually set the 'nospamnumber' to 0 and wrote out the question. It now picks out the 2nd or 3rd answer in the admin CP and validates against it. Wich is good enough for me at the moment, but i'd like to understand it more, if anyone can help.

antialiasis 02-14-2007 09:58 PM

The variable $nospamnumber is basically which NoSpam! question it is so that the hack can determine which answer it should be comparing the input to.

A few forums have had that problem, but it still mystifies me what the heck is wrong there. :/

I guess you could try just putting this block of code right at the start of the plugin on global_start:

PHP Code:

            $questions explode("\n"$vbulletin->options['nospam_questions']);
            
$nospamnumber array_rand($questions);
            
$qanda explode(":",$questions["$nospamnumber"]);
            
$nospamquestion $qanda[0]; 


morrow 02-14-2007 10:26 PM

This mod is a must have! Thanks for all of your hard work!

chkdgate 02-15-2007 09:04 AM

What about multiple questions?

Eagle Creek 02-15-2007 05:14 PM

Quote:

Originally Posted by chkdgate (Post 1183077)
What about multiple questions?

Possible!
https://vborg.vbsupport.ru/attachmen...2&d=1156727175

chkdgate 02-15-2007 06:36 PM

Quote:

Originally Posted by Eagle Creek (Post 1183358)

I already tried this method but it doesn't work for me. Do I separate the questions in any particular way.

antialiasis 02-16-2007 12:30 AM

You just put one question/answer set on each line, and then it picks one at random. If you were asking if it could actually ask multiple questions at the same time, it would be possible to do but there's absolutely no need for it; you can of course ask a question in two parts just by combining them into one.

CP, 02-16-2007 12:00 PM

i have a 3.5.4 will this work?

antialiasis 02-16-2007 04:39 PM

Please click the link in the first post or in my signature for the 3.5 version.

demojames 02-16-2007 08:15 PM

Awesome! I love this mod! My spam has gone from 3-5 a day to ZERO! NONE! NADA!

a1whs.com 02-17-2007 07:11 AM

To be frank i do not like it as it requires installation of another mod, can this be just a standalone mod not requiring installation of another 3rd party mod?

Top Nurse 02-17-2007 09:25 AM

Quote:

Originally Posted by derfelix (Post 1182738)
Ok i looked a little into the multilingual support.. as I was not satisfied with the solution above. I am using the hack https://vborg.vbsupport.ru/showthread.php?t=98904 by JoergZ for translating customfields and i thought that i could use a few lines of code here. (actually it is a code snippet I posted in that thread to adapt his hack)

Thanks for the mini-hack :D

I think this may work better than my idea as I was just being lazy. Having the ability to using the vB language system to take care of the translation makes it look a lot more professional.

antialiasis 02-18-2007 12:13 PM

Quote:

Originally Posted by a1whs.com (Post 1184430)
To be frank i do not like it as it requires installation of another mod, can this be just a standalone mod not requiring installation of another 3rd party mod?

Huh? You're reading something very wrong. You don't need to install anything except the core vBulletin software to use this.

chkdgate 02-18-2007 11:48 PM

Over the weekend a couple of spam emails went through so I added a couple more random questions. Should be good. MOTM for sure!

clarkstoncracke 02-19-2007 02:26 AM

Best PLUGIN EVER!

My large website went from 20-30 spammers a day to ZERO!

Thanks again!

If it continues to prevent spam, I may get to turn off new user validation! That would make my life so much better!

AND this took all of 20 seconds to install! Nice installer, great options.

mrgrimes 02-19-2007 11:17 AM

Quote:

Originally Posted by antialiasis (Post 1177176)
I have figured out the Form Hack integration; see the newly-added integration.txt file.

Hi. I followed the instructions in integration.txt but on testing the form I got this error: 'Fatal error: Cannot redeclare trim_array() (previously declared in /var/www/citfou_vbulletin/global.php(356) : eval()'d code:43) in /var/www/citfou_vbulletin/includes/functions_newpost.php(360) : eval()'d code on line 13'
Any ideas?

Eagle Creek 02-19-2007 01:34 PM

Quote:

Originally Posted by clarkstoncracke (Post 1185715)
Best PLUGIN EVER!

My large website went from 20-30 spammers a day to ZERO!


Thanks again!

If it continues to prevent spam, I may get to turn off new user validation! That would make my life so much better!


AND this took all of 20 seconds to install! Nice installer, great options.

Sweet huh! :up:

derfelix 02-20-2007 05:33 PM

Quote:

Originally Posted by Top Nurse (Post 1184473)
Thanks for the mini-hack :D

I think this may work better than my idea as I was just being lazy. Having the ability to using the vB language system to take care of the translation makes it look a lot more professional.

well in your case it was ok.. but i installed russian, english and simple chinese so the users wouldn't understand the questions in the different languages and be afraid to answer..

still didn't test it on a live system though

Felix

bjf123 02-21-2007 01:22 AM

I just added it to my forum. We'll see if the bogus registrations stop. ;)

antialiasis 02-21-2007 07:41 PM

Quote:

Originally Posted by mrgrimes (Post 1185910)
Hi. I followed the instructions in integration.txt but on testing the form I got this error: 'Fatal error: Cannot redeclare trim_array() (previously declared in /var/www/citfou_vbulletin/global.php(356) : eval()'d code:43) in /var/www/citfou_vbulletin/includes/functions_newpost.php(360) : eval()'d code on line 13'
Any ideas?

Remove this bit from the code you added into the plugin on global_start, and you should be fine:

Code:

            function trim_array(&$answer)
            {
              $answer = trim($answer);
            }


Top Nurse 02-22-2007 05:01 AM

I'm going to add that hack to our production forum sometime this weekend as we have a lot of Spanish readers who can test the system for us. Let you know how it flies. :)

Quote:

Originally Posted by derfelix (Post 1186872)
well in your case it was ok.. but i installed russian, english and simple chinese so the users wouldn't understand the questions in the different languages and be afraid to answer..

still didn't test it on a live system though

Felix


SPEED1 02-25-2007 02:42 PM

Awesome!! Installed. Thank you! :)

old_expat 02-28-2007 02:08 PM

Quote:

Go to the register template and try manually finding $imagereg and adding $nospamfield above it.
For those new to vBulletin .. where is the "register template" i.e. which directory. I can't find anything except register.php

BACANERIA 02-28-2007 04:56 PM

thanks but ill be instaling this later

blockbusted 02-28-2007 09:57 PM

Great hack! Thanks!

*clicks install

antialiasis 02-28-2007 10:44 PM

Quote:

Originally Posted by old_expat (Post 1192661)
For those new to vBulletin .. where is the "register template" i.e. which directory. I can't find anything except register.php

That's the PHP files; most hacks don't require you to edit those. The templates are located in the Admin CP; look under Styles and Templates. The template you should edit is called simply register.

chkdgate 03-02-2007 05:29 PM

Has anyone tried it with 3.6.5 yet?

phill2003 03-02-2007 07:27 PM

Quote:

Originally Posted by chkdgate (Post 1194264)
Has anyone tried it with 3.6.5 yet?

From what I can see not a lot has changed with 3.6.5 so I would be amazed if it did not work...

antialiasis 03-02-2007 10:54 PM

I don't think any of the hooks used in NoSpam! are actually in files that were changed in 3.6.5, so you should be pretty safe with that. :/

Stilgar 03-02-2007 11:22 PM

Quote:

Originally Posted by chkdgate (Post 1194264)
Has anyone tried it with 3.6.5 yet?


Works just fine with v3.6.5

chkdgate 03-03-2007 06:51 AM

Thank you phill2003.

talenak 03-04-2007 03:35 AM

This is a good hack, but you can accomplish exactly the same thing using the User Profile Field Manager.

User Profile Field>Add New User Profile Field>

You can require it to be answered, require a certain answer, all the same niftyness.

antialiasis 03-04-2007 09:59 AM

No, you can't.

1. It will only work on registration - not for guest posts, guest searches or guest Contact Us.
2. It can only be one set question, not a random one out of many like this hack.
3. Although this is the 3.6 version, it is not possible to require a certain answer for a profile field in 3.5. There is a 3.5 version of the hack.

LPH2004 03-05-2007 11:16 AM

Spammers are still getting through to the forums and posting. In fact, the one this morning was banned, masks changed to deny on all forums, and they were still posting. They registered this morning, so they were getting through somehow. I even changed the questions/answers for future registrations.

Any thoughts on how they are still getting through?

Smoothie 03-05-2007 01:02 PM

LPH2004,

Live spammers, (aka humans) can still register and post. At least last time I checked. ;) This mod should and does prevent bots from regsitering. It cannot and does not prevent someone with a brain from registering.

SoftWareRevue 03-05-2007 01:24 PM

Quote:

Originally Posted by LPH2004 (Post 1196145)
Spammers are still getting through to the forums and posting. In fact, the one this morning was banned, masks changed to deny on all forums, and they were still posting. They registered this morning, so they were getting through somehow. I even changed the questions/answers for future registrations.

Any thoughts on how they are still getting through?

Yeah. Like LPH2004 suggests, this hack stops the bots. Humans can still register. ;)

ThePiston 03-07-2007 09:13 PM

pretty nice add-on... ever think of including a stock or sample bundle of Q/As in the txt file?

ThePiston 03-07-2007 09:39 PM

can you tell me in very simple terms where I find "form template "? thanks


All times are GMT. The time now is 08:19 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.01711 seconds
  • Memory Usage 1,845KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (15)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
  • (40)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