Skip to content

Commit

Permalink
search: move functions up
Browse files Browse the repository at this point in the history
  • Loading branch information
RedDragonWebDesign committed Feb 7, 2024
1 parent 25b40ca commit 6f270a8
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions src/forum/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,39 @@
*
*/

function recurseSubForums($spacing) {
global $filterBoardOptions, $boardObj, $memberInfo;

$arrSubforums = $boardObj->getSubForums();
foreach ($arrSubforums as $boardID) {
$boardObj->select($boardID);
if ($boardObj->memberHasAccess($memberInfo)) {
$filterBoardOptions[$boardObj->get_info("forumboard_id")] = $spacing.$boardObj->get_info_filtered("name");
if (count($boardObj->getSubForums()) > 0) {
recurseSubForums("    ".$spacing);
}
}
}
}

/**
* Validation function used by the form processor
*/
function check_filter_boards() {
global $boardObj, $formObj;

$countErrors = 0;
foreach ($_POST['filterboards'] as $value) {
if (!$boardObj->select($value) && $value != 0) {
$countErrors++;
}
}

if ($countErrors > 0) {
$formObj->errors[] = "You selected an invalid board filter.";
}
}

// Config File
$prevFolder = "../";

Expand Down Expand Up @@ -103,37 +136,6 @@
}
}

function recurseSubForums($spacing) {
global $filterBoardOptions, $boardObj, $memberInfo;

$arrSubforums = $boardObj->getSubForums();
foreach ($arrSubforums as $boardID) {
$boardObj->select($boardID);
if ($boardObj->memberHasAccess($memberInfo)) {
$filterBoardOptions[$boardObj->get_info("forumboard_id")] = $spacing.$boardObj->get_info_filtered("name");
if (count($boardObj->getSubForums()) > 0) {
recurseSubForums("    ".$spacing);
}
}
}
}

function check_filter_boards() {
global $boardObj, $formObj;

$countErrors = 0;
foreach ($_POST['filterboards'] as $value) {
if (!$boardObj->select($value) && $value != 0) {
$countErrors++;
}
}

if ($countErrors > 0) {
$formObj->errors[] = "You selected an invalid board filter.";
}
}


$filterBoardSize = floor(count($filterBoardOptions)*.85);

$i=1;
Expand Down

0 comments on commit 6f270a8

Please sign in to comment.