Ejemplo n.º 1
0
function faucet_get_captcha($SETTINGS)
{
    if ($SETTINGS->get("use_captcha")) {
        //Settings to pass to captcha functions
        $captcha_config = array();
        //Load Captcha HTML
        if ($SETTINGS->get("captcha") == "simple-captcha") {
            //Load simple captcha library
            $simplecaptcha = './libraries/simple-captcha/simple-php-captcha.php';
            require_once $simplecaptcha;
            $captcha_config['session_name'] = $SETTINGS->config["captcha_config"]["simple_captcha_session_name"];
            @session_name($captcha_config['session_name']);
            @session_start();
            $_SESSION['captcha'] = simple_php_captcha($captcha_config);
            // set a new CAPTCHA
            return isset($_SESSION['captcha']) ? '<img src="' . $simplecaptcha . $_SESSION['captcha']["image_request"] . '" alt="[captcha]"/>' : '';
        } elseif ($SETTINGS->get("captcha") == "solvemedia") {
            //Load solvemedia library
            require_once './libraries/solvemedialib.php';
            $captcha_config['solvemedia_challenge_key'] = $SETTINGS->config["captcha_config"]["solvemedia_challenge_key"];
            return solvemedia_get_html($captcha_config["solvemedia_challenge_key"]);
        } elseif ($SETTINGS->get("captcha") == "recaptcha") {
            //Load re-captcha library
            require_once './libraries/recaptchalib.php';
            $captcha_config['recpatcha_public_key'] = $SETTINGS->config["captcha_config"]["recpatcha_public_key"];
            return recaptcha_get_html($captcha_config["recpatcha_public_key"]);
        }
    } else {
        return '';
        //Emtpy
    }
}
Ejemplo n.º 2
0
 /**
  * Add captcha
  * ...
  * @return the form
  */
 public function action_form_comment($form, $context = 'public')
 {
     $solvemedia_options = "<script type='text/javascript'>var ACPuzzleOptions = {\n\t\t\ttabindex: {$form->cf_submit->tabindex},\n\t\t\ttheme: '" . Options::get('solvemedia__theme', 'white') . "',\n\t\t\tlang: '" . Options::get('solvemedia__lang', _t('en', 'solvemedia')) . "',\n\t\t\tsize: '" . Options::get('solvemedia__dims', '300x100') . "' };</script> ";
     $form->append('static', 'solvemedia_captcha', $solvemedia_options . solvemedia_get_html(Options::get('solvemedia__ckey')));
     $form->solvemedia_captcha->add_validator(array($this, 'validate_captcha'));
     $form->move_before($form->solvemedia_captcha, $form->cf_submit);
     $form->cf_submit->tabindex = $form->cf_submit->tabindex + 1;
     // ideally we get the captcha tabindex between content and this.
     return $form;
 }
