index.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php
  2. session_start();
  3. $http_host = $_SERVER["HTTP_HOST"];
  4. $doc_root = $_SERVER["DOCUMENT_ROOT"];
  5. include $doc_root . "functions.php";
  6. $proto = get_protocol();
  7. $con = start_db();
  8. $server = $proto . $http_host;
  9. $lang = select_language();
  10. $lserver = $server . "/" . $lang;
  11. $cur_section = "";
  12. $cur_entry = "";
  13. ?>
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  18. <meta charset='utf-8'/>
  19. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  20. <title>I&ntilde;igo Valentin</title>
  21. <link rel='shortcut icon' href='<?=$lserver?>/img/logo/x2/favicon.ico'/>
  22. <!-- CSS files -->
  23. <style>
  24. <?php
  25. include $doc_root . "css/ui.css";
  26. include $doc_root . "css/home.css";
  27. ?>
  28. </style>
  29. <!-- CSS for mobile version -->
  30. <style media='(max-width : 990px)'>
  31. <?php
  32. include $doc_root . "css/m/ui.css";
  33. include $doc_root . "css/m/home.css";
  34. ?>
  35. </style>
  36. <!-- Script files -->
  37. <script type='text/javascript'>
  38. <?php
  39. include $doc_root . "script/ui.js";
  40. ?>
  41. </script>
  42. <!-- Meta tags -->
  43. <link rel='canonical' href='<?=$lserver?>'/>
  44. <link rel='author' href='<?=$lserver?>'/>
  45. <link rel='publisher' href='<?=$lserver?>'/>
  46. <meta name='description' content=''/>
  47. <meta property='og:title' content='I&ntilde;igo Valentin'/>
  48. <meta property='og:url' content='<?=$lserver?>'/>
  49. <meta property='og:description' content=''/>
  50. <meta property='og:image' content='<?=$lserver?>/img/logo/x3/favicon.ico''/>
  51. <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
  52. <meta property='og:type' content='website'/>
  53. <meta property='og:locale' content='<?=$lang?>'/>
  54. <meta name='twitter:card' content='summary'/>
  55. <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
  56. <meta name='twitter:description' content=''/>
  57. <meta name='twitter:image' content='<?=$lserver?>/img/logo/x3/favicon.ico''/>
  58. <meta name='twitter:url' content='<?=$lserver?>'/>
  59. <meta name='robots' content='index follow'/>
  60. </head>
  61. <body>
  62. <div id='logo'>
  63. <img id='logo' src='<?=$lserver?>/img/logo/x6/inigovalentin.png' alt='I&ntilde;igo Valentin'/>
  64. </div>
  65. <?php
  66. include $doc_root . "header.php";
  67. ?>
  68. <div id='content'>
  69. <div id='content_row'>
  70. <div class='content_cell' id='content_cell_profile'>
  71. <div class='section'>
  72. <h3 class='section_title'>I&ntilde;igo Valentin</h3>
  73. <div class='entry'>
  74. <img id='profile' src='<?=$lserver?>/img/profile/x16/preview/0.png' alt='I&ntilde;igo Valentin' title='I&ntilde;igo Valentin' />
  75. </div> <!-- .entry -->
  76. </div> <!-- .section -->
  77. </div> <!-- #content_cell_profile -->
  78. <div class='content_cell' id='content_cell_content'>
  79. <div class='section' id='projects_section'>
  80. <h3 class='section_title'>TR#Ultimos proyectos</h3>
  81. <?php
  82. $q_project = mysqli_query($con, "SELECT id, permalink, type, title, logo, header, license, (SELECT dtime FROM project_version WHERE project = p.id AND visible = 1 ORDER BY dtime desc LIMIT 1) AS modified FROM project p WHERE visible = 1 ORDER BY modified DESC LIMIT 3;");
  83. while ($r_project = mysqli_fetch_array($q_project)){
  84. ?>
  85. <div class='entry entry_list project_row'>
  86. <table>
  87. <tr>
  88. <?php
  89. if (strlen($r_project["logo"]) > 0){
  90. ?>
  91. <td>
  92. <a title='<?=text($con, $r_project["title"], $lang)?>' href='<?=$lserver?>/project/<?=$r_project["permalink"]?>'>
  93. <img clsass='project_list_image' alt='<?=text($con, $r_project["title"], $lang)?>' title='<?=text($con, $r_project["title"], $lang)?>' src='<?=$lserver?>/img/project/x2/<?=$r_project["logo"]?>'/>
  94. </a>
  95. </td>
  96. <?php
  97. }
  98. ?>
  99. <td>
  100. <a title='<?=text($con, $r_project["title"], $lang)?>' href='<?=$lserver?>/project/<?=$r_project["permalink"]?>'>
  101. <h4><?=text($con, $r_project["title"], $lang)?></h4>
  102. </a> <?=text($con, $r_project["header"], $lang)?>
  103. </td>
  104. </tr>
  105. </table>
  106. </div> <!-- .entry -->
  107. <?php
  108. }
  109. ?>
  110. </div> <!-- .section -->
  111. <div class='section' id='blog_section'>
  112. <h3 class='section_title'>TR#Ultimos posts</h3>
  113. <?php
  114. $q_blog = mysqli_query($con, "SELECT id, permalink, title, text, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate, dtime, comments FROM post WHERE visible = 1 ORDER BY dtime DESC;");
  115. while($r_blog = mysqli_fetch_array($q_blog)){
  116. ?>
  117. <div itemscope itemtype='http://schema.org/BlogPosting' class='entry entry_list blog_entry'>
  118. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  119. <meta itemprop='datePublished dateModified' content='<?=$r_blog["isodate"]?>'/>
  120. <meta itemprop='headline name' content='<?=text($con, $r_blog["title"], $lang)?>'/>
  121. <meta itemprop='articleBody text' content='<?=text($con, $r_blog["text"], $lang)?>'/>
  122. <meta itemprop='mainEntityOfPage' content='<?=$lserver?>'/>
  123. <h3 class='entry_title'>
  124. <a itemprop='url' href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'><?=text($con, $r_blog["title"], $lang)?></a>
  125. </h3>
  126. <?php
  127. $q_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_blog[id] ORDER BY idx LIMIT 1;");
  128. if (mysqli_num_rows($q_image) > 0){
  129. $r_image = mysqli_fetch_array($q_image);
  130. ?>
  131. <div class='post_list_image_container'>
  132. <a href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'>
  133. <meta itemprop='image' content='<?=$lserver?>/img/blog/x4/<?=$r_image["image"]?>'/>
  134. <img class='post_list_image' alt='<?=$r_blog["title"]?>' src='<?=$lserver?>/img/blog/x2/<?=$r_image["image"]?>'/>
  135. </a>
  136. </div>
  137. <?php
  138. }
  139. ?>
  140. <p><?=cut_text(text($con, $r_blog["text"], $lang), 150, text($con, "BLOG_MORE", $lang), "$lserver/blog/$r_blog[permalink]/")?></p>
  141. <hr/>
  142. <table class='post_list_footer'>
  143. <tr>
  144. <td class='date'>
  145. <span class='date'><?=format_date($r_blog['dtime'], $lang, false)?></span>
  146. </td>
  147. <?php
  148. #Comment counter
  149. if ($r_blog["comments"] == 1){
  150. $q_comment = mysqli_query($con, "SELECT count(id) AS count FROM post_comment WHERE post = $r_blog[id] AND approved = 1;");
  151. $r_comment = mysqli_fetch_array($q_comment);
  152. ?>
  153. <meta itemprop='commentCount interationCount' content='<?=$r_comment["count"]?>'/>
  154. <td class='comment_counter'>
  155. <?php
  156. if ($r_comment['count'] == 1){
  157. ?>
  158. <span class='comment_counter'>1 <?=text($con, "BLOG_COMMENTS_1", $lang)?></span>
  159. <?php
  160. }
  161. else if ($r_comment['count'] == 0){
  162. ?>
  163. <span class='comment_counter'><?=text($con, "BLOG_COMMENTS_0", $lang)?></span>
  164. <?php
  165. }
  166. else{
  167. ?>
  168. <span class='comment_counter'><?=$r_comment["count"]?> <?=text($con, "BLOG_COMMENTS_X", $lang)?></span>
  169. <?php
  170. }
  171. ?>
  172. </td>
  173. <?php
  174. } // if ($r_blog["comments"] == 1)
  175. ?>
  176. </tr>
  177. </table> <!-- .post_list_footer -->
  178. </div> <!-- .blog_entry -->
  179. </br>
  180. <?php
  181. }
  182. ?>
  183. </div> <!-- .section -->
  184. </div> <!-- #content_cell_content -->
  185. </div> <!-- .content_row -->
  186. </div> <!-- #content -->
  187. <?php
  188. include $doc_root . "footer.php";
  189. stats($con, $cur_section, $cur_entry);
  190. ?>
  191. </body>
  192. </html>