Ostap34JS

Untitled

Mar 11th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.33 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>"Поздравляем героя «Отеля Элеон» Костика"</title>
  5.         <meta charset="UTF-8">
  6.         <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">
  7.     </head>
  8.     <body>
  9.  
  10.  
  11.         <table border="1" width="100%" cellspacing="0" cellpadding="4" bordercolor="#99BF00">
  12.             <tbody>
  13.                 <?php
  14.                 $id = $_GET['id'];
  15.                 $from_id = $_GET['from_id'];
  16.  
  17.                 $post = urlencode($from_id . "_" . $id);
  18.  
  19.                 $url = file_get_contents("https://api.vk.com/method/wall.getById?posts=$post");
  20.  
  21.                 $json_data = json_decode($url,true);
  22.  
  23.                 foreach ($json_data['response'] as $key => $value) {
  24.                     echo"<center>";
  25.                     if (isset($value['attachment']) && $value['attachment']['type'] === 'photo') {
  26.                         $text = $value['text'];
  27.  
  28.                         $Year = date('Y');
  29.                         $Month = date('F');
  30.                         $dir = "public_html/content/{$Year}/{$Month}";
  31.                        
  32.                         $fp = fopen("{$text}.txt", 'w');
  33.  
  34.  
  35.  
  36.  
  37.                         echo '<p class="vk-post"><img src="', $value['attachment']['photo']['src_big'], '"></p>';
  38.                         echo"<br>";
  39.                         $post_id = urlencode($value['from_id'] . "_" . $value['id'] );
  40.                         echo"<p>" . $text . "</p>";
  41.                     }
  42.                     echo"</center>";
  43.                 }
  44.  
  45.                 $getComments = file_get_contents("https://api.vk.com/method/wall.getComments?post_id=$id&owner_id=$from_id&count=15");
  46.  
  47.                 $json_Comments = json_decode($getComments,true);
  48.  
  49.                 foreach ($json_Comments['response'] as $key => $value) {
  50.  
  51.                     $text = $value['text'];
  52.                     $user_id = $value['uid'];
  53.  
  54.                     $url3 = file_get_contents("https://api.vk.com/method/users.get?user_ids=$user_id&fields=photo_200");
  55.  
  56.                     $json_data3 = json_decode($url3,true);
  57.  
  58.  
  59.                     foreach ($json_data3['response'] as $key => $value2) {
  60.                         $name = $value2['first_name'];
  61.                         $name = $value2['first_name'];
  62.                         $image_src = $value2['photo_200'];
  63.                         $date = date ("y-m-d", $value['date']);
  64.                     }
  65.  
  66.  
  67.  
  68.                     echo"
  69.                <tr>
  70.                    <td width='210' align='center'>{$name}</td>
  71.                    <td>
  72.                    <p align='right'>{$date}</td>
  73.                </tr>
  74.                <tr>
  75.                    <td width='210' align='center' valign='top'><img src='{$image_src}'></td>
  76.                    <td>{$text}<p>&nbsp;</td>
  77.                </tr>
  78.                <tr style='border-bottom: 3px solid #000;'>
  79.                    <td width='210'>&nbsp;</td>
  80.                    <td>
  81.                    <p align='right'>Кнопки соц мереж</td>
  82.                </tr>
  83.            ";
  84.                 }
  85.  
  86.                 ?>
  87.             </tbody>
  88.         </table>
  89.     </body>
  90. </html>
Advertisement
Add Comment
Please, Sign In to add comment