Ejemplo n.º 3
0
     if ($captcha['available']) {
         $captcha['selected'] = $captcha['available'][0];
     }
     if (in_array($data['default_captcha'], $captcha['available'])) {
         $captcha['selected'] = $data['default_captcha'];
     } else {
         if ($captcha['available']) {
             $captcha['selected'] = $captcha['available'][0];
         }
     }
 }
 #MuliCaptcha: And finally handle chosen captcha system
 switch ($captcha['selected']) {
     case 'SolveMedia':
         require_once "libs/solvemedialib.php";
         $data["captcha"] = solvemedia_get_html($data["solvemedia_challenge_key"], null, is_ssl());
         if (array_key_exists('address', $_POST)) {
             $resp = solvemedia_check_answer($data['solvemedia_verification_key'], getIP(), array_key_exists('adcopy_challenge', $_POST) ? $_POST['adcopy_challenge'] : '', array_key_exists('adcopy_response', $_POST) ? $_POST['adcopy_response'] : '', $data["solvemedia_auth_key"]);
             $data["captcha_valid"] = $resp->is_valid;
         }
         break;
     case 'reCaptcha':
         $data["captcha"] = str_replace('<:: your_site_key ::>', $data["recaptcha_public_key"], $recaptcha_template);
         if (array_key_exists('address', $_POST)) {
             $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . $data["recaptcha_private_key"] . '&response=' . (array_key_exists('g-recaptcha-response', $_POST) ? $_POST["g-recaptcha-response"] : '') . '&remoteip=' . getIP();
             $resp = json_decode(file_get_contents($url), true);
             $data['captcha_valid'] = $resp['success'];
         }
         break;
     case 'AreYouAHuman':
         require_once "libs/ayahlib.php";
Ejemplo n.º 4
0
                                Fifth
                            </option>
                        </select></td>

                        <td></td>
                    </tr>

                    <tr>
                        <td><label for="file">Profile Picture :</label></td>

                        <td><input type="file" name="file" id="file" /></td>
                    </tr>

                    <tr>
                        <td colspan="2"><?php 
echo solvemedia_get_html("qjmGRXOO9Bq7AfRhBy22ue7pPkcBCGIH");
//outputs the widget
?>
</td>
                    </tr>

                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>

                    <tr>
                        <td colspan="2" align="center"><input type="submit" value="Register" /></td>
                    </tr>
                </table>
            </form>
Ejemplo n.º 5
0
 function form_addguest($extra_html = '', $new_hash = 0, $an_error = 0)
 {
     global $GB_PG, $_COOKIE;
     $LANG =& $this->db->LANG;
     $VARS =& $this->db->VARS;
     if ($an_error === 1 && get_magic_quotes_gpc()) {
         $this->strip_all_slashes();
     }
     $this->icq = intval($this->icq) === 0 ? '' : $this->icq;
     $antispam = $this->db->VARS['antispam_word'];
     $HTML_CODE = $this->db->VARS['allow_html'] == 1 ? $this->db->LANG['BookMess2'] : $this->db->LANG['BookMess1'];
     if (isset($_COOKIE['lang']) && !empty($_COOKIE['lang']) && file_exists($this->include_path . '/lang/codes-' . $_COOKIE['lang'] . '.php')) {
         $LANG_CODES = $GB_PG[base_url] . '/lang/codes-' . $_COOKIE['lang'] . '.php';
     } elseif (file_exists($this->include_path . '/lang/codes-' . $VARS['lang'] . '.php')) {
         $LANG_CODES = $GB_PG['base_url'] . '/lang/codes-' . $VARS['lang'] . '.php';
     } else {
         $LANG_CODES = $GB_PG['base_url'] . '/lang/codes-english.php';
     }
     $AG_CODE = $this->db->VARS['agcode'] == 1 ? '<a href="' . $LANG_CODES . '?show=agcode" onclick="openCentered(\'' . $LANG_CODES . '?show=agcode\',\'_codes\',640,450,\'scrollbars=yes\'); return false;" target="_codes">' . $this->db->LANG['FormMess3'] . '</a>' : $this->db->LANG['FormMess6'];
     if ($this->db->VARS['smilies'] == 1) {
         $SMILE_CODE = $this->db->LANG['FormMess2'];
         $SMILEYS = '';
         $LAZSMILEYS = $this->db->generate_smilies();
     } else {
         $SMILE_CODE = $this->db->LANG['FormMess7'];
         $LAZSMILEYS = '';
     }
     $EXTRAJS = '';
     $EMAILJS = '';
     $BOTTEST = '';
     $EMAILREQ = '';
     $EMAILDISPLAYED = $this->db->VARS['require_email'] > 2 ? $LANG['FormEmailDisplay'] : '';
     if ($this->db->VARS['require_email'] == 1 || $this->db->VARS['require_email'] == 4) {
         $EXTRAJS .= " document.book.gb_email.value=trim(document.book.gb_email.value);\nif(document.book.gb_email.value == \"\") {\n    errorStyling('gb_email');\n    errorMessages[errorNum++] = \"" . $LANG['ErrorPost12'] . "\";\n }";
         $EMAILREQ = '*';
     }
     //$this->strip_all_slashes();
     $OPTIONS[] = '';
     if ($this->db->VARS['require_email'] != 2) {
         eval("\$OPTIONS['email'] = \"" . $this->template->get_template('form_email') . "\";");
     }
     if ($this->db->VARS['allow_loc'] == 1) {
         eval("\$OPTIONS['location'] = \"" . $this->template->get_template('form_loc') . "\";");
     }
     if ($this->db->VARS['allow_url'] == 1) {
         eval("\$OPTIONS['url'] = \"" . $this->template->get_template('form_url') . "\";");
     }
     if ($this->db->VARS['allow_icq'] == 1) {
         $this->icq = $this->icq === 0 ? '' : $this->icq;
         eval("\$OPTIONS['icq'] = \"" . $this->template->get_template('form_icq') . "\";");
     }
     if ($this->db->VARS['allow_aim'] == 1) {
         eval("\$OPTIONS['aim'] = \"" . $this->template->get_template('form_aim') . "\";");
     }
     if ($this->db->VARS['allow_yahoo'] == 1) {
         eval("\$OPTIONS['yahoo'] = \"" . $this->template->get_template('form_yahoo') . "\";");
     }
     if ($this->db->VARS['allow_skype'] == 1) {
         eval("\$OPTIONS['skype'] = \"" . $this->template->get_template('form_skype') . "\";");
     }
     if ($this->db->VARS['allow_msn'] == 1) {
         eval("\$OPTIONS['msn'] = \"" . $this->template->get_template('form_msn') . "\";");
     }
     if ($this->db->VARS['allow_gender'] == 1) {
         $ourgender = array('f' => '', 'm' => '', 'x' => '');
         if (!empty($extra_html) && !empty($this->gender)) {
             $ourgender[$this->gender] = ' checked';
         } else {
             $ourgender['x'] = ' checked';
         }
         eval("\$OPTIONS['gender'] = \"" . $this->template->get_template('form_gender') . "\";");
     }
     if ($this->db->VARS['allow_img'] == 1) {
         if (!empty($extra_html) && !empty($this->image_file)) {
             eval("\$OPTIONS['img'] = \"" . $this->template->get_template('form_image_prev') . "\";");
         } else {
             eval("\$OPTIONS['img'] = \"" . $this->template->get_template('form_image') . "\";");
         }
     }
     $TIMEHASH = !empty($extra_html) && $new_hash == 0 ? $this->timehash : $this->db->generate_timehash();
     $footerJS = '';
     $PRIVATE = '';
     $PRIVATE .= $this->db->VARS['allow_private'] == 1 ? '<input type="checkbox" name="gb_private" value="1" /> <font size="1" face="' . $VARS['font_face'] . '">' . $LANG['FormPriv'] . '</font>' : '';
     if ($this->db->VARS['honeypot'] == 1) {
         $PRIVATE .= '<span id="gb_username"><input type="checkbox" name="gb_username" value="1" /> Spammer?<br /></span>';
         $footerJS .= "document.getElementById('gb_username').style.display = 'none';\n";
     }
     $PRIVATE .= '<input type="hidden" name="gb_timehash" value="' . $TIMEHASH . '" />';
     $OPTIONAL = implode("\n", $OPTIONS);
     if ($this->db->VARS['antibottest'] == 1) {
         $EXTRAJS .= " document.book.gb_bottest.value=trim(document.book.gb_bottest.value);\n if(document.book.gb_bottest.value == \"\") {\n    errorStyling('gb_bottest');\n    errorMessages[errorNum++] = \"" . $LANG['ErrorPost13'] . "\";\n }";
         $bot_question = get_magic_quotes_gpc() ? stripslashes($this->db->VARS['bottestquestion']) : $this->db->VARS['bottestquestion'];
         eval("\$BOTTEST .= \"" . $this->template->get_template('form_bots') . "\";");
     } elseif ($this->db->VARS['antibottest'] == 2) {
         if ($this->db->VARS['solve_media'] == 1) {
             $EXTRAJS .= " document.book.adcopy_response.value=trim(document.book.adcopy_response.value);\n if(document.book.adcopy_response.value == \"\") {\n    errorStyling('adcopy_response');\n    errorMessages[errorNum++] = \"" . $LANG['ErrorPost13'] . "\";\n }";
             require_once LAZ_INCLUDE_PATH . '/solvemedialib.php';
             //include the Solve Media library
             $SolveMedia = solvemedia_get_html('G8vem0b2VDBXju20c9OwHO7makkjC9-o');
             //outputs the widget
             eval("\$BOTTEST .= \"" . $this->template->get_template('form_captcha2') . "\";");
         } else {
             $EXTRAJS .= " document.book.gb_bottest.value=trim(document.book.gb_bottest.value);\n if(document.book.gb_bottest.value == \"\") {\n    errorStyling('gb_bottest');\n    errorMessages[errorNum++] = \"" . $LANG['ErrorPost13'] . "\";\n }";
             eval("\$BOTTEST .= \"" . $this->template->get_template('form_captcha') . "\";");
             $footerJS .= "document.getElementById('captchaReload').style.display = 'block';\nreloadCaptcha();";
         }
     }
     $display_tags = $this->db->create_buttons($LANG_CODES);
     $addform_html = '';
     eval("\$addform_html = \"" . $this->template->get_template('header') . "\";");
     eval("\$addform_html .= \"" . $this->template->get_template('form') . "\";");
     eval("\$addform_html .= \"" . $this->template->get_template('footer') . "\";");
     return $addform_html;
 }
Ejemplo n.º 6
0
     $smarty->assign('inproccess', 1);
 }
 if ($_SESSION['error']['nowallet']) {
     $smarty->assign('nobtc', 1);
 }
 if ($timer) {
     $smarty->assign('succ', $_SESSION['user']['succ']);
     $smarty->assign('amount', $_SESSION['user']['amount']);
     $smarty->assign('wallet', $_SESSION['user']['wallet']);
 }
 if ($_SESSION['error']['capt']) {
     $smarty->assign('captcha', 1);
 }
 unset($_SESSION['error']);
 $smarty->assign('ads_1', $ads_1);
 $smarty->assign('captcha_box', solvemedia_get_html($privkey));
 $smarty->assign('ads_2', $ads_2);
 $smarty->assign('wll', $_COOKIE['w']);
 $smarty->assign('title', $sitetitle);
 $smarty->assign('favicon', $favicon);
 $smarty->assign('domainname', $domainname);
 $smarty->assign('ads_left', $ads_left);
 $smarty->assign('ads_right', $ads_right);
 $smarty->assign('ads_main_top', $ads_main_top);
 $smarty->assign('ads_main_bottom', $ads_main_bottom);
 $smarty->assign('ref_percent', $ref_percent);
 $db->queryres("select prize from tbl_prize order by prize asc limit 1 ");
 $smarty->assign('prize_min', $db->res['prize']);
 $db->queryres("select prize from tbl_prize order by prize desc limit 1 ");
 $smarty->assign('prize_max', $db->res['prize']);
 $smarty->assign('globalboxalert', $globalboxalert);
