Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>"Поздравляем героя «Отеля Элеон» Костика"</title>
- <meta charset="UTF-8">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
- </head>
- <body>
- <table border="1" width="100%" cellspacing="0" cellpadding="4" bordercolor="#99BF00">
- <tbody>
- <?php
- $id = $_GET['id'];
- $from_id = $_GET['from_id'];
- $post = urlencode($from_id . "_" . $id);
- $url = file_get_contents("https://api.vk.com/method/wall.getById?posts=$post");
- $json_data = json_decode($url,true);
- foreach ($json_data['response'] as $key => $value) {
- echo"<center>";
- if (isset($value['attachment']) && $value['attachment']['type'] === 'photo') {
- $text = $value['text'];
- $Year = date('Y');
- $Month = date('F');
- $dir = "public_html/content/{$Year}/{$Month}";
- $fp = fopen("{$text}.txt", 'w');
- echo '<p class="vk-post"><img src="', $value['attachment']['photo']['src_big'], '"></p>';
- echo"<br>";
- $post_id = urlencode($value['from_id'] . "_" . $value['id'] );
- echo"<p>" . $text . "</p>";
- }
- echo"</center>";
- }
- $getComments = file_get_contents("https://api.vk.com/method/wall.getComments?post_id=$id&owner_id=$from_id&count=15");
- $json_Comments = json_decode($getComments,true);
- foreach ($json_Comments['response'] as $key => $value) {
- $text = $value['text'];
- $user_id = $value['uid'];
- $url3 = file_get_contents("https://api.vk.com/method/users.get?user_ids=$user_id&fields=photo_200");
- $json_data3 = json_decode($url3,true);
- foreach ($json_data3['response'] as $key => $value2) {
- $name = $value2['first_name'];
- $name = $value2['first_name'];
- $image_src = $value2['photo_200'];
- $date = date ("y-m-d", $value['date']);
- }
- echo"
- <tr>
- <td width='210' align='center'>{$name}</td>
- <td>
- <p align='right'>{$date}</td>
- </tr>
- <tr>
- <td width='210' align='center' valign='top'><img src='{$image_src}'></td>
- <td>{$text}<p> </td>
- </tr>
- <tr style='border-bottom: 3px solid #000;'>
- <td width='210'> </td>
- <td>
- <p align='right'>Кнопки соц мереж</td>
- </tr>
- ";
- }
- ?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment