#!/usr/bin/perl # # DCForum99 Version 1.0 # dcboard.cgi # Part of DCForum by DCScripts # Copyright ©1997-1999 DCScripts All Rights Reserved # # As part of the installation process, you will be asked # to accept the terms of this Agreement. This Agreement is # a legal contract, which specifies the terms of the license # and warranty limitation between you and DCScripts and DCForum. # You should carefully read this terms agreement as outlined in # the readme.txt file included with this distribution before # installing or using this software. Unless you have a different license # agreement obtained from DCScripts, installation or use of this software # indicates your acceptance of the license and warranty limitation terms # contained in this Agreement. If you do not agree to the terms of this # Agreement, promptly delete and destroy all copies of the Software. # ################################################################### # # NOTE: You may need to provide full path to each setup files # Some server require this. # $path is the directory path to the location of this file. $path = "."; #>>>>>>>>>>>>>>> NO NEED TO EDIT ANYTHING BELOW THIS LINE <<<<<<<< #>>>>>>>>>>>>>>> NO NEED TO EDIT ANYTHING BELOW THIS LINE <<<<<<<< #>>>>>>>>>>>>>>> NO NEED TO EDIT ANYTHING BELOW THIS LINE <<<<<<<< require "$path/dcforum.setup"; require "$path/dcboard.setup"; require "$cgidir/cgi-lib.pl"; require "$cgidir/dcforumlib.pl"; require "$cgidir/dclib.pl"; # Print HTTP output header print "Content-type: text/html\n"; # Read-in form data... # Someday, I need to replace this with my own version &ReadParse; # define reference to %in # this things going to be passed to everywhere $r_in = \%in; # Check and see if we are working with Archive if ($r_in->{'database'} eq "" or $r_in->{'database'} ne 'archive') { $r_in->{'database'} = $database; } else { $database = "arc_" . $database; $r_in->{'arc_database'} = $database; } # Get current time and date get_date($r_in); # initialize some internal variables... # Need to change this for speed improvement $r_setup = initialize($password_file_dir,$forum_file,$board_setup_file); # Set Global variables # Must require this after the call to initialize require "$path/global.pl"; # If the input forum type is Private, then # set appropriate file extension and dir if ($r_setup->{'forum_type'}->{ $r_in->{'forum'} } eq 'Private') { $ext = $privateext; $maindir = $privatedir; } # Get forum information and put them in old variables $forum = $r_in->{'forum'}; $az = $r_in->{'az'}; # OK, before we do anything, let's check the user's session ID # If it exists then read in user data $r_in->{'userdata'} = {}; $session = get_cookie($cookie_name); if ($session) { if (-e "$password_file_dir/$session.session") { $r_in->{'userdata'} = get_userdata("$password_file_dir/$session.session"); } else { send_cookie($cookie_name,'','Thur, 31-Dec-98 12:00:00 GMT',''); $session = ''; } } # Next readin the team members # and append it as a string #$r_team = []; if (-e "$password_file_dir/$team_file_name") { $r_team = readdata("$password_file_dir/$team_file_name"); } $team = join(" ",@{$r_team}); # OK, if $az is 'list' then list topics in a forum # If not, list forums if ($az eq "list") { # End of HTTP Header print "\n"; # Create menu buttons $menu_button = create_button('list',$r_in,$r_setup); # Oppps, forum is offline if ($r_setup->{'forum_status'}->{ $forum } ne "on") { ($heading,$sub_heading,$html_output) = access_error('forum off',$r_in,$r_setup); } # Oppps, no access allowed elsif ( ! check_forum_access($r_in,$r_setup,$forum) ) { ($heading,$sub_heading,$html_output) = access_error('forum private',$r_in,$r_setup); } else { ($heading, $sub_heading, $html_output) = list($r_in,$r_setup); } } # Listing main entrance - the forum list else { # First end http header print "\n"; $heading = $heading_list_forums; $sub_heading = $sub_heading_list_forums; # If no $session, display drop down menu to fetch messages # from last few days unless ($session) { $sub_heading .= qq~
~; } # Create menus for the forum listing $menu_button = create_button("list_forums",$r_in,$r_setup); # list forums $html_output = list_forums($r_in,$r_setup); } # create forum_links $html_forum_links = forum_links($r_in,$r_setup); # Get template variables ready my %namespace = ( FORUMLINKS => $html_forum_links, MENU => $menu_button, TITLE => $heading, HEADER => $heading, SUBHEADER => $sub_heading, HTMLOUTPUT => $html_output ); # display output display_output($templatefile,\%namespace); exit(0); ##### # # subroutine list_forums # Creates the main lobby page # ##### sub list_forums { my ($r_in,$r_setup) = @_; my $current_time = time_format($r_in->{'localtime'}); my $current_date = date_format($r_in->{'date'}); my $html_output = ''; $icon_display = 'yes'; # Should Icon indicator be displayed? $html_output .= qq~Forums in $conf_name |
---|
$r_setup->{'forum_name'}->{$_}
$r_setup->{'forum_desc'}->{$_} |
Moderator: $r_setup->{'forum_owner'}->{$_}
$r_setup->{'forum_type'}->{$_} Forum $r_setup->{'forum_threads'}->{$_} Current Discussions $r_setup->{'forum_archive'}->{$_} Archived Discussions $date $ltime |
Moderator: $r_setup->{'forum_owner'}->{$forum} Time Zone: $time_zone Forum Type: $r_setup->{'forum_type'}->{$forum} |
|||
~; if ($re_num > $r_setup->{'board_setup'}->{'max_messages'}) { $html_output .=qq~ $subject [Display All] $caption | ~; } else { $html_output .=qq~ $subject $caption ~; } $ltime = time_format($ltime); $date = date_format($date); $html_output .=qq~
$name $date $ltime $replies messages |
||
~; if ($re_num > $r_setup->{'board_setup'}->{'max_messages'}) { $html_output .=qq~ $subject~; if ($r_setup->{'forum_type'}->{$forum} eq "Private") { $html_output .=qq~ [Display All] ~; } else { $html_output .=qq~ [Display All] ~; } $html_output .=qq~ $caption | ~; } else { if ($r_setup->{'forum_type'}->{$forum} eq "Private") { $html_output .=qq~ $subject ~; } else { $html_output .=qq~ $subject ~; } } $ltime = time_format($ltime); $date = date_format($date); $html_output .=qq~$name | $date $ltime | $replies |
$temp_output |