Incorporate Captcha into AkoBook

16 years 1 month ago #59176 by laurie_lewis
Incorporate Captcha into AkoBook was created by laurie_lewis
Hi,

I am after a bit of assistance with incorporating CB Captcha 2 into Akobook (and AKocomment). Akobook is currently being rewritten so that it is Joomla 1.5 native.

I am trying to teach myself (not very successfully :blush: ) to do this, but I am stuck. The Captcha process only needs to be displayed when a guest writes a guest book entry. The file that does this is attached. To date I have come up with the following code, taken from CB Contact component. The $useCBCaptcha is a variable defined earlier as Akobook has a number of security options built in by Cedric Walter already.

[code:1] if ($useCBCaptcha) {

echo "<TR> <TD colspan = 3>";

global $_PLUGINS;

$_CB_joomla_adminpath = $mainframe->getCfg( 'absolute_path' ). "/administrator";
$_CB_adminpath = $_CB_joomla_adminpath. "/components/com_comprofiler";

include_once($_CB_adminpath."/ue_config.php" );
include_once($_CB_adminpath."/plugin.class.php"«»);
include_once($_CB_adminpath."/comprofiler.class.php"«»);
include_once($_CB_adminpath."/imgToolbox.class.php"«»);

$UElanguagePath = $mainframe->getCfg( 'absolute_path' ).'/components/com_comprofiler/plugin/language';
$UElanguage = $mainframe->getCfg( 'lang' );

if ( ! file_exists( $UElanguagePath . '/' . $mosConfig_lang . '/' . $mosConfig_lang . '.php' ) ) {
$UElanguage = 'default_language';
}
include_once( $UElanguagePath . '/' . $UElanguage . '/' . $UElanguage . '.php' );

$results = null;

$_PLUGINS->loadPluginGroup('user');
$results = $_PLUGINS->trigger( 'onBeforeEmailToContactForm', array( (int) $contact->user_id, &$contact, $_CB_ui ));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"".$_PLUGINS->getErrorMSG()."\"«»); window.history.go(-1); </script>\n";
exit();
}
$warning = _UE_EMAILFORMWARNING;
$resultsAfter = $_PLUGINS->trigger( 'onAfterEmailToContactForm', array( (int) $contact->user_id, &$contact, $_CB_ui ));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"".$_PLUGINS->getErrorMSG()."\"«»); window.history.go(-1); </script>\n";
exit();
}

echo '<br />';
// Display Captcha
if ( is_array($resultsAfter) && ( implode( $resultsAfter ) ) ) {
echo implode( "<br />", $resultsAfter ) . '<br />';
}






echo "</TD></TR>";
}
[/code:1]

It shows the captcha OK, the sound works but I can not figure out how it is supposed to check the security code before it saves the entry.

Any help, advice, tips appreciated. Hopefully if it works here I can then repeat the process and get it to be incorporated into AkoComment when it becomes 1.5 native. I love these simple components that do one thing well and just add to your site. I want to incorporate the use of CB Captcha so I have a consistent look and I know it works well.

Even if it only works with Captcha 2 it might cause a few people to sign up :whistle::whistle:
:whistle:

Thanks all

Laurie

Attachment sub_writeentry.zip not found


Laurie
My Community Site: thelewisfamily.id.au
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.131 seconds

Facebook Twitter LinkedIn