1. PHP / Говнокод #19571

    +3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    <?php 
    if ($site_url == 'http://'.$_SERVER['HTTP_HOST'].'/'){
    	if(!isset($_SESSION['access_token'])){
    		$all_likes = mysqli_result(mysqli_query($con, "SELECT sum(likes) FROM tb_members"),0,0);
    		 ?>
    		<div style="text-align:center; padding-top: 20px;">
    			<img src="<?=$site_url; ?>images/banner.jpg" alt="бесплатные лайки здесь">
    		</div>
    		<div style="text-align: center;">					
    			<div class="form-search" id="loginform">
    				<?php 
    				if($_POST['token']){
    					if(preg_match("/^[a-zA-Z0-9]+$/", $_POST['token'])){
    						$s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']);
    						$user = json_decode($s, true);
    						if($user['network'] == "vkontakte"){
    							$id = preg_replace('|^(?:https?://)?vk\.com/?|i', '', $user['identity']);
    							if(mb_substr($id, 0, 2) == 'id')
    								$id = mb_substr($id, 2);
    								$id = str_replace('/', '', $id); 
    							if($id!=""){
    								$num = mysqli_num_rows(mysqli_query($con, "SELECT id FROM tb_members WHERE uid = '".$id."'"));
    								$req = file_get_contents("https://api.vk.com/method/users.get?fields=photo_100&uids=".$id);
    								$data_user = json_decode($req, true);
    								$time = time()+(24*3600);
    								if($num==0){
    									if($_SESSION['referer']!=""){
    										$num = mysqli_num_rows(mysqli_query($con, "SELECT id FROM tb_members WHERE uid = '".$_SESSION['referer']."'"));
    										if($num==1){
    											mysqli_query($con, "UPDATE tb_members SET likes = likes + '".$refl."', money = money + '".$refm."', refs = refs + 1 WHERE uid = '".$_SESSION['referer']."'") OR die(mysql_error()); 
    											$time = time(); 
    											$message = "Новый реферал. <strong>VK ID: ".$id."</strong>";
    											mysqli_query($con, "INSERT INTO tb_events (`uid`,`message`,`time`) VALUES ('".$_SESSION['referer']."','$message','$time')");
    										}else{
    											$_SESSION['referer']="";
    										}
    									}
    									mysqli_query($con, "INSERT INTO tb_members (`uid`,`name`,`likes`,`lastname`,`referer`,`bonus`,`registration_date`) VALUES ('".$id."','".$data_user["response"][0]["first_name"]."','".$rbon."','".$data_user["response"][0]["last_name"]."','".$_SESSION['referer']."',$time,'".time()."')");
    									echo '<script type="text/javascript">alert("Вам начислен ежедневный бонус в '.$rbon.' лайков! :)");</script> ';
    								}
    								$row = mysqli_fetch_array(mysqli_query($con, "SELECT id, bonus, pro FROM tb_members WHERE uid = '".$id."'"));
    								session_unset();
    								$_SESSION["access_token"] = true;
    								$_SESSION["site_id"] = $row["id"];
    								$_SESSION["user_id"] = $id;
    								$_SESSION["img"] = $data_user["response"][0]["photo_100"];
    								$id = $row['id'];
    								mysqli_query($con, "UPDATE tb_members SET visit_date = ".time()." WHERE id = $id");
    								if($row['bonus']<time()){
    									if(status_pro($row['pro']) == true){
    										$dbon = $premiumbon;
    										mysqli_query($con, "UPDATE tb_members SET rating = rating + $premiumratind_bon WHERE id = $id");
    										mysqli_query($con, "UPDATE tb_members SET likes = likes + $dbon, bonus = $time WHERE id = $id");
    										echo '<script type="text/javascript">alert("Вам начислен ежедневный бонус в '.$dbon.' лайков и +'.$premiumratind_bon.' баллов рейтинга! :)");</script> ';
    									}else{
    										mysqli_query($con, "UPDATE tb_members SET likes = likes + $dbon, bonus = $time WHERE id = $id");
    										echo '<script type="text/javascript">alert("Вам начислен ежедневный бонус в '.$dbon.' лайков! :)");</script> ';
    									}
    									$a = mysqli_fetch_array(mysqli_query($con, "SELECT * FROM tb_members WHERE id = $id"));
    									$b = $a['referral_rate'];
    									if($a['refs'] > 0){
    										mysqli_query($con, "UPDATE tb_members SET likes = likes + referral_rate WHERE id = $id");
    										echo '<script type="text/javascript">alert("Вам начислено '.$b.' баллов от рефералов");</script> ';  
    										mysqli_query($con, "UPDATE tb_members SET referral_rate = referral_rate - referral_rate WHERE id = $id");
    									}
    								}
    								?>
    								<script type="text/javascript">  
    									 location.replace("/");  
    								</script>
    								<?php 
    							}
    						}
    					}
    				}
    
    				Class login{
    					var $user;
    					var $AllStatus = array();		
    					function __construct($AllStatus){
    						global $con;
    						$this -> AllStatus = $AllStatus;
    						if(isset($_POST['second'])){
    						$check = $this -> second_check();
    							if($check != NULL){
    							echo '<span style="color:#b32d2d; font-size:18px;">Ошибка: '.$check.'</span>';
    							}else{
    								$this -> ouath();
    								echo '<script type="text/javascript">location.replace("/");</script>';
    								return;
    							}
    						}
    						if(isset($_SESSION['vkk'])){
    							$this -> second();
    							return;
    						}
    						if(isset($_POST['subm'])){
    							$check = $this -> checkForm();
    							if($check != NULL){

    Куча с toplikers.ru. Наклали так наклали.. И весь "проект" такой

    Запостил: dev400, 03 Марта 2016

    Комментарии (2) RSS

    • До боли знакомый код.
      Это двиг для накрутки фоточек в vk. Я как то влез в него. Потом за неделю заново все переписал.
      Ответить
    • Какая задача, такой и код...
      Ответить

    Добавить комментарий