#!/usr/local/bin/perl # * # * Copyright (c) 1998-1999 SangHoon Park # * Neo Solutions, Inc. # * # * Script found in: http://neosol.com # * # * Author: SangHoon Park(shpark@neosol.com) January '99. # * Design: SooYeon Lim(sylim@neosol.com) January '99. # * # * Improvements submitted by other developers: # * # * For instructions and other information e-mail to shpark@neosol.com # * # * if you modify this script to distribute to other site # * for non-comerical purpose. # ############################################################################### # # import default include file # require "./include/NeoBoard.conf"; require "./include/NeoVar.conf"; require "./include/NeoLocale.conf"; require "./include/NeoMimeType.conf"; require "./lib/cgi-lib.pl"; require "./lib/ns-lib.pl"; require "./lib/NeoBoard-lib.pl"; require "./lib/NeoTemplate-lib.pl"; # # For those whose server is on Windows, # you need the following three lines. # But, they have not an effect on UNIX. # binmode(STDIN); binmode(STDOUT); binmode(STDERR); umask(000) if ($_wb'ServerOs eq "UNIX"); # # pre process function here # sub MakeKeyWordStr { local ($key_str) = @_; local ($key_type); if ($key_str =~ /\*/) { (@gKeyBuf) = split(/\s*\*\s*/, $key_str); $key_type = "AND"; } elsif ($key_str =~ /\+/) { (@gKeyBuf) = split(/\s*\+\s*/, $key_str); $key_type = "OR"; } elsif ($key_str =~ /\s+/) { $gKeyBuf[0] = $key_str; $key_type = "STR"; } elsif ($key_str =~ /\?/) { $key_str =~ s/\?//g; $gKeyBuf[0] = $key_str; $key_type = "STR"; } else { $gKeyBuf[0] = $key_str; $key_type = "STR"; } return $key_type; } sub GetBoardList { local (*boardList, $makeFlag) = @_; local ($i, $j, $index); local (@writeList, @replyList, @node); # # get the page to display # local ($block_number); $gTotalNum = $#boardList + 1; $gTotalBlock = &plInt_GetBlockNum($gTotalNum, $_wb'NumPerPage); # # if the load is first, set last log page # if (! $gCurrBlockNum || $gCurrBlockNum < 0) { $gCurrBlockNum = $gTotalBlock; } elsif ($gCurrBlockNum >= $gTotalBlock) { $gCurrBlockNum = $gTotalBlock; } # # make DSC list # if ($makeFlag && $_wb'SortMethod eq "T") { @writeList = grep(/^[0-9]+$/, @boardList); @writeList = reverse (sort bynum @writeList); @replyList = grep(/_+/, @boardList); @replyList = sort @replyList; # # initialize array # $index = 0; $#boardList = -1; for ($i = 0; $i <= $#writeList; $i++) { if ($index > (($gTotalBlock - $gCurrBlockNum) * $_wb'NumPerPage)+$_wb'NumPerPage+1) { last; } $boardList[$index] = $writeList[$i]; $index++; @node = (); @node = grep(/^$writeList[$i]_/, @replyList); for ($j = 0; $j <= $#node; $j++) { $boardList[$index] = $node[$j]; $index++; } } } else { @boardList = reverse @boardList; } $index = ($gTotalBlock - $gCurrBlockNum) * $_wb'NumPerPage; $index = 0 if ($index < 0); # # get virtual number # $gVirtualNumber = $gTotalNum; $gVirtualNumber -= $index; $mainIndex = 0; for ($i = $index; $i < $index + $_wb'NumPerPage; $i++) { last if ($i > $#boardList); local (%hsInfo, $content); &plInt_GetBoardInfo( "$_wb'DataDir/$form{'Db'}/$_wb'DataPrefix.$boardList[$i]", *hsInfo); next if (! $hsInfo{$BBS_SUBJECT} || ! $hsInfo{$BBS_NAME} || ! $hsInfo{$BBS_DATE}); $gNumber[$mainIndex] = $boardList[$i]; $gDocType[$mainIndex] = $hsInfo{$BBS_DOCTYPE}; $gSubject[$mainIndex] = $hsInfo{$BBS_SUBJECT}; # # auto contraction of subjects # if ($_wb'ContractionSize && length($gSubject[$mainIndex]) > $_wb'ContractionSize) { $gSubject[$mainIndex] = &plStr_StrCutByLen($gSubject[$mainIndex], $_wb'ContractionSize); $gSubject[$mainIndex] .= "....."; } $gName[$mainIndex] = $hsInfo{$BBS_NAME}; $gEmail[$mainIndex] = $hsInfo{$BBS_EMAIL}; $gDate[$mainIndex] = $hsInfo{$BBS_DATE}; $gTime[$mainIndex] = $hsInfo{$BBS_TIME}; $gCount[$mainIndex] = int($hsInfo{$BBS_HITS}); $gLines[$mainIndex] = int($hsInfo{$BBS_LINES}); $gFileName[$mainIndex] = $hsInfo{$BBS_FILENAME}; $gDownload[$mainIndex] = int($hsInfo{$BBS_DOWNLOAD}); $gCategory[$mainIndex] = $hsInfo{$BBS_CATEGORY}; $gUserid[$mainIndex] = $hsInfo{$BBS_USERID}; $gHomepage[$mainIndex] = $hsInfo{$BBS_HOMEPAGE}; &plInt_File2StrByPos( "$_wb'DataDir/$form{'Db'}/$_wb'DataPrefix.$boardList[$i]", "$BBS_CONTENT=", *content); chomp($content); $gContent[$mainIndex] = (length($content)) ? "$content" : 0; $mainIndex++; } return $mainIndex ? $_ns'success : $_ns'failure; } sub GetAllSearchList { local ($idx_file, @array); # # get Board index from the index file # $idx_file = "$_wb'DataDir/$form{'Db'}/$_wb'IndexDir/$_wb'BoardIndex"; return $_ns'failure if (! &plInt_File2Array("$idx_file", *array)); chomp(@array); $gInsertTab = 1; return GetBoardList(*array, "1"); } sub GetSearchFromFile { local (@array); # # get all lists from file # return $_ns'failure if (! &plInt_File2Array("$gSearchFile", *array)); chomp(@array); $gInsertTab = 0; return &GetBoardList(*array, "0"); } sub GetOptionalSearchList { local ($idx_file, $key_type, $key_str, @array, $i); # # KeyWord search # $key_type = &MakeKeyWordStr($form{'fmKeyWord'}); $idx_file = "$_wb'DataDir/$form{'Db'}/$_wb'IndexDir/$_wb'SearchIndex"; if (&plInt_Search4Body( $idx_file, *gKeyBuf, $key_type, $form{'fmSearchType'}, *array)) { # # save array to temp file # $gSearchFile = "$_wb'CgiBaseDir/tmp/$ENV{'REMOTE_ADDR'}.$$"; if (&plInt_Array2File("$gSearchFile", *array)) { $gSearchOpt = 1; } } else { return $_ns'failure; } # cutting newline chomp(@array); $gInsertTab = 0; return &GetBoardList(*array, "0"); } # # html code process here # sub MakeIconStr { local (*icon_str) = @_; $home = $_ico'Home; $reload = $_ico'Reload; $write = $_ico'Write; $prev = $_ico'Prev; $next = $_ico'Next; $admin = $_ico'AdminLink; $delete = $_ico'Delete; $br_tag = ($_wb'TemplateType) ? "
" : ""; $icon_str = "$br_tag"; # # Home Icon # if ($_wb'HomeUrl) { $icon_str .= "\t\t" . "Home$br_tag\n"; } # # Reload Icon # $icon_str .= "\t\t" . "Reload$br_tag\n"; # # Write Icon # if ($_wb'IsPrivateBoard && $gUserType ne "admin" && $gUserType ne "dbadmin" && $gUserType ne "member") { # # need to member login # $icon_str .= "\t\t"; } else { $icon_str .= "\t\t"; } $icon_str .= "Write$br_tag\n"; # # Next icon # if ($gCurrBlockNum >= 1 && $gCurrBlockNum < $gTotalBlock) { $icon_str .= "\t\t" . "Next Page$br_tag\n"; } # # Prev Icon # if ($gCurrBlockNum > 1 && $gCurrBlockNum <= $gTotalBlock) { $icon_str .= "\t\t" . "Previous Page$br_tag\n"; } # # Admin Icon # if ($_wb'ShowAdminLink) { if ($gUserType eq "admin" || $gUserType eq "dbadmin") { $icon_str .= "\t\t"; $icon_str .= "DB Administration$br_tag\n"; } # # Admin Delete Icon # if ($_wb'ShowDeleteMark && ($gUserType eq "admin" || $gUserType eq "dbadmin")) { # print delete icon if the option is set $icon_str .= "\t\t" . "Delete$br_tag\n"; } $icon_str .= "$br_tag"; return; } sub MakeMessageStr { local (*msg_str) = @_; $msg_str = ""; if ($_wb'ShowArticleInfo) { $msg_str .= "$_csList'Article: "; $msg_str .= "$gTotalNum, "; $msg_str .= "$_csList'Page: "; $msg_str .= "$gCurrBlockNum/$gTotalBlock\n"; } return; } sub MakePrivateIconStr { local (*msg_str) = @_; $msg_str = ""; if ($_wb'IsPrivateBoard) { if ($gUserType ne "admin" && $gUserType ne "dbadmin" && $gUserType ne "member") { $msg_str .= "\t\n"; $msg_str .= "\t\t\n"; $msg_str .= "\t\tMember Login\n"; } else { $msg_str .= "\t\n"; $msg_str .= "\t\t$_csList\n"; if ($_wb'UseMemberMail) { $msg_str .= "\t\t\n"; $msg_str .= "\t\t Member Mailing\n"; } } } return; } sub MakeMultiBoardStr { local (*msg_str) = @_; local ($i, $idx, @dbList, @array, @realName, @nickName); $msg_str = ""; if (&plInt_GetDbGroupList("$_wb'GroupName", *dbList) <= 0) { $msg_str = "     "; return $_ns'failure } $idx = 0; for ($i = 0; $i <= $#dbList; $i++) { next if (! -d "$_wb'DataDir/$dbList[$i]"); next if ("$dbList[$i]" eq "$form{'Db'}"); local ($isLink, $nickName); &plInt_GetProfileString("$_wb'DataDir/$dbList[$i]/$_wb'IndexDir/$_wb'DefaultConf", "LinkMultipleBoard", *isLink); if ($isLink) { $nickName = &plStr_GetDbNickName("$dbList[$i]"); $array[$idx] = "$nickName$_wb'Separator$dbList[$i]"; $idx++; } } return $_ns'failure if ($#array < 0); # sort by nickname @array = sort @array; for ($i = 0; $i <= $#array; $i++) { ($nickName[$i], $realName[$i]) = split(/$_wb'Separator/, $array[$i], 2); } $msg_str .= "\t\t \n"; $msg_str .= "\t\t\n"; $msg_str .= "\t\t\n"; return $_ns'success; } sub MakeBoardGroupStr { local (*msg_str) = @_; local ($idx, $group_name, @groupList); (@groupList) = split(/\//, $_wb'GroupName); $msg_str = ""; $msg_str .= "\t\t"; # # Print Start position # $msg_str .= "$_csList'InitLevel >> "; for ($idx = 0; $idx <= $#groupList; $idx++) { $group_name = join("/", @groupList[0..$idx]); &plVoid_UrlEncoding(*group_name); $msg_str .= "" . "$groupList[$idx]"; if ($idx == $#groupList) { $msg_str .= " >> \n"; } else { $msg_str .= " >> "; } } $msg_str .= "$gDbNickName\n"; return $_ns'success; } # # Make Search Option # sub MakeSearchStr { local (*msg_str) = @_; $msg_str = ""; $msg_str .= "\t\t\n"; $msg_str .= "\t\t\n"; $msg_str .= "\t\t\n"; $msg_str .= qq|\t\t\n|; $msg_str .= qq|\t\t$_csList'HelpBtn\n|; $msg_str .= "\t\t\n"; return; } sub PrintPostContent { local ($retCode) = @_; print <$_wb'MetaStr $_wb'DefaultTitle - Member Verification
END_OF_MARK } sub PrintHtmlContent { print <$_wb'MetaStr $_wb'DefaultTitle $gHeadStr
END_OF_MARK # # get Category information # &plVoid_GetCategoryInfo("$form{'Db'}", *_st'Category); @_st'Category = sort bynum (@_st'Category); # # Make icon, message, time string # &MakeIconStr(*icon_output); &MakeBoardGroupStr(*group_output) if ($_wb'ShowGroupInfo); &MakeMessageStr(*msg_output) if ($_wb'ShowArticleInfo); &MakeMultiBoardStr(*multi_output) if ($_wb'MultipleBoard); &MakePrivateIconStr(*private_output) if ($_wb'IsPrivateBoard); &MakeSearchStr(*search_output) if ($_wb'ShowSearch); # # print link icon in the top of the page # if (($_wb'ShowLinkIcon eq "1" || $_wb'ShowLinkIcon eq "3") && ! $_wb'TemplateType) { print qq|\n|; # # print icon # print qq|\n|; # # print article information, multiple board, private icon # print "\t\n"; print qq|
$icon_output\n"; print "$msg_output\n" if ($_wb'ShowArticleInfo); print "$multi_output\n" if ($_wb'MultipleBoard); print "$private_output\n" if ($_wb'IsPrivateBoard); print "\t
\n|; } if (($_wb'ShowLinkIcon eq "2" || ! $_wb'ShowLinkIcon) && ! $_wb'TemplateType) { print qq|\n|; # # print group information # print "\t\n" if ($_wb'ShowGroupInfo); # # print article information, multiple board, private icon # print "\t\n"; print "
$group_output\n"; print "$msg_output\n" if ($_wb'ShowArticleInfo); print "$multi_output\n" if ($_wb'MultipleBoard); print "$private_output\n" if ($_wb'IsPrivateBoard); print "\t
"; } # # Top Template # print &nbStr_OpenTemplate(); print &nbStr_TopLeftTemplate(); if ($_wb'ShowGroupInfo) { print &nbStr_TopCenterTemplate("$multi_output", " $group_output"); } else { print &nbStr_TopCenterTemplate("$multi_output", " $msg_output  $private_output"); } print &nbStr_TopRightTemplate(); if ($_wb'ShowLinkIcon eq "1" || $_wb'ShowLinkIcon eq "3") { print &nbStr_MiddleLeftTemplate($icon_output); } else { print &nbStr_MiddleLeftTemplate("









