Location: PHPKode > scripts > QT-registrations > qt-registrations/qtregistrations/qtr_topic_m.php
<?php



// QT-registrations 1.3 build:20080923



require_once('bin/qtr_fn_limitsql.php');



// COUNT RECORDS



$oDB->Query('SELECT count(p.id) as countid FROM '.TABPOST.' p WHERE p.section='.$oSEC->id.' AND p.topic='.$oTopic->id);

$row = $oDB->Getrow();

$intPosts = $row['countid'];



// stop if no post (or user not creator)



if ( $intPosts==0 )

{

  echo '<p>'.$L['None'].'...</p>';

}

else

{

  // PAGER

  

  $strPager = MakePager("$oVIP->selfurl?s={$oSEC->id}&t={$oTopic->id}",$intPosts,$_SESSION[QT]['topics_per_page'],$PAGEcurr,$L);

  if ($strPager=='') { $strPager='&nbsp;';} else { $strPager = $L['Page'].$strPager; }

  

  // BUTTONS

  if ( $oSEC->status==1 )

  {

    $strCommand = '<td class="td_button" style="width:120px"><span class="a_button_off">&nbsp;'.$L['E_section_closed'].'&nbsp;</span></td>'.N;

  }

  else

  {

    $strCommand = '<td class="td_button" style="width:120px">&nbsp;<a class="a_button" href="qtr_form_edit.php?s='.$oSEC->id.'&amp;t='.$oTopic->id.'&amp;a=re">'.$L['Post_reply'].'</a>&nbsp;</td>'.N;

    if ( $oTopic->status=='Z' || $oTopic->status=='0' ) $strCommand = '<td class="td_button" style="width:120px"><span class="a_button_off">&nbsp;'.$L['Topic_closed'].'&nbsp;</span></td>'.N;

    if ( ($oVIP->role=='V') && ($_SESSION[QT]['visitor_right']<6) )

    {

    $strCommand = '<td class="td_button" style="width:120px"><span class="a_button_off">&nbsp;'.$L['Post_reply'].'&nbsp;</span></td>'.N;

    }

  }



  // QUERY



  $strState = 'p.id,p.section,p.topic,p.icon,p.title,p.type,p.userid,p.username,p.issuedate,p.modifdate,p.modifuser,p.modifname,p.attach,p.textmsg, u.role, u.location, u.avatar, u.signature

  FROM '.TABPOST.' p, '.TABUSER.' u WHERE p.userid = u.id AND p.topic='.$oTopic->id;

  $strQuery = LimitSQL($oDB,$strState,'p.id ASC',$limit,$_SESSION[QT]['replies_per_page'],$intPosts);

  $oDB->Query($strQuery);



  $iMsgNum = $limit;

  $iMsgAdd = 1;

  $intWhile= 0;

  $strAlt = '1';

  $strSep = '<div class="div_post_sep_'.($_SESSION[QT]['viewmode']=='N' ? 'n' : 'c').'"></div>'.N;

  $bButton = true; if (isset($bToPrint) ) $bButton = false;

  $bAvatar = true;



  // BUTTON LINE AND PAGER



  echo '<!-- Button and pager -->',N;

  echo '<table class="ta_button ta_button_top" cellspacing="0">',N;

  echo '<tr class="tr_button">',N;

  echo '<td id="zone_pager_top">',$strPager,'</td>',N;

  echo '</tr>',N;

  echo '</table>',N;

  echo '<!-- End button and pager -->',N,N;



  // DISPLAY MESSAGES



  include('qtr_topic_m_inc.php');



  // QUICK REPLY

  if ( !isset($bToPrint) ) {

  if ( $_SESSION[QT]['show_quick_reply']=='1' ) {

  

    if ( $oSEC->status=='0' && $oTopic->status!='Z' && $oTopic->status!='0' )

    {

      if ( $oVIP->role=='V' && $_SESSION[QT]['visitor_right']<7 )

      {

      }

      else

      {

      echo '  <!-- Quick reply -->',N;

      echo '  <div class="fs_quickreply">',N;

      $intMax = $_SESSION[QT]['chars_per_post'];

      echo '  <script type="text/javascript">

      <!--

      function ValidateForm(theForm)

      {

        if (theForm.text.value.length==0) { alert(html_entity_decode("',$L['E_mandatory'],': ',$L['Message'],'")); return false; }

        if (theForm.text.value.length>'.$intMax.') { alert("Message too long: Maxlenght < ',$intMax,'"); return false; }

        return null;

      }

      -->

      </script>',N;

      echo '<form method="post" action="qtr_form_edit.php" onsubmit="return ValidateForm(this);">',N;

      echo '<input type="hidden" name="section" value="',$oSEC->id,'"/>

      <input type="hidden" name="topic" value="',$oTopic->id,'"/>

      <input type="hidden" name="action" value="re"/>

      <input type="hidden" name="ref" value="',$oTopic->numid,'"/>

      <input type="hidden" name="icon" value="00"/>

      <input type="hidden" name="title" value=""/>',N;

      echo $L['Quick_reply'],S,S,N;

      include('qtr_form_button.php');

      echo '&nbsp;&nbsp;<input type="submit" id="dopreview" name="dopreview" value="',$L['Advanced_reply'],'" class="small"/><br/>',N;

      echo '<a href="textarea"></a>';

      echo '<textarea id="text" name="text" rows="5" wrap="virtual" cols="85"></textarea>';

      echo '&nbsp;<input type="submit" id="dosend" name="dosend" value="',$L['Send'],'"/>',N;

      echo '</form>',N,'</div>',N;

      echo '<!-- End Quick reply -->',N,N;

      }

    }

  

  }}



  // BUTTON LINE AND PAGER



  //if ( $intPosts>1 )

  //{

  echo '<!-- Button and pager -->',N;

  echo '<table class="ta_button ta_button_bot" cellspacing="0">',N;

  echo '<tr class="tr_button">',N;

  if ( !isset($bToPrint) ) echo $strCommand;

  echo '<td id="zone_pager_bot">',$strPager,'</td>',N;

  echo '</tr>',N;

  echo '</table>',N;

  echo '<!-- End button and pager -->',N,N;

  //}

  

}



?>
Return current item: QT-registrations