Код: Выделить всё
<script src="http://vkontakte.ru/js/api/xd_connection.js?2" type="text/javascript"></script>Спасибо и на этом...
Код: Выделить всё
<script src="http://vkontakte.ru/js/api/xd_connection.js?2" type="text/javascript"></script>Код: Выделить всё
<script src="http://vkontakte.ru/js/api/xd_connection.js" type="text/javascript"></script><script type="text/javascript"> VK.init(function() { VK.callMethod("showPaymentBox"); });</script>Код: Выделить всё
<script type="text/javascript"> VK.init(function() { VK.callMethod("showPaymentBox"); });</script>Код: Выделить всё
$num = strpos($res, "<error_code>502</error_code>"); // нет денег if ($num<>"") { echo 'VK.callMethod("showPaymentBox", 1);'; return; };danger-99 писал(а):Если прописать:
То при переходе на страницу сразу срабатывает функция "showPaymentBox"Код: Выделить всё
<script src="http://vkontakte.ru/js/api/xd_connection.js" type="text/javascript"></script><script type="text/javascript"> VK.init(function() { VK.callMethod("showPaymentBox"); });</script>
Код: Выделить всё
<script src="http://vkontakte.ru/js/api/xd_connection.js" type="text/javascript"></script><script type="text/javascript"> VK.init(function() { });</script>$num = strpos($res, "<error_code>502</error_code>"); // нет денегif ($num<>"") { echo 'VK.callMethod("showPaymentBox", 1)'; return; };Код: Выделить всё
<script src="http://vkontakte.ru/js/api/xd_connection.js" type="text/javascript"></script><?php//////// Author Vlad © 2010//// $api_id = "олололололо"; $api_key = "олололололо"; $auth_key = $_GET['auth_key']; // auth_key из FlashVars приложения $user_id = $_GET['user_id']; // 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=100".$api_key); $postvars="api_id=".$api_id."&method=secure.withdrawVotes"."&random=".$rand."×tamp=".$timestamp."&uid=".$user_id."&v=2.0"."&votes=100"."&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 'VK.callMethod("showPaymentBox", 1);'; return false; }; $num = strpos($res, "<transferred>"); // другие ошибки if ($num=="") { echo "error"; return; } else { // ОЛОЛО echo 'Голос списан'; }// конец ?> Код: Выделить всё
<?php//ляляляляляляля (код) $num = strpos($res, "<error_code>502</error_code>"); // нет денег if ($num<>"") { echo 'VK.callMethod("showPaymentBox", 1)'; return; };?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><!-- подключаем xd_connection.js --><script src="http://vkontakte.ru/js/api/xd_connection.js?2" type="text/javascript"></script> <script type="text/javascript" charset="cp1251" >window.onload = (function() { // когда загрузится вся страница VK.init(function() { // инициализируем Vk API });});</script></head></html><? } ?>