Initial commit
This commit is contained in:
commit
43ad32700c
7085 changed files with 447606 additions and 0 deletions
61
modules/nickpage/nickpage.module.php
Normal file
61
modules/nickpage/nickpage.module.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
class module_nickpage extends admin_module{
|
||||
|
||||
function admin_panels(){
|
||||
//$panels=array(array("add_text","Text hinzufügen","page_add"),array("edit_text","Text editieren","page_edit"),array("group_only","Textkategorien"),array("addcategory_text","Kategorie hinzufügen","tag_blue_add"),array("editcategory_text","Kategorie editieren","tag_blue_edit"));
|
||||
//return $panels;
|
||||
}
|
||||
|
||||
function get_info(){
|
||||
$info["name"]="Nickpages";
|
||||
$info["file"]="nickpage";
|
||||
$info["author"]="astat";
|
||||
$info["version"]="1.0.0";
|
||||
$info["url"]="http://www.astat.org";
|
||||
return $info;
|
||||
}
|
||||
|
||||
function install(){
|
||||
global $config, $db;
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "nickpage` (
|
||||
`id` int(11) NOT NULL,
|
||||
`np_text` text NOT NULL,
|
||||
`np_link1` varchar(130) NOT NULL,
|
||||
`np_link2` varchar(130) NOT NULL,
|
||||
`np_link3` varchar(130) NOT NULL,
|
||||
`np_link4` varchar(130) NOT NULL,
|
||||
`np_picture` varchar(45) NOT NULL,
|
||||
`np_mood` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);");
|
||||
$db->query("INSERT INTO `" . $config["prefix"] . "nickpage` (`id`) SELECT `uid` FROM `" . $config["prefix"] . "users`");
|
||||
$db->query("CREATE VIEW `" . $config["prefix"] . "v_nickpage` AS SELECT * FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "nickpage` n ON n.`id`=u.`uid`");
|
||||
|
||||
mkdir ($_SERVER["DOCUMENT_ROOT"]."/np_images", 0777);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function uninstall(){
|
||||
global $config, $db;
|
||||
$db->query("DROP VIEW `" . $config["prefix"] . "v_nickpage` ");
|
||||
$db->query("DROP TABLE `" . $config["prefix"] . "nickpage`");
|
||||
@$this->recursive($_SERVER["DOCUMENT_ROOT"]."/np_images");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue