PHP Classes

File: upload/themes/bb_simple/model/Forum.php

Recommend this page to a friend!
  Classes of James Brows   PHP Bulletin Board   upload/themes/bb_simple/model/Forum.php   Download  
File: upload/themes/bb_simple/model/Forum.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Bulletin Board
Manage and post messages in multi-user forums
Author: By
Last change:
Date: 3 years ago
Size: 1,271 bytes
 

Contents

Class file image Download
<?php

function bb_genListNestedForum($listCategories=array(),$listSubCategories=array())
{

   
$result=array();

   
$total=count($listCategories);
   
$totalSub=count($listSubCategories);

    for (
$i=0; $i < $total; $i++) {
        if(
$listCategories[$i]['parent_id']==null || strlen($listCategories[$i]['parent_id'])==0)
        {
           
array_push($result,$listCategories[$i]);
        }
       
        for (
$j=0; $j < $totalSub; $j++) {
            if(
$listCategories[$i]['forum_id']==$listSubCategories[$j]['parent_id'])
            {
               
$listSubCategories[$j]['title']='Sub -> '.$listSubCategories[$j]['title'];

               
array_push($result,$listSubCategories[$j]);
            }
        }
    }

    return
$result;
}

function
bb_gen_breadcum_forum_data($forum_id,$listCategories=array())
{
    if(!isset(
Configs::$_['forum_breadcum_data']))
    {
       
Configs::$_['forum_breadcum_data']=[];
    }

   
$total=count($listCategories);

    for (
$i=0; $i < $total; $i++) {
        if(
$forum_id==$listCategories[$i]['forum_id'])
        {
           
array_push(Configs::$_['forum_breadcum_data'],$listCategories[$i]);

           
bb_gen_breadcum_forum_data($listCategories[$i]['parent_id'],$listCategories);
        }
    }
}