Location: PHPKode > projects > QuickTicket > quickticket/quickticket/qti_adm_topic.php
<?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.
 *
 * @category   Troubleticket
 * @package    QuickTicket
 * @author     Philippe Vandenberghe <hide@address.com>
 * @copyright  2008-2012 The PHP Group
 * @license    http://www.php.net/license  PHP License 3.0
 * @version    1.9.0.3 build:20081001
 * @link       http://www.qt-cute.org/doc/package/qti
 * @since      File available since Release 1.0.0
 * @deprecated File deprecated in Release 2.0.0
 *
 */

session_start();
require_once('bin/qti_init.php');
include(Translate('qti_lang_adm.inc'));
include('bin/qti_fn_limitsql.php');

if ( $oVIP->role!='A' ) die($L['E_admin']);

// INITIALISE

$days = 10;
if ( isset($_GET['d']) ) $days = intval(strip_tags($_GET['d']));

$oVIP->selfurl = 'qti_adm_topic.php';
$oVIP->selfname = $L['Topic_man'];

// --------
// SUBMITTED
// --------

if ( isset($_POST['ok']) )
{
  $days = intval(trim($_POST['days']));
  if ( !QTisbetween($days,1,99) )
  {
  $qti_error = $L['Days'].S.$L['E_invalid'].' (1-99)';
  $days = 10;
  }
}

// --------
// HTML START
// --------

$arrJava = array('com'=>false);

include('qti_adm_p_header.php');
include('qti_adm_p_title.php');

// --------
// CONTENT
// --------

echo '<table class="ta ta_s" cellspacing="0">
<colgroup span="6"><col width="50"></col><col></col><col></col><col></col><col></col><col></col><col></col></colgroup>
<tr class="tr_s tr_s0">
<th class="th_o" colspan="2">',$L['Domain'],'/',$L['Section'],'</th>
<th class="th_o">',$L['Topics'],'&nbsp;</th>
<th class="th_o">',$L['Replys'],'&nbsp;</th>
<th class="th_o">',$L['Unreplied'],'*&nbsp;</th>
<th class="th_o">',$L['Action'],'</th>
</tr>
';

foreach ($_SESSION['qtiDomains'] as $intDomid => $strDomtitle)
{

  echo '<tr class="tr_s tr_s1">',N,'<td class="td_o_all" colspan="6">',$strDomtitle,'</td>',N,'</tr>',N;

  // GET FORUMS (with hidden)

  $arrSections = GetSectionTitles('A',$intDomid);

  foreach ($arrSections as $intKey => $strValue)
  {
    $oSEC = new cSection($intKey);

    $intN = $oSEC->Count('news');
    $intU = $oSEC->Count('unreplied',null,$days);

    echo '<tr class="tr_s tr_s2">',N;
    echo '<td class="td_o" style="text-align:center">',AsImg($_SESSION[QT]['skin_dir'].'/ico_section_'.$oSEC->type.'_'.$oSEC->status.'.gif','S',$L['Ico_section_'.$oSEC->type.'_'.$oSEC->status],'ico ico_s'),'</td>';
    echo '<td class="td_o"><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="td_o td_o_sta" style="text-align:center;">',$oSEC->topics,'</td>',N;
    echo '<td class="td_o td_o_sta" style="text-align:center;">',$oSEC->replies,'</td>',N;
    echo '<td class="td_o td_o_sta" style="text-align:center;">',$intU,'</td>',N;
    echo '<td class="td_o td_o_sta" style="text-align:center;">',N;
    if ( $oSEC->topics>0 )
    {
    echo '<a class="small" href="qti_adm_cmd.php?a=topicmoveall&amp;s=',$oSEC->id,'&amp;d=',$days,'">',$L['Move'],'</a> &middot; ';
    echo '<a class="small" href="qti_adm_cmd.php?a=topicdeleteall&amp;s=',$oSEC->id,'&amp;d=',$days,'">',$L['Delete'],'</a> &middot; ';
    }
    else
    {
    echo '<span class="disabled">',$L['Move'],'</span> &middot; ';
    echo '<span class="disabled">',$L['Delete'],'</span> &middot; ';
    }
    if ( $intU>0 )
    {
    echo '<a class="small" href="qti_adm_cmd.php?a=topicprune&amp;s=',$oSEC->id,'&amp;d=',$days,'">',$L['Prune'],'</a>';
    }
    else
    {
    echo '<span class="disabled">',$L['Prune'],'</span>';
    }
    echo '</td>',N,'</tr>',N;
  }
}
echo '</table>
<br/>
<form method="post" action="',$oVIP->selfurl,'">
<fieldset style="width:450px; padding:5px; text-align:right;">
<legend>*',$L['Unreplied'],'</legend>',N;
echo sprintf($L['H_Unreplied'],'<input type="text" name="days" size="2" maxlength="2" value="'.$days.'" class="small"/>'),'&nbsp;<input name="ok" type="submit" value="',$L['Ok'],'"/><br/>
</fieldset>
</form>
<br/>',N;

// HTML END

include('qti_adm_p_footer.php');

?>
Return current item: QuickTicket