PHP - Payperclick System

Discussion in 'PHP' started by Jeremy Benson, Oct 11, 2014.

  1. #1
    Hello,

    I'm trying to work out the code for my pay-per-click system. I know the pseudo below is full of kinks. Can you have a look and help out, or have any suggestions on how to develop one of these... Maybe a tutorial in php or pseudo. When searching all I find is how to run campaigns on Google, lol.

    Pay-per click system - workflow

    1. Pull out all ad campaigns ordered from most clicks to least clicks wanted.

    2. Depending on clicks wanted generate a number from 1-100: to determine click range.

    If at least 1 ad clicksWanted >= 100 and one clicksWanted < 100 and >= 50 and one clicksWanted < 50

    - 60% chance if >= 100 clicks, 30% if < 100 and >= 50, 10% if < 50.

    Else if one clicksWanted < 100 and >50 and one clicksWanted < 50

    - 60% if above 50, 40% if below 50

    Else if one clicksWanted >= 100 and one clicksWanted >= 50

    -60% above 100 and 40% if >= 50

    Else if one clicksWanted >=100 and on clicksWanted <50

    -80% if above 100, 20% if below 50.

    If only one ad in either range then

    - show ad in that range

    End if

    3. Explode ad's tags for each ad within that range: CSV.

    4. Find random ad within that click that matches a find in users tag usage.

    5. Show that ad to the user.

    6. If user has never posted with tags show any ad from selected range.
     
    Last edited: Oct 12, 2014
    Jeremy Benson, Oct 11, 2014 IP