# FILE: src-board-subs-3 # Copyright (c) 1998, Kevin W. Paulisse and William F. Polik, all rights reserved # Licensed under the Discus license agreement # http://www.chem.hope.edu/discus #---SEPARATOR---# sub page_mgr_1 { local ($username) = @_; local ($append,$owntopic,$tc); &header; print "Page Manager\n"; print "\n"; print "\n"; print "\n"; print "$fs
Page Manager
\n"; $append = "?username=$username"; $tc = 0; print "
\n"; print "Select one of the following topics to edit:\n"; print "

\n"; open (FILE, "$message_dir/board-topics.html") || &error_message("File Error", "Could not open top file (board-topics.html):

$!
! "); @lines = ; close(FILE); print "\n"; $bgcolor = "ffffcc"; foreach $line (@lines) { if ($line =~ //) { $filenumber = $1; $tc += 1; $string = "//$filenumber/$filenumber.$ext"; &extract("$string"); if (&verify_owner($owner,$username)) { print "\n"; $owntopic = 1; if ($bgcolor eq "ffffff") { $bgcolor = "ffffcc"; } else { $bgcolor = "ffffff"; } } } } if ($owntopic == 0) { print "
 TopicGroup 
 "; print "$fs$topic_name"; print "$fs\u$owner 
 $fs", "You aren't authorized to edit any topics!!!\n"; if ($tc == 0 && $username eq $superuser) { print "

Note that this is because there are not any topics created yet. You need\n"; print "to use the 'Board Manager' to create topics. For more information,\n"; print "consult the Superuser Getting Started Tutorial!

\n"; } print "

 
\n"; } else { print " \n"; } print "\n"; exit(0); } #---SEPARATOR---# #REQ:get_date_time sub page_mgr_2 { local ($page_referer,$username) = @_; local ($str,$key,$line,@parent); &extract($page_referer); open (ME, "$message_dir/$topic_number/$me_number.$ext"); local (@me) = ; close (ME); $count = 0; $messagecount = 0; foreach $line (@me) { $count += 1 if $line =~ /Page Manager: $str\n"; print "\n"; print "\n"; print '\n"; print "$fs\n"; print "
$me_name
\n"; print "
\n"; local (@array) = ("$topic_number:$topic_name"); foreach $key (sort by_number keys(%level_number)) { push (@array, "$level_number{$key}:$level_name{$key}"); } print "Page Manager:\n"; foreach $line (@array) { ($number,$name) = split(/:/, $line, 2); if ($number != $me_number) { print ""; } print "$name"; print ":\n" if $number != $me_number; } print "
\n"; print "\n"; print "\n"; print "
$fs"; print "
Quick Navigation

