Location: PHPKode > projects > Esvon Personals > esvon-personals/modules/Reviews/hw_event.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/
//
// --------------------------------------------------------------------------

function Reviews_Event($event,&$args){
global $db;

  $HW_MOD = 'Reviews';
  $TBL_REVIEWS = hwModTable($HW_MOD,'data');

  switch($event){
     
    case 'onAdDelete':
      $db->query('DELETE FROM '.$TBL_REVIEWS.' WHERE link_id='.(int)$args['ID']);
      break;
      
    case 'onAdmSummary':
      $a_v = array();
      $a_v['s_title'] = '<a href="modules.php?mod=Reviews&f_type=approved">{Item} Reviews</a>';
      $a_v['s_amt'] = $db->one_data('SELECT count(*) FROM '.$TBL_REVIEWS.' WHERE approved="1"');
      $args['EXTRA']['A'][] = $a_v;
      $a_v['s_title'] = '<a href="modules.php?mod=Reviews&f_type=disabled">{Item} Reviews</a>';
      $a_v['s_amt'] = $db->one_data('SELECT count(*) FROM '.$TBL_REVIEWS.' WHERE approved="0"');
      $args['EXTRA']['P'][] = $a_v;
      break;

    case 'onAdmViewAd':
      $a_v = array();
      $rev_num = $db->one_data('SELECT count(*) FROM '.$TBL_REVIEWS.' WHERE link_id='.(int)$args['ID'].' AND approved="1"');
      if($rev_num==0) return;
      $a_v['f_t'] = 'Reviews';
      $a_v['f_v'] = $rev_num;
      $a_v['f_txt'] = '&nbsp; <a href="modules.php?mod='.$HW_MOD.'&s_by=link_id&q='.urlencode($args['ID']).'&f_type=approved" class=txt8>view reviews</a>';
      $args['EXTRA'][] = $a_v;
      break;

  }

}

?>
Return current item: Esvon Personals