Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Randomising Likes Page
#1
So that all users have an equal chance of getting likes I made this quick mod to the Facebook module.

Now when you click Earn Coins>Facebook Likes they are first sorted so the highest CPC is displayed first, then where the CPC is the same they are randomized. I think this gives everyone a better chance of getting some likes when you have a lot of users.

in your system/modules/facebook/ folder
edit module.php

look for the section <?
$sites = $db->QueryFetchArrayAll("SELECT id,url,title,cpc FROM `facebook` WHERE `active`='0' AND (SELECT `coins` FROM `users` WHERE `id` = `user` )>=`cpc` AND `cpc`>='2' AND

(`id` NOT IN (SELECT `site_id` FROM `liked` WHERE `user_id`='".$data['id']."') AND `user`!='".$data['id']."') AND (`country`='".$data['country']."' OR `country`='0') AND

(`sex`='".$data['sex']."' OR `sex`='0') AND `type`='".$fbType."' ORDER BY `cpc` DESC LIMIT ".($fbType == 0 ? 15 : 14));


and right towards the end add RAND () so that it looks like this:

<?
$sites = $db->QueryFetchArrayAll("SELECT id,url,title,cpc FROM `facebook` WHERE `active`='0' AND (SELECT `coins` FROM `users` WHERE `id` = `user` )>=`cpc` AND `cpc`>='2' AND

(`id` NOT IN (SELECT `site_id` FROM `liked` WHERE `user_id`='".$data['id']."') AND `user`!='".$data['id']."') AND (`country`='".$data['country']."' OR `country`='0') AND

(`sex`='".$data['sex']."' OR `sex`='0') AND `type`='".$fbType."' ORDER BY `cpc` DESC, RAND() LIMIT ".($fbType == 0 ? 15 : 14));

Then save your file and upload it.

Remember to make a copy of the original file before making any changes and also that when you next update you may overwrite this file so you will have to make the change again.
Reply
#2
careful doing this, you removed the privilege of premium members, one to be a priority in the viewer ...
Reply
#3
jnfs, I see where you are coming from, if a premium member posts a page that's the highest FREE cpc (lets say 5) then his page could rank / display anywhere with all the other 5's.

But since he is a premium member, the user will be taking advantage that he can post his page with a higher cpc say 6 which will put him above all the 5's.

This mod still sorts by CPC, just randomizes pages with the same CPC and allowing new pages and old equal chance of being liked.
Reply
#4
Nice. Good to see this option Wink
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Instruction page for PES Pro Kingston 24 17,935 08-12-2016, 12:55 AM
Last Post: rudolfrasta2
Information Terms & Condition page Kingston 8 7,340 08-12-2016, 12:49 AM
Last Post: rudolfrasta2
  Module FB Photo Likes (Profile) for PESPro achip 2 3,497 01-13-2014, 12:49 AM
Last Post: aitor72

Forum Jump:


Users browsing this thread: 4 Guest(s)

About MN Shop

MafiaNet Shop is an online store where you can buy powerful scripts, cool templates, graphic components and many other digital goods.

              Quick Links

              User Links

              Advertise