<?php
/**
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to hide@address.com so we can mail you a copy immediately.
*
* @package QuickTalk forum
* @author Philippe Vandenberghe <hide@address.com>
* @copyright 2008-2012 The PHP Group
* @version 2.5 build:20100924
*/
session_start();
require_once('bin/qtf_init.php');
include(Translate('qtf_adm.php'));
include('bin/qtf_fn_sql.php');
if ( $oVIP->role!='A' ) die(Error(13));
// INITIALISE
$d = 10; // days
$ok = '';
QThttpvar('d ok','int str');
$oVIP->selfurl = 'qtf_adm_topic.php';
$oVIP->selfname = '<span class="upper">'.$L['Adm_content'].'</span><br/>'.$L['Topics'];
$oVIP->exitname = '« '.$L['Topics'];
$arrStats = GetStats();
// --------
// SUBMITTED
// --------
if ( !empty($ok) )
{
if ( !QTisbetween($d,1,99) ) { $error=$L['Days'].' '.Error(1).' (1-99)'; $d=10; }
}
// --------
// HTML START
// --------
include('qtf_adm_p_header.php');
$arrDomains = GetDomains();
echo '<table class="data_o" cellspacing="0" summary="manage topics">
<colgroup span="6">
<col width="50"></col>
<col></col>
<col></col>
<col></col>
<col></col>
<col></col>
</colgroup>
<tr class="data_o">
<td class="colhd" colspan="2">',$L['Domain'],'/',$L['Section'],'</td>
<td class="colhd" style="text-align:center;">',$L['Topics'],' </td>
<td class="colhd" style="text-align:center;">',$L['Replys'],' </td>
<td class="colhd" style="text-align:center;">',$L['Unreplied'],'* </td>
<td class="colhd" style="text-align:center;">',$L['Action'],' </td>
</tr>',N;
foreach($arrDomains as $intDomid=>$strDomtitle)
{
echo '<tr class="data_o"><td class="colgroup" colspan="6">',$strDomtitle,'</td></tr>',N;
$arrSections = QTarrget(GetSections('A',$intDomid)); // GET SECTIONS (with hidden)
foreach($arrSections as $s=>$strValue)
{
$oSEC = new cSection($s);
$intN = $oSEC->Count('news');
$intU = $oSEC->Count('unreplied',$d);
echo '<tr class="data_o">';
echo '<td class="colct" style="text-align:center">',AsImg($oSEC->GetLogo(),'S',$L['Ico_section_'.$oSEC->type.'_'.$oSEC->status],'ico i_sec'),'</td>';
echo '<td class="colct"><b>',$oSEC->name,'</b><br/><span class="small">',$L['Section_type'][$oSEC->type],($oSEC->status=='1' ? '('.$L['Section_status'][1].')' : ''),'</span></td>';
echo '<td class="colct" style="text-align:center;">',$arrStats[$s]['topics'],'</td>';
echo '<td class="colct" style="text-align:center;">',$arrStats[$s]['replies'],'</td>';
echo '<td class="colct" style="text-align:center;">',$intU,'</td>';
echo '<td class="colct" style="text-align:center;">';
if ( $arrStats[$s]['topics']>0 )
{
echo '<a class="small" href="qtf_adm_change.php?a=topicmoveall&s=',$s,'&d=',$d,'">',$L['Move'],'</a> · ';
echo '<a class="small" href="qtf_adm_change.php?a=topicdeleteall&s=',$s,'&d=',$d,'">',$L['Delete'],'</a> · ';
}
else
{
echo '<span class="disabled">',$L['Move'],'</span> · ';
echo '<span class="disabled">',$L['Delete'],'</span> · ';
}
if ( $intU>0 )
{
echo '<a class="small" href="qtf_adm_change.php?a=topicprune&s=',$s,'&d=',$d,'">',$L['Prune'],'</a>';
}
else
{
echo '<span class="disabled">',$L['Prune'],'</span>';
}
echo '</td></tr>',N;
}
}
echo '</table>
<br/><form method="post" action="',$oVIP->selfurl,'">
<fieldset style="width:450px; padding:5px; text-align:right;">
<legend>*',$L['Unreplied'],'</legend>';
printf($L['H_Unreplied'],'<input type="text" name="d" size="2" maxlength="2" value="'.$d.'" class="small"/>');
echo ' <input type="submit" name="ok" value="',$L['Ok'],'"/><br/>
</fieldset>
</form><br/>',N;
// HTML END
include('qtf_adm_p_footer.php');
?>