Can you let me know something about this code? This is from a web video script that I have (but didn't develop):
I know that 'set p_v' is the buy price of the video. I know that if text (or a negative number) is entered into the ‘Price’ form field the
is activated and displays: “The video price should be numeric and greater than 0”.
I know that if the 'Price' form field is left empty and Submitted, the video is free. I'd like to know where that is in this code. That's what I'd like help with.
I believe this code overall says/does:
the config variables in $pt needs to be set and if the sell_videos_system config variable is set to 'on' and the type of video sale is a user, or set to 'pro_users' and the user is a pro_user or the user is an admin proceed with the check.
If set_p_v is not a number, or below 0 or the variable com_type=0 and the price of the video is less than or equal to the admin_com_sell_videos price, then display the language video_price_error with either com_type=0 and the admin_com_sell_videos price or 0.
What I'd like to know is, where in this code does it generate the ability to have the video be free when the 'Price' form field is left empty and Submitted?
Any help is appreciated.
Code:
if (!empty($_POST['set_p_v'])) {
if (($pt->config->sell_videos_system == 'on' && $pt->config->who_sell == 'pro_users' && $pt->user->is_pro) || ($pt->config->sell_videos_system == 'on' && $pt->config->who_sell == 'users') || ($pt->config->sell_videos_system == 'on' && $pt->user->admin) && !empty($_POST['set_p_v'])) {
if (!empty($_POST['set_p_v']) || (in_array('set_p_v', array_keys($_POST)) && $_POST['set_p_v'] < 0)) {
if (!is_numeric($_POST['set_p_v']) || $_POST['set_p_v'] < 0 || (($pt->config->com_type == 0 && $_POST['set_p_v'] <= $pt->config->admin_com_sell_videos)) ) {
$error = $lang->video_price_error." ".($pt->config->com_type == 0 ? $pt->config->admin_com_sell_videos : 0);
}
}}}
I know that 'set p_v' is the buy price of the video. I know that if text (or a negative number) is entered into the ‘Price’ form field the
PHP:
$error = $lang->video_price_error
I know that if the 'Price' form field is left empty and Submitted, the video is free. I'd like to know where that is in this code. That's what I'd like help with.
I believe this code overall says/does:
the config variables in $pt needs to be set and if the sell_videos_system config variable is set to 'on' and the type of video sale is a user, or set to 'pro_users' and the user is a pro_user or the user is an admin proceed with the check.
If set_p_v is not a number, or below 0 or the variable com_type=0 and the price of the video is less than or equal to the admin_com_sell_videos price, then display the language video_price_error with either com_type=0 and the admin_com_sell_videos price or 0.
What I'd like to know is, where in this code does it generate the ability to have the video be free when the 'Price' form field is left empty and Submitted?
Any help is appreciated.
Last edited: