Location: PHPKode > projects > QuickTicket > quickticket/qti_adm_topic.php
<?php

/**
* PHP versions 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    QuickTicket
* @author     Philippe Vandenberghe <hide@address.com>
* @copyright  2008-2012 The PHP Group
* @version    2.5 build:20101222
*/

session_start();
require_once('bin/qti_init.php');
include(Translate('qti_adm.php'));
include('bin/qti_fn_sql.php');

if ( $oVIP->role!='A' ) die(Error(13));

// INITIALISE

$d = 10; // days
$ok = '';
QThttpvar('d ok','int str');

$oVIP->selfurl = 'qti_adm_topic.php';
$oVIP->selfname = '<span class="upper">'.$L['Adm_content'].'</span><br />'.$L['Topics'];

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

if ( !empty($ok) )
{
  if ( !QTisbetween($d,1,99) ) { $error=$L['Days'].' '.Error(1).' (1-99)'; $d=10; }
}

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

include('qti_adm_p_header.php');

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

$arrDomains = GetDomains();

echo '<table class="data_o" cellspacing="0">
<colgroup span="6"><col width="50"></col><col></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">',$L['Topics'],'&nbsp;</td>
<td class="colhd">',$L['Replys'],'&nbsp;</td>
<td class="colhd">',$L['Unreplied'],'*&nbsp;</td>
<td class="colhd">',$L['Action'],'</td>
</tr>
';

foreach($arrDomains as $intDomid=>$strDomtitle)
{

  echo '<tr class="data_o">',N,'<td class="colgroup" colspan="6">',$strDomtitle,'</td>',N,'</tr>',N;

  // GET FORUMS (with hidden)

  $arrSections = QTarrget(GetSections('A',$intDomid));

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

    $intN = cSection::CountItems($oSEC->id,'news');
    $intU = cSection::CountItems($oSEC->id,'unreplied',$d);

    echo '<tr class="data_o">',N;
    echo '<td class="colct center">',AsImg($oSEC->GetLogo(),'S',$L['Ico_section_'.$oSEC->type.'_'.$oSEC->status],'ico ico_s'),'</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 center">',$oSEC->items,'</td>',N;
    echo '<td class="colct center">',$oSEC->replies,'</td>',N;
    echo '<td class="colct center">',$intU,'</td>',N;
    echo '<td class="colct center">',N;
    if ( $oSEC->items>0 )
    {
    echo '<a class="small" href="qti_adm_change.php?a=topicmoveall&amp;s=',$oSEC->id,'&amp;d=',$d,'">',$L['Move'],'</a> &middot; ';
    echo '<a class="small" href="qti_adm_change.php?a=topicdeleteall&amp;s=',$oSEC->id,'&amp;d=',$d,'">',$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_change.php?a=topicprune&amp;s=',$oSEC->id,'&amp;d=',$d,'">',$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="d" size="2" maxlength="2" value="'.$d.'" class="small" />'),'&nbsp;<input name="ok" type="submit" value="',$L['Ok'],'" /><br />
</fieldset>
</form>
';

// HTML END

include('qti_adm_p_footer.php');

?>
Return current item: QuickTicket