Project

General

Profile

« Previous | Next » 

Revision 596

Added by thorn almost 17 years ago

added new CAPTCHA and ASP (Advanced Spam Protection)

View differences:

upgrade-script.php
61 61
 */
62 62
function db_add_search_key_value($key, $value) {
63 63
	global $database; global $OK; global $FAIL;
64
	$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = '$key' LIMIT 1");
64
	$table = TABLE_PREFIX.'search';
65
	$query = $database->query("SELECT value FROM $table WHERE name = '$key' LIMIT 1");
65 66
	if($query->numRows() > 0) {
66 67
		echo "$key: allready there. $OK.<br />";
67 68
		return true;
68 69
	} else {
69
		$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('$key', '$value', '')");
70
		$database->query("INSERT INTO $table (name,value,extra) VALUES ('$key', '$value', '')");
70 71
		echo mysql_error()?mysql_error().'<br />':'';
71
		$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = '$key' LIMIT 1");
72
		$query = $database->query("SELECT value FROM $table WHERE name = '$key' LIMIT 1");
72 73
		if($query->numRows() > 0) {
73 74
			echo "$key: $OK.<br />";
74 75
			return true;
......
349 350
	
350 351
}
351 352

  
353
/**********************************************************
354
 *  - asp - Advanced Spam Protection
355
 */
356
echo "<br /><u>Adding table mod_captcha_control</u><br />";
357
$table = TABLE_PREFIX.'mod_captcha_control';
358
$database->query("DROP TABLE IF EXISTS `$table`");
359
$database->query("CREATE TABLE `$table` (
360
	`enabled_captcha` VARCHAR(1) NOT NULL DEFAULT '1',
361
	`enabled_asp` VARCHAR(1) NOT NULL DEFAULT '1',
362
	`captcha_type` VARCHAR(255) NOT NULL DEFAULT 'calc_text',
363
	`asp_session_min_age` INT(11) NOT NULL DEFAULT '20',
364
	`asp_view_min_age` INT(11) NOT NULL DEFAULT '10',
365
	`asp_input_min_age` INT(11) NOT NULL DEFAULT '5'
366
	)"
367
);
368
$database->query("
369
	INSERT INTO `$table`
370
		(`enabled_captcha`, `enabled_asp`, `captcha_type`)
371
	VALUES
372
		('1', '1', 'calc_text')
373
");
352 374

  
353 375

  
354 376
//******************************************************************************

Also available in: Unified diff