I cannot get my code set up to display for non registered users. Can you help me?
This is what it reads:
Somewhere I am missing some code or took the wrong thing out.
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2006 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.12
CAPTCHA Plugin
Based on Mod by Abbas ali(http://forum.coppermine-gallery.net/index.php?topic=29564.0)
Plugin Writen by bmossavari at gmail dot com
**********************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
// Add a filter for the gallery header
$thisplugin->add_filter('page_html','captcha_main');
// Add actions
$thisplugin->add_action('page_start','captcha_page_start');
// captcha function to modify gallery header html
function captcha_main($html) {
global $lang_display_comments, $lang_register_php, $lang_plugin_captcha_conf;
if(!USER_ID) {
if(preg_match($exper,$html)){
if(USER_ID) {
$newcpch = '<!-- CAPTCH PLUGIN --><input type="submit" class="comment_button" name="submit" id="submit" value="'.$lang_display_comments['OK'].'" /></td></tr><tr><td class="tableb_compact" colspan="2">'.$lang_plugin_captcha_conf.'</td><td class="tableb_compact" colspan="2"><input type="text" name="confirmCode" id="confirmCode" size="5" class="textinput"><img src="./plugins/captcha/captcha.php" align="middle">';
} else {
$newcpch = '<!-- CAPTCH PLUGIN --><input type="submit" class="comment_button" name="submit" id="submit" value="'.$lang_display_comments['OK'].'" /></td></tr><tr><td class="tableb_compact" >'.$lang_plugin_captcha_conf.'</td><td class="tableb_compact" ><input type="text" name="confirmCode" id="confirmCode" size="5" class="textinput"><td class="tableb_compact"><img src="./plugins/captcha/captcha.php" align="middle"></td><td class="tableb_compact" > </td><td class="tableb_compact" > </td>';
}
$html = preg_replace($exper,$newcpch,$html);
}
}
if(preg_match($exper,$html)){
$newcpch = '<!-- CAPTCH PLUGIN --><input type="hidden" value="captcha_check" id="reg_captcha" name="reg_captcha" /><tr><td class="tableb" height="25" width="40%">'.$lang_plugin_captcha_conf.'</td><td class="tableb_compact" colspan="2"><input type="text" name="confirmCode" id="confirmCode" size="5" class="textinput"><img src="./plugins/captcha/captcha.php" align="middle"></tr><tr><td colspan="2" align="center" class="tablef">
<input type="submit" name="submit" value="'.$lang_register_php['submit'].'" class="button" />
</td></tr>';
$html = preg_replace($exper,$newcpch,$html);
}
return $html;
}
function captcha_page_start()
{
global $lang_plugin_captcha_conf, $CONFIG;
require ('plugins/captcha/include/init.inc.php');
require('plugins/captcha/include/captcha.class.php');
if(!USER_ID) { {
load_template();
pageheader($lang_error);
cpg_die(ERROR, "$lang_plugin_captcha_error", __FILE__, __LINE__);
}
}
}
?>
Edit By Sami:
added code block to php code