Ejemplo n.º 7
0
                        <td><label for="file">Facebook Profile Picture :</label></td>

                        <td><img style="border-radius: 155px;" src="' . $imageURL . '" width="160" height="150"/></td>
                    </tr>';
}
?>
								 <script type="text/javascript">
										var ACPuzzleOptions = {
														tabindex:   11,
														lang:     'en'
										};
								</script>

                                <tr>
                                    <td colspan="2"><?php 
echo solvemedia_get_html("Yzv8vDKv1wEDtfGHAkHJvvXsJa4YcWm5");
//outputs the widget
?>
</td>
                                </tr>

                                <tr>
                                    <td colspan="2">&nbsp;</td>
                                </tr>

                                <tr>
                                    <td colspan="2" align="center"><input type="submit" value="SIGNUP"></td>
                                </tr>
                            </table>
                        </form>
                </div>
Ejemplo n.º 8
0
 protected function _solvemedia($get_api = false)
 {
     require_once $this->fw->get('ROOT') . '/captcha_lib/solvemedialib.php';
     if (!$get_api) {
         $captcha = solvemedia_get_html($this->site_settings['faucet_solvemedia_challenge_key'], null, $ssl = $this->is_ssl());
         return $captcha;
         //bail early
     }
     $this->resp = solvemedia_check_answer($this->site_settings['faucet_solvemedia_verification_key'], $this->fw->get('IP'), $this->fw->get('POST.adcopy_challenge'), $this->fw->get('POST.adcopy_response'), $this->site_settings['faucet_solvemedia_auth_key']);
     return $this->resp->is_valid;
 }
