1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Trending algorithm in PHP?

Discussion in 'PHP' started by tinman47, Aug 27, 2015.

  1. #1
    I'm working on a personal project that organizes songs uploaded by the frequency of votes in a certain amount of time, and maybe some sort of base score (probably how many likes something has, or plays). I've seen some trending/hot algorithms, but the problem is that they have downvoting, while my system does not. Can anyone give me insight on how to perform something like this in PHP?

    This is what my idea is so far:

    $s = $row['song_stat_plays'];
    $s = $s + (2 * $row['song_stat_downloads']);
    $s = $s * (3 * $row['song_votes']);
    $TrendScore = floor(log(max($s,1)));
    tinman47, Aug 27, 2015 IP