Jump to content

MAJOR crediting script problem


thefreebielife

Recommended Posts

so i tried updating this script to credit values such as 10, 20, etc. to users "ostatus". But it still only credits 1, and only 1. and the worst part, if a user does more then 1 offer, theyre account still only gets credited 1. before it worked fine when it was fractions and stopped at 1. please let me know what i did wrong.

<?php
if ($status == 1) {

                //Added following for crediting Logic
                if($ip == "75.126.157.90" or "204.10.140.62" or "204.10.140.63") $sql="select oWeight from offers where oCampID='" . $campaign . "'";
                else $sql="select oWeight from offers where oName='" . $name . "'";
                $result = mysql_query($sql);
                $oWeight=0.0;
                if($r=mysql_fetch_array($result))
                {       
                        if($r['oWeight']=='1')
                        $oWeight=1;
                        else if($r['oWeight']=='5')
                        $oWeight=5;
                        else if($r['oWeight']=='10')
                        $oWeight=10;
                        else if($r['oWeight']=='20')
                        $oWeight=15;
                        else if($r['oWeight']=='25')
                        $oWeight=25;
                        else if($r['oWeight']=='30')
                        $oWeight=30;
                        else if($r['oWeight']=='35')
                        $oWeight=35;
                        else if($r['oWeight']=='45')
                        $oWeight=40;
                        else if($r['oWeight']=='50')
                        $oWeight=50;
                        else if($r['oWeight']=='60')
                        $oWeight=60;
                }

                //Updating ostatus with weightage rather then 1 or 0.
                $totalO=0;
                $currOStatus=mysql_result(mysql_query("SELECT `ostatus` FROM `users` WHERE `uid`='$sid'"),0);
                if(($currOStatus+$oWeight)>1) $totalO=100;
                else $totalO=$currOStatus+$oWeight;    
php?>

Link to comment
https://forums.phpfreaks.com/topic/53275-major-crediting-script-problem/
Share on other sites

erm.. try this

 

(created on the fly, may have errors)

 

<?php
if ($status == 1) {

                //Added following for crediting Logic
                if($ip == "75.126.157.90" or "204.10.140.62" or "204.10.140.63") $sql="select oWeight from offers where oCampID='" . $campaign . "'";
                else $sql="select oWeight from offers where oName='" . $name . "'";
                $result = mysql_query($sql);
                $oWeight=0.0;
                if($r=mysql_fetch_array($result))
                {
                        $oWeight = (float)$r['oWeight'];
                }

                //Updating ostatus with weightage rather then 1 or 0.
                $totalO=0;
                $result =mysql_query("SELECT `ostatus` FROM `users` WHERE `uid`='$sid'");
                $currOStatus = 0.0;
                if($r=mysql_fetch_array($result))
                {
                        $currOStatus= (float)$r['ostatus'];
                }
                if(($currOStatus+$oWeight)>1) $totalO=100;
                else $totalO=$currOStatus+$oWeight;    
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.