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 "

"; + $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 '

'.$entrytitle.'

'.$entry.'
'; + } + } + + echo '
' . $lang['guestbook']['newentry'] . ''; + +} + +function guestbook_page_site_newentry(){ +global $lang; + ?> +
+
+

+

+

+ +
+
+ + + + ', $title)) || (ereg('<', $email)) || (ereg('>', $email)) || (ereg('<', $description)) || (ereg('>', $description))) { ?> + + ', $description); + + $file=str_replace(" ", "_", $title); + $file=date ("dmY"). '-' . $file; + + $fp = fopen ('data/settings/modules/guestbook/new/' . $file . '.php',"w"); + fputs ($fp, '
". + $lang['guestbook']['mail_tit'].'
'.$title."
". + $lang['guestbook']['mail_dis'].'
'.$description."
". + $lang['guestbook']['mail_email'].'
'.$email.'
'; + + mail ($site_email,$lang['guestbook']['msubject'],$message,"From: ".$email." \n" . "Content-type: text/html; charset=utf-8"); + + echo $lang['guestbook']['wsend']; + + } + } + } + +} + + +?> diff --git a/images/icon.png b/images/icon.png new file mode 100755 index 0000000..b346953 Binary files /dev/null and b/images/icon.png differ diff --git a/lang/en.php b/lang/en.php new file mode 100755 index 0000000..b7c1a71 --- /dev/null +++ b/lang/en.php @@ -0,0 +1,32 @@ +