############################################################################### # Search.pm # # $Date: 06.01.16 $ # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 2.6.13 # # Packaged: June 1, 2016 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # ############################################################################### no warnings qw(uninitialized); our $VERSION = '2.6.13'; $searchpmver = 'YaBB 2.6.13 $Revision$'; $action ||= q{}; if ( $action eq 'detailedversion' ) { return 1; } LoadLanguage('Search'); get_micon(); get_template('Search'); if ( $FORM{'searchboards'} =~ /\A\!/xsm ) { my $checklist = q{}; get_forum_master(); foreach my $catid (@categoryorder) { (@bdlist) = split /\,/xsm, $cat{$catid}; my ( $catname, $catperms, $catallowcol ) = split /\|/xsm, $catinfo{$catid}; my $access = CatAccess($catperms); if ( !$access ) { next; } recursive_search(@bdlist); } sub recursive_search { my @x = @_; foreach my $curboard (@x) { chomp $curboard; # don't add to count if it's a sub board if ( !${ $uid . $curboard }{'parent'} ) { $cat_boardcnt{$catid}++; } my ( $boardname, $boardperms, $boardview ) = split /\|/xsm, $board{$curboard}; my $access = AccessCheck( $curboard, q{}, $boardperms ); if ( !$iamadmin && $access ne 'granted' ) { next; } $checklist .= qq~$curboard, ~; if ( $subboard{$curboard} ) { recursive_search( split /\|/xsm, $subboard{$curboard} ); } } return; } $checklist =~ s/, \Z//sm; $FORM{'searchboards'} = $checklist; } sub plushSearch1 { # generate error if admin has disabled search options if ( $maxsearchdisplay < 0 ) { fatal_error('search_disabled'); } if ( $advsearchaccess ne 'granted' ) { fatal_error('no_access'); } my ( @categories, $curcat, %catname, %cataccess, @membergroups, %openmemgr, $curboard, @threads, @boardinfo, $counter ); LoadCensorList(); if ( !$iamguest ) { Collapse_Load(); } $yymain .= qq~