/** * Default method * Display paginated articles with specified key * * @param object $page object * @param array $args array of args * @param string $param parameter (the key) * @return string */ public function get_module($page, $args, $param = '') { $out = ''; // pagination index $pp = isset($args[0]) ? intval($args[0]) : 0; // tag index $tag = isset($args[1]) && $args[1] == 'tag' ? urldecode($args[2]) : false; if (!empty($param)) { if ($tag) { $mod = new X3get_by_key_model(); $items = X4Pagination_helper::paginate($mod->get_articles_by_key_and_tag($page->id_area, $page->lang, $param, $tag), $pp); $out .= '<div class="block"><h3>' . _TAG . ': ' . htmlentities($tag) . '</h3></div>'; } else { $items = X4Pagination_helper::paginate($this->site->get_articles_by_key($page->id_area, $page->lang, $param), $pp); } // use pagination if ($items[0]) { foreach ($items[0] as $i) { if (!empty($i->content)) { $out .= '<div class="block">' . X4Utils_helper::online_edit($i, 0); // options $out .= X4Utils_helper::get_block_options($i); // check excerpt if ($i->excerpt) { $text = X4Utils_helper::excerpt($i->content); $out .= X4Utils_helper::reset_url(stripslashes($text[0])); } else { $out .= X4Utils_helper::reset_url(stripslashes($i->content)); } $out .= '<div class="clear"></div>'; // display tags if ($i->show_tags && !empty($i->tags)) { $out .= '<p class="tags"><span>' . _TAGS . '</span>: '; $tt = explode(',', $i->tags); foreach ($tt as $t) { $t = trim($t); $out .= '<a href="' . BASE_URL . $page->url . '/0/tag/' . urlencode($t) . '" title="' . _TAG . '">' . $t . '</a> '; } $out .= '</p>'; } $out .= '</div>'; } // module if (!empty($i->module)) { $out .= X4Utils_helper::module($this->site, $page, $args, $i->module, $i->param); } } // pager $out .= '<div id="pager">' . X4Pagination_helper::pager(BASE_URL . $page->url . '/', $items[1]) . '</div>'; } else { $out .= '<div class="block"><p>' . _NO_ITEMS . '</p></div>'; } } return $out; }
<div class="row">'; $c = 0; $x = 4; // max number of columns $n = sizeof($sections[2]); $widths = array('', '12', '6', '4', '3'); foreach ($sections[2] as $i) { if (!empty($i->content) || !empty($i->module)) { $class = $n >= $x ? $widths[$x] : $widths[$n]; if ($c > 0 && $c % $x == 0) { $n = $n - $x; $class = $n >= $x ? $widths[$x] : $widths[$n]; echo '</div><div class="row">'; } echo '<div class="col-xs-12 col-sm-6 col-md-' . $class . '">' . X4Utils_helper::online_edit($i, 2) . X4Utils_helper::get_block_options($i); echo '<div class="block" id="' . $i->bid . '">' . X4Utils_helper::reset_url(stripslashes($i->content)) . '</div>'; // module if (!empty($i->module)) { echo stripslashes(X4Utils_helper::module($this->site, $page, $args, $i->module, $i->param)); } echo '</div>'; } $c++; } echo '</div> </div>'; } ?> </div> </div>
<?php // check user agent $browser = $_SERVER['HTTP_USER_AGENT']; if (strstr($browser, 'MSIE') == '' || strstr($browser, 'MSIE 10.0;') != '') { // msg if (isset($_SESSION['msg']) && !empty($_SESSION['msg'])) { echo '<div id="msg"><div><p>' . $_SESSION['msg'] . '</p></div></div>'; unset($_SESSION['msg']); } // content if (isset($content)) { echo $content; } elseif (!empty($sections[1])) { // section 1 foreach ($sections[1] as $i) { echo '<article class="block">' . X4Utils_helper::reset_url(stripslashes($i->content)); if (!empty($i->module)) { echo stripslashes(X4Utils_helper::module($this->site, $page, $args, $i->module, $i->param)); } echo '</article>'; } } else { echo '<div class="block"><h1>' . _WARNING . '</h1>', '<p>' . _GLOBAL_PAGE_NOT_FOUND . '</p>', '</div>'; } } else { echo '<div id="msg"><div><p>' . _UNSUPPORTED_BROWSER . '</p></div></div>'; echo '<div class="block"><h4>' . _SUPPORTED_BROWSER . '</h4>', '<a href="http://www.google.com/chrome" title="Google Chrome"><img src="' . THEME_URL . 'img/chrome.png" alt="Google Chrome" /></a>', '<a href="http://www.mozilla.org/firefox/new/" title="Mozilla Firefox"><img src="' . THEME_URL . 'img/firefox.png" alt="Mozilla Firefox" /></a>', '<a href="http://www.opera.com/download/" title="Opera"><img src="' . THEME_URL . 'img/opera.png" alt="Opera" /></a>'; // Windows users and Mac OSX users if (strstr($browser, 'Windows') != '') { echo '<a href="http://support.apple.com/it_IT/downloads/#internet" title="Safari"><img src="' . THEME_URL . 'img/safari.png" alt="Safari" /></a>', '<a href="http://windows.microsoft.com/it-IT/internet-explorer/products/ie/home" title="Internet Explorer"><img src="' . THEME_URL . 'img/ie.png" alt="Internet Explorer" /></a>'; } else {
defined('ROOT') or die('No direct script access.'); /** * X3 CMS - A smart Content Management System * * @author Paolo Certo * @copyright (c) CBlu.net di Paolo Certo * @license http://www.gnu.org/licenses/agpl.htm * @package X3CMS */ // section 1 if (!empty($sections[1])) { foreach ($sections[1] as $i) { if (!empty($i->content)) { // options echo X4Utils_helper::get_block_options($i); echo X4Utils_helper::reset_url(stripslashes($i->content . NL . html_entity_decode($i->js))); } if (!empty($i->module)) { echo stripslashes(X4Utils_helper::module($this->site, $page, $args, $i->module, $i->param)); } // javascript for admin side if ($page->id_area == 1 && $navbar != '') { // update breadcrumb echo ' <script> window.addEvent("domready", function() { $("page-title").set("html", "' . addslashes(X4Utils_helper::navbar($navbar, ' . ', false)) . '"); buttonize("page-title", null, "topic"); }); </script>'; }
<div class="row">'; $c = 0; $x = 4; // max number of columns $n = sizeof($sections[3]); $widths = array('', '12', '6', '4', '3'); foreach ($sections[3] as $i) { if (!empty($i->content) || !empty($i->module)) { $class = $n >= $x ? $widths[$x] : $widths[$n]; if ($c > 0 && $c % $x == 0) { $n = $n - $x; $class = $n >= $x ? $widths[$x] : $widths[$n]; echo '</div><div class="row">'; } echo '<div class="col-xs-12 col-sm-6 col-md-' . $class . ' block" id="' . $i->bid . '">' . X4Utils_helper::online_edit($i, 3) . X4Utils_helper::get_block_options($i); echo X4Utils_helper::reset_url(stripslashes($i->content)); // module if (!empty($i->module)) { echo stripslashes(X4Utils_helper::module($this->site, $page, $args, $i->module, $i->param)); } echo '</div>'; } $c++; } echo '</div> </div>'; } ?> </div> </div>