Location: PHPKode > projects > Esvon Personals > esvon-personals/modules/Report_Abuse/hw_user.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');

function Report_Abuse_main(){
  
global $db,$TITLE_FIELD,$MOD_CFG;

  if(!GD_VER) $MOD_CFG['EN_IMG_VER'] = 0;

  if($_GET['mode']=='image'){
    if($MOD_CFG['EN_IMG_VER']) {
      $o_iv =& Factory::create('Image_Verify');
      $o_iv->DisplayImage();
    }
    exit;
  } 
 
  $id = (int)$_REQUEST['id'];

  list($l_title,$cid) = $db->one_row('SELECT '.$TITLE_FIELD.',catid FROM '.TBL_AD." WHERE link_id='$id'".hwFilterGetSQL());
  if(!isset($l_title)) die('Invalid request');

  $url = SITE_URL.hwGetAdURL($id);

  $tpl_v = compact('id', 'cid', 'l_title','url');
  $post_vars = array('subj','email','txt');

  foreach($post_vars as $k) $tpl_v[$k] = $_POST[$k]!='' ? html_esc($_POST[$k]) : '';

  $tpl_f = 'report_form.htm';
  $err_msg = '';
  
  if($_POST['go']){
    
    if(!$tpl_v['email'] || !IsEmail($tpl_v['email'])) $err_msg = hwLng('req_email');

    if(!$err_msg && $MOD_CFG['EN_IMG_VER']){
      $o_iv =& Factory::create('Image_Verify');
      if(!$o_iv->IsTextOK($_POST['img_text'])) $err_msg = hwLng('err_img_code');
    }
  
    if(!$err_msg){
      $tpl_v['ADMIN_DIR'] = ADMIN_DIR;
      if($MOD_CFG['MAX_MSG_LEN'] > 0) $tpl_v['txt'] = substr($tpl_v['txt'], 0, $MOD_CFG['MAX_MSG_LEN']);
      $email_body = EvalAdvTpl(HW_MOD_TPL.'report.mail',$tpl_v);
      hwSendMail(ADMIN_EMAIL,$tpl_v['email'],'',$email_body);
      $tpl_f = 'report_sent.htm';
    }
  }
  
  $tpl_v['err_msg'] = $err_msg;
  if(!$tpl_v['txt']) $tpl_v['txt'] = hwLng('report_intro')."\n$url\n----";
  else $tpl_v['txt'] = substr($tpl_v['txt'],0,$MOD_CFG['MAX_MSG_LEN']);

  EvalAdvTpl(HW_MOD_TPL.$tpl_f, $tpl_v, 1);

}

?>
Return current item: Esvon Personals