Advertisement
denis-skripnik

golos-site/head.php

Jan 11th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.03 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
  6.  
  7.     <?php
  8.  
  9. require 'vendor/autoload.php';
  10.  
  11. use GrapheneNodeClient\Commands\CommandQueryData;
  12. use GrapheneNodeClient\Commands\DataBase\GetContentCommand;
  13. use GrapheneNodeClient\Connectors\WebSocket\GolosWSConnector;
  14.  
  15. $commandQuery = new CommandQueryData();
  16.  
  17.  
  18. if (isset ($_GET['page'])) {
  19. $data = ['golos-site',$_GET['page']]; // Делаем так, чтобы подгружались данные страницы, содержащей permlink из ?page=
  20.  
  21. $commandQuery->setParams($data);
  22.  
  23. $connector = new GolosWSConnector();
  24.  
  25. $command = new GetContentCommand($connector);
  26.  
  27. $res = $command->execute($commandQuery);
  28.  
  29. ?>
  30. <title><?php echo $res['result']['title']; ?></title>
  31.     <meta name="keywords" content="<?php echo $res['result']['title']; ?>" />
  32.     <meta name="description" content="<?php echo $res['result']['title']; ?>" />
  33. <?php
  34. } else { // Главная
  35. $data = ['golos-site','glavnayaglavnaya']; // Делаем так, чтобы подгружались данные главной страницы
  36.  
  37. $commandQuery->setParams($data);
  38.  
  39. $connector = new GolosWSConnector();
  40.  
  41. $command = new GetContentCommand($connector);
  42.  
  43. $res = $command->execute($commandQuery);
  44. ?>
  45. <title><?php echo $res['result']['title']; ?></title>
  46.     <meta name="keywords" content="<?php echo $res['result']['title']; ?>" />
  47.     <meta name="description" content="<?php echo $res['result']['title']; ?>" />
  48. <?php } ?>
  49.         <link href="style.css" rel="stylesheet">
  50. <style>
  51. /* Eric Meyer's CSS Reset */
  52. html, body, div, span, applet, object, iframe,
  53. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  54. a, abbr, acronym, address, big, cite, code,
  55. del, dfn, em, img, ins, kbd, q, s, samp,
  56. small, strike, strong, sub, sup, tt, var,
  57. b, u, i, center,
  58. dl, dt, dd, ol, ul, li,
  59. fieldset, form, label, legend,
  60. table, caption, tbody, tfoot, thead, tr, th, td,
  61. article, aside, canvas, details, embed,
  62. figure, figcaption, footer, header, hgroup,
  63. menu, nav, output, ruby, section, summary,
  64. time, mark, audio, video {
  65.     margin: 0;
  66.     padding: 0;
  67.     border: 0;
  68.     font-size: 100%;
  69.     font: inherit;
  70.     vertical-align: baseline;
  71. }
  72. /* HTML5 display-role reset for older browsers */
  73. article, aside, details, figcaption, figure,
  74. footer, header, hgroup, menu, nav, section {
  75.     display: block;
  76. }
  77. body {
  78.     line-height: 1;
  79. }
  80. ol, ul {
  81.     list-style: none;
  82. }
  83. blockquote, q {
  84.     quotes: none;
  85. }
  86. blockquote:before, blockquote:after,
  87. q:before, q:after {
  88.     content: '';
  89.     content: none;
  90. }
  91. table {
  92.     border-collapse: collapse;
  93.     border-spacing: 0;
  94. }
  95. /* End of Eric Meyer's CSS Reset */
  96.  
  97. article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
  98.     display: block;
  99. }
  100. body {
  101.     font: 12px/18px Arial, sans-serif;
  102. }
  103. /* Begin of styles for the demo (you can remove them) */
  104. a.expand {
  105.     width: 90px;
  106.     display: block;
  107.     margin: 10px 0 0;
  108. }
  109. a.expand:hover {
  110.     height: 500px;
  111. }
  112. /* End of of styles for the demo */
  113. .wrapper {
  114.     min-width: 400px;
  115.     max-width: 1920px;
  116.     margin: 0 auto;
  117. }
  118.  
  119.  
  120. /* Header
  121. -----------------------------------------------------------------------------*/
  122. .header {
  123.     height: 150px;
  124.     background: #FFE680;
  125. }
  126.  
  127.  
  128. /* Middle
  129. -----------------------------------------------------------------------------*/
  130. .middle {
  131.     border-right: 250px solid #FFACAA;
  132.     position: relative;
  133. }
  134. .middle:after {
  135.     display: table;
  136.     clear: both;
  137.     content: '';
  138. }
  139. .container {
  140.     width: 100%;
  141.     float: left;
  142.     overflow: hidden;
  143.     margin-right: -100%;
  144. }
  145. .content {
  146.     padding: 0 20px;
  147. }
  148.  
  149.  
  150. /* Right Sidebar
  151. -----------------------------------------------------------------------------*/
  152. .right-sidebar {
  153.     float: right;
  154.     margin-right: -250px;
  155.     width: 250px;
  156.     position: relative;
  157.     background: #FFACAA;
  158. }
  159.  
  160.  
  161. /* Footer
  162. -----------------------------------------------------------------------------*/
  163. .footer {
  164.     height: 100px;
  165.     background: #BFF08E;
  166. }
  167. </style>
  168.     </head>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement