WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums


Image Ratios
Image Ratio Calculations?

Version: 2.3.6
printPrint


Image Ratios
eric0524
Experienced

Usergroup: Member
Joined: Jun 11, 2006
Total Topics: 15
Total Posts: 55
Posted 07/01/06 - 07:29 AM:
quote post
#1
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}downlo ad ratio is.
</center>
</IF>

_____________________
----------------------------
www.saltwatersportswear.com - the largest selection of t-shirts
www.showyour.com/photoswap
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 49
Total Posts: 5539
Posted 07/02/06 - 10:10 AM:
quote post
#2
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 Posts: 55
Posted 07/02/06 - 11:33 AM:
quote post
#3
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 Edited by eric0524 on 07/02/06 - 11:42 AM

_____________________
----------------------------
www.saltwatersportswear.com - the largest selection of t-shirts
www.showyour.com/photoswap
eric0524
Experienced

Usergroup: Member
Joined: Jun 11, 2006
Total Topics: 15
Total Posts: 55
Posted 12/05/07 - 04:08 PM:
quote post
#4
Has anyone ever came up with a solution for this? If so, could you please pst the code?

_____________________
----------------------------
www.saltwatersportswear.com - the largest selection of t-shirts
www.showyour.com/photoswap
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 49
Total Posts: 5539
Posted 12/05/07 - 08:14 PM:
quote post
#5
<?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.

Edited by Paul on 12/05/07 - 08:16 PM
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.