Please or Register to create posts and topics.

Add Captcha for guest postings

PreviousPage 3 of 5Next

Wenn ich den Code oben eingeben möchte, geht gar nichts mehr auf meiner Seite.

ParseError geworfen

Syntaxfehler, unerwarteter ‘editor_custom_content_bottom’ (T_STRING)

Hallo @mato

Bitte überprüfe erneut, ob du den Code vollständig kopiert hast. Beachte außerdem, diesen am Ende deiner functions.php-Datei – allerdings vor dem schließenden ?> Tag – einzufügen.

@hiteshchandwani

I added your plugin to the starting-post. Nice work! 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

@Asgaros – thanks for the appreciation. 🙂

Hello. Newbie see so be gentle!

I am putting a forum in my site and am very much a beginner. I have activated the re Captcha plugin and also the reCaptcha for Asgaros Forum plugin. the latter asks me for the api keys with starred out values. It gives me a link to Google but I can’t see where I should go from there. Can you help?

Hello @davestrong10

An API-key is required for ReCaptcha to work. Information on how to get this should be available via the link which leads you to the Google website (ReCaptcha is developed by Google). If not, please try to contact the developer of the ReCaptcha-plugin. They should know the correct ressource for it. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Is there a way to integrate “Advanced noCaptcha & invisible Captcha (v2 & v3)” plugin with the forum in a way that captcha is required to post for logged in users except for selected usergroups?

Hello @fatalframe

If you have coding-experience it should be possible using the same filters/hooks as in the first post. Otherwise I suggest you to contact the developers of this plugin because often captcha-plugins add support for third-party components.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hi @asgaros

mit Hilfe deines Codebeispieles im ersten Posting hatte ich versucht Captcha Plus von BestWebSoft einzubinden. Hat aber nicht geklappt.

Vielleicht kannst du mir helfen.

Zum Ausliefern des Captchas bieten sie diesen Filter:

<?php echo apply_filters( 'cptch_display', '' ); ?>

und zur Validierung dieses hier:

<?php $error = apply_filters( 'cptch_verify', true );
if ( true === $error ) { /* the CAPTCHA answer is right */
   /* do necessary action */
} else { /* the CAPTCHA answer is wrong or there are some other errors */
   echo $error; /* display the error message or do other necessary actions in case when the CAPTCHA test was failed */
} ?>

Wie müsste das denn jetzt in Verbindung mit dem Hook asgarosforum_editor_custom_content_bottom und dem Filter asgarosforum_filter_insert_custom_validation aussehen?

Bin völlig überfordert 😉

Besten Dank im Voraus und beste Grüße

Ole

Ok ich bin ein Stück weiter:

// Captcha für Forum
function editor_custom_content_bottom() {
  global $asgarosforum;
  if (!is_user_logged_in() && $asgarosforum->options['allow_guest_postings']) {
      echo apply_filters( 'cptch_display', '' ); 
  }
}
add_action('asgarosforum_editor_custom_content_bottom', 'editor_custom_content_bottom');

function insert_custom_validation($status) {
  global $asgarosforum;
  if (!is_user_logged_in() && $asgarosforum->options['allow_guest_postings']) {
    $error = apply_filters( 'cptch_verify', true );
if ( true !== $error ) { 
  $asgarosforum->info = __('You must enter the correct captcha.', 'asgaros-forum');
      return false;
}
  }
    return $status;
}
add_filter('asgarosforum_filter_insert_custom_validation', 'insert_custom_validation');

Das platziert das Captcha und funktioniert.
1.) wird das Captcha richtig ausgefüllt, wird der Beitrag gepostet.
2.) wird das Captcha gar nicht ausgefüllt kommt beim “Submit” eine Meldung (wahrscheinlich vom Captcha Plugin) das es ausgefüllt werden will und der Beitrag wird nicht gepostet

ABER:
Wird das Captcha falsch ausgefüllt, wird zwar der Beitrag nicht gepostet, aber die Meldung

$asgarosforum->info = __('You must enter the correct captcha.', 'asgaros-forum');

wird nicht ausgegeben.

Sachdienliche Hinweise sind gerne willkommen 😉

Beste Grüße

Ole

Give a link to your example on the forum to see how it works.

PreviousPage 3 of 5Next