Location: PHPKode > projects > QuickTalk Forum > quicktalk/qtf_index.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.
*
* @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');

// --------
// SECURITY
// --------

if ( $_SESSION[QT]['board_offline']=='1' ) HtmlPage(99);
if ( $_SESSION[QT]['visitor_right']<1 && $oVIP->role=='V' ) HtmlPage(11);

// --------
// INITIALIZE
// --------

$arrDomains = GetDomains($oVIP->role);
$arrStats = GetStats();

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

$oVIP->arrJava=null;
include('qtf_p_header.php');

// --------
// DOMAIN / SECTIONS
// --------

$intDom = 0;
$intSec = 0;
foreach($arrDomains as $intDomid=>$strDomtitle)
{
  $arrSections = GetSections($oVIP->role,$intDomid);

  if ( count($arrSections)>0 )
  {
    $intDom++;
    if ( $intDom>1 ) echo '<!-- domain separator -->',N,'<div class="dom_separator"></div>',N;
    echo '<!-- domain ',$intDomid,': ',$strDomtitle,' -->',N;
    echo '<table class="data_s" cellspacing="0" summary="domain">',N;
    echo '<colgroup span="5"><col></col><col></col><col width="150"></col><col width="60"></col><col width="60"></col></colgroup>',N;
    echo '<tr class="data_s">',N;
    echo '<td class="colhd colhdico colhdfirst">',S,'</td>',N;
    echo '<td class="colhd">',$strDomtitle,'</td>',N;
    echo '<td class="colhd">',$L['Last_message'],'</td>',N;
    echo '<td class="colhd">',$L['Topics'],'</td>',N;
    echo '<td class="colhd colhdlast">',$L['Replys'],'</td>',N;
    echo '</tr>',N;

    // SHOW SECTIONS
    
    $strAlt='r1';

    foreach($arrSections as $s=>$arrSection)
    {
      $intSec++;
      $oSEC = new cSection($arrSection,true);
      
      echo '<tr class="data_s ',$strAlt,'">',N;
      echo '<td class="colct colico ',$strAlt,' colfirst">',AsImg($oSEC->GetLogo(),'F',$L['Ico_section_'.$oSEC->type.'_'.$oSEC->status],'ico i_sec','',Href('qtf_topics.php').'?s='.$s),'</td>',N;
      echo '<td class="colct ',$strAlt,'"><a class="section" href="',Href('qtf_topics.php'),'?s=',$s,'">',$oSEC->name,'</a>',(empty($oSEC->descr) ? '' : '<br/><span class="sectiondesc">'.$oSEC->descr.'</span>'),'</td>',N;
      echo '<td class="colct ',$strAlt,'">',N;
      if ( $arrStats[$s]['topics']<1 )
      {
      echo S;
      }
      else
      {
        if ( isset($oSEC->lastpostid) )
        {
        echo QTdatestr($oSEC->lastpostdate,'$','$',true,true,true);
        echo ' <a href="',Href('qtf_topic.php'),'?t=',$oSEC->lastposttopic,'#p',$oSEC->lastpostid,'" title="',$L['H_Goto_message'],'">',$L['Goto_message'],'</a><br/>',strtolower($L['By']).' <a href="qtf_user.php?id=',$oSEC->lastpostuser,'" title="',$L['Ico_user_p'],'" class="small">',$oSEC->lastpostname,'</a>';
        }
        else
        {
        echo S;
        }
      }
      echo '</td>',N;
      echo '<td class="colct center ',$strAlt,'">',(isset($arrStats[$s]) ? $arrStats[$s]['topics'] : 0),'</td>',N;
      echo '<td class="colct center ',$strAlt,' collast">',(isset($arrStats[$s]) ? $arrStats[$s]['replies'] : 0),'</td>',N;
      echo '</tr>',N;
      if ( $strAlt=='r1' ) { $strAlt='r2'; } else { $strAlt='r1'; }
    }

    echo '<tr class="data_s">',N;
    echo '<td class="colft colftfirst"></td>',N;
    echo '<td class="colft"></td>',N;
    echo '<td class="colft"></td>',N;
    echo '<td class="colft"></td>',N;
    echo '<td class="colft colftlast"></td>',N;
    echo '</tr>',N;
    echo '</table>',N;
  }
}

// No public section

if ( $intSec==0 )
{
  echo '<p>',( $oVIP->role=='V' ? $L['E_no_public_section'] : $L['E_no_visible_section'] ),'</p>';
}

// HTML END

if ( isset($oSEC) ) unset($oSEC);
include('qtf_p_footer.php');

?>
Return current item: QuickTalk Forum