Phalcon Framework 5.9.3

ParseError: Unclosed '{' on line 1

/tmp/cache/volt/%%srv%%chathispanoengine%%releases%%100%%apps%%web%%views%%index%%carousel.volt.compiled (79)
#0Phalcon\Mvc\View\Engine\Volt->render
#1Phalcon\Mvc\View->engineRender
#2Phalcon\Mvc\View->partial
#3Phalcon\Mvc\View\Engine\AbstractEngine->partial
/tmp/cache/volt/%%srv%%chathispanoengine%%releases%%100%%apps%%web%%views%%index%%index.volt.compiled (715)
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <?php if ($env == 'prod') { ?>
  5. <script async src="https://www.googletagmanager.com/gtag/js?id=G-55ZZ1BSSED"></script>
  6. <script>
  7. window.dataLayer = window.dataLayer || [];
  8. function gtag(){dataLayer.push(arguments);}
  9. gtag('js', new Date());
  10. gtag('config', 'G-55ZZ1BSSED');
  11. </script>
  12. <?php } ?>
  13.  
  14. <meta charset="UTF-8" />
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  16. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=yes">
  17. <meta name="keywords" content="chat, chats, chatear, chat gratis, red de chat, irc, ligar en chat, chat de ciudades, chat de pueblos, chatear gratis" />
  18.  
  19. <?php if ($controller == 'index' && $action == 'index') { ?>
  20. <meta name="publisuites-verify-code" content="aHR0cHM6Ly9jaGF0aGlzcGFuby5jb20=" />
  21. <meta name="google-site-verification" content="qcxe2DWGaxmp1Db8zhwmwe5-A7BlJicc7R7hfTywm-4" />
  22. <meta name="msvalidate.01" content="8599F70ACD2A8328EADD494BDE2BD875" />
  23. <meta name="Trafficstars" content="73817">
  24. <?php } ?>
  25.  
  26. <?php if (isset($amphtml)) { ?>
  27. <link rel="amphtml" href="<?= $amphtml ?>">
  28. <?php } ?>
  29.  
  30. <title><?= $head_title ?> <?= $head_suffix ?></title>
  31.  
  32. <?php if ($rel_canonical) { ?>
  33. <link rel="canonical" href="<?= $rel_canonical ?>" />
  34. <?php } ?>
  35.  
  36. <meta name="description" content="<?= $meta_description ?>" />
  37.  
  38. <meta name="twitter:card" content="summary">
  39. <meta name="twitter:description" content="<?= $meta_description ?>">
  40. <meta name="twitter:title" content="<?= $head_title ?>">
  41. <meta name="twitter:site" content="<?= $meta_twitter_profile ?>">
  42.  
  43. <meta property="og:title" content="<?= $head_title ?>" />
  44. <meta property="og:type" content="website" />
  45. <meta property="og:url" content="<?= $fullUri ?>" />
  46. <?php if ($meta_show_image) { ?>
  47. <meta property="og:image" content="<?= $meta_image ?>" />
  48. <?php } ?>
  49. <meta property="og:description" content="<?= $meta_description ?>" />
  50. <meta property="og:site_name" content="<?= $meta_site_name ?>" />
  51. <meta property="fb:admins" content="<?= $meta_facebook_id ?>" />
  52.  
  53. <?php if ($meta_article) { ?>
  54. <?php foreach ($meta_article_tags as $tag) { ?>
  55. <?php if ($tag && $tag != '') { ?>
  56. <meta property="article:tag" content="<?= $tag ?>" />
  57. <?php } ?>
  58. <?php } ?>
  59. <meta property="article:section" content="<?= $meta_article_section ?>" />
  60. <meta property="article:published_time" content="<?= $meta_article_created ?>" />
  61. <meta property="article:modified_time" content="<?= $meta_article_updated ?>" />
  62. <?php } ?>
  63.  
  64. <?php if ($meta_noindex && $meta_nofollow) { ?>
  65. <meta name="robots" content="noindex,nofollow">
  66. <meta name="googlebot" content="noindex,nofollow">
  67. <?php } elseif ($meta_noindex) { ?>
  68. <meta name="robots" content="noindex">
  69. <meta name="googlebot" content="noindex">
  70. <?php } elseif ($meta_nofollow) { ?>
  71. <meta name="robots" content="nofollow">
  72. <meta name="googlebot" content="nofollow">
  73. <?php } ?>
  74.  
  75. <script>
  76. var googletag = googletag || {};
  77. googletag.cmd = googletag.cmd || [];
  78. var msTag = {
  79. site: 'chathispano',
  80. <?php if ($controller == 'index' && $action == 'index') { ?>
  81. page: 'home',
  82. <?php } elseif ($controller == 'blogs' || ($controller == 'news' && ($action == 'index' || ($action == 'list' && $type == 'noticias')))) { ?>
  83. page: 'blog',
  84. <?php } elseif ($controller == 'webchat' && ($action == 'index' || $action == 'element')) { ?>
  85. page: 'chat',
  86. <?php } else { ?>
  87. page: 'ros',
  88. <?php } ?>
  89. data: {
  90. <?php if ($controller == 'index' && $action == 'index') { ?>
  91. ZonasMassarius: 'home',
  92. <?php } elseif ($controller == 'blogs' || ($controller == 'news' && ($action == 'index' || ($action == 'list' && $type == 'noticias')))) { ?>
  93. //ZonasMassarius: 'article',
  94. ZonasMassarius: 'blog',
  95. <?php } elseif ($controller == 'webchat' && $action == 'index') { ?>
  96. ZonasMassarius: 'chat',
  97. <?php } elseif ($controller == 'webchat' && $action == 'element') { ?>
  98. ZonasMassarius: 'chat',
  99. <?php } else { ?>
  100. ZonasMassarius: 'ros',
  101. <?php } ?>
  102. <?php if ($hasPremium || $ads_revive_enabled || $refinery89_enabled || $section_gay == 1 || $section_sex == 1 || $section_lesbianas == 1) { ?>
  103. noAds: true
  104. <?php } elseif ($controller == 'error' || $controller == 'paywall' || $controller == 'auth' || $controller == 'sexshop') { ?>
  105. noAds: true
  106. <?php } else { ?>
  107. noAds: false
  108. <?php } ?>
  109. },
  110. cb: function () {},
  111. };
  112. if (window.self !== window.top) {
  113. msTag.data.noAds = true;
  114. }
  115. </script>
  116.  
  117.  
  118. <script type="text/javascript">
  119. (function(c,l,a,r,i,t,y){
  120. c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
  121. t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
  122. y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
  123. })(window, document, "clarity", "script", "mh9qwq8zpy");
  124. </script>
  125.  
  126.  
  127. <!-- favicon -->
  128. <link rel="shortcut icon" href="/assets/web/images/favicon.ico" type="image/x-icon">
  129. <link rel="icon" href="/assets/web/images/favicon.ico" type="image/x-icon">
  130.  
  131. <link rel="preload" as="font" href="<?= $baseUri ?>webfonts/fa-solid-900.woff2" type="font/woff2" crossorigin="anonymous">
  132. <link rel="preload" as="font" href="<?= $baseUri ?>webfonts/fa-brands-400.woff2" type="font/woff2" crossorigin="anonymous">
  133. <link rel="preload" as="font" href="<?= $baseUri ?>webfonts/fa-regular-400.woff2" type="font/woff2" crossorigin="anonymous">
  134. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-BoldItalic.ttf" type="font/ttf" crossorigin="anonymous">
  135. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-Bold.ttf" type="font/ttf" crossorigin="anonymous">
  136. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-Italic.ttf" type="font/ttf" crossorigin="anonymous">
  137. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-MediumItalic.ttf" type="font/ttf" crossorigin="anonymous">
  138. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-Medium.ttf" type="font/ttf" crossorigin="anonymous">
  139. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-Regular.ttf" type="font/ttf" crossorigin="anonymous">
  140. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-SemiBoldItalic.ttf" type="font/ttf" crossorigin="anonymous">
  141. <link rel="preload" as="font" href="<?= $baseUri ?>assets/web/fonts/Asap-SemiBold.ttf" type="font/ttf" crossorigin="anonymous">
  142.  
  143.  
  144. <link rel="stylesheet" href="https://massariuscdn.com/pubs/chathispano/index.css">
  145. <script async type="text/javascript" src="https://massariuscdn.com/pubs/chathispano/chathispano_hb_setup.js"></script>
  146.  
  147. <?php if ($refinery89_enabled) { ?>
  148. <script src="https://tags.refinery89.com/chathispanocom.js" async></script>
  149. <?php } ?>
  150.  
  151. <style>
  152. :root {
  153. --banner-container-top: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted.png);
  154. --banner-container-top-home: url(<?= $baseUri ?>assets/web/images/banner-container-top-home.png);
  155. --banner-container-bottom: url(<?= $baseUri ?>assets/web/images/banner-container-bottom.png);
  156. --banner-container-top-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted.webp);
  157. --banner-container-top-home-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-home.webp);
  158. --banner-container-bottom-webp: url(<?= $baseUri ?>assets/web/images/banner-container-bottom.webp);
  159. }
  160. @media (max-width : 576px) {
  161. :root {
  162. --banner-container-top: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-xs.png);
  163. --banner-container-top-home: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-xs.png);
  164. --banner-container-bottom: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-xs.png);
  165. --banner-container-top-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-xs.webp);
  166. --banner-container-top-home-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-xs.webp);
  167. --banner-container-bottom-webp: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-xs.webp);
  168. }
  169. }
  170. @media (min-width : 577px) and (max-width : 768px) {
  171. :root {
  172. --banner-container-top: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-sm.png);
  173. --banner-container-top-home: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-sm.png);
  174. --banner-container-bottom: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-sm.png);
  175. --banner-container-top-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-sm.webp);
  176. --banner-container-top-home-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-sm.webp);
  177. --banner-container-bottom-webp: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-sm.webp);
  178. }
  179. }
  180. @media (min-width : 769px) and (max-width : 992px) {
  181. :root {
  182. --banner-container-top: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-md.png);
  183. --banner-container-top-home: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-md.png);
  184. --banner-container-bottom: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-md.png);
  185. --banner-container-top-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-md.webp);
  186. --banner-container-top-home-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-md.webp);
  187. --banner-container-bottom-webp: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-md.webp);
  188. }
  189. }
  190. @media (min-width : 993px) and (max-width : 1200px) {
  191. :root {
  192. --banner-container-top: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-lg.png);
  193. --banner-container-top-home: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-lg.png);
  194. --banner-container-bottom: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-lg.png);
  195. --banner-container-top-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-cutted-lg.webp);
  196. --banner-container-top-home-webp: url(<?= $baseUri ?>assets/web/images/banner-container-top-home-lg.webp);
  197. --banner-container-bottom-webp: url(<?= $baseUri ?>assets/web/images/banner-container-bottom-lg.webp);
  198. }
  199. }
  200. </style>
  201.  
  202. <style>
  203. @font-face {
  204. font-family: FontAwesome5Solid;
  205. src: url(<?= $baseUri ?>webfonts/fa-solid-900.woff2);
  206. font-display: swap;
  207. }
  208.  
  209. @font-face {
  210. font-family: FontAwesome5Brands;
  211. src: url(<?= $baseUri ?>webfonts/fa-brands-400.woff2);
  212. font-display: swap;
  213. }
  214.  
  215. @font-face {
  216. font-family: FontAwesome5Regular;
  217. src: url(<?= $baseUri ?>webfonts/fa-regular-400.woff2);
  218. font-display: swap;
  219. }
  220.  
  221. .fa, .fas {
  222. font-family: FontAwesome5Solid !important;
  223. }
  224. .fab {
  225. font-family: FontAwesome5Brands !important;
  226. }
  227. .far {
  228. font-family: FontAwesome5Regular !important;
  229. }
  230.  
  231. @font-face {
  232. font-family: AsapBold;
  233. src: url(<?= $baseUri ?>assets/web/fonts/Asap-Bold.ttf);
  234. font-display: swap;
  235. }
  236.  
  237. @font-face {
  238. font-family: AsapBoldItalic;
  239. src: url(<?= $baseUri ?>assets/web/fonts/Asap-BoldItalic.ttf);
  240. font-display: swap;
  241. }
  242.  
  243. @font-face {
  244. font-family: AsapItalic;
  245. src: url(<?= $baseUri ?>assets/web/fonts/Asap-Italic.ttf);
  246. font-display: swap;
  247. }
  248.  
  249. @font-face {
  250. font-family: AsapMedium;
  251. src: url(<?= $baseUri ?>assets/web/fonts/Asap-Medium.ttf);
  252. font-display: swap;
  253. }
  254.  
  255. @font-face {
  256. font-family: AsapMediumItalic;
  257. src: url(<?= $baseUri ?>assets/web/fonts/Asap-MediumItalic.ttf);
  258. font-display: swap;
  259. }
  260.  
  261. @font-face {
  262. font-family: AsapRegular;
  263. src: url(<?= $baseUri ?>assets/web/fonts/Asap-Regular.ttf);
  264. font-display: swap;
  265. }
  266.  
  267. @font-face {
  268. font-family: AsapSemiBold;
  269. src: url(<?= $baseUri ?>assets/web/fonts/Asap-SemiBold.ttf);
  270. font-display: swap;
  271. }
  272.  
  273. @font-face {
  274. font-family: AsapSemiBoldItalic;
  275. src: url(<?= $baseUri ?>assets/web/fonts/Asap-SemiBoldItalic.ttf);
  276. font-display: swap;
  277. }
  278. </style>
  279.  
  280. <?= $this->assets->outputInlineCss('headerCss') ?>
  281. </head>
  282.  
  283. <body class="container-fluid pl-0 pr-0 pb-0">
  284. <div id="veil"
  285. style="position:absolute;top:0px;bottom:0px;left:0px;right:0px;width:100%;height:100%;margin:0px;padding:0px;background-color:#ffffff;z-index:100000000;">
  286. </div>
  287.  
  288.  
  289. <?php if ($env == 'prod') { ?>
  290. <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N9MM3TX"
  291. height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  292. <?php } ?>
  293.  
  294. <nav class="navbar fixed-top navbar-expand-lg">
  295. <div class="container-xl">
  296. <button class="navbar-toggler text-neutral1" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
  297. aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="<?= $this->translate->translate('Toggle navigation') ?>">
  298. <span class="fas fa-ellipsis-v"></span>
  299. <font style="position:fixed;top:14px;left:0px;width:100%;text-align:center;font-weight:bold;">CHAT HISPANO</font>
  300. </button>
  301. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  302. <ul class="navbar-nav mr-auto d-lg-none d-xl-none">
  303. <li class="nav-item">
  304. <a href="<?php if ($enable_element) { ?>/chat/<?php } else { ?>/webchat/<?php } ?>" class="nav-link pt-2 pb-2" target="_blank">
  305. <font><?= $this->translate->translate('Chat') ?></font>
  306. </a>
  307. </li>
  308. <li class="nav-item">
  309. <a href="https://foro.chathispano.com/" class="nav-link pt-2 pb-2" target="_blank">
  310. <font><?= $this->translate->translate('Forum') ?></font>
  311. </a>
  312. </li>
  313. <li class="nav-item">
  314. <a href="<?= $this->url->get('blogs/') ?>" class="nav-link pt-2 pb-2">
  315. <font><?= $this->translate->translate('Blogs') ?></font>
  316. </a>
  317. </li>
  318. <li class="nav-item">
  319. <a href="<?= $this->url->get('noticias/') ?>" class="nav-link pt-2 pb-2">
  320. <font><?= $this->translate->translate('News') ?></font>
  321. </a>
  322. </li>
  323. <li class="nav-item">
  324. <a href="<?= $this->url->get('normas/') ?>" class="nav-link pt-2 pb-2">
  325. <font><?= $this->translate->translate('Rules') ?></font>
  326. </a>
  327. </li>
  328. <li class="nav-item">
  329. <a href="<?= $this->url->get('gestiones/') ?>" class="nav-link pt-2 pb-2">
  330. <font><?= $this->translate->translate('Procedures') ?></font>
  331. </a>
  332. </li>
  333. <li class="nav-item">
  334. <a href="<?= $this->url->get('contactar/') ?>" class="nav-link pt-2 pb-2">
  335. <font><?= $this->translate->translate('Contact') ?></font>
  336. </a>
  337. </li>
  338. <li class="nav-item">
  339. <a href="<?= $this->url->get('ayuda/') ?>" class="nav-link pt-2 pb-2">
  340. <font><?= $this->translate->translate('Help') ?></font>
  341. </a>
  342. </li>
  343. <li class="dropdown-divider"></li>
  344. <li class="nav-item">
  345. <a class="nav-link pt-2 pb-2" href="/faqs-premium">
  346. <span class="fa fa-question" style="color:#ffffff;"></span>
  347. <font><?= $this->translate->translate('Premium FAQS') ?></font>
  348. </a>
  349. </li>
  350. <li class="dropdown-divider"></li>
  351. <?php if ($loggedIn) { ?>
  352. <li class="nav-item">
  353. <a href="<?= $this->url->get('perfil/') ?>" class="nav-link pt-2 pb-2">
  354. <font><?= $this->translate->translate('Profile') ?></font>
  355. </a>
  356. </li>
  357. <?php } ?>
  358. <li class="nav-item">
  359. <a href="/faqs-premium" class="nav-link pt-2 pb-2">
  360. <font><?= $this->translate->translate('Premium FAQS') ?></font>
  361. </a>
  362. </li>
  363. <li class="nav-item">
  364. <a href="/suscripciones" class="nav-link pt-2 pb-2">
  365. <font><?= $this->translate->translate('Subscriptions') ?></font>
  366. </a>
  367. </li>
  368. <?php if ($loggedIn) { ?>
  369. <li class="nav-item">
  370. <a href="<?= $this->url->get('auth/logout') ?>" class="nav-link pt-2 pb-2">
  371. <font><?= $this->translate->translate('Log out') ?></font>
  372. </a>
  373. </li>
  374. <?php } else { ?>
  375. <li class="nav-item">
  376. <a href="<?= $this->url->get('auth/login') ?>" class="nav-link pt-2 pb-2">
  377. <font><?= $this->translate->translate('Log in') ?></font>
  378. </a>
  379. </li>
  380. <?php } ?>
  381. </ul>
  382. </div>
  383. <div class="d-none d-lg-flex d-xl-flex justify-content-end">
  384. <ul class="navbar-nav mr-auto d-none d-lg-flex d-xl-flex">
  385. <li class="nav-item mr-4">
  386. <a href="<?php if ($enable_element) { ?>/chat/<?php } else { ?>/webchat/<?php } ?>" class="nav-link" target="_blank">
  387. <font><?= $this->translate->translate('Chat') ?></font>
  388. </a>
  389. </li>
  390. <li class="nav-item mr-4">
  391. <a href="https://foro.chathispano.com" class="nav-link" target="_blank">
  392. <font><?= $this->translate->translate('Forum') ?></font>
  393. </a>
  394. </li>
  395. <li class="nav-item mr-4">
  396. <a href="<?= $this->url->get('blogs/') ?>" class="nav-link">
  397. <font><?= $this->translate->translate('Blogs') ?></font>
  398. </a>
  399. </li>
  400. <li class="nav-item mr-4">
  401. <a href="<?= $this->url->get('noticias/') ?>" class="nav-link">
  402. <font><?= $this->translate->translate('News') ?></font>
  403. </a>
  404. </li>
  405. <li class="nav-item mr-4">
  406. <a href="<?= $this->url->get('normas/') ?>" class="nav-link">
  407. <font><?= $this->translate->translate('Rules') ?></font>
  408. </a>
  409. </li>
  410. <li class="nav-item mr-4">
  411. <a href="<?= $this->url->get('gestiones/') ?>" class="nav-link">
  412. <font><?= $this->translate->translate('Procedures') ?></font>
  413. </a>
  414. </li>
  415. <li class="nav-item mr-4">
  416. <a href="<?= $this->url->get('contactar/') ?>" class="nav-link">
  417. <font><?= $this->translate->translate('Contact') ?></font>
  418. </a>
  419. </li>
  420. <li class="nav-item mr-4">
  421. <a href="<?= $this->url->get('ayuda/') ?>" class="nav-link">
  422. <font><?= $this->translate->translate('Help') ?></font>
  423. </a>
  424. </li>
  425. </ul>
  426. <?php if ($controller != 'error') { ?>
  427. <form class="form-inline mr-4 pt-2 pb-1">
  428. <div class="dropdown">
  429. <button class="btn btn-outline-light dropdown-toggle" type="button"
  430. id="dropdownSearch" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  431. <span class="fa fa-search"></span>
  432. <?= $this->translate->translate('Search') ?>
  433. </button>
  434. <div class="dropdown-menu" aria-labelledby="dropdownSearch">
  435. <div class="input-group">
  436. <input type="search" class="border-0 pl-2 pr-2 pb-2 pt-2 rounded-right typeahead" name="search" placeHolder="<?= $this->translate->translate('Search') ?>"
  437. data-url='["<?= $baseUri ?>noticias/buscar/%QUERY","<?= $baseUri ?>blogs/buscar/%QUERY","<?= $baseUri ?>canal/buscar/%QUERY"]'
  438. data-wildcard="%QUERY"
  439. data-name='["News","Blogs","Channels"]'
  440. data-type="single"
  441. data-empty='["<?= str_replace(["'","à","á","è","é","í","ò","ó","ú"], ["&#39;","&agrave;","&aacute;","&egrave;","&eacute;","&iacute;","&ograve;","&oacute;","&uacute;"], $this->translate->translate('No articles found')) ?>","<?= str_replace(["'","à","á","è","é","í","ò","ó","ú"], ["&#39;","&agrave;","&aacute;","&egrave;","&eacute;","&iacute;","&ograve;","&oacute;","&uacute;"], $this->translate->translate('No blog posts found')) ?>","<?= str_replace(["'","à","á","è","é","í","ò","ó","ú"], ["&#39;","&agrave;","&aacute;","&egrave;","&eacute;","&iacute;","&ograve;","&oacute;","&uacute;"], $this->translate->translate('No channels found.')) ?>"]'
  442. data-template='["articles_search_mini","blogs_search_mini","channel_search_mini"]'
  443. data-limit="5"
  444. data-pending='<?= $this->translate->translate('Searching...') ?>'
  445. data-position="absolute"
  446. data-header="1">
  447. </div>
  448. </div>
  449. </div>
  450. </form>
  451. <?php } ?>
  452. <ul class="navbar-nav mr-auto d-none d-lg-flex d-xl-flex">
  453. <?php if ($hasPremium) { ?>
  454. <li class="nav-item pt-3 mr-2 nav-item-be-premium">
  455. <a href="<?= $baseUri ?>suscripciones/premium" class="nav-link btn btn-sm btn-gold">
  456. <span class="fa fa-star"></span>
  457. Webchat Premium
  458. </a>
  459. </li>
  460. <?php } else { ?>
  461. <li class="nav-item pt-3 mr-2 nav-item-be-premium">
  462. <a href="<?= $baseUri ?>suscripciones/premium" class="nav-link btn btn-sm btn-green">
  463. <span class="fa fa-star"></span>
  464. <?= $this->translate->translate('Chat without ads!') ?>
  465. </a>
  466. </li>
  467. <?php } ?>
  468. <li class="nav-item">
  469. <div class="dropdown">
  470. <a href="#" class="nav-link"
  471. data-toggle="dropdown" id="MenuProfile" aria-haspopup="true" aria-expanded="false">
  472. <img class="icon-log-in" alt="log in" src="/assets/web/images/log-in.png">
  473. </a>
  474. <div class="dropdown-menu dropdown-menu-right pt-0 pb-0 border-0">
  475. <?php if ($loggedIn) { ?>
  476. <a class="dropdown-item" href="/perfil"><?= $this->translate->translate('Profile') ?></a>
  477. <?php } ?>
  478. <a class="dropdown-item" href="/faqs-premium">
  479. <span class="fa fa-question"></span>
  480. <?= $this->translate->translate('Premium FAQS') ?>
  481. </a>
  482. <a class="dropdown-item" href="/suscripciones">
  483. <span class="fa fa-list"></span>
  484. <?= $this->translate->translate('Subscriptions') ?>
  485. </a>
  486. <?php if ($loggedIn) { ?>
  487. <a class="dropdown-item rounded-bottom" href="/auth/logout"><?= $this->translate->translate('Log out') ?></a>
  488. <?php } else { ?>
  489. <a class="dropdown-item rounded-bottom" href="/auth/login"><?= $this->translate->translate('Log in') ?></a>
  490. <?php } ?>
  491. </div>
  492. </div>
  493. </li>
  494. </ul>
  495. </div>
  496. </div>
  497. </nav>
  498.  
  499. <div class="container-fluid d-sm-none nav-item-be-premium pt-2 pb-2">
  500. <a href="<?= $baseUri ?>suscripciones" class="btn btn-block btn-green">
  501. <span class="fa fa-star"></span>
  502. <?= $this->translate->translate('Chat without ads!') ?>
  503. </a>
  504. </div>
  505.  
  506.  
  507. <?php if (!$hasPremium && $controller != 'error' && $controller != 'paywall' && $controller != 'auth' && $controller != 'sexshop') { ?>
  508. <div class="container-fluid banner-top pt-2 pb-2">
  509. <div id="pubtop" class="pt-2 pb-4 text-center">
  510. <?php if ($ads_revive_enabled) { ?>
  511. <p class="pt-0 pb-2"><small>PUBLICIDAD</small></p>
  512. <!-- We do not need to include anything here -->
  513. <?php } elseif ($section_gay == 1 || $section_sex == 1) { ?>
  514. <p class="pt-0 pb-2"><small>PUBLICIDAD</small></p>
  515. <script>
  516. document.getElementById('pubtop').style.height = 'auto';
  517. if (screen.width < 576) {
  518. i = document.createElement('iframe');
  519. i.setAttribute('width', '300');
  520. i.setAttribute('height', '100');
  521. i.setAttribute('frameborder', '0');
  522. i.setAttribute('scrolling', 'no');
  523. i.setAttribute('src', '//tsyndicate.com/iframes2/c4d6e6b25f6e49bdb7e52be5827d9a12.html?');
  524. document.getElementById('pubtop').appendChild(i);
  525. s = document.createElement('s');
  526. s.setAttribute('text/javascript');
  527. s.setAttribute('src', '//cdn.tsyndicate.com/sdk/v1/bi.js');
  528. s.setAttribute('data-ts-spot', 'c4d6e6b25f6e49bdb7e52be5827d9a12');
  529. s.setAttribute('data-ts-width', '300');
  530. s.setAttribute('data-ts-height', '100');
  531. s.setAttribute('async', true);
  532. s.setAttribute('defer', true);
  533. document.getElementById('pubtop').appendChild(s);
  534. } else {
  535. d = document.createElement('div');
  536. d.setAttribute('id', "ts_ad_native_s5bpv");
  537. d.setAttribute('class', "text-center");
  538. document.getElementById('pubtop').appendChild(d);
  539. s = document.createElement('script');
  540. s.setAttribute('src', "//cdn.tsyndicate.com/sdk/v1/n.js");
  541. s.addEventListener('load', function () {
  542. NativeAd({
  543. element_id: "ts_ad_native_s5bpv",
  544. spot: "02d5c76c09a14f998e5303fb3b3633f6",
  545. type: "img-left",
  546. cols: 6,
  547. rows: 1,
  548. title: "",
  549. titlePosition: "left",
  550. adsByPosition: "bottom-right",
  551. breakpoints: [
  552. {
  553. "cols": "2",
  554. "width": window.innerWidth + 12
  555. }
  556. ],
  557. styles: {
  558. "image": {
  559. "padding-bottom": "72px"
  560. },
  561. "label": {
  562. "height": "72px"
  563. },
  564. "thumb": {
  565. "margin-bottom": 0
  566. },
  567. "container": {
  568. "width": (window.innerWidth - 30) + 'px',
  569. "height": "auto",
  570. "overflow": "hidden",
  571. "display": "inline-block"
  572. }
  573. }
  574. });
  575. });
  576. document.getElementById('pubtop').appendChild(s);
  577. }
  578. </script>
  579.  
  580. <?php } elseif ($section_lesbianas == 1) { ?>
  581. <p class="pt-0 pb-2"><small>PUBLICIDAD</small></p>
  582. <?php if (isset($vivelavita) && $vivelavita) { ?>
  583. <?php if ($section_lesbianas == 1) { ?>
  584. <?php $vivelavita_slug = 'lesbianas'; ?>
  585. <?php } elseif ($section_gay == 1) { ?>
  586. <?php $vivelavita_slug = 'gays'; ?>
  587. <?php } else { ?>
  588. <?php $vivelavita_slug = 'heteros'; ?>
  589. <?php } ?>
  590. <a href="/sexshop/<?= $vivelavita_slug ?>" target="_blank" style="display:block;height:90px;">
  591. <img src="/assets/web/images/vivelavita.jpg" style="height:90px;">
  592. </a>
  593. <br>
  594. <a href="/sexshop/<?= $vivelavita_slug ?>" target="_blank" class="text-primary" style="text-transform:uppercase;font-weight:bold;">Ir al sexshop</a>
  595. <?php } ?>
  596.  
  597. <?php } else { ?>
  598. <p class="text-muted pt-0 pb-2"><small>PUBLICIDAD</small></p>
  599. <div id="div-gpt-ad-1489776310120-0" style="display:block;"></div>
  600. <?php } ?>
  601. </div>
  602.  
  603. </div>
  604. <?php } ?>
  605.  
  606. <?php if ($controller == 'index' && $action == 'index') { ?>
  607. <div class="container-fluid main-content main-content-home">
  608. <?php } else { ?>
  609. <div class="container-fluid main-content">
  610. <?php } ?>
  611. <div class="row">
  612. <?php if ($controller == 'index' && $action == 'index') { ?>
  613. <div class="container-fluid home-header">
  614. <div class="container-xl main-content-header">
  615. <div class="row">
  616. <div class="col-5 pt-sm-4 pb-sm-4">
  617. <h1 class="mb-1 mb-sm-4 text-left">Chat Hispano</h1>
  618. <h2 class="mb-1 mb-sm-4 text-left"><?= $this->translate->translate('Greatest free chat network in spanish') ?></h2>
  619. <a href="<?php if ($enable_element) { ?>/chat/<?php } else { ?>/webchat/<?php } ?>" class="btn btn-lg btn-primary mt-4 ml-sm-4" target="_blank"><?= $this->translate->translate('Chat') ?></a>
  620. </div>
  621. </div>
  622. </div>
  623. <style>
  624. .main-content.main-content-home .main-content-header {
  625. color: var(--color-neutral1);
  626. }
  627. .main-content.main-content-home .main-content-header h1,
  628. .main-content.main-content-home .main-content-header h2 {
  629. font-size: 48px;
  630. }
  631. .main-content.main-content-home .main-content-header div a.btn {
  632. background-color: var(--color-primary);
  633. color: var(--color-neutral1);
  634. width: 250px;
  635. font-family: AsapSemiBold;
  636. }
  637.  
  638. /* xs mobile */
  639. @media (max-width: 575px) {
  640. .main-content.main-content-home .main-content-header h1,
  641. .main-content.main-content-home .main-content-header h2 {
  642. font-size: 19px;
  643. }
  644. }
  645. </style>
  646.  
  647. </div>
  648. <?php } ?>
  649. <div class="container-xl">
  650. <?php if (isset($navigation) && $this->length($navigation) > 0) { ?>
  651. <nav aria-label="breadcrumb">
  652. <ol class="breadcrumb bg-transparent">
  653. <?php foreach ($navigation as $idx => $item) { ?>
  654. <?php if ($idx == $this->length($navigation) - 1) { ?>
  655. <li class="breadcrumb-item active text-neutral1" aria-current="page"><?= $item['name'] ?></li>
  656. <?php } else { ?>
  657. <li class="breadcrumb-item text-neutral1"><a href="<?= $item['url'] ?>" class="text-neutral1"><?= $item['name'] ?></a></li>
  658. <?php } ?>
  659. <?php } ?>
  660. </ol>
  661. </nav>
  662. <style>
  663. .breadcrumb-item:not(.active) {
  664. font-weight: normal;
  665. }
  666. .breadcrumb-item.active {
  667. font-family: AsapSemiBold;
  668. font-weight: normal;
  669. text-decoration: underline;
  670. }
  671. </style>
  672. <?php } ?>
  673.  
  674. </div>
  675. <div class="container-xl">
  676. <div class="row">
  677. <div class="col-sm main-content-left bg-neutral1 rounded">
  678. <?= $this->flashSession->output() ?>
  679. <div class="container-fluid pb-0">
  680. <div class="row pb-4">
  681. <h2 class="mb-4"><?= $this->translate->translate('Welcome!') ?></h2>
  682. <p class="text-left"><?= $this->translate->translate('WELCOME_INTRO1') ?></p>
  683. <p class="text-left"><?= $this->translate->translate('WELCOME_INTRO2') ?></p>
  684. </div>
  685. </div>
  686. <?php if (!$hasPremium) { ?>
  687. <div class="mt-0 mb-4 text-center">
  688. <a href="/suscripciones/premium">
  689. <?php if ($paywall_promo_enabled) { ?>
  690. <img alt="Chat Hispano PREMIUM" src="/assets/web/images/<?= $paywall_promo_image ?>" />
  691. <?php } else { ?>
  692. <img alt="Chat Hispano PREMIUM" src="/assets/web/images/hispano-large-premium.png" />
  693. <?php } ?>
  694. </a>
  695. <p class="modal-title text-center mt-3">
  696. <b>
  697. <?php if ($paywall_promo_enabled) { ?>
  698. <a href="/suscripciones/premium" class="text-primary"><?= $paywall_promo_keyword_header ?></a>
  699. <?php } else { ?>
  700. <a href="/suscripciones/premium" class="text-primary">¡Chatea como nunca lo has soñado!</a>
  701. <?php } ?>
  702. </b>
  703. </p>
  704. <?php if ($paywall_promo_enabled) { ?>
  705. <p class="text-muted pt-2"><small><i><?= $paywall_promo_keyword_description ?></i></small></p>
  706. <?php } ?>
  707. <a href="/suscripciones/premium" class="btn btn-lg btn-goldenrot mt-4 mb-4" target="_blank">
  708. <?= $this->translate->translate('Try it free') ?>
  709. </a>
  710. </div>
  711.  
  712. <?php } ?>
  713. <?php $this->partial('index/categorylist', ['seemore' => 1]); ?>
  714. <?php $this->partial('index/carousel', ['list' => $carousel_data, 'carousel_id' => 'HomeCarousel', 'title' => $this->translate->translate('Outstanding news')]); ?>
  715. <h1 class="mb-4 mt-4"><?= $this->translate->translate('Information for webmasters') ?></h1>
  716. <div class="row">
  717. <div class="col-12 col-sm-6 mb-4">
  718. <div class="card bg-secondary1 border-0 h-100">
  719. <div class="card-body border-0">
  720. <p>
  721. <?= $this->translate->translate('If you have a web in Wordpress, you can use our %plugin%.', ['plugin' => '<a href="https://wordpress.org/plugins/chathispano/" target="_blank">' . $this->translate->translate('official plugin') . '</a>']) ?>
  722. </p>
  723. <p>
  724. <?= $this->translate->translate('It will help you configure our webchat in your page. Easy and simple.') ?>
  725. </p>
  726. </div>
  727. <div class="card-footer border-0">
  728. <a href="https://wordpress.org/plugins/chathispano/" target="_blank"
  729. class="btn btn-block btn-primary btn-outline">
  730. <?= $this->translate->translate('Download Wordpress plugin') ?>
  731. </a>
  732. </div>
  733. </div>
  734. </div>
  735. <div class="col-12 col-sm-6 mb-4">
  736. <div class="card bg-secondary1 border-0 h-100">
  737. <div class="card-body border-0">
  738. <p>
  739. <?= $this->translate->translate('We also offer you the possibility to use %configurator% to generate a javascript code that you will only have to paste in your web page code.', ['configurator' => '<a href="' . $this->url->get('webmaster/embed') . '">' . $this->translate->translate('our configurator') . '</a>']) ?>
  740. </p>
  741. <p>
  742. <?= $this->translate->translate('Is simple as put Google Analytics code.') ?>
  743. </p>
  744. </div>
  745. <div class="card-footer border-0">
  746. <a href="<?= $this->url->get('webmaster/embed') ?>"
  747. class="btn btn-block btn-primary btn-outline">
  748. <?= $this->translate->translate('Go to configurator') ?>
  749. </a>
  750. </div>
  751. </div>
  752. </div>
  753. </div>
  754.  
  755.  
  756. <?php if (!$hasPremium && $controller != 'paywall' && $controller != 'auth' && $controller != 'error' && $controller != 'sexshop' && $section_gay != 1 && $section_lesbianas != 1 && $section_sex != 1) { ?>
  757. <?php if ($ads_onnetwork_enabled) { ?><div class="container-fluid text-center mb-4 pl-0 pr-0 ml-0 mr-0">
  758. <div id="onnetworkvideo">
  759. </div>
  760. </div>
  761. <script type="text/javascript">
  762. if (window.top === window.self) {
  763. console.log('Launching OnNetwork video');
  764. s = document.createElement('script');
  765. s.type = "text/javascript";
  766. <?php if ($controller == 'index' && $action == 'index') { ?>
  767. s.src = "https://video.onnetwork.tv/embed.php?sid=MnVjLDAsbDQ=";
  768. <?php } else { ?>
  769. s.src = "https://video.onnetwork.tv/embed.php?sid=MnVjLDAsbEs=";
  770. <?php } ?>
  771. document.getElementById('onnetworkvideo').append(s);
  772. }
  773. </script>
  774. <style>
  775. div#onnetworkvideo {
  776. max-width: 500px;
  777. width:100%;
  778. display:inline-block;
  779. }
  780. @media (max-width: 500px) {
  781. div#onnetworkvideo {
  782. max-width: 100%;
  783. }
  784. }
  785. </style>
  786. <?php } ?>
  787. <?php } ?>
  788. </div>
  789. <?php if (!$hasPremium && $controller != 'paywall' && $controller != 'auth' && $controller != 'error' && $controller != 'sexshop') { ?>
  790. <div class="col col-sm-auto main-content-right ml-sm-4 mt-4 mt-sm-0 bg-neutral3 rounded">
  791. <div id="pubright" class="banner-right">
  792. <?php if ($ads_revive_enabled) { ?>
  793. <p class="pt-0 pb-2"><small>PUBLICIDAD</small></p>
  794. <!-- We do not need to include anything here -->
  795. <?php } elseif ($section_gay == 1 || $section_sex == 1) { ?>
  796. <p class="pt-0 pb-2"><small>PUBLICIDAD</small></p>
  797. <script>
  798. if (screen.width >= 576) {
  799. i = document.createElement('iframe');
  800. i.setAttribute('width', '300');
  801. i.setAttribute('height', '250');
  802. i.setAttribute('frameborder', '0');
  803. i.setAttribute('scrolling', 'no');
  804. i.setAttribute('src', '//tsyndicate.com/iframes2/a7537a6a41084932bb8e7209f4d68dfc.html?');
  805. document.getElementById('pubright').appendChild(i);
  806. s = document.createElement('s');
  807. s.setAttribute('text/javascript');
  808. s.setAttribute('src', '//cdn.tsyndicate.com/sdk/v1/bi.js');
  809. s.setAttribute('data-ts-spot', 'a7537a6a41084932bb8e7209f4d68dfc');
  810. s.setAttribute('data-ts-width', '300');
  811. s.setAttribute('data-ts-height', '250');
  812. s.setAttribute('async', true);
  813. s.setAttribute('defer', true);
  814. document.getElementById('pubright').appendChild(s);
  815. }
  816. </script>
  817.  
  818. <?php } elseif ($section_lesbianas == 1) { ?>
  819. <p class="pt-0 pb-2"><small>PUBLICIDAD</small></p>
  820. <?php if (isset($vivelavita) && $vivelavita) { ?>
  821. <?php if ($section_lesbianas == 1) { ?>
  822. <?php $vivelavita_slug = 'lesbianas'; ?>
  823. <?php } elseif ($section_gay == 1) { ?>
  824. <?php $vivelavita_slug = 'gays'; ?>
  825. <?php } else { ?>
  826. <?php $vivelavita_slug = 'heteros'; ?>
  827. <?php } ?>
  828. <a href="/sexshop/<?= $vivelavita_slug ?>" target="_blank" style="display:block;width:300px;margin-top:10px;">
  829. <img src="/assets/web/images/vivelavita.jpg" style="width:300px;">
  830. </a>
  831. <?php } ?>
  832.  
  833. <?php } else { ?>
  834. <p class="text-muted pt-0 pb-2"><small>PUBLICIDAD</small></p>
  835. <div id="div-gpt-ad-1489677647865-0" style="display:block;"></div>
  836. <?php if ($ads_optimanetwork_enabled) { ?>
  837. <div id="div-gpt-ad-chathispano-optima-network"></div>
  838.  
  839. <?php } ?>
  840. <?php } ?>
  841. </div>
  842.  
  843. </div>
  844. <?php } ?>
  845. </div>
  846. <?php if ($controller != 'paywall' && $controller != 'auth' && $controller != 'error' && $controller != 'profile' && $controller != 'sexshop') { ?>
  847. <div class="row">
  848. <?php if (!$hasPremium && $controller == 'index' && $action == 'index') { ?>
  849. <div class="col-12 pt-4 pb-4">
  850. <div class="container-fluid bg-neutral1 rounded mb-0">
  851. <?php if ($section_lesbianas != 1 && $section_gay != 1 && $section_sex != 1) { ?>
  852. <div id="div-gpt-ad-1511474953866-0"></div>
  853. <?php } ?>
  854.  
  855. </div>
  856. </div>
  857. <?php } ?>
  858. </div>
  859. <?php } ?>
  860. </div>
  861. </div>
  862. </div>
  863.  
  864. <div id="footer" class="container-fluid bg-neutral6">
  865. <div class="container-xl">
  866. <div class="row justify-content-center mb-4">
  867. <div class="col">
  868. <img class="lazyload" alt="logo"
  869. data-src="<?= $cdnUri ?>/public/assets/web/images/logo-menu-large.png?system=1">
  870. </div>
  871. <div class="col-auto">
  872. <ul class="sitemap list-group border-0 pl-4">
  873. <li class="list-group-item border-0 bg-transparent">
  874. <a href="<?= $this->url->get('webchat/') ?>" target="_blank"><?= $this->translate->translate('Chat') ?></a>
  875. </li>
  876. <li class="list-group-item border-0 bg-transparent">
  877. <a href="https://foro.chathispano.com/" target="_blank"><?= $this->translate->translate('Forum') ?></a>
  878. </li>
  879. <li class="list-group-item border-0 bg-transparent">
  880. <a href="<?= $this->url->get('blogs/') ?>"><?= $this->translate->translate('Blogs') ?></a>
  881. </li>
  882. <li class="list-group-item border-0 bg-transparent">
  883. <a href="<?= $this->url->get('noticias/') ?>"><?= $this->translate->translate('News') ?></a>
  884. </li>
  885. <li class="list-group-item border-0 bg-transparent">
  886. <a href="<?= $this->url->get('normas/') ?>"><?= $this->translate->translate('Rules') ?></a>
  887. </li>
  888. <li class="list-group-item border-0 bg-transparent">
  889. <a href="<?= $this->url->get('stats/') ?>"><?= $this->translate->translate('Stats') ?></a>
  890. </li>
  891. <li class="list-group-item border-0 bg-transparent">
  892. <a href="<?= $this->url->get('historias/') ?>"><?= $this->translate->translate('Stories') ?></a>
  893. </li>
  894. <li class="list-group-item border-0 bg-transparent">
  895. <a href="https://tuforo.chathispano.com"><?= $this->translate->translate('Your free forum') ?></a>
  896. </li>
  897. </ul>
  898. </div>
  899. <div class="col-auto">
  900. <ul class="sitemap list-group border-0">
  901. <li class="list-group-item border-0 bg-transparent">
  902. <a href="<?= $this->url->get('contactar/') ?>"><?= $this->translate->translate('Contact') ?></a>
  903. </li>
  904. <li class="list-group-item border-0 bg-transparent">
  905. <a href="<?= $this->url->get('ayuda/') ?>"><?= $this->translate->translate('Help') ?></a>
  906. </li>
  907. </ul>
  908. </div>
  909. <div class="col-auto">
  910. <ul class="sitemap list-group border-0 pr-4">
  911. <li class="list-group-item border-0 bg-transparent">
  912. <a href="<?= $this->url->get('condiciones/') ?>"><?= $this->translate->translate('Use conditions') ?></a>
  913. </li>
  914. <li class="list-group-item border-0 bg-transparent">
  915. <a href="<?= $this->url->get('lopd/') ?>"><?= $this->translate->translate('Privacy') ?></a>
  916. </li>
  917. <li class="list-group-item border-0 bg-transparent">
  918. <a href="<?= $this->url->get('soporte/') ?>"><?= $this->translate->translate('Support') ?></a>
  919. </li>
  920. <li class="list-group-item border-0 bg-transparent">
  921. <a href="<?= $this->url->get('contactar/comercial') ?>"><?= $this->translate->translate('Advertising') ?></a>
  922. </li>
  923. </ul>
  924. </div>
  925. <div class="col social text-right">
  926. <a href="https://www.facebook.com/IRCHispanoChat/" target="_blank" title="Facebook">
  927. <i class="fab fa-facebook-f fa-2x"></i>
  928. </a>
  929. <a href="https://twitter.com/irchispanochat" target="_blank" class="ml-2" title="Twitter">
  930. <i class="fab fa-twitter fa-2x"></i>
  931. </a>
  932. <a href="https://www.youtube.com/channel/UCDTR3d_JQWNqcfXIak35XKg" target="_blank" class="ml-2" title="YouTube">
  933. <i class="fab fa-youtube fa-2x"></i>
  934. </a>
  935. </div>
  936. </div>
  937. <div class="row mt-4 pt-4 pb-4 pl-4 pr-4 bg-white">
  938. <img alt="Logos Kit Digital" src="/assets/web/images/logos-kit-digital.png">
  939. </div>
  940. <div class="row pt-4">
  941. <div class="col-12 text-center copyright">
  942. Copyright © 1996-<?= $current_year ?> Chat Hispano, S.L. Todos los derechos reservados.
  943. </div>
  944. </div>
  945. </div>
  946. </div>
  947.  
  948.  
  949. <script type="text/javascript">
  950. document.getElementById('veil').remove();
  951. </script>
  952.  
  953.  
  954. <!-- main JavaScript -->
  955. <?= $this->assets->outputInlineJs('mainJs') ?>
  956. <?php if ($enable_moment) { ?>
  957. <?= $this->assets->outputInlineJs('momentJs') ?>
  958. <?php } ?>
  959. <?php if ($enable_charts) { ?>
  960. <?= $this->assets->outputInlineJs('chartJs') ?>
  961. <?php } ?>
  962. <?php if ($enable_editor) { ?>
  963. <?= $this->assets->outputJs('ckeditorJs') ?>
  964. <?php } ?>
  965. <?= $this->assets->outputInlineJs('pluginJs') ?>
  966.  
  967. <script type="text/javascript">
  968. $(document).ready(function() {
  969. /**********
  970. * PLUGIN *
  971. **********/
  972. var chathispano = new $.chathispano({
  973. 'baseUri': "<?= $baseUri ?>",
  974. 'locale': "<?= $locale ?>",
  975. 'rev': "<?= $revision ?>",
  976. 'tmpl_dir': '/assets/web/js/templates/',
  977. 'storage_prefix': 'ChatHispanoWeb-',
  978. 'language_file': 'web',
  979. });
  980. window.chathispano = chathispano;
  981. document.chathispano = chathispano;
  982. chathispano.init();
  983. chathispano.ready();
  984.  
  985. <?php if ($env == 'prod') { ?>
  986. $(window).on('unload', function() {
  987. window.dataLayer.push({'event': 'unloadPage'});
  988. });
  989. <?php if ($ads_revive_enabled) { ?>
  990. window.dataLayer.push({'event': 'revive'});
  991. <?php } else { ?>
  992. window.dataLayer.push({'event': 'massarius'});
  993. <?php } ?>
  994. <?php } ?>
  995. });
  996. </script>
  997.  
  998. <script type="text/javascript">
  999. function check_menu_css() {
  1000. if ($('nav').css('opacity') != 1) {
  1001. $('nav').css('opacity', '');
  1002. $('nav').css('pointer-events', '');
  1003. console.log('Fixed nav CSS');
  1004. } else {
  1005. setTimeout(check_menu_css, 1000);
  1006. }
  1007. }
  1008. setTimeout(check_menu_css, 1000);
  1009. </script>
  1010.  
  1011.  
  1012.  
  1013. <?php if ($controller == 'index' && $controller == 'index' && !$hasPremium && $ads_revive_enabled) { ?>
  1014. <div class="modal fade" id="pubmodal" tabindex="-1" aria-hidden="true">
  1015. <div class="modal-dialog modal-dialog-centered">
  1016. <div class="modal-content">
  1017. <div class="modal-header">
  1018. PUBLICIDAD
  1019. <button type="button" class="close" data-dismiss="modal" aria-label="<?= $this->translate->translate('Close') ?>">
  1020. <span aria-hidden="true">&times;</span>
  1021. </button>
  1022. </div>
  1023. <div class="modal-body">
  1024. </div>
  1025. </div>
  1026. </div>
  1027. </div>
  1028. <style>
  1029. #pubmodal .modal-dialog .modal-content {
  1030. width: auto;
  1031. }
  1032. #pubmodal .modal-dialog .modal-content .modal-header {
  1033. border-bottom: 0px;
  1034. padding-left: 5px;
  1035. padding-right: 5px;
  1036. padding-top: 5px;
  1037. padding-bottom: 0px;
  1038. }
  1039. #pubmodal .modal-dialog .modal-content .modal-body {
  1040. padding-left: 5px;
  1041. padding-right: 5px;
  1042. padding-top: 5px;
  1043. padding-bottom: 0px;
  1044. }
  1045. @media (max-width: 767px) {
  1046. #pubmodal .modal-dialog .modal-content {
  1047. width: 100%;
  1048. }
  1049. #pubmodal .modal-dialog .modal-content .modal-body {
  1050. text-align: center;
  1051. }
  1052. }
  1053. </style>
  1054.  
  1055. <script type="text/javascript">
  1056. // Vars
  1057. var reviveId = 'ce33c1420c1c0f400ccdb1a320f6d2f5';
  1058. var reviveRefreshInterval = 120000;
  1059. // Sets up a banner given its node, zone and id
  1060. function revive_setup_banner(node, zoneId) {
  1061. $(node+' ins, '+node+' script').remove();
  1062. el = $(node+' ins');
  1063. el = document.createElement('ins');
  1064. el.setAttribute('data-revive-zoneid', zoneId);
  1065. el.setAttribute('data-revive-id', reviveId);
  1066. $(node).append(el);
  1067. }
  1068. // Setup modal
  1069. function revive_modal(zoneId) {
  1070. el = document.createElement('ins');
  1071. el.setAttribute('data-revive-zoneid', zoneId);
  1072. el.setAttribute('data-revive-id', reviveId);
  1073. $('#pubmodal .modal-body').append(el);
  1074. $('#pubmodal').modal();
  1075. }
  1076. // Setup function
  1077. function revive_setup() {
  1078. <?php if ($section_gay == 1) { ?>
  1079. <!-- g section -->
  1080. if (window.screen.width >= 992) { // desktop
  1081. revive_setup_banner('#pubtop', '66');
  1082. revive_setup_banner('#pubright', '90');
  1083. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1084. revive_setup_banner('#publeft', '96');
  1085. revive_setup_banner('#pubbottom', '78');
  1086. <?php } ?>
  1087. } else if (window.screen.width >= 768) { // tablet
  1088. revive_setup_banner('#pubtop', '72');
  1089. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1090. revive_setup_banner('#pubbottom', '84');
  1091. <?php } else { ?>
  1092. revive_setup_banner('#pubright', '102');
  1093. <?php } ?>
  1094. } else { // mobile
  1095. revive_setup_banner('#pubtop', '150');
  1096. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1097. revive_setup_banner('#pubbottom', '144');
  1098. <?php } else { ?>
  1099. revive_setup_banner('#pubright', '102');
  1100. <?php } ?>
  1101. }
  1102. <?php } elseif ($section_sex == 1) { ?>
  1103. <!-- a section -->
  1104. if (window.screen.width >= 992) { // desktop
  1105. revive_setup_banner('#pubtop', '192');
  1106. revive_setup_banner('#pubright', '180');
  1107. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1108. revive_setup_banner('#publeft', '174');
  1109. revive_setup_banner('#pubbottom', '156');
  1110. <?php } ?>
  1111. } else if (window.screen.width >= 768) { // tablet
  1112. revive_setup_banner('#pubtop', '204');
  1113. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1114. revive_setup_banner('#pubbottom', '168');
  1115. <?php } else { ?>
  1116. revive_setup_banner('#pubright', '186');
  1117. <?php } ?>
  1118. } else { // mobile
  1119. revive_setup_banner('#pubtop', '198');
  1120. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1121. revive_setup_banner('#pubbottom', '162');
  1122. <?php } else { ?>
  1123. revive_setup_banner('#pubright', '186');
  1124. <?php } ?>
  1125. }
  1126. <?php } else { ?>
  1127. <!-- default -->
  1128. if (window.screen.width >= 992) { // desktop
  1129. revive_setup_banner('#pubtop', '6');
  1130. revive_setup_banner('#pubright', '54');
  1131. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1132. revive_setup_banner('#publeft', '48');
  1133. revive_setup_banner('#pubbottom', '30');
  1134. <?php } ?>
  1135. } else if (window.screen.width >= 768) { // tablet
  1136. revive_setup_banner('#pubtop', '24');
  1137. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1138. revive_setup_banner('#pubbottom', '36');
  1139. <?php } else { ?>
  1140. revive_setup_banner('#pubright', '60');
  1141. <?php } ?>
  1142. } else { // mobile
  1143. revive_setup_banner('#pubtop', '18');
  1144. <?php if ($controller == 'webchat' && $action == 'index') { ?>
  1145. revive_setup_banner('#pubbottom', '42');
  1146. <?php } else { ?>
  1147. revive_setup_banner('#pubright', '60');
  1148. <?php } ?>
  1149. }
  1150. <?php } ?>
  1151. var s = document.createElement("script");
  1152. s.async = true;
  1153. s.type = "text/javascript";
  1154. s.src = "https://ad.chathispano.com/www/delivery/asyncjs.php";
  1155. $('body').append(s);
  1156. }
  1157. function revive_start() {
  1158. setInterval(function() {
  1159. window.reviveAsync={};
  1160. revive_setup();
  1161. }, reviveRefreshInterval);
  1162. revive_setup();
  1163. }
  1164. revive_start();
  1165. if (window.screen.width >= 768) { // tablet + desktop
  1166. revive_modal('282');
  1167. } else { // mobile
  1168. revive_modal('294');
  1169. }
  1170. </script>
  1171.  
  1172. <?php } ?>
  1173.  
  1174. <div id="hispanito">
  1175. <img alt="HispaNiTo" src="/assets/web/images/logo-menu.png">
  1176. <div>
  1177. <?php if ($loggedIn) { ?>
  1178. <hr>
  1179. <a href="/perfil/info" class="text-purple" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1180. <span class="fa fa-2x fa-user-circle"></span><br>
  1181. <?= $this->translate->translate('Profile') ?>
  1182. </a>
  1183. <?php } else { ?>
  1184. <hr>
  1185. <a href="/auth/login" class="text-purple" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1186. <span class="fas fa-2x fa-sign-in-alt"></span><br>
  1187. <?= $this->translate->translate('Log in') ?>
  1188. </a>
  1189. <?php } ?>
  1190. <hr>
  1191. <a href="/suscripciones"
  1192. class="<?php if (!$hasPremium) { ?>text-darkgreen<?php } else { ?>text-goldenrot<?php } ?>"
  1193. <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1194. <?php if (!$hasPremium) { ?>
  1195. <span class="fa fa-2x fa-star"></span><br>
  1196. <?= $this->translate->translate('Chat without ads!') ?>
  1197. <?php } else { ?>
  1198. <span class="fa fa-2x fa-star"></span><br>
  1199. <font class="text-goldenrot">Webchat Premium</font>
  1200. <?php } ?>
  1201. </a>
  1202. <?php if (!$loggedIn) { ?>
  1203. <hr>
  1204. <a href="/auth/register" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1205. <span class="fa fa-2x fa-user-circle"></span><br>
  1206. <?= $this->translate->translate('Create an account') ?>
  1207. </a>
  1208. <?php } ?>
  1209. <?php if (!$loggedIn || isset($identity) && $this->length($identity['nicks']) < 3) { ?>
  1210. <hr>
  1211. <a href="/regnick" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1212. <span class="fa fa-2x fa-user-plus"></span><br>
  1213. <?= $this->translate->translate('Nick reservation') ?>
  1214. </a>
  1215. <?php } ?>
  1216. <?php if (!$loggedIn || isset($identity) && $this->length($identity['nicks']) > 0) { ?>
  1217. <hr>
  1218. <a href="/setpass" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1219. <span class="fa fa-2x fa-key"></span><br>
  1220. <?= $this->translate->translate('Update password') ?>
  1221. </a>
  1222. <hr>
  1223. <a href="/ipvirtual" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1224. <span class="fa fa-2x fa-paint-brush"></span><br>
  1225. <?= $this->translate->translate('Update Virtual IP') ?>
  1226. </a>
  1227. <hr>
  1228. <a href="/perfil/misblogs" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1229. <span class="fa fa-2x fa-blog"></span><br>
  1230. <?= $this->translate->translate('My blogs') ?>
  1231. </a>
  1232. <hr>
  1233. <a href="/perfil/misforos" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1234. <span class="fab fa-2x fa-discourse"></span><br>
  1235. <?= $this->translate->translate('My forums') ?>
  1236. </a>
  1237. <hr>
  1238. <a href="/chanreg" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1239. <span class="fa fa-2x fa-users"></span><br>
  1240. <?= $this->translate->translate('Channel registration') ?>
  1241. </a>
  1242. <?php } ?>
  1243. <hr>
  1244. <a href="/gestiones" <?php if ($controller == 'webchat' && $action == 'index') { ?>target="_blank"<?php } ?>>
  1245. <span class="fa fa-2x fa-list"></span><br>
  1246. <?= $this->translate->translate('More procedures') ?>
  1247. </a>
  1248. </div>
  1249. </div>
  1250.  
  1251. </body>
  1252. </html>
