<?php
//
// +---------------------------------------------------------------------------+
// | Multilingual FAQ Plugin |
// +---------------------------------------------------------------------------+
// | index.php FAQMan rediretor |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2009 by the following authors: |
// | |
// | Author: http://lior.weissbrod.com |
//
// | Copyright (C) 2006 by the following authors: |
// | |
// | Author: Oliver Spiesshofer |
// | Constructed with the Universal Plugin |
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - hide@address.com |
// | Blaine Lang - hide@address.com |
// | The Universal Plugin is based on prior work by: |
// | Tony Bibbs - hide@address.com |
// +---------------------------------------------------------------------------+
// | |
// | This program 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 2 |
// | of the License, or (at your option) any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
// | |
// +---------------------------------------------------------------------------+
//
require_once('../lib-common.php');
$mfaq_faqman = true;
if (isset($_GET['op'])) {
$mfaq_type = COM_applyFilter($_GET['op']);
if (($mfaq_type == 'cat') && isset($_GET['c'])) {
$mfaq_id = COM_applyFilter($_GET['c']);
$mfaq_type = 't';
} else if (isset($_GET['t'])) {
$mfaq_id = COM_applyFilter($_GET['t']);
$mfaq_type = 'q';
}
else {
$mfaq_faqman = false;
}
} else {
$mfaq_faqman = false;
}
if ($mfaq_faqman) {
$mfaq_sql = "SELECT `new_id` FROM {$_TABLES['mfaq_link']} "
. "WHERE `old_id`='$mfaq_id' AND `type`='$mfaq_type' AND `source`='faqman' LIMIT 1";
$mfaq_result = DB_query($mfaq_sql);
if (DB_numRows($mfaq_result) == 1) {
$A = DB_fetchArray($mfaq_result);
$mfaq_url = "{$_CONF['site_url']}/multifaq/index.php?id={$A['new_id']}";
if ($mfaq_type == 't') {
$mfaq_url .= "&what=topic";
}
} else {
$mfaq_faqman = false;
}
}
if ($mfaq_faqman) {
echo COM_refresh(COM_buildUrl($mfaq_url));
} else {
echo COM_refresh("{$_CONF['site_url']}/multifaq/index.php");
}
?>