Skip to main content

Reply To: How to make upload image a required field?

ClassiBase classifieds script Forums General help How to make upload image a required field? Reply To: How to make upload image a required field?

#1094 Reply

ClassiBase
Keymaster

This requires advanced PHP knowledge. You have to edit /sys/app/controllers/PostController.php file line 274.

Add else statement to if like following

if($uploads['num_files'])
{
...
}
else
{
// no image uploaded then display error and prompt upload at least one image 
$this->validation()->set_error(__('Please upload at least one image.'));

// delete this ad
$ad->delete();
return $ad;
}

Remind you again that changes made to core files will be deleted on script update.

  • Classifieds Business Newsletter

    Get discounts and tips about growing your classifieds website.

    Subscribe