#4Phalcon\Mvc\View\Engine\Volt->render
#5Phalcon\Mvc\View->engineRender
#6Phalcon\Mvc\View->processRender
#7Phalcon\Mvc\View->render
#8Phalcon\Mvc\Application->handle
/srv/ChatHispanoEngine/releases/100/apps/Application.php (150)
  1. <?php
  2.  
  3. // namespace ChatHispanoEngine;
  4.  
  5. /**
  6. * Application driver class to initialize Phalcon and
  7. * other resources.
  8. */
  9. class Application extends \Phalcon\Mvc\Application
  10. {
  11. private static $mode = 'dev';
  12.  
  13. private static $DEFAULT_MODULE = 'api';
  14.  
  15. public const MODE_PRODUCTION = 'prod';
  16. public const MODE_STAGING = 'staging';
  17. public const MODE_TEST = 'test';
  18. public const MODE_DEVELOPMENT = 'dev';
  19.  
  20. /**
  21. * Set application mode and error reporting level.
  22. */
  23. public function __construct($defaultModule, $env = 'dev')
  24. {
  25. $this->modules = array(
  26. 'core' => array(
  27. 'className' => 'ChatHispanoEngine\Core\Module',
  28. 'path' => __DIR__.'/Core/Module.php',
  29. ),
  30. 'api' => array(
  31. 'className' => 'ChatHispanoEngine\Api\Module',
  32. 'path' => __DIR__.'/Api/Module.php',
  33. ),
  34. 'login' => array(
  35. 'className' => 'ChatHispanoEngine\Login\Module',
  36. 'path' => __DIR__.'/Login/Module.php',
  37. ),
  38. 'oidc' => array(
  39. 'className' => 'ChatHispanoEngine\Oidc\Module',
  40. 'path' => __DIR__.'/Oidc/Module.php',
  41. ),
  42. 'web' => array(
  43. 'className' => 'ChatHispanoEngine\Web\Module',
  44. 'path' => __DIR__.'/Web/Module.php',
  45. ),
  46. 'backoffice' => array(
  47. 'className' => 'ChatHispanoEngine\Backoffice\Module',
  48. 'path' => __DIR__.'/Backoffice/Module.php',
  49. ),
  50. 'movil' => array(
  51. 'className' => 'ChatHispanoEngine\Movil\Module',
  52. 'path' => __DIR__.'/Movil/Module.php',
  53. ),
  54. 'regwebexternal' => array(
  55. 'className' => 'ChatHispanoEngine\RegWebExternal\Module',
  56. 'path' => __DIR__.'/Regwebexternal/Module.php',
  57. ),
  58. 'cdn' => array(
  59. 'className' => 'ChatHispanoEngine\Cdn\Module',
  60. 'path' => __DIR__.'/Cdn/Module.php',
  61. ),
  62. 'shorten' => array(
  63. 'className' => 'ChatHispanoEngine\Shorten\Module',
  64. 'path' => __DIR__.'/Shorten/Module.php',
  65. ),
  66. );
  67.  
  68. static::$DEFAULT_MODULE = $defaultModule;
  69. self::$mode = $env;
  70.  
  71. self::$mode = trim(file_get_contents(__DIR__.'/../config/environment.txt'));
  72. define('ENVIRONMENT', self::$mode);
  73.  
  74. if (!defined('PHALCON_MODE')) {
  75. $mode = getenv('PHALCON_MODE');
  76. $mode = $mode ? $mode : self::$mode;
  77. define('PHALCON_MODE', $mode);
  78. }
  79.  
  80. switch (self::getMode()) {
  81. case self::MODE_PRODUCTION:
  82. case self::MODE_STAGING:
  83. error_reporting(0);
  84. break;
  85. case self::MODE_TEST:
  86. case self::MODE_DEVELOPMENT:
  87. ini_set('display_errors', 'On');
  88. error_reporting(E_ALL);
  89. break;
  90. }
  91. }
  92.  
  93. /**
  94. * Register the services here to make them general or register in
  95. * the ModuleDefinition to make them module-specific.
  96. */
  97. protected function _registerServices()
  98. {
  99. $defaultModule = self::$DEFAULT_MODULE;
  100. $modules = $this->modules;
  101. $config = include __DIR__.'/../config/config.php';
  102. $env_config = include __DIR__.'/../config/config_'.ENVIRONMENT.'.php';
  103. $config->merge($env_config);
  104.  
  105. $di = new \Phalcon\DI\FactoryDefault();
  106.  
  107. include __DIR__.'/../config/loader.php';
  108. include __DIR__.'/../config/services.php';
  109. include __DIR__.'/../config/routing.php';
  110.  
  111. $this->setDI($di);
  112. }
  113.  
  114. /**
  115. * Run the application.
  116. */
  117. public function main()
  118. {
  119. if (static::MODE_PRODUCTION === static::getMode()) {
  120. $this->mainProd();
  121. } else {
  122. $this->mainDev();
  123. }
  124. }
  125.  
  126. private function getRequestUri()
  127. {
  128. if (!isset($_SERVER)) {
  129. return "/";
  130. }
  131. if (!is_array($_SERVER)) {
  132. return "/";
  133. }
  134. if (!isset($_SERVER['REQUEST_URI'])) {
  135. return "/";
  136. }
  137. return $_SERVER['REQUEST_URI'];
  138. }
  139.  
  140. /**
  141. * Run the development environment.
  142. */
  143. private function mainDev()
  144. {
  145. (new \Phalcon\Support\Debug())->listen();
  146.  
  147. $this->_registerServices();
  148. $this->registerModules($this->modules);
  149.  
  150. $response = $this->handle($this->getRequestUri());
  151. $response->send();
  152. }
  153.  
  154. /**
  155. * Run the production environment.
  156. */
  157. private function mainProd()
  158. {
  159. try {
  160. $this->registerModules($this->modules);
  161. $this->_registerServices();
  162.  
  163. $response = $this->handle($this->getRequestUri());
  164. $response->send();
  165. } catch (\Exception $e) {
  166. $logger = new \Phalcon\Logger\Adapter\Stream(__DIR__.'/../logs/'.date('Y-m-d').'.log');
  167. $msg = "[".$_SERVER['SERVER_NAME']."] [".$_SERVER['REQUEST_URI']."] [".$e->getCode()."] ".$e->getMessage()." at ".$e->getFile()." (".$e->getLine().")";
  168. $msg .= "\n".$e->getTraceAsString();
  169. $logger->process(new \Phalcon\Logger\Item($msg, "error", 100));
  170. $logger->close();
  171.  
  172. // remove view contents from buffer
  173. ob_clean();
  174.  
  175. $errorCode = 500;
  176. $errorView = __DIR__.'/../public/errors/error.html';
  177.  
  178. if (401 === $e->getCode()) {
  179. // 401 UNAUTHORIZED
  180. $errorCode = 401;
  181. } elseif (403 === $e->getCode()) {
  182. // 403 FORBIDDEN
  183. $errorCode = 403;
  184. } elseif (404 === $e->getCode()
  185. || $e instanceof Phalcon\Mvc\View\Exception
  186. || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
  187. // 404 NOT FOUND
  188. $errorCode = 404;
  189. }
  190.  
  191. // Get error view contents. Since we are including the view
  192. // file here you can use PHP and local vars inside the error view.
  193. ob_start();
  194. include_once $errorView;
  195. $contents = ob_get_contents();
  196. ob_end_clean();
  197.  
  198. // send view to header
  199. $response = $this->getDI()->getShared('response');
  200. $response->resetHeaders()
  201. ->setStatusCode($errorCode, null)
  202. ->setContent($contents)
  203. ->send()
  204. ;
  205.  
  206. /**
  207. * We try to register in MongoDB the error to be able to
  208. * track it in backoffice and/or receive emails
  209. */
  210. try {
  211. $system_log_manager = $this->getDI()->get('system_log_manager');
  212. if ($errorCode == 500) {
  213. $system_log_manager->createError([
  214. 'ip' => $_SERVER['SERVER_ADDR'],
  215. 'host' => $_SERVER['SERVER_NAME'],
  216. 'process' => 'php-fpm',
  217. 'message' => $e->getMessage(),
  218. 'file' => $e->getFile(),
  219. 'line' => $e->getLine(),
  220. ]);
  221. } else {
  222. $system_log_manager->createWarning([
  223. 'ip' => $_SERVER['SERVER_ADDR'],
  224. 'host' => $_SERVER['SERVER_NAME'],
  225. 'process' => 'php-fpm',
  226. 'message' => $e->getMessage(),
  227. 'file' => $e->getFile(),
  228. 'line' => $e->getLine(),
  229. ]);
  230. }
  231. } catch (\Exception $e) {
  232. }
  233. }
  234. }
  235.  
  236. public function slowLog($t)
  237. {
  238. $config = $this->getDI()->get('config');
  239. $irc_manager = $this->getDI()->get('inspircd_irc_manager');
  240. $server = gethostname() ? gethostname() : 'unknown';
  241. $uri = "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
  242. if (substr($_SERVER['REQUEST_URI'], 0, 10) == '/historias') {
  243. return;
  244. }
  245. $msg = "\x02[SLOWLOG] [".str_pad($server, 6, " ", STR_PAD_LEFT)."] [".str_pad(round($t, 1), 5, " ", STR_PAD_LEFT)."s] PATH=\x02 ".$_SERVER['REQUEST_URI']
  246. ."\x02 TYPE=\x02 ".$_SERVER['REQUEST_METHOD']."\x02 URI=\x02 ".$uri;
  247. $irc_manager->privmsgOrderEnqueue('AAAAAI', $config->irc->debug_channel, $msg);
  248. }
  249.  
  250. /**
  251. * Get the current mode.
  252. *
  253. * @return string
  254. */
  255. public static function getMode()
  256. {
  257. return self::$mode;
  258. }
  259. }
