Currently, the php web script I’m using automatically defaults to the price of 2 credits, for all uploaded videos.
A user/uploader can go to his edit-video page and edit the price to any amount above the amount of 2, save/submit,
and the new price will be displayed in the next video search. If a u/u (user/uploader) tries to enter a price of less than 2,
the price automatically defaults back to 2.
I’m trying to work on modifying the script so that a zero can be entered into the edit-video > price field & then save/submit, which will display a new price of 0 in the next video search. And when the 0 priced video is selected, as a purchase, nothing will be deducted from the purchaser’s wallet, but an amount will be deducted from the u/u wallet – in other words, the u/u is providing his video for free to users and getting charged each time his video is selected.
I believe the modification should check a u/u wallet, for a minimum amount, upon his action of entering 0 into edit-video > price field upon save/submit. If the minimum amount is not there then error message and price automatically defaults back to 2.
Also, the modification should check a u/u wallet, for a minimum amount, upon his action of depleting his wallet amount by his own purchases. If he goes below a minimum amount, and is a u/u of a zero priced video, his video price should automatically defaults back to 2.
How can it check only u/u’s who change a price to zero, and not check everyone who purchases a video?
What am I not considering? What would be needed to make this modification feasible? What would be a better (maybe easier) solution?
Here’s some current code:
“`
$min_price=$config[‘video_play_price’];
$temp_price = $videos[‘video_play_price’];
if ($temp_price<$min_price) { $temp_price = $min_price;}
any comments/guidance is appreciated