diff --git a/guestbook.admin.php b/guestbook.admin.php new file mode 100755 index 0000000..9242686 --- /dev/null +++ b/guestbook.admin.php @@ -0,0 +1,114 @@ + 'Main', + 'title' => $lang['guestbook']['main'] + ); + $module_page_admin[] = array( + 'func' => 'activate', + 'title' => $lang['guestbook']['adminpage'] + ); + + return $module_page_admin; +} + +function guestbook_page_admin_Main() { + global $lang; + + showmenudiv($lang['guestbook']['adminpage'],$lang['guestbook']['adminpage'],'data/image/note.png','admin.php?module=guestbook&page=activate',false); + + if (!file_exists('data/settings/modules/guestbook')) { + mkdir('data/settings/modules/guestbook', 0775, true); + } + + if (!file_exists('data/settings/modules/guestbook/new')) { + mkdir('data/settings/modules/guestbook/new', 0775, true); + } + + if (isset($_GET['delete'])) { + unlink ('data/settings/modules/guestbook/'.$_GET['delete']); + echo $file . $lang['guestbook']['deleted']; + redirect ('?module=guestbook','0'); + } + + $dir = opendir('data/settings/modules/guestbook/'); + while (false !== ($file = readdir($dir))) { + if(($file !== ".") and ($file !== "..") and ($file != "new")) { + include ('data/settings/modules/guestbook/'.$file); + echo ' +
'; + + } + } + +} + +function guestbook_page_admin_activate(){ + global $lang; + showmenudiv($lang['guestbook']['backlink'],false,'data/image/restore.png','?module=guestbook',false); + + $dir = opendir('data/settings/modules/guestbook/new/'); + while (false !== ($file = readdir($dir))) { + if(($file !== ".") and ($file !== "..")) { + include ('data/settings/modules/guestbook/new/'.$file); + echo ' + '; + } + } + + if (isset($_GET['delete'])) { + unlink ('data/settings/modules/guestbook/new/' . $_GET['delete']); + echo $file . $lang['guestbook']['deleted']; + redirect('?module=guestbook','0'); + } + + if (isset($_GET['activate'])) { + copy('data/settings/modules/guestbook/new/'.$_GET['activate'],'data/settings/modules/guestbook/'.$_GET['activate']); + unlink ('data/settings/modules/guestbook/new/'.$_GET['activate']); + redirect('?module=guestbook&page=activate','0'); + } + +} + + +?> diff --git a/guestbook.php b/guestbook.php new file mode 100755 index 0000000..465f1cd --- /dev/null +++ b/guestbook.php @@ -0,0 +1,24 @@ + $lang['guestbook']['name'], + 'intro' => $lang['guestbook']['intro'], + 'version' => '0.1', + 'author' => $lang['guestbook']['author'], + 'website' => 'http://xobit.nl', + 'icon' => 'images/icon.png', + 'compatibility' => '4.7' + ); + return $module_info; +} + +?> diff --git a/guestbook.site.php b/guestbook.site.php new file mode 100755 index 0000000..7fb64c9 --- /dev/null +++ b/guestbook.site.php @@ -0,0 +1,111 @@ + 'Main', + 'title' => $lang['guestbook']['main'] + ); + $module_page_admin[] = array( + 'func' => 'newentry', + 'title' => $lang['guestbook']['newentry'] + ); + + return $module_page_admin; +} + +function guestbook_theme_Main() { + global $lang; + + if (!file_exists('data/settings/modules/guestbook')) { + mkdir('data/settings/modules/guestbook', 0775, true); + } + + if (!file_exists('data/settings/modules/guestbook/new')) { + mkdir('data/settings/modules/guestbook/new', 0775, true); + } + echo "