<?php
// --------------------------------------------------------------------------
//
// Esvon Classifieds v.4.0
// Copyright(C), Esvon LTD, 2001-2007, 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 block_Member_Register(&$tpl, $args = ''){
// If logged in - hide user register block
if(hwSessionGetVar('userid')) return;
$block_id = 'b_Member_Register';
$tpl->AddCell($block_id,'','start');
$en_fields = ($args['fields'] && strtolower($args['fields'])!='off') ? TRUE : FALSE;
if($en_fields){
$O_UFS = &Factory::singleton('FieldsSet', '{user_fields}');
$O_UFS->rewind();
$v = array();
while($o_f = &$O_UFS->next()){
if(!$o_f->ACTIVE || !$o_f->REQUIRED) continue;
if(isset($_POST[$o_f->ID]) && $o_f->TYPE != 'file') $o_f->VALUE = $_POST[$o_f->ID];
$v['f_t'] = $o_f->TITLE;
$v['f_v'] = $o_f->GetInputCtrl();
$v['f_txt'] = $o_f->TXT;
$tpl->AddCell($block_id,$v,'fields');
}
}
else{
$a_v = array('username','email','pwd','pwd2');
$tpl_v = array();
foreach($a_v as $fid){
$tpl_v[$fid] = $_POST[$fid]!='' ? html_esc($_POST[$fid]) : '';
}
$tpl->AddCell($block_id,$tpl_v,'req');
}
$tpl->AddCell($block_id,'','end');
}
?>