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

// QuickTicket 2.5 build:20101222

include('bin/qt_lib_txt.php');
include('bin/qt_lib_db.php');
include('bin/qti_fn_base.php');

// Protection against injection (accept only 3 'lang')
$id = strip_tags($_POST['id']);
$lang = strip_tags($_POST['lang']);
if ( !in_array($lang,array('language/english/','language/francais/','language/nederlands/','language/espanol/')) ) $lang='language/english/';

$id = intval(substr($id,1));
 
include($lang.'qti_main.php');
include('bin/config.php');

$oDBAJAX = new cDB($qti_dbsystem,$qti_host,$qti_database,$qti_user,$qti_pwd,$qti_port,$qti_dsn);
if ( !empty($oDBAJAX->error) ) exit;

// query

$oDBAJAX->Query('SELECT t.*,p.icon,p.title,p.icon as smile,p.textmsg FROM ('.$qti_prefix.'qtitopic t INNER JOIN '.$qti_prefix.'qtipost p ON t.firstpostid = p.id) WHERE t.id='.$id);
$row = $oDBAJAX->GetRow();
$row['title'] = QTconv(stripslashes($row['title']),'-4');
$row['textmsg'] = QTconv(stripslashes($row['textmsg']),'-4');

$oDBAJAX->Query('SELECT * FROM '.$qti_prefix.'qtiforum s WHERE s.id='.$row['forum']);
$row2 = $oDBAJAX->GetRow();

//output the response
echo '<p class="preview_section">',$L['Section'],': ',stripslashes($row2['title']),'</p>';
echo '<div class="preview"><p class="preview_title">';
if ( $row2['numfield']!='N' )
{
  printf($row2['numfield'],$row['numid']);
  echo '<br />';
}
echo htmlentities($row['title'],ENT_NOQUOTES),'</p>';

echo '<p class="preview_message">',htmlentities(QTcompact(QTunbbc($row['textmsg']),250,' '),ENT_NOQUOTES),'</p>';
echo '<p class="preview_user">',$row['firstpostname'],'</p></div>';
echo '<p class="preview_date">',QTdatestr($row['firstpostdate'],'M d','(H:i)'),'</p>';
if ( $row['actorid']>=0 ) echo '<p class="preview_date">',$L['Userrole_MA'],': ',$row['actorname'],'</p>';

?>
Return current item: QuickTicket