There is a bulletin board, it has a VIP-status. When assigning a VIP-status is attached class="topmess ads" . What kind of php-code to write, so that this script can be run via CRON . The "raise ad" command. Maybe give a couple of tips?
- Any PHP script is run from the command line 'php script / path / script. name.php '. This command is added to Cron. - E_p
|
1 answer
For a start, I would distribute the issue from the database, for sure it is real (for example, 10 normal 3 vip). Further, using php, I would assign the class "topmess ads" and, accordingly, set it higher than others when generating the html page. Here, even cron is not needed. It is enough to register the condition of verification of paid vip status. Queue of vip ad impressions - to evenly distribute impressions - sort by the lowest impressions, select the desired number of ads, update the impression counter accordingly.
|