funchat/modules/captcha/captcha.module.php

92 lines
2.5 KiB
PHP
Raw Normal View History

2025-06-02 10:01:12 +02:00
<?php
class module_captcha extends admin_module{
function admin_panels(){
$panels=array(array("manage_captcha","Captcha verwalten","manage_captcha"));
return $panels;
}
function get_info(){
$info["name"]="Captcha Management";
$info["file"]="captcha";
$info["author"]="BeCast";
$info["version"]="1.0.0";
$info["url"]="http://www.becast.at";
return $info;
}
function install(){
global $config, $db;
$db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article` (
`id` int(11) NOT NULL auto_increment,
`text` text NOT NULL,
`date` int(11) NOT NULL default '0',
`author` int(11) NOT NULL default '0',
`eid` int(11) NOT NULL,
`edittime` int(11) NOT NULL,
`menue` int(11) NOT NULL default '0',
`title` varchar(80) NOT NULL default '',
`url` varchar(120) NOT NULL,
`rightnavi` enum('false','true') NOT NULL,
`active` enum('true','false') NOT NULL,
PRIMARY KEY (`id`),
KEY `author` (`author`),
KEY `menue` (`menue`),
KEY `eid` (`eid`)
) ENGINE=MyISAM");
$db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article_categorys` (
`id` int(11) NOT NULL auto_increment,
`categoryname` varchar(80) NOT NULL default '',
`picture` varchar(80) NOT NULL default '',
`active` enum('true','false') NOT NULL,
PRIMARY KEY (`id`),
KEY `active` (`active`)
) ENGINE=MyISAM");
$db->query("CREATE TABLE `" . $config["prefix"] . "article_category` (
`a_id` int(11) NOT NULL,
`c_id` int(11) NOT NULL,
KEY `a_id` (`a_id`),
KEY `c_id` (`c_id`)
) ENGINE=MyISAM");
$db->query("CREATE TABLE `" . $config["prefix"] . "article_menue` (
`id` int(11) NOT NULL auto_increment,
`sort` int(11) NOT NULL,
`name` text NOT NULL,
PRIMARY KEY (`id`),
KEY `sort` (`sort`)
) ENGINE=MyISAM");
mkdir ($_SERVER["DOCUMENT_ROOT"]."/catimages", 0777);
return TRUE;
}
function uninstall(){
global $config, $db;
$db->query("DROP TABLE `" . $config["prefix"] . "article`");
$db->query("DROP TABLE `" . $config["prefix"] . "article_categorys`");
$db->query("DROP TABLE `" . $config["prefix"] . "article_category`");
$db->query("DROP TABLE `" . $config["prefix"] . "article_menue`");
@$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages");
return TRUE;
}
function recursive($dest){
$list = array_diff(scandir($dest), array('.', '..'));
foreach ($list as $value) {
$file = $dest.'/'.$value;
if (is_dir($file)) {
recursive($file);
}else{
unlink($file);
}
}
return rmdir($dest);
}
}
?>