This is the code for fake ads
If it is disabled, does it affect other codes?
// akismet check spam ...
if ($this->_akismet_text($aItem[ 'title' ], $aItem[ 'description' ], $contactName, $contactEmail)) {
$is_spam = 1;
}
$flash_error .= ((!osc_validate_category($aItem[ 'catId' ])) ? _m('Category invalid.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_number($aItem[ 'price' ])) ? _m('Price must be a number.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max(number_format((float)$aItem[ 'price' ], 0, '', ''), 25)) ? _m('Price too long.') . PHP_EOL : '');
$flash_error .= (($aItem[ 'price' ] !== null && (int)$aItem[ 'price' ] < 0) ? _m('Price must be positive number.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($contactName, 35)) ? _m('Name too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($contactPhone, 100)) ? _m('Phone too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($contactOther, 100)) ? _m('Other contact information too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_email($contactEmail)) ? _m('Email invalid.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_text($aItem[ 'countryName' ], 2, false)) ? _m('Country too short.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($aItem[ 'countryName' ], 50)) ? _m('Country too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_text($aItem[ 'regionName' ], 2, false)) ? _m('Region too short.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($aItem[ 'regionName' ], 50)) ? _m('Region too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_text($aItem[ 'cityName' ], 2, false)) ? _m('City too short.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($aItem[ 'cityName' ], 50)) ? _m('City too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_text($aItem[ 'cityArea' ], 2, false)) ? _m('Municipality too short.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($aItem[ 'cityArea' ], 50)) ? _m('Municipality too long.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_text($aItem[ 'address' ], 3, false)) ? _m('Address too short.') . PHP_EOL : '');
$flash_error .= ((!osc_validate_max($aItem[ 'address' ], 100)) ? _m('Address too long.') . PHP_EOL : '');
$flash_error .= ((((time() - (int)Session::newInstance()->_get('last_submit_item')) < osc_items_wait_time()) && !$this->is_admin) ? _m('Too fast. You should wait a little to publish your ad.') . PHP_EOL : '');
$_meta = Field::newInstance()->findByCategory($aItem[ 'catId' ]);
$meta = (is_array(Params::getParam('meta')) ? Params::getParam('meta') : array());
if(is_array($_meta) && count($_meta) > 0) {
foreach ($_meta as $_m) {
if(isset($_m['pk_i_id']) && trim($_m['pk_i_id']) <> '') {
$meta[$_m['pk_i_id']] = isset($meta[$_m['pk_i_id']]) ? $meta[$_m['pk_i_id']] : '';
}
}
}
if ($meta != '' && is_array($meta) && count($meta) > 0) {
$mField = Field::newInstance();
foreach ($meta as $k => $v) {
if ($v == '') {
$field = $mField->findByPrimaryKey($k);
if ($field[ 'b_required' ] == 1) {
$flash_error .= sprintf(_m('%s field is required.'), $field[ 's_name' ]) . PHP_EOL;
}
}
}
}