[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/includes/ -> functions_separate.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /***************************************************************************
   7   *                            function_separate.php
   8   *                            -------------------
   9   *   begin                : Tuesday, Mar 15, 2005
  10   *   copyright            : (C) 2005 Aiencran
  11   *   email                : cranportal@katamail.com
  12   *
  13   *   $Id: functions_separate.php,v 1.0.0.0 2005/03/15 15:20:00 psotfx Exp $
  14   *
  15   ***************************************************************************/
  16  
  17  /***************************************************************************
  18   *
  19   *   This program is free software; you can redistribute it and/or modify
  20   *   it under the terms of the GNU General Public License as published by
  21   *   the Free Software Foundation; either version 2 of the License, or
  22   *   (at your option) any later version.
  23   *
  24   ***************************************************************************/
  25  
  26  if (!defined('IN_PHPBB'))
  27  {
  28      die('Hacking attempt');
  29  }
  30  
  31  //
  32  // Select topic to be suggested
  33  //
  34  function get_dividers($topics)
  35  {
  36      global $lang;
  37  
  38      $dividers = array();
  39      $total_topics = count($topics);
  40      $total_by_type = array (POST_GLOBAL_ANNOUNCE => 0, POST_ANNOUNCE => 0, POST_STICKY => 0, POST_NORMAL => 0);
  41  
  42      for ( $i=0; $i < $total_topics; $i++ )
  43      {
  44          $total_by_type[$topics[$i]['topic_type']]++;            
  45      }
  46  
  47      if ( ( $total_by_type[POST_GLOBAL_ANNOUNCE] + $total_by_type[POST_ANNOUNCE] + $total_by_type[POST_STICKY] ) != 0 )
  48      {
  49          $count_topics = 0;
  50          
  51          $dividers[$count_topics] = $lang['Global_Announcements'];
  52          $count_topics += $total_by_type[POST_GLOBAL_ANNOUNCE];
  53  
  54          $dividers[$count_topics] = $lang['Announcements'];
  55          $count_topics += $total_by_type[POST_ANNOUNCE];
  56  
  57          $dividers[$count_topics] = $lang['Sticky_Topics'];
  58          $count_topics += $total_by_type[POST_STICKY];
  59  
  60          if ( $count_topics < $total_topics )
  61          {
  62              $dividers[$count_topics] = $lang['Topics'];
  63          }
  64      }
  65  
  66      return $dividers;
  67  }
  68  
  69  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7