From b50897cb0fdf0d42d306b20b8e38f19f8e2832e3 Mon Sep 17 00:00:00 2001 From: jimmacfx Date: Tue, 14 Feb 2006 20:52:54 +0000 Subject: add sqlite hooks git-svn-id: https://forgesvn1.novell.com/svn/original/trunk@9 4fa712ea-3c06-0410-9261-c11b4c06c003 --- www/inc/www.class.inc.php | 145 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) (limited to 'www/inc/www.class.inc.php') diff --git a/www/inc/www.class.inc.php b/www/inc/www.class.inc.php index 2206382..27683cc 100644 --- a/www/inc/www.class.inc.php +++ b/www/inc/www.class.inc.php @@ -188,7 +188,150 @@ class C_www { echo "\n"; } - + + function navigation ($gallery, $snapshot, $image) { + global $gallery_dir, $root, $ThisScript, $textnav, $img, + $show_thumbs, $exif_style, $PNthumbScale; + + $next = $snapshot + 1; + $prev = $snapshot - 1; + + if (!$image) { // this will render a navigation bar - max 3 buttons + echo "\n
\n"; + echo "
\n"; + if ($snapshot > 1) { //previous + echo ""; + echo "< Previous\n"; + } + echo " "; + if (is_file("$gallery_dir/$gallery/lq/img-$next.jpg")) { //next + echo ""; + echo "Next >\n"; + } + echo "
\n
\n"; + } elseif ($image=="prev") { //previous thumbnail + if ($snapshot > 1) { //previous + echo "
"; + echo ""; + if (file_exists("$gallery_dir/$gallery/thumbs/img-$prev.png")) { + $Pthumb = "$gallery_dir/$gallery/thumbs/img-$prev.png"; + } else { + $Pthumb = "$gallery_dir/$gallery/thumbs/img-$prev.jpg"; + } + $v = getimagesize("$root/$Pthumb"); + echo "\"Previous\""; + echo "
" . __('Previous'); + echo "
\n"; + } + } else { //next thumbnail + if (is_file("$gallery_dir/$gallery/lq/img-$next.jpg")) { + echo "
"; + echo ""; + if (file_exists("$gallery_dir/$gallery/thumbs/img-$next.png")) { + $Nthumb = "$gallery_dir/$gallery/thumbs/img-$next.png"; + } else { + $Nthumb = "$gallery_dir/$gallery/thumbs/img-$next.jpg"; + } + $v = getimagesize("$root/$Nthumb"); + echo "\"Next\""; + //echo "
Next"; + echo "
" . __('Next') ; + echo "
\n"; + } + } + } + + function user_comments($photo) { + global $root, $gallery_dir, $galerie, $comments, $picture; + + if ($comments) { + if (is_writable("$root/$gallery_dir/$galerie/comments")) { // needs perms + require("inc/comment_form.inc.php"); + + if ($picture->comments) { + print "
"; + print $picture->comments; + print "
"; + } + } else { + print "\n"; + } + } + } + + function process_comment_form() { // processing of the user comment data + global $comments, $root, $gallery_dir, $galerie, $snimek; + + if($comments && @$_POST["commentdata"]) { + $username = @$_COOKIE["username"]; + $comment_name = @$_POST["commentname"]; + $save_comment_name = @$_POST["savecommentname"]; + $comment_data = @$_POST["commentdata"]; + $comment_kolacek = @$_POST["commentkolacek"]; + $comment_spamcheck = @$_POST["commentspamcheck"]; + + #check for HTML tags + + $comment_name = stripslashes(strip_tags($comment_name)); + $allowedTags = '