Webmastersite.net
Register Log In

Image Ratios
Image Ratio Calculations?

Comments on Image Ratios

eric0524
Experienced

Usergroup: Member
Joined: Jun 11, 2006

Total Topics: 15
Total Comments: 55
Posted Jul 01, 2006 - 7:29 AM:

I am trying to write an image ratio calculation to stop leechers. I have tried the following with no success, can anyone help?

<IF {THISMEMBERLINKSVIEWED} / {MEMBERIMAGES} < .02>
<center>
You are in Leach mode! Please upload before you are banned.<br>
Low quality or non-amatuer images will be removed and count against you!<br>
Your score is Downloads: {THISMEMBERLINKSVIEWED} Uploads: {MEMBERIMAGES}>
</center>
<OTHERWISE>
<center>
Your upload {MEMBERIMAGES}:{THISMEMBERLINKSVIEWED}download ratio is.
</center>
</IF>
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 02, 2006 - 10:10 AM:

You're telling it that if somebody has viewed 1 image and uploaded 2000 (1/2000 < .02) then they're required to upload more before they're banned, and if they've viewed 5000 and uploaded 1 then they can go ahead (5000/1 !< .02). Plus it's undefined/illogical for when they haven't uploaded anything.

uploaded/viewed would make more logical sense, but it should still protect against zeros.
<?php if ($thismember->linksviewed() > 0) $viewed = $thismember->linksviewed(); else $viewed = 1;
if ($thismember->images / $viewed > 0.02) {
?>

And this still doesn't seem very wise to me since it requires people to upload before they can view... who wants to upload without even knowing what a site offers?
eric0524
Experienced

Usergroup: Member
Joined: Jun 11, 2006

Total Topics: 15
Total Comments: 55
Posted Jul 02, 2006 - 11:33 AM:

You are right, it should be the other way around.

uploads / downloads.
But then there has to to another condition.

if downloads => 100 and uploads = 0
then block them out
endif

either way I can't get it to work in the eric0524
Experienced

Usergroup: Member
Joined: Jun 11, 2006

Total Topics: 15
Total Comments: 55
Posted Dec 05, 2007 - 4:08 PM:

Has anyone ever came up with a solution for this? If so, could you please pst the code?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Dec 05, 2007 - 8:14 PM:

<?php 
global $thismember;
$blocked = false;
if ($thismember->linksviewed() > 100) $viewed = $thismember->linksviewed(); else $viewed = 1;
if ($thismember->images / $viewed > 0.02) $blocked = true;
if ($viewed >= 100 && $thismember->images == 0) $blocked = true;
if ($blocked) {
?>
You are blocked
<?php } else { ?>
not blocked
<?php } ?>


This can only count the number of images viewed though, not the actual number of times images have been downloaded.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.