"); } print &nbStr_OpenMiddleCenter(); # # Print Main List # local ($fieldNum = 0); if ($_wb'TemplateType && $_wb'TblSize =~ /%/) { $_wb'TblSize = "100%"; } if ($_wb'TemplateType && $_wb'ShowGroupInfo) { print qq|\n|; print qq|\n|; print qq|
$msg_output $private_output
\n|; } $bdr_size = ($_wb'ListBorderSize) ? $_wb'ListBorderSize : 0; $cell_space = ($_wb'ListCellSpace) ? $_wb'ListCellSpace : 0; if ($_wb'ListHeaderColor && $_wb'ListBodyColor) { $cell_color = ($_wb'ListCellColor) ? "BGCOLOR=$_wb'ListCellColor" : ""; } print "\n"; print "\n"; print "
\n"; print "\n"; if ($_wb'ShowNumberField) { $fieldNum++; print "\t\n"; } if ($_wb'ShowCateField) { $fieldNum++; print "\t\n"; } if ($_wb'ShowFileField) { $fieldNum++; print "\t\n"; } # # subject field # if ($_wb'ShowSubjectField) { $fieldNum++; print "\t\n"; } else { $fieldNum++; print "\t\n"; } if ($_wb'ShowNameField) { $fieldNum++; print "\t\n"; } if ($_wb'ShowDateField) { $fieldNum++; print "\t\n"; } if ($_wb'ShowHitsField) { $fieldNum++; print "\t\n"; } if ($_wb'ShowDeleteMark && ($gUserType eq "admin" || $gUserType eq "dbadmin")) { $fieldNum++; print "\t\n"; } # # set content preview option # $subject_size = "$_wb'Style_Body"; if ($_wb'ListPreview && $_wb'ListContentNum) { $subject_size = "$_wb'Style_Title"; $start_dl_tag = "
"; $open_bold = ""; $close_bold = ""; } local ($bi); for ($bi = 0; $bi <= $#gNumber; $bi++) { print "\t
\n"; local ($j, $key, $value, $color, $flag, $st_color, $st_class); $st_color = $_wb'ListBodyColor; $body_font = $_wb'ListBodyFont; if ($_wb'ShowCateField) { for ($j = 0; $j <= $#_st'Category; $j++) { ($key, $value, $color, $flag) = split(/\s*=\s*/, $_st'Category[$j], 4); if ($key eq $gCategory[$bi]) { $st_class = $value; $st_color = "BGCOLOR='$color'" if ($color); last; } } } # # write a number # if ($_wb'ShowNumberField) { print "\t\n"; } # # display class # if ($_wb'ShowCateField) { print "\t\n"; } # # display file type icon # if ($_wb'ShowFileField) { local ($size, @pre, $ext, $alt, $type); print "\t\n"; } # # write a subject # print "\t\n"; # # write a name # if ($_wb'ShowNameField) { print "\t\n"; } # # write date # if ($_wb'ShowDateField) { print "\t\n"; ### ZZZ to display time information ### ### print "\t\t", &plStr_GetFormatedDate("$gDate[$bi]$gTime[$bi]", "$_wb'DateFormat", "TIME"), "\n"; } # # write hits # if ($_wb'ShowHitsField) { print "\t\n"; } # # write delete mark # if ($_wb'ShowDeleteMark && ($gUserType eq "admin" || $gUserType eq "dbadmin")) { print "\t\n"; } } # # print bottom bar # print "\t\n"; print "\t\n"; print "\t
\n"; print "\t\t$_csList'Number\n"; print "\t\t$_csList'Category\n"; print "\t\t$_csList'File\n"; print "\t\t$_csList'Subject\n"; print "\t\t \n"; print "\t\t$_csList'Name\n"; print "\t\t$_csList'Date\n"; print "\t\t$_csList'Hits\n"; print "\t\t$_csList'Delete
\n"; $number = $gNumber[$bi]; if ($_wb'ShowVirtual) { $number = $gVirtualNumber--; } else { if ($gNumber[$bi] =~ /_/ && $_wb'HideReplyNum) { $number = " "; } } print "\t\t$number" . "$st_class
" . "
\n"; if ($gFileName[$bi]) { $size = &plInt_GetFileSize("$_wb'UploadDir/$form{'Db'}/$gFileName[$bi]"); (@pre) = split(/\./, $gFileName[$bi]); $ext = $pre[$#pre]; $ext = &plChar_ToUpper($ext); $gFileExtension = $ext; if (! $_st'FileType{$ext}) { $type = ( -T "$_wb'UploadDir/$form{'Db'}/$gFileName[$bi]") ? $_st'FileType{'TXT'} : $_st'FileType{'UNKNOWN'}; } else { $type = $_st'FileType{$ext}; } $alt = "Downloaded $gDownload[$bi] times : $gFileName[$bi] ($size bytes)"; # # to hide Download file. # if ($_wb'IsPrivateBoard && $gUserType ne "admin" && $gUserType ne "dbadmin" && $gUserType ne "member") { $size = 0; } if ($size) { local ($width, $height, $img_src, $is_image_exist); if (($_wb'ListPreview && $_wb'ListContentNum && $_wb'ImagePreview)) { ##ZZ## $_wb'ImagePreview && $_wb'ImageWidth && $_wb'ImageHeight)) { $width = $_wb'ImageWidth; $height = $_wb'ImageHeight; $img_src = "$_wb'UploadPath/$form{'Db'}/$gFileName[$bi]"; $alt = "$gFileName[$bi] ($size bytes)"; $is_image_exist = 1 if ($ext eq "JPG" || $ext eq "GIF"); if (length($gHomepage[$bi]) > 7) { $alt = "Go to $gHomepage[$bi]"; print "\t\t"; } } else { $width=16; $height=14; $img_src = "$_wb'HtmlBaseDir/$type"; $is_image_exist = 1; print "\t\t\n"; } else { print "\t\t\t onMouseOver=\"window.status='$alt'; return true;\"\n"; print "\t\t\t onMouseOut=\"window.status=''; return true;\">\n"; } } if ($is_image_exist) { print "\t\t
\n"; } else { print " \n"; } } else { print " \n"; } } else { print " \n"; } print "\t
\n"; # print "$start_dl_tag"; # # insert tab when the message is a reply # if ($_wb'SortMethod eq "T" && $gInsertTab) { local ($depth, $tab); $depth = ($gNumber[$bi] =~ s/_/_/g); while ($depth) { $tab = $_wb'ReplyTab; while ($tab) { print " "; $tab--; } $depth--; } } # # Check the Doc Type # $doc_type = ""; if ($_wb'UseDocType && $gDocType[$bi]) { $doc_type = "$_csList"; } # # dont' make a hyperlink if a article doesn't have contents. # local ($text_color, $close_link_tag); $text_color = "COLOR='$body_font'"; if ($gContent[$bi] || $_st'MimeType{$gFileExtension} eq "text/plain" || $_st'MimeType{$gFileExtension} eq "image/gif" || $_st'MimeType{$gFileExtension} eq "image/jpeg") { $text_color = ""; $close_link_tag = ""; if ($_wb'ViewInNewWindow) { if ($_wb'IsPrivateBoard && $gUserType ne "admin" && $gUserType ne "dbadmin" && $gUserType ne "member") { # # need to member login # print "\n"; } else { local ($rest_url); $rest_url = "&Mode=view&Block=$gCurrBlockNum&Number=$gNumber[$bi]&" . "SearchID=$gSearchFile&fmSearchType=$form{'fmSearchType'}&" . "fmKeyWord=$gEncKeyWord"; print "\n"; } } else { if ($_wb'IsPrivateBoard && $gUserType ne "admin" && $gUserType ne "dbadmin" && $gUserType ne "member") { # # need to member login # print "\n"; } else { print "\n"; } } } if ($_wb'UseReplyImage && ($gNumber[$bi] =~ /_/g)) { $gSubject[$bi] =~ s/^.*://; print "\t\t"; print "\t\t"; print "$doc_type $open_bold$gSubject[$bi]$close_bold$close_link_tag"; } else { print "\t\t $doc_type $open_bold$gSubject[$bi]$close_bold$close_link_tag"; } if ($gCurrentDate eq $gDate[$bi]) { print "New article
\n"; } else { print "
\n"; } if ($_wb'ListPreview && $_wb'ListContentNum && $gContent[$bi]) { local ($content_str); $content_str = &plStr_RemoveHtmlTag($gContent[$bi]); $content_str =~ s//>/g; $content_str = &plStr_StrCutByLen($content_str, $_wb'ListContentNum); $start_dd_tag = "
" if ($_wb'SortMethod eq "T" && $gInsertTab && $_wb'ReplyTab && ($gNumber[$bi] =~ /_/)); print "$start_dd_tag $content_str ...\n"; $start_dd_tag = ""; print ""; } print "
\n"; if ($_wb'ShowAdminMark && $gUserid[$bi] eq "admin") { print "\t\t"; print ""; } elsif ($_wb'ShowAdminMark && $gUserid[$bi] eq "dbadmin") { print "\t\t"; print ""; } else { if (length($gEmail[$bi]) > 3) { print "\t\t"; print "$gName[$bi]"; } else { print "\t\t$gName[$bi]"; } } print "\n"; print "\t\t", &plStr_GetFormatedDate($gDate[$bi], "$_wb'DateFormat", ""), "\n"; print "\t\t$gCount[$bi]\n"; print "\t\t"; print "
\n"; print "\t\t\n"; print "\t\t $_wb'NeoVersion - "; print "Powered by $_wb'VenderName\n"; print "\t\t\n"; print "\t
\n"; print "\t
\n"; # # Make Page Link # if ($_wb'ShowPageLink) { # # get a number of block # $gTotalPage = &plInt_GetBlockNum($gTotalBlock, $_wb'PageLinkNum); $url = "$_wb'ListProgram?"; $url .= "Db=$gDataBaseName&Mode=$form{'Mode'}&Block=NEWBLOCK&SearchID=$gSearchFile&"; $url .= "fmSearchType=$form{'fmSearchType'}&fmKeyWord=$gEncKeyWord"; $pagelink_output = &plStr_GetBlockMovePage( $gTotalBlock, $gCurrBlockNum, $gTotalPage, $_wb'PageLinkNum, "$url", "NEWBLOCK"); } # # Bottom Template # print &nbStr_CloseMiddleCenter(); if ($_wb'ShowLinkIcon eq "2" || $_wb'ShowLinkIcon eq "3") { print &nbStr_MiddleRightTemplate($icon_output); } else { print &nbStr_MiddleRightTemplate("









"); } print &nbStr_BottomLeftTemplate(); print &nbStr_BottomCenterTemplate("$pagelink_output   ", "$search_output"); print &nbStr_BottomRightTemplate(); print &nbStr_CloseTemplate(); # # Print Page Link # if ($_wb'ShowPageLink && ! $_wb'TemplateType) { print "\n"; print "\t\n"; print "
"; print qq|$pagelink_output\n|; print "\t
\n"; } # # Print Search Option # if ($_wb'ShowSearch && ! $_wb'TemplateType) { print "\t\n"; print "\n"; print "\t\n"; print "
\n"; print qq|$search_output\n|; print "\t
\n"; } # # Print HR Line # if ($_wb'ShowBottomLine) { print "\n"; print "\n"; print "\n"; print "

\n"; } # # print link icon in the bottom of page # if (($_wb'ShowLinkIcon eq "2" || $_wb'ShowLinkIcon eq "3") && ! $_wb'TemplateType) { print qq|\n|; # # print icon # print qq|\n|; print qq|
$icon_output
\n|; } print < $gTailStr END_OF_MARK } # # Start main routine here # # # get cookie values # &plVoid_ReadCookie(*cookie); # # Get Form value # &ReadParse(*form); $gDataBaseName = "$form{'Db'}"; &plVoid_UrlEncoding(*gDataBaseName); &plVoid_CheckDb("$_wb'DataDir/$form{'Db'}", "1"); if ($form{'Mode'} eq "download") { local (%hsInfo, $size, *DOWN_FILE, @pre, $ext); &plInt_GetBoardInfo( "$_wb'DataDir/$form{'Db'}/$_wb'DataPrefix.$form{'Number'}", *hsInfo); if ($hsInfo{$BBS_REMOTEADDR} ne $ENV{'REMOTE_ADDR'}) { # # increase download times # &plInt_OpenLock("$form{'Db'}", "$_wb'DataPrefix.$form{'Number'}"); &plInt_WriteProfileString( "$_wb'DataDir/$form{'Db'}/$_wb'DataPrefix.$form{'Number'}", "$BBS_DOWNLOAD", int($hsInfo{$BBS_DOWNLOAD})+1); &plInt_CloseLock("$form{'Db'}", "$_wb'DataPrefix.$form{'Number'}"); # # Append Access Log # $curr_date = &plStr_GetCurrentDate(); $date = substr($curr_date, 0, 8); $time = substr($curr_date, 8, 6); &plInt_WriteAccessLog( $form{'Db'}, $date, $time, $ENV{'REMOTE_ADDR'}, "$form{'Mode'}=$form{'Number'}", "$hsInfo{$BBS_FILENAME}"); } $size = &plInt_GetFileSize("$_wb'UploadDir/$form{'Db'}/$hsInfo{$BBS_FILENAME}"); (@pre) = split(/\./, $hsInfo{$BBS_FILENAME}); $ext = $pre[$#pre]; $ext = &plChar_ToUpper($ext); if ($_wb'BrowserType =~ /MSIE/) { print "Content-Length: $size\n"; print "Content-Type: www/unknown; Name=$hsInfo{$BBS_FILENAME}\n"; if ($ext eq "HTML" || $ext eq "HTM" || $ext eq "JPG" || $ext eq "GIF" || $ext eq "RM" || $ext eq "RAM") { print "Content-Disposition: inline; filename=${hsInfo{$BBS_FILENAME}}.neo\n\n"; } else { print "Content-Disposition: inline; filename=$hsInfo{$BBS_FILENAME}\n\n"; } } else { print "Content-Length: $size\n"; print "Content-Type: application/octet-stream; Name=$hsInfo{$BBS_FILENAME}\n"; print "Content-Disposition: inline; filename=$hsInfo{$BBS_FILENAME}\n\n"; } open(DOWN_FILE, "$_wb'UploadDir/$form{'Db'}/$hsInfo{$BBS_FILENAME}"); binmode(DOWN_FILE); print ; close(DOWN_FILE); exit; } # # First, print this line # print "Content-type: text/html\n\n"; $gCurrBlockNum = ($form{'Block'}) ? $form{'Block'} : 0; $gTotalBlock = 0 if (! $gTotalBlock); # # Set Conf value for local db # &plVoid_SetDbConfValue("$form{'Db'}"); # # Set Language for local db # &plVoid_ImportLocale("$_wb'Language", "user"); # # Set the defined words for local db # &plVoid_SetDbLocaleValue("$form{'Db'}") if ($_wb'UseDefineWord); # # if ShowGroupInfo is set, then the icons should be placed on the bottom # of the page. # if ($_wb'ShowGroupInfo && ! $_wb'TemplateType) { $_wb'ShowLinkIcon = ($_wb'ShowLinkIcon) ? 2 : 0; } # # get the help message file # &plInt_File2Str("$_wb'LocaleDir/$_wb'Language/$_wb'HelpPrefix.msg", *gHelpStr); # # get the head and tail message # &plInt_File2Str("$_wb'DataDir/$form{'Db'}/$_wb'IndexDir/$_wb'ListHeadFile", *gHeadStr); chomp($gHeadStr); &plInt_File2Str("$_wb'DataDir/$form{'Db'}/$_wb'IndexDir/$_wb'ListTailFile", *gTailStr); chomp($gTailStr); # # get the type of user # $gUserType = "user"; if (&plInt_CheckAdmin("$_wb'DefaultDb", $cookie{'NeoAdmin'})) { $gUserType = "admin"; } else { $gUserType = "dbadmin" if (&plInt_CheckAdmin("$form{'Db'}", $cookie{'NeoDbAdmin'})); } if ($_wb'IsPrivateBoard && $gUserType eq "user" && &plInt_CheckMember("$form{'Db'}", "$cookie{'NeoMemberId'}", "$cookie{'NeoMemberPass'}", "$_wb'UseGlobalMember") == 1) { $gUserType = "member"; } if ($_wb'IsPrivateBoard && $_wb'DisAllowList && $gUserType ne "admin" && $gUserType ne "dbadmin" && $gUserType ne "member") { &PrintPostContent("MEMBER_LOGIN"); exit; } # # fmKeyWord have to URL Encoding before reuse it # $gEncKeyWord = $form{'fmKeyWord'}; &plVoid_UrlEncoding(*gEncKeyWord); # # Get the nick name of this DB # $gDbNickName = &plStr_GetDbNickName("$form{'Db'}"); # # # $gCurrentDate = substr(&plStr_GetCurrentDate(), 0, 8); # # delete messages selected by administrator # if (($gUserType eq "admin" || $gUserType eq "dbadmin") && length($form{'fmDeleteList'})) { local ($i, $count, @deleteList); $date_str = &plStr_GetCurrentDate(); $d_date = substr($date_str, 0, 8); $d_time = substr($date_str, 8, 6); @deleteList = split(/:/, $form{'fmDeleteList'}); $count = 0; for ($i = 0; $i <= $#deleteList; $i++) { if (&plInt_DeleteBoardMessage($form{'Db'}, $deleteList[$i])) { $count += 1; &plInt_WriteAccessLog( "$form{'Db'}", "$d_date", "$d_time", "$ENV{'REMOTE_ADDR'}", "delete=$deleteList[$i]", "$gUserType [$cookie{'NeoName'}]"); } } print "\n"; } if ($form{'SearchID'}) { # # make keyword value for message read # &MakeKeyWordStr($form{'fmKeyWord'}); $gSearchFile = "$form{'SearchID'}"; $gReturn = &GetSearchFromFile; } else { # # clear temporary file # local (@tmp_arr); if (&plInt_GetDirectoryList("$_wb'CgiBaseDir/tmp", *tmp_arr, "")) { foreach (@tmp_arr) { if ($_ =~ /^$ENV{'REMOTE_ADDR'}/) { unlink("$_wb'CgiBaseDir/tmp/$_"); } } } if ($form{'fmKeyWord'}) { # # if teh keyword is exist, then optional search # $ret = &GetOptionalSearchList; } else { # # if there is no keyword, then all search # $ret = &GetAllSearchList; } } &PrintHtmlContent;