#9Application->mainDev
/srv/ChatHispanoEngine/releases/100/apps/Application.php (122)
  1. <?php
  2.  
  3. // namespace ChatHispanoEngine;
  4.  
  5. /**
  6. * Application driver class to initialize Phalcon and
  7. * other resources.
  8. */
  9. class Application extends \Phalcon\Mvc\Application
  10. {
  11. private static $mode = 'dev';
  12.  
  13. private static $DEFAULT_MODULE = 'api';
  14.  
  15. public const MODE_PRODUCTION = 'prod';
  16. public const MODE_STAGING = 'staging';
  17. public const MODE_TEST = 'test';
  18. public const MODE_DEVELOPMENT = 'dev';
  19.  
  20. /**
  21. * Set application mode and error reporting level.
  22. */
  23. public function __construct($defaultModule, $env = 'dev')
  24. {
  25. $this->modules = array(
  26. 'core' => array(
  27. 'className' => 'ChatHispanoEngine\Core\Module',
  28. 'path' => __DIR__.'/Core/Module.php',
  29. ),
  30. 'api' => array(
  31. 'className' => 'ChatHispanoEngine\Api\Module',
  32. 'path' => __DIR__.'/Api/Module.php',
  33. ),
  34. 'login' => array(
  35. 'className' => 'ChatHispanoEngine\Login\Module',
  36. 'path' => __DIR__.'/Login/Module.php',
  37. ),
  38. 'oidc' => array(
  39. 'className' => 'ChatHispanoEngine\Oidc\Module',
  40. 'path' => __DIR__.'/Oidc/Module.php',
  41. ),
  42. 'web' => array(
  43. 'className' => 'ChatHispanoEngine\Web\Module',
  44. 'path' => __DIR__.'/Web/Module.php',
  45. ),
  46. 'backoffice' => array(
  47. 'className' => 'ChatHispanoEngine\Backoffice\Module',
  48. 'path' => __DIR__.'/Backoffice/Module.php',
  49. ),
  50. 'movil' => array(
  51. 'className' => 'ChatHispanoEngine\Movil\Module',
  52. 'path' => __DIR__.'/Movil/Module.php',
  53. ),
  54. 'regwebexternal' => array(
  55. 'className' => 'ChatHispanoEngine\RegWebExternal\Module',
  56. 'path' => __DIR__.'/Regwebexternal/Module.php',
  57. ),
  58. 'cdn' => array(
  59. 'className' => 'ChatHispanoEngine\Cdn\Module',
  60. 'path' => __DIR__.'/Cdn/Module.php',
  61. ),
  62. 'shorten' => array(
  63. 'className' => 'ChatHispanoEngine\Shorten\Module',
  64. 'path' => __DIR__.'/Shorten/Module.php',
  65. ),
  66. );
  67.  
  68. static::$DEFAULT_MODULE = $defaultModule;
  69. self::$mode = $env;
  70.  
  71. self::$mode = trim(file_get_contents(__DIR__.'/../config/environment.txt'));
  72. define('ENVIRONMENT', self::$mode);
  73.  
  74. if (!defined('PHALCON_MODE')) {
  75. $mode = getenv('PHALCON_MODE');
  76. $mode = $mode ? $mode : self::$mode;
  77. define('PHALCON_MODE', $mode);
  78. }
  79.  
  80. switch (self::getMode()) {
  81. case self::MODE_PRODUCTION:
  82. case self::MODE_STAGING:
  83. error_reporting(0);
  84. break;
  85. case self::MODE_TEST:
  86. case self::MODE_DEVELOPMENT:
  87. ini_set('display_errors', 'On');
  88. error_reporting(E_ALL);
  89. break;
  90. }
  91. }
  92.  
  93. /**
  94. * Register the services here to make them general or register in
  95. * the ModuleDefinition to make them module-specific.
  96. */
  97. protected function _registerServices()
  98. {
  99. $defaultModule = self::$DEFAULT_MODULE;
  100. $modules = $this->modules;
  101. $config = include __DIR__.'/../config/config.php';
  102. $env_config = include __DIR__.'/../config/config_'.ENVIRONMENT.'.php';
  103. $config->merge($env_config);
  104.  
  105. $di = new \Phalcon\DI\FactoryDefault();
  106.  
  107. include __DIR__.'/../config/loader.php';
  108. include __DIR__.'/../config/services.php';
  109. include __DIR__.'/../config/routing.php';
  110.  
  111. $this->setDI($di);
  112. }
  113.  
  114. /**
  115. * Run the application.
  116. */
  117. public function main()
  118. {
  119. if (static::MODE_PRODUCTION === static::getMode()) {
  120. $this->mainProd();
  121. } else {
  122. $this->mainDev();
  123. }
  124. }
  125.  
  126. private function getRequestUri()
  127. {
  128. if (!isset($_SERVER)) {
  129. return "/";
  130. }
  131. if (!is_array($_SERVER)) {
  132. return "/";
  133. }
  134. if (!isset($_SERVER['REQUEST_URI'])) {
  135. return "/";
  136. }
  137. return $_SERVER['REQUEST_URI'];
  138. }
  139.  
  140. /**
  141. * Run the development environment.
  142. */
  143. private function mainDev()
  144. {
  145. (new \Phalcon\Support\Debug())->listen();
  146.  
  147. $this->_registerServices();
  148. $this->registerModules($this->modules);
  149.  
  150. $response = $this->handle($this->getRequestUri());
  151. $response->send();
  152. }
  153.  
  154. /**
  155. * Run the production environment.
  156. */
  157. private function mainProd()
  158. {
  159. try {
  160. $this->registerModules($this->modules);
  161. $this->_registerServices();
  162.  
  163. $response = $this->handle($this->getRequestUri());
  164. $response->send();
  165. } catch (\Exception $e) {
  166. $logger = new \Phalcon\Logger\Adapter\Stream(__DIR__.'/../logs/'.date('Y-m-d').'.log');
  167. $msg = "[".$_SERVER['SERVER_NAME']."] [".$_SERVER['REQUEST_URI']."] [".$e->getCode()."] ".$e->getMessage()." at ".$e->getFile()." (".$e->getLine().")";
  168. $msg .= "\n".$e->getTraceAsString();
  169. $logger->process(new \Phalcon\Logger\Item($msg, "error", 100));
  170. $logger->close();
  171.  
  172. // remove view contents from buffer
  173. ob_clean();
  174.  
  175. $errorCode = 500;
  176. $errorView = __DIR__.'/../public/errors/error.html';
  177.  
  178. if (401 === $e->getCode()) {
  179. // 401 UNAUTHORIZED
  180. $errorCode = 401;
  181. } elseif (403 === $e->getCode()) {
  182. // 403 FORBIDDEN
  183. $errorCode = 403;
  184. } elseif (404 === $e->getCode()
  185. || $e instanceof Phalcon\Mvc\View\Exception
  186. || $e instanceof Phalcon\Mvc\Dispatcher\Exception) {
  187. // 404 NOT FOUND
  188. $errorCode = 404;
  189. }
  190.  
  191. // Get error view contents. Since we are including the view
  192. // file here you can use PHP and local vars inside the error view.
  193. ob_start();
  194. include_once $errorView;
  195. $contents = ob_get_contents();
  196. ob_end_clean();
  197.  
  198. // send view to header
  199. $response = $this->getDI()->getShared('response');
  200. $response->resetHeaders()
  201. ->setStatusCode($errorCode, null)
  202. ->setContent($contents)
  203. ->send()
  204. ;
  205.  
  206. /**
  207. * We try to register in MongoDB the error to be able to
  208. * track it in backoffice and/or receive emails
  209. */
  210. try {
  211. $system_log_manager = $this->getDI()->get('system_log_manager');
  212. if ($errorCode == 500) {
  213. $system_log_manager->createError([
  214. 'ip' => $_SERVER['SERVER_ADDR'],
  215. 'host' => $_SERVER['SERVER_NAME'],
  216. 'process' => 'php-fpm',
  217. 'message' => $e->getMessage(),
  218. 'file' => $e->getFile(),
  219. 'line' => $e->getLine(),
  220. ]);
  221. } else {
  222. $system_log_manager->createWarning([
  223. 'ip' => $_SERVER['SERVER_ADDR'],
  224. 'host' => $_SERVER['SERVER_NAME'],
  225. 'process' => 'php-fpm',
  226. 'message' => $e->getMessage(),
  227. 'file' => $e->getFile(),
  228. 'line' => $e->getLine(),
  229. ]);
  230. }
  231. } catch (\Exception $e) {
  232. }
  233. }
  234. }
  235.  
  236. public function slowLog($t)
  237. {
  238. $config = $this->getDI()->get('config');
  239. $irc_manager = $this->getDI()->get('inspircd_irc_manager');
  240. $server = gethostname() ? gethostname() : 'unknown';
  241. $uri = "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
  242. if (substr($_SERVER['REQUEST_URI'], 0, 10) == '/historias') {
  243. return;
  244. }
  245. $msg = "\x02[SLOWLOG] [".str_pad($server, 6, " ", STR_PAD_LEFT)."] [".str_pad(round($t, 1), 5, " ", STR_PAD_LEFT)."s] PATH=\x02 ".$_SERVER['REQUEST_URI']
  246. ."\x02 TYPE=\x02 ".$_SERVER['REQUEST_METHOD']."\x02 URI=\x02 ".$uri;
  247. $irc_manager->privmsgOrderEnqueue('AAAAAI', $config->irc->debug_channel, $msg);
  248. }
  249.  
  250. /**
  251. * Get the current mode.
  252. *
  253. * @return string
  254. */
  255. public static function getMode()
  256. {
  257. return self::$mode;
  258. }
  259. }
#10Application->main
/srv/ChatHispanoEngine/releases/100/public/index.php (13)
  1. <?php
  2.  
  3. date_default_timezone_set('Europe/Madrid');
  4.  
  5. require_once __DIR__.'/../vendor/autoload.php';
  6. require_once __DIR__.'/../apps/Application.php';
  7.  
  8. if (isset($_SERVER['PHALCON_APP'])) {
  9. $app = new Application($_SERVER['PHALCON_APP']);
  10. } else {
  11. $app = new Application('web');
  12. }
  13. $app->main();
  14.  
  15. try {
  16. $t = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
  17. if ($t > 6) {
  18. $app->slowLog($t);
  19. }
  20. } catch (\Exception $e) {
  21. }