Код: Выделить всё
<form name="admin" action="ban.php" method="POST"><p><strong><font color="#ff0000">ID</font> пользователя: </strong><input name="user-ok['id']" value=""></p><p><strong>Причина: </strong><input name="user-ok['reason']" value=""></p><p><strong>Штраф: </strong><input name="user-ok['fine']" value=""><em>1/100</em> голосов</p><p><input type="submit" value="Забанить"></p></form>
Код: Выделить всё
<?$viewer_id = $_GET['viewer_id'];?><p><font color="#ff0000">Вы были заблокированы администрацией по причине:</font></p><p><strong><?include("reason_ban$viewer_id.txt");?></strong></p><p>Штраф: <em><?$fine = include("fine_ban$viewer_id.txt");echo bcdiv($fine, 100, 2);?> голосов</em> (<a href="payment_fine.php?viewer_id=<?echo ($_GET["viewer_id"]."");?>&auth_key=<?echo ($_GET["auth_key"]."");?>">Оплатить</a>)<strong><br></strong></p>
Код: Выделить всё
<?php$api_url = $_GET['api_url'];$api_id = $_GET['api_id'];$api_settings = $_GET['api_settings'];$viewer_id = $_GET['viewer_id'];$viewer_type = $_GET['viewer_type'];$sid = $_GET['sid'];$user_id = $_GET['user_id'];$group_id = $_GET['group_id'];$is_app_user = $_GET['is_app_user'];$auth_key = $_GET['auth_key'];if(substr_count(file_get_contents('ban$viewer_id.txt'), '1')) {header("Location: ban_inf.php?viewer_id=$viewer_id&auth_key=$auth_key");}else{header("Location: index.php?api_url=$api_url&api_id=$api_id&api_settings=$api_settings&viewer_id=$viewer_id&viewer_type=$viewer_type&sid=$sid&user_id=$user_id&group_id=$group_id&is_app_user=$is_app_user&auth_key=$auth_key");}?>
Код: Выделить всё
<font color="#006400">Пользователь</font><strong><font color="#ff0000">id<?echo($_POST["viewer_id"]."");?></font></strong><font color="#006400">заблокирован!</font> <? $viewer_id = $_POST['id']; $fp=fopen("ban$viewer_id.txt","a+"); if ($fp) { flock($fp,2); fwrite($fp,"1"); flock($fp,3); fclose($fp); }?> <? $reason = $_POST['reason']; $viewer_id = $_POST['id']; $fp=fopen("reason_ban$viewer_id.txt","a+"); if ($fp) { flock($fp,2); fwrite($fp,"$reason"); flock($fp,3); fclose($fp); }?> <? $fine = $_POST['fine']; $viewer_id = $_POST['id']; $fp=fopen("fine_ban$viewer_id.txt","a+"); if ($fp) { flock($fp,2); fwrite($fp,"$fine"); flock($fp,3); fclose($fp); }?>
Код: Выделить всё
<?php//////// Author Vlad © 2010//// $api_id = "ID Приложения"; $api_key = "Защищённый ключ"; $auth_key = $_GET['auth_key']; // auth_key из FlashVars приложения $user_id = $_GET['user_id']; // id просматривающего приложение $viewer_id = $_GET['viewer_id']; // вот это кусок списывания голоса $rand = rand(); $timestamp = time()+300; $sig = md5("api_id=".$api_id."method=secure.withdrawVotes". "random=".$rand. "timestamp=".$timestamp. "uid=".$user_id. "v=2.0". "votes=include("fine_ban$viewer_id.txt")".$api_key); $postvars="api_id=".$api_id."&method=secure.withdrawVotes"."&random=".$rand."×tamp=".$timestamp."&uid=".$user_id."&v=2.0"."&votes=include("fine_ban$viewer_id.txt")"."&sig=".$sig; $chp = curl_init('http://api.vkontakte.ru/api.php'); curl_setopt($chp, CURLOPT_HEADER,0); curl_setopt($chp, CURLOPT_RETURNTRANSFER ,1); curl_setopt($chp, CURLOPT_POST, 1); curl_setopt($chp, CURLOPT_POSTFIELDS, $postvars); $res = curl_exec($chp); curl_close($chp);// проверка есть ли голос у типа $num = strpos($res, "<error_code>502</error_code>"); // нет денег if ($num<>"") { echo "На балансе приложения отсутствуют голоса"; return; } $num = strpos($res, "<transferred>"); // другие ошибки if ($num=="") { echo "error"; return; } else { // ОЛОЛО echo 'Вы разблокированы! Пожалуйста, обновите страницу'; file_put_contents('ban$viewer_id.txt', ''); file_put_contents('fine_ban$viewer_id.txt', ''); file_put_contents('reason_ban$viewer_id.txt', ''); $fp=fopen("ban$viewer_id.txt","a+"); //Открытие дескриптора файла пользователя на запись if ($fp) { flock($fp,2); fwrite($fp,"0"); flock($fp,3); fclose($fp); } }// конец ?>
index.php - страница, которая должна открываться, если пользователь не заблокирован.
ban_inf.php - страница, на которую vk_start.php редиректит, и которая уведомляет пользователя о бане, причине, и предлагает оплатить штраф.
vk_start.php - страница, где проверяется, заблокирован ли пользователь.
control.html - панель администратирования.
Заходим в редактирование приложения и меняем там адрес на vk_start.php.
P.S. В файле payment_fine.php не забудьте заменить id и ключ приложения.