<?php
/**
 * This file is part of 
 * pragmaMx - Web Content Management System.
 * Copyright by pragmaMx Developer Team - http://www.pragmamx.org
 *
 * pragmaMx is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * $Revision: 1.8.6.1 $
 * $Author: tora60 $
 * $Date: 2009/02/21 11:26:55 $
 *
 * this file based on:
 * php-nuke Web Portal System - http://phpnuke.org/
 * Thatware - http://thatware.org/
 */

defined('mxMainFileLoaded') or die('access denied');

$mxblockcache = true;

global $prefix;

if ($GLOBALS['multilingual']) {
    if (strpos($GLOBALS['currentlang'], 'german') === 0) $thislang = 'german';
    else $thislang = $GLOBALS['currentlang'];
    $querylang = "WHERE (flanguage LIKE '" . $thislang . "%' OR flanguage='')";
} else {
    $querylang = '';
}

$result = sql_query("SELECT id_cat, categories FROM ${prefix}_faqcategories $querylang ORDER BY categories");
$content = '';
while (list($id_cat, $categories) = sql_fetch_row($result)) {
    $cresult = sql_query("SELECT * FROM " . $prefix . "_faqanswer WHERE id_cat=" . $id_cat);
    $cnumrows = mxValueToString(sql_num_rows($cresult), 0);
    $content .= '<div style="text-indent: -8px; margin-left: 8px;"><strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=FAQ&amp;cat=' . $id_cat . '">' . $categories . '</a>&nbsp;<span class="tiny">(' . $cnumrows . ')</span></div>';
}

?>