Ejemplo n.º 9
0
function spb_recaptcha_add_SolveMedia_Script()
{
    $challengeKey = yourls_get_option('spb_recaptcha_solvemediaCKey', "");
    if (!(yourls_is_valid_user() === true)) {
        require_once dirname(__FILE__) . "/solvemedialib.php";
        //include the Solve Media library
        echo solvemedia_get_html($challengeKey);
        //outputs the widget
    }
    echo "<input type='hidden' id='spb_recaptcha_captchatype' name='spb_recaptcha_captchatype' value='solvemedia'/>";
}
Ejemplo n.º 10
0
</head>
<body>
<?php 
if ($success) {
    ?>
<script type="text/javascript">
var d = new Date();
d.setTime(d.getTime()+(24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = "captcha=1; " + expires;
window.parent.save();
</script>
<?php 
} else {
    ?>
<p>To continue, please verify that you're a human and not a computer:</p>
<form action="" method="post">
<div id="captcha_container">
<div id="captcha_alternate">
1330 + 7 = <input type="text" name="adcopy_response" value="" />
</div>
<?php 
    echo solvemedia_get_html($settings['k_c']);
    ?>
</div>
<input type="submit" value="Save" />
</form>
<?php 
}
?>
</html>
Ejemplo n.º 11
0
 function comment_form($extra_html = '')
 {
     global $GB_PG, $gbsession, $rid, $uid, $included;
     //, $include_path;
     if ($this->db->VARS['disablecomments'] != 1 && (!empty($_GET['gbsession']) && !empty($_GET['uid']))) {
         $GB_PG['comment'] = $GB_PG['comment'] . '?gbsession=' . $gbsession . '&amp;rid=' . $rid . '&amp;uid=' . $uid . '&amp;included=' . $included;
     }
     $this->db->query("SELECT x.*, y.p_filename, y.width, y.height, z.comments from " . LAZ_TABLE_PREFIX . "_data x left join " . LAZ_TABLE_PREFIX . "_pics y on (x.id=y.msg_id and y.book_id=2) left join " . LAZ_TABLE_PREFIX . "_com z on (x.id=z.id) WHERE (x.accepted='1' AND x.id=" . $this->id . ") LIMIT 1");
     $row = $this->db->fetch_array($this->db->result);
     $LANG =& $this->db->LANG;
     $VARS =& $this->db->VARS;
     if (isset($_COOKIE['lang']) && !empty($_COOKIE['lang']) && file_exists(LAZ_INCLUDE_PATH . '/lang/codes-' . $_COOKIE['lang'] . '.php')) {
         $LANG_CODES = $GB_PG['base_url'] . '/lang/codes-' . $_COOKIE['lang'] . '.php';
     } elseif (file_exists(LAZ_INCLUDE_PATH . '/lang/codes-' . $VARS['lang'] . '.php')) {
         $LANG_CODES = $GB_PG['base_url'] . '/lang/codes-' . $VARS['lang'] . '.php';
     } else {
         $LANG_CODES = $GB_PG['base_url'] . '/lang/codes-english.php';
     }
     $antispam = $this->db->VARS['antispam_word'];
     $HTML_CODE = $this->db->VARS['allow_html'] == 1 ? $this->db->LANG['BookMess2'] : $this->db->LANG['BookMess1'];
     $AG_CODE = $this->db->VARS['agcode'] == 1 ? '<a href="' . $LANG_CODES . '?show=agcode" onclick="openCentered(\'' . $LANG_CODES . '?show=agcode\',\'_codes\',640,450,\'scrollbars=yes\')" target="_codes">' . $this->db->LANG['FormMess3'] . '</a>' : $this->db->LANG['FormMess6'];
     $SMILE_CODE = $this->db->VARS['smilies'] == 1 ? $this->db->LANG['FormMess2'] : $this->db->LANG['FormMess7'];
     $DATE = $this->db->DateFormat($row['date']);
     $MESSAGE = nl2br($row['comment']);
     $id = $this->id;
     $bgcolor = $this->db->VARS['tb_color_1'];
     $COMMENT = '';
     if ($row['p_filename'] && preg_match('/^img-/', $row['p_filename'])) {
         $img = new gb_image();
         $img->set_border_size($this->db->VARS['img_width'], $this->db->VARS['img_height']);
         $new_img_size = $img->get_img_size_format($row['width'], $row['height']);
         $row['p_filename2'] = $row['p_filename'];
         $GB_UPLOAD = 'public';
         if (file_exists($this->path . '/public/t_' . $row['p_filename'])) {
             $row['p_filename2'] = 't_' . $row['p_filename2'];
         }
         eval("\$USER_PIC = \"" . $this->template->get_template('user_pic') . "\";");
     } else {
         $USER_PIC = '';
     }
     $row['name'] = $this->db->CensorBadWords($row['name']);
     $MESSAGE = $this->db->CensorBadWords($MESSAGE);
     if ($this->db->VARS['smilies'] == 1) {
         $MESSAGE = $this->db->emotion($MESSAGE);
         $LAZSMILEYS = $this->db->generate_smilies();
     } else {
         $LAZSMILEYS = '';
     }
     if ($row['url'] && $this->db->VARS['allow_url'] == 1) {
         $row['url'] = $this->db->CensorBadWords($row['url']);
         eval("\$URL = \"" . $this->template->get_template('url') . "\";");
     } else {
         $URL = '';
     }
     if ($row['location'] && $this->db->VARS['allow_loc'] == 1) {
         $row['location'] = $this->db->CensorBadWords($row['location']);
         $THEIRLOC = urlencode($row['location']);
         eval("\$LOCATION = \"" . $this->template->get_template('location') . "\";");
     } else {
         $LOCATION = '';
     }
     if ($row['icq'] && $this->db->VARS['allow_icq'] == 1 && $row['icq'] != 0) {
         eval("\$ICQ = \"" . $this->template->get_template('icq') . "\";");
     } else {
         $ICQ = '';
     }
     if ($row['aim'] && $this->db->VARS['allow_aim'] == 1) {
         eval("\$AIM = \"" . $this->template->get_template('aim') . "\";");
     } else {
         $AIM = '';
     }
     if ($row['msn'] && $this->db->VARS['allow_msn'] == 1) {
         eval("\$MSN = \"" . $this->template->get_template('msn') . "\";");
     } else {
         $MSN = '';
     }
     if ($row['yahoo'] && $this->db->VARS['allow_yahoo'] == 1) {
         eval("\$YAHOO = \"" . $this->template->get_template('yahoo') . "\";");
     } else {
         $YAHOO = '';
     }
     if ($row['skype'] && $this->db->VARS['allow_skype'] == 1) {
         eval("\$SKYPE = \"" . $this->template->get_template('skype') . "\";");
     } else {
         $SKYPE = '';
     }
     if ($row['email']) {
         $GRAVATAR = $this->db->VARS['use_gravatar'] == 1 ? ' background: transparent url(http://www.gravatar.com/avatar/' . md5($row['email']) . '?s=24&amp;d=wavatar&amp;r=G) no-repeat right;' : '';
         if ($this->db->VARS['require_email'] < 2) {
             $row['email'] = $this->db->CensorBadWords($row['email']);
             if ($this->db->VARS['encrypt_email'] == 1) {
                 $MAILTO = $this->db->html_encode('mailto:' . $row['email']);
             } else {
                 $MAILTO = 'mailto:' . $row['email'];
             }
             eval("\$EMAIL = \"" . $this->template->get_template('email') . "\";");
         } else {
             $EMAIL = '';
         }
     } else {
         $GRAVATAR = '';
         $EMAIL = '';
     }
     if ($this->db->VARS['allow_gender'] == 1) {
         if ($row['gender'] == 'f') {
             eval("\$GENDER = \"" . $this->template->get_template('img_female') . "\";");
         } elseif ($row['gender'] == 'm') {
             eval("\$GENDER = \"" . $this->template->get_template('img_male') . "\";");
         } else {
             $GENDER = '';
         }
     } else {
         $GENDER = '';
     }
     if ($this->db->VARS['show_ip'] == 1) {
         $hostname = preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $row['host']) ? 'IP' : 'Host';
         $HOST = '<em style="font-weight: normal;">' . $hostname . ': ' . $row['host'] . "</em>\n";
     } else {
         $HOST = '';
     }
     $TIMEHASH = $this->db->generate_timehash();
     $TimehashTag = '<input type="hidden" name="gb_timehash" value="' . $TIMEHASH . '" />';
     $EXTRAJS = '';
     $OPTIONS[] = '';
     $EMAILREQ = '';
     $EMAILDISPLAYED = $this->db->VARS['require_email'] > 2 ? $LANG['FormEmailDisplay'] : '';
     if ($this->db->VARS['require_email'] == 1 || $this->db->VARS['require_email'] == 4) {
         $EXTRAJS .= 'document.getElementById(\'gb_email\').value = trim(document.getElementById(\'gb_email\').value);
     if(document.getElementById(\'gb_email\').value == "") {
       errorStyling(\'gb_email\');
       errorMessages[errorNum++] = "' . $LANG['ErrorPost12'] . '";
     }';
         $EMAILREQ = '*';
     }
     $footerJS = '';
     if ($this->db->VARS['require_email'] != 2) {
         eval("\$OPTIONS['email'] = \"" . $this->template->get_template('form_email') . "\";");
     }
     if ($this->db->VARS['honeypot'] == 1) {
         $honeypot = '<br /><span id="gb_username"><input type="checkbox" name="gb_username" value="1" /> Spammer?</span><br />';
         $footerJS .= "document.getElementById('gb_username').style.display = 'none';\n";
     } else {
         $honeypot = '';
     }
     if ($this->db->VARS['need_pass'] == 1) {
         $com_question = '';
         if ($this->db->VARS['com_question'] != '') {
             $com_question = $this->db->VARS['com_question'] . "<br />\n";
             // This is a bit of a hack but means only editing this file and ot the template as well
             $LANG['FormPass'] = $LANG['FormBot'];
         }
         $EXTRAJS .= 'document.getElementById(\'gb_bottest\').value = trim(document.getElementById(\'gb_bottest\').value);
     if(document.getElementById(\'gb_bottest\').value == "") {
       errorStyling(\'gb_bottest\');
       errorMessages[errorNum++] = "' . $LANG['ErrorPost13'] . '";
     }';
         eval("\$OPTIONS['antibot'] = \"" . $this->template->get_template('com_pass') . "\";");
     } elseif ($this->db->VARS['need_pass'] == 2) {
         if ($this->db->VARS['solve_media'] == 1) {
             $EXTRAJS .= 'document.getElementById(\'adcopy_response\').value = trim(document.getElementById(\'adcopy_response\').value);
     if(document.getElementById(\'adcopy_response\').value == "") {
       errorStyling(\'adcopy_response\');
       errorMessages[errorNum++] = "' . $LANG['ErrorPost13'] . '";
     }';
             require_once LAZ_INCLUDE_PATH . '/solvemedialib.php';
             //include the Solve Media library
             $SolveMedia = solvemedia_get_html('G8vem0b2VDBXju20c9OwHO7makkjC9-o');
             //outputs the widget
             eval("\$OPTIONS['antibot'] = \"" . $this->template->get_template('form_captcha2') . "\";");
         } else {
             $EXTRAJS .= 'document.getElementById(\'gb_bottest\').value = trim(document.getElementById(\'gb_bottest\').value);
     if(document.getElementById(\'gb_bottest\').value == "") {
       errorStyling(\'gb_bottest\');
       errorMessages[errorNum++] = "' . $LANG['ErrorPost13'] . '";
     }';
             $footerJS .= "document.getElementById('captchaReload').style.display = 'block';\nreloadCaptcha();";
             eval("\$OPTIONS['antibot'] = \"" . $this->template->get_template('form_captcha') . "\";");
         }
     }
     $OPTIONAL = implode("\n", $OPTIONS);
     $GB_COMMENT = '#';
     $GB_ENTRY = '';
     $display_tags = $this->db->create_buttons($LANG_CODES);
     if ($row['comments']) {
         $coms = $this->db->query("SELECT * FROM " . LAZ_TABLE_PREFIX . "_com WHERE id='" . $this->id . "' AND comaccepted='1' order by com_id asc");
         while ($com = $this->db->fetch_array($coms)) {
             $COMDATE = $this->db->DateFormat($com['timestamp']);
             $comhostname = preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $com['host']) ? 'IP' : 'Host';
             $comhost = $this->db->VARS['show_ip'] == 1 ? '<i>' . $comhostname . ': ' . $com['host'] . "</i><br />\n" : '';
             $com['comments'] = $this->db->VARS['smilies'] == 1 ? nl2br($this->db->emotion($com['comments'])) : nl2br($com['comments']);
             $com['name'] = $this->db->CensorBadWords($com['name']);
             $com['comments'] = $this->db->CensorBadWords($com['comments']);
             $COMEMAIL = '';
             $COMGRAVATAR = '';
             $template['com_email'] = $this->template->get_template('com_email');
             if (!empty($com['email'])) {
                 $COMGRAVATAR = $this->db->VARS['use_gravatar'] == 1 ? 'padding-left:26px;background: url(http://www.gravatar.com/avatar/' . md5($com['email']) . '?s=24&amp;d=wavatar&amp;r=G) no-repeat;' : '';
                 if ($this->db->VARS['require_email'] < 2) {
                     $template['com_email'] = $this->template->get_template('com_email');
                     $com['email'] = $this->db->CensorBadWords($com['email']);
                     if ($this->db->VARS['encrypt_email'] == 1) {
                         $COMMAILTO = $this->db->html_encode('mailto:' . $com['email']);
                     } else {
                         $COMMAILTO = 'mailto:' . $com['email'];
                     }
                     eval("\$COMEMAIL = \"" . $template['com_email'] . "\";");
                 } else {
                     $COMEMAIL = '';
                 }
             }
             eval("\$COMMENT .= \"" . $this->template->get_template('com') . "\";");
         }
     }
     $theirbrowser = $this->db->browser_detect($row['browser']);
     $comment_html = '';
     $COMMENTLINK = '';
     $PERMALINK = '';
     eval("\$GB_ENTRY = \"" . $this->template->get_template('entry') . "\";");
     $GB_ENTRY .= $TimehashTag;
     eval("\$comment_html = \"" . $this->template->get_template('header') . "\";");
     eval("\$comment_html .= \"" . $this->template->get_template('comment') . "\";");
     eval("\$comment_html .= \"" . $this->template->get_template('footer') . "\";");
     return $comment_html;
 }