Location: PHPKode > projects > PHP Enter > www/news.php
<?php session_start();
//PHP Enter 3.0.
//Copyright (C) 2011  Predrag Rukavina hide@address.com
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
error_reporting(E_ERROR | E_WARNING | E_PARSE);
require_once('recaptchalib.php');
$name = (int)$_GET['name'];
include('settings.php');
$tmp = mysql_query("SELECT * FROM categori ORDER BY name ASC"); 
while ($aclrow = mysql_fetch_assoc($tmp))
{
$ccval[] = $aclrow;
}
$smarty->assign('path',$path);
$smarty->assign('title',$title);
$smarty->assign('temp',$temp);
$smarty->assign('categori', $ccval);
$resulty = mysql_query("select * from newser where univer = '" . mysql_real_escape_string($name) ."'")
or die(mysql_error()); 
while($nrow=mysql_fetch_array($resulty)){
$val[] = $nrow;
}
$revres = mysql_query("select * from reviews where comrev = '" . mysql_real_escape_string($name) ."' order by cdate desc")
or die(mysql_error()); 
while($revrow=mysql_fetch_array($revres)){
$reval[] = $revrow;
}
$galres = mysql_query("select * from vgalery order by galid desc LIMIT 5")
or die(mysql_error()); 
while($gevrow=mysql_fetch_array($galres)){
$geval[] = $gevrow;
}
$shouter = @$_SESSION['INC_USER_ID'];
if($shouter == true){
$ures = mysql_query("SELECT * FROM users WHERE usid='" . mysql_real_escape_string($shouter) ."' ")
or die(mysql_error()); 
while($urow=mysql_fetch_array($ures)){
$kori= $urow['usid'];
$usercc=$urow['username'];
$thumbs=$urow['thumbs'];
$eeuser=$urow['email'];
$smarty->assign('kori', $kori);
$smarty->assign('usercc', $usercc);
$smarty->assign('thumbs', $thumbs);
}
}
$incname = (int)$_GET['name'];
$smarty->assign('incname', $incname);
$smarty->assign('newser', $val);
$smarty->assign('reviews', $reval);
$smarty->assign('vgalery', $geval);
$smarty->caching = 1;
$smarty->display('news.php',$name);
if($shouter == true){
$smarty->display('form.php');
}else{
echo "<br /><div id=\"message\"><a href=\"link.php?return=$name\">You must be logged in to post a comment</a></div>";
}
?>
  </td>
  <td valign="top">
<?php $smarty->display('sidebar.php'); ?>
  </td>
 </tr>
</table>
</div>
<?php $smarty->display('footer.php'); ?>
Return current item: PHP Enter