Location: PHPKode > projects > Esvon Personals > esvon-personals/inc/pages/rate.php
<?php

// --------------------------------------------------------------------------
//
// Esvon Classifieds v.4.0
// Copyright(C), Esvon LTD, 2001-2010, All Rights Reserved.
// E-mail: hide@address.com
//
// All forms of reproduction, including, but not limited to, internet posting, 
// printing, e-mailing, faxing and recording are strictly prohibited.
// One license required per site running Esvon Classifieds. 
// To obtain a license for using Esvon Classifieds, please register at
// http://www.esvon.com/pg/products/p_classifieds/
//
// --------------------------------------------------------------------------

if(!defined('SITE_PATH')) die('Access Denied');

$id = (int)$_REQUEST['id'];
$rate = (int)$_REQUEST['rate'];

$url = '';
if(!$id) $url = 'index.php?page=browse';
elseif(!$rate || $rate<1 || $rate>5) $url = hwGetAdURL($id);
if($url){ header('Location: '.$url); exit; }

$f_title = $db->one_data("SELECT $TITLE_FIELD FROM ".TBL_AD." WHERE link_id='$id'");
if(!isset($f_title)){
  header('Location: index.php?page=browse'); 
  exit;
}

$banned = IsBanned($id,VOTE_UNBAN,'v');
if(!$banned){
  $db->query('UPDATE '.TBL_AD.' SET rating=(rating*num_votes+'.$rate.')/(num_votes+1),
  	num_votes=num_votes+1 WHERE link_id="'.$id.'"');
}

if(!$banned) $banned = '';
EvalAdvTpl(TPL_PATH.'rated.htm','$f_title,$banned',1);

?>
Return current item: Esvon Personals