function checkTopicsCategory($topics, $threads, $idCategory, $categoryUser, $threadMembers, $userID) { $counter = 0; foreach ($topics as $top) { if ($top->category == $idCategory) { $countThreadsTopic = checkThreadsTopic($threads, $top->id, $threadMembers, $idCategory, $categoryUser, $top->tenaga_ahli, $userID); if ($countThreadsTopic > 0) { $counter += 1; } } } return $counter; }
function checkTopicsCategory($topics, $threads, $idCategory) { $counter = 0; foreach ($topics as $top) { if ($top->category == $idCategory) { $countThreadsTopic = checkThreadsTopic($threads, $top->id); if ($countThreadsTopic > 0) { $counter += 1; } } } return $counter; }
<div class="forum-heading"> <h3><?php if (isset($category)) { echo $category; } else { echo $cat->category_name; } ?> </h3> </div> <div class="forum-main"> <div class="forum-list"> <?php foreach ($topics as $top) { if ($top->category == $cat->id) { $countThreadsTopic = checkThreadsTopic($threads, $top->id); if ($countThreadsTopic > 0) { ?> <table class="table table-striped"> <thead class="thead-inverse"> <tr> <th colspan="2">Topic : <?php echo $top->topic; ?> </th> </tr> </thead> <tbody> <?php $isThread = false; foreach ($threads as $thr) {
<div class="forum-heading"> <h3><?php if (isset($category)) { echo $category; } else { echo $cat->category_name; } ?> </h3> </div> <div class="forum-main"> <div class="forum-list"> <?php foreach ($topics as $top) { if ($top->category == $cat->id) { $countThreadsTopic = checkThreadsTopic($threads, $top->id, $threadMembers, $userID); if ($countThreadsTopic > 0) { ?> <table class="table table-striped"> <thead class="thead-inverse"> <tr> <th>Topic : <?php echo $top->topic; ?> </th> </tr> </thead> <tbody> <?php $isThread = false; foreach ($threads as $thr) {
} else { echo $cat->category_name; } ?> </h3> </div> <div class="forum-main"> <div class="forum-list"> <?php foreach ($topics as $top) { if ($top->category == $cat->id) { if (isset($categoryUser)) { $countThreadsTopic = checkThreadsTopic($threads, $top->id, $threadMembers, $cat->id, $categoryUser, $top->tenaga_ahli, $userID); } else { $categoryUser = array(); $countThreadsTopic = checkThreadsTopic($threads, $top->id, $threadMembers, $cat->id, $categoryUser, $top->tenaga_ahli, $userID); } if ($countThreadsTopic > 0) { ?> <table class="table table-striped"> <thead class="thead-inverse"> <tr> <th>Topic : <?php echo $top->topic; ?> </th> </tr> </thead> <tbody> <?php $isThread = false;