• 18-06-2014, 21:29:28
    #1
    Merhaba arkadaşlar twitter takip edeni takip ederim mantığı ile yürüyen kredili scriptimiz üzerinde twitter kullanıcısı şuan eklenemiyor. PHP kodları aşağıdaki gibi sürekli olarak "Twitter doesn't exist!" hatasını vermekte.

    <?php
    include('header.php');
    foreach($_POST as $key => $value) {
    	$protectie[$key] = filter($value);
    }
    $tw1 = mysql_query("SELECT * FROM `twitter` WHERE `user`='{$data->id}' AND `active`='0'");
    $tw = mysql_fetch_object($tw1);
    
    if(isset($_POST['submit'])) {
    $ext1 = mysql_query("SELECT * FROM `twitter` WHERE `t_name`='{$protectie['name']}' AND `user`='{$data->id}'");
    $ext = mysql_fetch_object($ext1);
    if($ext->id != ""){
    mysql_query("UPDATE `twitter` SET `active`='0' WHERE `t_name`='{$protectie['name']}' AND `user`='{$data->id}'");
    $mesaj = "<div class=\"success\">Twitter added successfully!</div>";
    $h = 1;
    }else{
    $num1 = mysql_query("SELECT * FROM `twitter` WHERE `t_name`='{$protectie['name']}'");
    $num = mysql_num_rows($num1);
    if($num > 0){
    $mesaj = "<div class=\"msg\"><div class=\"error\">Twitter already exist!</div></div>";
    }else{
     $url = get_data("http://api.twitter.com/1/users/lookup.xml?screen_name={$protectie['name']}");
     $xml = new SimpleXMLElement($url);
     $id = $xml->user->id;
     $av = $xml->user->profile_image_url;
    if ($id != "")
    {
    mysql_query("INSERT INTO `twitter` (user, t_name, t_id, t_av) VALUES('{$data->id}', '{$protectie['name']}', '{$id}', '{$av}')");
    $mesaj = "<div class=\"msg\"><div class=\"success\">Twitter added successfully!</div></div>";
    $h = 1;
    }else{
    $mesaj = "<div class=\"msg\"><div class=\"error\">Twitter dosen't exist!</div></div>";
    }}}}?>
    <div class="block medium right">
    			<div class="top"><?if(isset($data->login)) {?>			
    					<h1>Twitter Account</h1>
    			</div>
    		<div class="content"><? echo $mesaj; ?> 
    <? if($_GET['a'] == "cpc"){
    if(isset($_POST['editcpc'])){
    mysql_query("UPDATE `twitter` SET `cpc`='{$_POST['cpc']}' WHERE `t_name`='{$tw->t_name}' AND `user`='{$data->id}'");
    echo "<div class=\"msg\"><div class=\"success\">CPC successfully changed!</div></div>";
    }
    ?>
    <form method="post">
    <fieldset>
    	<p>
    		<label>CPC*</label> <br/>
            <select class="styled" name="cpc">
    		    <option value="1">1 Coin</option>
    			<option value="2" <?if($tw->cpc == 2){?>selected<?}?>>2 Coins</option>
    			<option value="3" <?if($tw->cpc == 3){?>selected<?}?>>3 Coins</option>
    			<option value="4" <?if($tw->cpc == 4){?>selected<?}?>>4 Coins</option>
    			<option value="5" <?if($tw->cpc == 5){?>selected<?}?>>5 Coins</option>
    		</select>
    	</p>
    	<p><small><b>* Coins per Click.</b></small></p>	
        <p>
    		<input type="submit" class="button gray small" value="Change CPC" name="editcpc" />
    	</p>
    </fieldset>
    </form>
    <? }else if($tw->t_name != ""){?>
    <div style="float:left; margin-left: 5px;"><img src="<? echo $tw->t_av;?>" border="0" /></div>
    <div style="float:left; margin-left: 5px;"><b><a href="http://twitter.com/<? echo $tw->t_name;?>" style="text-decoration: underline; color: #000;" target="_blank"><? echo $tw->t_name;?></a></b> (<a href="delete_tw.php" style="text-decoration: none; color: red;">Delete</a>)<br><b>Coins:</b> <? echo $tw->points;?> (<a href="addcoinst.php" style="text-decoration: none; color: blue;">Add</a>)<br><b>CPC:</b> <? echo $tw->cpc;?> (<a href="twitterconfig.php?a=cpc" style="text-decoration: none; color: blue;">Edit</a>)</div>
    <?}else if(isset($_POST['submit']) && $h == 1){?>
    <center><br><img src="<? echo $av;?>" border="0" /><br><b><? echo $protectie['name'];?></b></center><?}else{?>
    <form method="post">
    <table class="form">
    	<tr>
    		<td width="150px"><b>Twitter Username</b></td>
    		<td>
    			<input type="text" name="name" /><br />			
    		</td>
    	</tr>
    	<tr>
    		<td></td>
    		<td><input type="submit" name="submit" value="Submit" /></td>
    	</tr>
    </table>
    <div class="msg"><div class="info">If you don't add your real twitter username, used on exchange, you can't earn coins.</div></div>
    </form>
    <?}}else{?><script>document.location.href='index.php'</script><?}?>
    				</div>
    			</div>		
    <?include('footer.php');?>


    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 21:24:51 -->-> Daha önceki mesaj 20:43:53 --

    Şuanda bu sorun çözüldü. Ancak farklı bir problemimiz var. Frame üstünde başka hesabı takip ettikten sonra confirm butonu kontrol yaptığında hesabı takip etmiş olsak bile "takip etmediniz" şeklinde hata alıyoruz.

    <?
    include('header.php');
    $query1 = mysql_query("SELECT * FROM `twitter` WHERE `active`='0' AND `user`='{$data->id}'");
    $query = mysql_num_rows($query1);
    $query2 = mysql_fetch_object($query1);
    
      $site2 = mysql_query("SELECT * FROM `twitter` WHERE (`active` = '0' AND `points` >= `cpc`) AND (`id` NOT IN (SELECT `site_id` FROM `followed` WHERE `user_id`='{$data->id}') AND `user`!='{$data->id}') ORDER BY `cpc` DESC LIMIT 0, 14");
      $ext = mysql_num_rows($site2);
    ?>
    <div class="block medium right">
    			<div class="top"><?if(isset($data->login)) {?>	
                      <h1>Earn Coins - Twitter</h1>
                </div>
    			<div class="content">	
    <?
    if($query > 0){
    if($ext > 0){
    ?>
    <p>Press "Follow" on this page and after that press "Follow" on twitter page. After that, press on "Confirm".</p>
    <script>
    var user= "<? echo $data->id;?>";
    function skipuser(str,username) {
    document.getElementById("txtHint").style.display='block';
    	$("#txtHint").html('<table cellpadding="2" cellspacing="0" width="500" align="center" class="maintable"><tr><td align="center"><font size="3"><b>Skipping @'+username+'</b></font></td></tr><tr><td><center><font size=2><b>Skipping... <img src="ajax-loader.gif"></b></font></center></td></tr></table><br>');
    	$.ajax({
    		type: "GET",
    		url: "follow.php?step=skip",
    		data: "id="+str+"&usr="+user,
    		success: function(msg){
    			$("#txtHint").html(msg);
    		}
    	});
    	remove(str);
    }
    function followuser(str,username)
    {
    document.getElementById("txtHint").style.display='block';
    	$("#txtHint").html('<table cellpadding="2" cellspacing="0" width="500" align="center" class="maintable"><tr><td align="center"><font size="3"><b>Did you follow @'+username+'?</b></font></td></tr><tr><td><center><font size=2><b>Verifying... <img src="ajax-loader.gif"></b></font></center></td></tr></table><br>');
    	$.ajax({
    		type: "GET",
    		url: "follow.php",
    		data: "id="+str+"&usr="+user,
    		success: function(msg){
    			$("#txtHint").html(msg);
    		}
    	});
    }
    
    function remove(Variable) {
    document.getElementById("follow"+Variable).style.display='none';
    }
    </script>
    <center><div id="txtHint" style="display:none;"></div></center>
    <div id="getpoints">
    <?
      for($j=1; $site = mysql_fetch_object($site2); $j++){
    ?>	
    <div class="follow" id="follow<? echo $site->id;?>"><center><img src="<?echo $site->t_av;?>" border="0" alt="@<? echo $site->t_name;?>" width="48" height="48" class="follower"><br><b>Coins</b>: <? echo $site->cpc;?><br><center><a href="javascript:void(0);" onclick="window.open('http://twitter.com/<? echo $site->t_name;?>','Twitter','status=0,toolbar=0,width=1000,height=500,resizable=0,menubar=0,location=0,directories=0');" class="followbutton">Follow</a>
    <a href="javascript:void(0);" onclick="followuser('<? echo $site->id;?>','<? echo $site->t_name;?>');" class="followbutton">Confirm</a>
    </center><font style="font-size:0.8em;">[<a href="javascript:void(0);" onclick="skipuser('<? echo $site->id;?>','<? echo $site->t_name;?>');remove('6923');" style="color: #666666;font-size:0.9em;">skip</a>]</font></center></div>
    <?}?>
    </div>
    <br>
    <div class='infobox'>Follow the users and refresh page to see the addition of points!
    <form action='' method='' onsubmit='refreshpage();'>
    <input name='refresh' type='submit' value='Refresh'>
    </form></div>
    <?}else{?>
    <div class="msg">
    <div class="error">Sorry, there are no more coins to be earned at the moment. Please try again later.</div>
    <div class="info"><a href="buycoins.php"><b>Feel like you need more coins? You can purchase them now!</b></a></div></div>
    <?}}else{?>
    <div class="msg"><div class="error"><a href="twitterconfig.php">Add your Twitter account first!</a></div></div>
    <?}}else{?><script>document.location.href='index.php'</script><?}?>
    				</div>
    			</div>		
    <?include('footer.php');?>


    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 21:29:28 -->-> Daha önceki mesaj 21:24:51 --

    Bu da fonksiyondaki follow.php

    <?
    include('config.php');
    foreach($_GET as $key => $value) {
    	$protect[$key] = filter($value);
    }
    if(isset($_GET['id'])){
    if($_GET['step'] == "skip"){
    mysql_query("INSERT INTO `followed` (user_id, site_id) VALUES('{$protect['usr']}', '{$protect['id']}')");
    echo "<table cellpadding=\"2\" cellspacing=\"0\" width=\"500\" align=\"center\" class=\"mainfocus\"><tr><td align=\"center\"><font size=\"3\"><b>Done!</b></font></td></tr></table>";
    }else{
    $dbres1				= mysql_query("SELECT * FROM `twitter` WHERE `user`='{$protect['usr']}'");
    $data3 = mysql_fetch_object($dbres1);
    $site = mysql_fetch_object(mysql_query("SELECT * FROM `twitter` WHERE `id`='{$protect['id']}'"));
     $url  = "http://api.twitter.com/1/friendships/exists.json?screen_name_a=" . $data3->t_name . "&screen_name_b=".$site->t_name;
     $page = get_data($url);
     $json_a = json_decode($page,true);
    $plused1 = mysql_query("SELECT * FROM `followed` WHERE `site_id`='{$protect['id']}' AND `user_id`='{$protect['usr']}'");
    $plused  = mysql_num_rows($plused1);
    if ($page == FALSE) { 
     echo "<table cellpadding=\"2\" cellspacing=\"0\" width=\"500\" align=\"center\" class=\"mainfocus\"><tr><td align=\"center\"><font size=\"3\"><b>Error!</b></font></td></tr><tr><td><center><b>We can't verify followers!</b></center></td></tr></table>";
    }else if($plused > 0){
    echo "<table cellpadding=\"2\" cellspacing=\"0\" width=\"500\" align=\"center\" class=\"mainfocus\"><tr><td align=\"center\"><font size=\"3\"><b>Error!</b></font></td></tr><tr><td><center><b>You already followed @".$site->t_name."!</b></center></td></tr></table>";
    }else if (strpos($page, "true") !== FALSE) {
    mysql_query("UPDATE `users` SET `coins`=`coins`+'{$site->cpc}' WHERE `id`='{$protect['usr']}'");
    mysql_query("UPDATE `twitter` SET `earned`=`earned`+'1', `points`=`points`-'{$site->cpc}' WHERE `id`='{$protect['id']}'");
    mysql_query("INSERT INTO `followed` (user_id, site_id) VALUES('{$protect['usr']}', '{$protect['id']}')");
    echo "<table cellpadding=\"2\" cellspacing=\"0\" width=\"500\" align=\"center\" class=\"mainfocus\"><tr><td align=\"center\"><font size=\"3\"><b>Success!</b></font></td></tr><tr><td><center><b>You followed @".$site->t_name."!<br><font color=\"#d4a1ff\" size=\"3\">You got {$site->cpc} Coin!</font></center></td></tr></table>";
    }else{
    echo "<table cellpadding=\"2\" cellspacing=\"0\" width=\"500\" align=\"center\" class=\"maintable\"><tr><td><center><b>Twitter says you aren't following @".$site->t_name."!</b><br><i>Check again if you are logged into " . $data3->t_name . " on Twitter.</i><br><b>Try Confirming again or Skip them!</b></center></td></tr></table><br>";
    }
    }}
    ?>
  • 18-06-2014, 21:31:42
    #2
    Sorun çözüldü.
  • 18-06-2014, 21:34:23
    #3
    AydinCan adlı üyeden alıntı: mesajı görüntüle
    Sorun çözüldü.
    Arkadaş problemi halleti ancak şuanda twitter.php üstünde takip etmeden confirm yapınca bile kredi vermekte. O problemi nasıl çözebiliriz?