PHP Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | [url]http://www.zen-cart.com/index.php[/url]                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | [url]http://www.zen-cart.com/license/2_0.txt[/url].                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: faq_manager.php 001 2005-05-05 [email protected]
//
  
$content "";
  
$content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">' "\n";
  for (
$i=0;$i<sizeof($box_faq_categories_array);$i++) {
    switch(
true) {
// to make a specific faq_category stand out define a new class in the stylesheet example: A.faq_category-holiday
// uncomment the select below and set the fcPath=3 to the fcPath= your_faq_categories_id
// many variations of this can be done
//      case ($box_faq_categories_array[$i]['path'] == 'fcPath=3'):
//        $new_style = 'faq_category-holiday';
//        break;
      
case ($box_faq_categories_array[$i]['top'] == 'true'):
        
$new_style 'category-top';
        break;
      case (
$box_faq_categories_array[$i]['has_sub_cat']):
        
$new_style 'category-subs';
        break;
      default:
        
$new_style 'category-products';
      }
     if (
zen_get_faq_types_to_faq_category($box_faq_categories_array[$i]['path']) == '3' or ($box_faq_categories_array[$i]['top'] != 'true' and SHOW_FAQ_CATEGORIES_SUBFAQ_CATEGORIES_ALWAYS != 1)) {
        
// skip it this is for the document box
      
} else {
      
$content .= '<a class="' $new_style '" href="' zen_href_link(FILENAME_FAQS$box_faq_categories_array[$i]['path']) . '">';

      if (
$box_faq_categories_array[$i]['current']) {
        if (
$box_faq_categories_array[$i]['has_sub_cat']) {
          
$content .= '<span class="category-subs-parent">' $box_faq_categories_array[$i]['name'] . '</span>';
        } else {
          
$content .= '<span class="category-subs-selected">' $box_faq_categories_array[$i]['name'] . '</span>';
        }
      } else {
        
$content .= $box_faq_categories_array[$i]['name'];
      }

      if (
$box_faq_categories_array[$i]['has_sub_cat']) {
        
$content .= FAQ_CATEGORIES_SEPARATOR;
      }
      
$content .= '</a>';

      if (
SHOW_FAQ_COUNTS == 'true') {
        if ((
FAQ_CATEGORIES_COUNT_ZERO == '1' and $box_faq_categories_array[$i]['count'] == 0) or $box_faq_categories_array[$i]['count'] >= 1) {
          
$content .= FAQ_CATEGORIES_COUNT_PREFIX $box_faq_categories_array[$i]['count'] . FAQ_CATEGORIES_COUNT_SUFFIX;
        }
      }

      
$content .= '<br />';
    }
  }

  if (
SHOW_FAQ_CATEGORIES_BOX_FAQS_NEW == 'true' or SHOW_FAQ_CATEGORIES_BOX_FEATURED_FAQS == 'true' or SHOW_FAQ_CATEGORIES_BOX_FAQS_ALL == 'true') {
// display a separator between faq_categories and links
    
if (SHOW_FAQ_CATEGORIES_SEPARATOR_LINK == '1') {
      
$content .= '<br />' zen_draw_separator('pixel_silver.gif') . '<br />';
    }
    if (
SHOW_FAQ_CATEGORIES_BOX_FAQS_NEW == 'true') {
      switch (
true) {
        case (
SHOW_NEW_FAQS_LIMIT == '0'):
          
$display_faq_limit '';
          break;
        case (
SHOW_NEW_FAQS_LIMIT == '1'):
          
$display_faq_limit " and date_format(p.faqs_date_added, '%Y%m') >= date_format(now(), '%Y%m')";
          break;
        case (
SHOW_NEW_FAQS_LIMIT == '30'):
          $
$display_faq_limit ' and TO_DAYS(NOW()) - TO_DAYS(p.faqs_date_added) <= 30';
          break;
        case (
SHOW_NEW_FAQS_LIMIT == '60'):
          
$display_faq_limit ' and TO_DAYS(NOW()) - TO_DAYS(p.faqs_date_added) <= 60';
          break;
        case (
SHOW_NEW_FAQS_LIMIT == '90'):
          
$display_faq_limit ' and TO_DAYS(NOW()) - TO_DAYS(p.faqs_date_added) <= 90';
          break;
        case (
SHOW_NEW_FAQS_LIMIT == '120'):
          
$display_faq_limit ' and TO_DAYS(NOW()) - TO_DAYS(p.faqs_date_added) <= 120';
          break;
      }

      
$show_this $db->Execute("select p.faqs_id
                                 from " 
TABLE_FAQS " p
                                 where p.faqs_status = '1' " 
$display_faq_limit " limit 1");
      if (
$show_this->RecordCount() > 0) {
        
$content .= '<a class="category-links" href="' zen_href_link(FILENAME_FAQS_NEW) . '">' FAQ_CATEGORIES_BOX_HEADING_WHATS_NEW '</a>' '<br />';
      }
    }
     if (
SHOW_FAQ_CATEGORIES_BOX_FAQS_ALL == 'true') {
      
$content .= '<a class="category-links" href="' zen_href_link(FILENAME_FAQS_ALL) . '">' FAQ_CATEGORIES_BOX_HEADING_FAQS_ALL '</a>';
    }
  }
$content .= '</div>' "\n";
?>[PHP]
[/PHP]