"; print "\n"; print " "; print "("; print "Go to this page on the board)
\n"; print " "; print "("; print "Show all subtopics)
\n"; if ($parent_number > 0 && $parent_number != $me_number) { open (PARENT, "$message_dir/$topic_number/$parent_number.$ext"); @parent = ; close (PARENT); print " "; } else { print " (Top Level)
\n"; @parent = ("
  • $me_name"); } foreach $line (@parent) { $lastnum = $1 if $line =~ //; } $lastflag1 = 0; $lastflag2 = 0; foreach $line (@parent) { if ($line =~ //) { $num = $1; $name2 = $2; $name2 = &remove_html($name2); ($name) = ($name2 =~ /^(.{0,30})/); $name .= "..." if $name ne $name2; $str = &JavaScript_prepare($name2); print "$name
    \n"; } elsif ($line =~ /
  • ([^>]*)>(.*)<\/A>/) { $num = $1; $name2 = $3; $name2 =~ s/<[^>]*>//g; ($name) = ($name2 =~ /^(.{0,25})/); $name .= "..." if $name ne $name2; $str = &JavaScript_prepare($name2); print "" if $num != $lastnum; print "" if $num == $lastnum; $lastflag1 = 1 if $num == $lastnum; if ($num != $me_number) { print " $name
    \n"; } else { print " $name
    \n"; undef @me_children; foreach $line (@me) { $lastme = $1 if $line =~ //; } foreach $line (@me) { if ($line =~ /
  • ([^>]*)>(.*)<\/A>/) { $num = $1; $name2 = $3; push (@me_children,"$num:$name2"); $name2 =~ s/<[^>]*>//g; ($name) = ($name2 =~ /^(.{0,25})/); $name .= "..." if $name ne $name2; $str = &JavaScript_prepare($name2); print "" if $lastflag1 == 0; print "" if $lastflag1 == 1; print "" if $lastme != $num; print "" if $lastme == $num; print " $name
    \n"; } elsif ($line =~ /
  • ]*>(.*)<\/A><\/LI>

    \n/) { push (@me_children, "0$1:$2!$3"); } } } } } print "

  • $fs\n"; print ""; print "Quick Options

    \n"; print "[Subtopics]
    \n" if $param =~ /Sub/; print "[Add a Subtopic]
    \n" if $param =~ /Sub/; print "[About Message]
    \n" if $param =~ /About/; print "[Messages]
    \n" if $param =~ /Message/; print "[Add a Message]
    \n" if $param =~ /Message/; print "[Page Layout]
    \n"; print "
    \n"; if ($param =~ /Sub/) { undef @seennum; print "

    Subtopics

    \n"; print "
    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $c = "ffffcc"; print "\n"; foreach $thing (@me_children) { if ($thing =~ /^(\d+):(.*)/) { $num = $1; $name = $2; push (@seennum, $num); } } $ctr = 0; $ct = scalar(@me_children); foreach $thing (@me_children) { if ($thing =~ /^(\d+):(.*)/) { $num = $1; $name = $2; if ($num =~ /^0/) { ($url,$descr) = split(/!/, $name, 2); $link = 1; } else { $link = 0; $descr = $name; } print ""; $counter += 1; if ($c eq "ffffcc") { $c = "ffffff"; } else { $c = "ffffcc"; } print ""; print "\n"; print ""; $name2 = &JavaScript_prepare($descr); $ctr++; print ""; print ""; print "\n"; print "" if !$link; print "" if $link; print "\n"; print ""; print "\n"; } } if ($counter > 0) { print ""; print "\n"; print ""; print "\n"; print ""; print ""; print ""; print "\n"; print ""; print "\n"; print ""; print "\n"; print "\n"; } print "
     Order MarkDelMov Prop Subtopic 
      "; print " "; print " "; print "    $fs\n"; if ($link) { print "$descr
    $url"; } else { print "$name"; } print "
     
      (Marked)     
     
    \n"; print "\n"; print "

    Add a Subtopic

    \n"; print "
    \n"; print "\n"; print "\n"; print "\n"; print "
    "; print "
    ", $fs, "Name:
    \n"; print "\n"; print "\n"; print "\n"; print "
    $fs", " New discussion page:$fs Link to external document:
    $fs", "   Private Index
    \n"; print "   Public Index
    \n"; print "   Message Page
    \n"; print "
    "; print "$fs   Right frame
    \n"; print "   Top (replace board)
    \n"; print "   New browser window

    \n"; print "URL:
    \n"; print "

    \n"; print "
    \n"; } if ($param =~ /About/) { print "

    About Message

    \n"; $aboutmessage = ""; $flag = 0; foreach $line (@me) { if ($line =~ //) { $flag = 0; } elsif ($flag == 1) { $aboutmessage .= $line; } } $aboutmessage =~ s/\n+$//g; $aboutmessage = &unescape($aboutmessage) unless $aboutmessage =~ /\s/; $aboutmessage =~ s//>/g; print "
    \n"; print "\n"; print "\n"; print "\n"; print "
    $fs", "Enter the text for your "About Message" in the area below.

    \n"; print "

    \n"; print "\n"; print "


    \n"; print "
    \n"; } if ($param =~ /Message/) { undef %message; undef @messageorder; $flag = 0; $ct = 0; foreach $line (@me) { if ($line =~ //) { $flag = $1; $ct += 1; push (@messageorder, $flag); } elsif ($line =~ /

    Messages

    \n"; print "
    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $c = "ffffcc"; print "\n"; $count = 0; open (LOG, "$admin_dir/log.txt"); @log = ; close (LOG); $counter = 0; foreach $num (@messageorder) { print ""; $counter += 1; ($info) = grep(/^$num;/, @log); ($numb, $by, $time, $where, $ipaddr, $iphost, $actualtext, $postby) = split(/;/, $info); if ($by eq "public user:MODERATOR") { $by = "Public User"; } $text = $message{$num}; @text = split(/\n/, $text); shift (@text); $postbyline = shift(@text); if ($postby eq "") { if ($postbyline =~ m|By (.*) on (.*):

    |) { $postby = &remove_html($1); $postby =~ s/\([^\)]*\)//g; } else { $postby = &remove_html($postbyline); $postby =~ s/\([^\)]*\)//g; } } else { $postby = &unescape($postby); $postby = &remove_html($postby); $postby =~ s/\([^\)]*\)//g; } $actualtext = join(" ", @text); $actualtext =~ s/\n/ /g; $preview = &remove_html($actualtext, 1); $preview .= " "; if ($preview =~ m|^(.{0,40})\s|) { $preview = $1; } else { $preview = substr($preview, 0, 40); } $ts = &get_date_time("short", $time); print "

    "; print "\n"; print ""; print ""; print ""; print "\n"; print ""; print ""; print ""; print "\n"; print ""; print "\n"; print "\n"; if ($c eq "ffffcc") { $c = "ffffff"; } else { $c = "ffffcc"; } } if ($counter > 0) { print ""; print "\n"; print ""; print "\n"; print ""; print ""; print ""; print "\n"; print ""; print "\n"; print ""; print "\n"; print "\n"; } print "
     Order MarkDelMov EditViewInfo Message 
      "; $pb = &JavaScript_prepare($postby); $pb =~ s/\s+$//; print " "; print " "; $ctr++; print "    $postby ["; print "$ts]
    $preview
     
      (Marked)     
     
    \n"; print "
    \n"; print "

    Add a Message

    \n"; print "
    \n"; print "
    $fs", "Enter the text for your message in the area below.

    \n"; print "

    \n"; print "$fs Post message as "Anonymous"

    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "

    \n"; } print "
    \n"; print "

    Page Layout

    \n"; undef %params; $params{subtopic} = "CHECKED" if $param =~ /Sub/; $params{create} = "CHECKED" if $param =~ /Create/; $params{messages} = "CHECKED" if $param =~ /Message/; $params{about} = "CHECKED" if $param =~ /About/; $params{add} = "CHECKED" if $param =~ /Add/; undef %t; print "
    \n"; print "\n"; print "\n"; print "\n"; print '
    '; print ""; print "\n"; print "
    $fs", "Available Templates:

    \n"; print " Private Index
    \n"; print " Public Index
    \n"; print " Message Page
    \n"; print " Custom Layout

       $fs", "Discussion Elements:

    \n"; print " List of subtopics
    \n"; print " "Create New Conversation" button
    \n"; print " About message
    \n"; print " Messages
    \n"; print " "Add a Message" form
    \n"; print "

    \n"; print "

    \n"; print "
    \n"; print "\n"; exit(0); }