From e9192b3d42660a5781101df4357d276318151e8a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 2 Aug 2013 17:14:41 -0500 Subject: cgi-bin & lib --- lib/settings.pm | 315 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 lib/settings.pm (limited to 'lib/settings.pm') diff --git a/lib/settings.pm b/lib/settings.pm new file mode 100644 index 0000000..2767cac --- /dev/null +++ b/lib/settings.pm @@ -0,0 +1,315 @@ +############################################# +# SETTINGS - thread maintain forms + +sub admin_form + { + my ($id, $t, $f, $k) = @_; + print < + +adminhead + if ($t->{files} > 0) + { + print qq(\n); + } + else + { + print qq(\n); + } + print < +
+exit settings screen


+adminhead + ($many, $flagged) = find_jpeg($files, $t->{flagged}); + print qq!!; + + thread_display_settings($id, $t, $k); + keyword_display_settings($id, $t, $k); + print q{ }; + + if ($t->{files} > 0) + { + print q{ }; + file_display_settings($id, $t); + print q{ }; + } + print q{}; + print q{}; + thread_delete_box($id); + print q{}; + print q{}; + } + +sub thread_display_settings + { + my ($id, $t, $k) = @_; + + my $rcolor = get_color($t, $k); + + print qq!
!; + print qq!
!; + print <display settings +
+keywordhead + print qq!
!; + print qq!
\n!; + print qq{\n} if ($DEBUG); + print qq{\n}; + print qq{\n}; + + print qq!!; + print qq!!; + print qq!!; + print qq!!; + print qq!!; + print qq!!; + print qq!!; + print qq!!; + print qq!!; + + print qq!!; + print qq!!; + print qq!
!; + print qq(title: ); + print qq!!; + print qq( ); + print qq!
!; + print qq(color: ); + print qq!!; + color_dropdown($rcolor, 0); + print qq!
 !; + + print qq!!; + print qq!!; + onecheckbox("shorturl", "shorten urls", $t->{display}); + print qq!!; + print qq!!; + onecheckbox("editable", "comments editable by ops", $t->{display}); + print qq!!; + print qq!!; + onecheckbox("opset", "post settings available to ops", $t->{display}); + print qq!!; + onecheckbox("no-zip-button", "no zip button", $t->{display}); + print qq!!; + + if ($t->{keyword} ne undef) + { + onecheckbox("hidekws", "hide keyword list", $t->{display}); + } + + if ($t->{files} > 5) + { + print qq!
!; + print qq!!; + my $ffl = check_key($t->{display}, "ffl"); + my $nfl = check_key($t->{display}, "nfl"); + oneradiobutton("filelist", 2, "full file list", $ffl); + print qq!!; + oneradiobutton("filelist", 1, "trim if many images", (!$nfl && !$ffl)); + print qq!!; + oneradiobutton("filelist", 0, "no file list", $nfl); + print qq!!; + print qq!
!; + } + print qq!
!; + print qq!!; + print qq!!; + print qq!!; + + print qq!
!; + print qq!!; + print_garrow("date posted", (verbosedate($t->{createdate}))); + print_garrow("last changed", (verbosedate($t->{lastmodified}))); + print_garrow("total comments", (hushnull($t->{comments}))); + print_garrow("total files", (hushnull($t->{files}))); + my $par = get_participation($t->{id}); + my $ps = $par != 1 ? 's' : ''; + print_garrow("participating",(hushnull($par).qq! duder$ps!)); + if ($t->{zipped} == -1) + { + my $zipfile = retrieve_zip_mechanism($t); + if ($zipfile == 1) + { print_garrow("zipfile?", qq(in progress)); } + } + if ($t->{zipped} == 0) + { + print_garrow("zipfile?", qq(none)); + } + if ($t->{zipped} == 1) + { + my $zip = get_file_from_filename(generate_zip_filename($t)); + print_garrow("zipfile?", qq(exists, complete as of ).(verbosedatetime($zip->{date}))[0].qq(
freshen | flush
)); + } + print qq!
!; + + print qq!
!; + print qq!
!; + print qq!
!; + + print qq!!; + print qq!!; + + print < +
+category settings +
+keywordhead + +# no keyword set + if ($t->{keyword} eq undef) + { + print qq!\n!; + print qq{\n} if ($DEBUG); + print qq{\n}; + print qq{\n}; + print qq!!; + print qq! + + + + +
SELECT ONE:  !; + keyword_pulldown($t->{keyword}); + print < + +
+or
make new category +
+kwform + } + else + { + print qq{current category: $k->{keyword}}; + + print qq! · detach!; + + if ($k->{owner} eq $USER->{username} || check_op($k) || $USER->{ulevel} == 3) + { + print qq! · settings!; + } + } + print < +
+privacy settings +
+kwform + + print qq!!; + print qq!!; + print qq!!; + print qq!
viewable by  ·!; + privacy_select("private", $t->{private}); + print qq!
!; + if ($t->{private} > 1) + { + print qq!\n!; + print qq!users checked off below will be able to read and update this post!; + if ($k != -1 && $k->{public} != 1) + { + print qq!,
but cannot see the rest of the keyword!; + } + print qq!.
\n!; + print qq!
!; + user_checkerboard($t->{allowed}, undef, $t->{username}); + } + print < + + +
+ +privend + } + +sub file_display_settings + { + my ($id, $t) = @_; + print < +file settings
+
+dirtop + + print qq!
!; + print qq{\n}; + print qq{\n}; + print qq{\n} if ($DEBUG); + print < + + + + · + + +actionform + file_list($files, -1, 1); + print < + +end + } + +sub thread_delete_box + { + my ($id) = @_; + print < + + + + + + + + + + +formend + } + +############################################# + +sub print_garrow + { + my ($a, $b) = @_; + $a =~ s/\s/ /g; + print qq!$a:$b\n!; + } + +1; + -- cgit v1.2.3-70-g09d2