#!/usr/bin/perl #################################################################### # Script: | Whats New (News Viewing Script) # # Version: | 2.0 # # By: | Jason Berry (i2 Services, Inc. / CGI World) # # Contact: | jason@cgi-world.com # # WWWeb: | http://www.cgi-world.com # # Copyright: | Jason Berry (CGI World / i2 Services, Inc.) # # Released | July 3rd 1998 # #################################################################### # By using this software, you have agreed to the license # # agreement packaged with this program. # # # #################################################################### # # # Variables: $font = "Verdana"; # Font to be used in HTML Files the script creates & displays. $side_marker = "
  • "; # This HTML Tag is posted next to news groups & headlines. If you would # like to use an image tag, insert the tag like this: # "" <-- Placing \ backslashes # inside of extra quotes inside the quotes. # Text / Images for Links: # # To input a HTML tag or IMAGE in the below variables, place a \ # (backslash) in front of any extra quotes (") you enter in. $more_news_text = "[View News Index]"; # HTML/TEXT linked to the area listing a news groups # news entries. $view_archives_text = "[More Archives]"; # HTML/TEXT linked to archive category listing all archived # news entries. $related_news_text = "[Related Link]"; # HTML/TEXT linked to a URL entered in a news entry in # a news group. $previous_news_text = "[Read Previous]"; # HTML/TEXT linked to read the previous news posted in # a news group. $next_news_text = "[Read Next]"; # HTML/TEXT linked for reading the next news posted in # a news group. $weeks_news_text = "[View This Weeks News]"; # HTML/TEXT for daily news linking to viewing all daily news listed under # a news group. $split_by = "|"; # What links under the news entry area are seperated by. $line_breaker = "
    "; # Seperator between News Groups listed. $archive_header = "archive.header"; # Default archive header file. Check the Whats New Install file # for more information on customizing Whats New Pages. $archive_footer = "archive.footer"; # Default archive footer file. Check the Whats New Install file # for more information on customizing Whats New Pages. $on_error_redirect_to = "http://csesupport.com"; # # When someone enters a string of commands onto this script # and they can not be associated w/ any command in the script, # it will redirect to the url you set in this variable. # # # # # # ##################################################################### # Whats New v2.0 - Do Not edit under this line. Violation of # # Prouduct license agreement. We do not support # # errors in this product after modification below. # ##################################################################### # if ($0=~m#^(.*)(\\|/)#) { $cgidir = $1; } else { $cgidir = `pwd`; chomp $cgidir; } $base_dir = "$cgidir/whats_new"; $data_dir = "$base_dir/data"; $script_url = "$ENV{'SCRIPT_NAME'}"; $html_dir = "$base_dir/html"; $days_dir = "$base_dir/days"; $archive_dir = "$base_dir/archives"; $lockdir = "$forum_dir/filelock"; $today = int(time / 86400); &parse_form; # View All Categories : ########################### if(!$ENV{'QUERY_STRING'} || !$c && $v !~ /^archive$/i) { print "Content-Type: text/html\n\n"; open(MAIN,"<$base_dir/index.html"); while(
    ) { print "$_"; } close(MAIN); if(!-e "$base_dir/index.html") { print "The index file has yet to be created, use the publish button from the administration script"; } exit; } # View Category News : ########################### if($v eq "news" && $c && !$id) { print "Content-Type: text/html\n\n"; open(NEWS,"<$base_dir/$c.html"); while() { print "$_"; } close(NEWS); exit; } # View News from Category : ########################### if($v eq "news" && $c && $id) { &grab_info; $group_name =~ s/_/ /gi; $count = 1; open(NEWSENTRY,"<$data_dir/$c.dat"); while() { chop($_); ($added_on,$news_id,$date,$entry_title,$file2,$link_to) = split(/\|/,$_); if($more_news) { $more_news++ }; if($next_id eq "$count") { $next_id = "$news_id" } ; if($id eq "$news_id") { $news_date = "$date"; $news_title = "$entry_title"; $news_body = "$file2"; $news_outlink = "$link_to"; $more_news = 1; $found_at = $count; $next_id = $found_at + 1; $previous_id = "$prev_id"; } $count++; $prev_id = "$news_id"; } close(NEWSENTRY); @date_info = split(/\//,$news_date); if($date_info[0] eq "01") { $date_info[0] = "January" }; if($date_info[0] eq "02") { $date_info[0] = "February" }; if($date_info[0] eq "03") { $date_info[0] = "March" }; if($date_info[0] eq "04") { $date_info[0] = "April" }; if($date_info[0] eq "05") { $date_info[0] = "May" }; if($date_info[0] eq "06") { $date_info[0] = "June" }; if($date_info[0] eq "07") { $date_info[0] = "July" }; if($date_info[0] eq "08") { $date_info[0] = "August" }; if($date_info[0] eq "09") { $date_info[0] = "September" }; if($date_info[0] eq "10") { $date_info[0] = "October" }; if($date_info[0] eq "11") { $date_info[0] = "November" }; if($date_info[0] eq "12") { $date_info[0] = "December" }; $date = "$date_info[0] $date_info[1], $date_info[2]"; open(HEADER,"<$html_dir/$header_file"); @header =
    ; close(HEADER); open(FOOTER,"<$html_dir/$footer_file"); @footer =