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


Messages In This Thread
Randomising Likes Page - by dadragon - 12-05-2012, 01:45 AM
RE: Randomising Likes Page - by jnfs - 12-05-2012, 03:10 AM
RE: Randomising Likes Page - by dadragon - 12-05-2012, 08:06 PM
RE: Randomising Likes Page - by barame - 11-27-2014, 04:30 AM

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

Forum Jump:


Users browsing this thread: 1 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