/** * Méthode permettant d'afficher les liens vers les articles précédent et suivant d'une catégorie ou de l'ensemble des articles * * @param $params array Tableau des paramètres d'affichage * $mode bool Si true, n'affiche que deux articles (au plus) d'une catégorie * Si false affiche deux articles (au plus) de tous les articles * $formatPrev string optional Le format d'affichage des liens "précédent" * $formatNext string optional le format d'affichage des liens "suivant" * @return $links string Au maximum, deux liens * @author Stéphane F., DanielSan, Cyril MAGUIRE */ public function prevNext($params) { $mode = (bool) $params[0]; if (isset($params[1])) { $formatPrev = $params[1]; } else { $formatPrev = '<a href="#prevUrl" title="#prevTitle" rel="prev">« <span>#prevArt</span></a> '; } if (isset($params[2])) { $formatNext = $params[2]; } else { $formatNext = ' <a href="#nextUrl" title="#nextTitle" rel="next"><span>#nextArt</span> »</a>'; } $plxShow = plxShow::getInstance(); $ordre = preg_match('/asc/', $plxShow->plxMotor->tri) ? 'sort' : 'rsort'; $links = ''; if ($mode and $plxShow->catId() != "home") { // Des articles parmi les articles d'une catégorie $ID_CAT = str_pad($plxShow->catId(), 3, '0', STR_PAD_LEFT); $aFiles = $plxShow->plxMotor->plxGlob_arts->query('/[0-9]{4}.[' . $ID_CAT . ']*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/', 'art', $ordre, 0, false, 'before'); } else { // Des articles parmi tous les articles $aFiles = $plxShow->plxMotor->plxGlob_arts->query('/[0-9]{4}.[home|0-9,]*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/', 'art', $ordre, 0, false, 'before'); } $key = array_search(basename($plxShow->plxMotor->plxRecord_arts->f('filename')), $aFiles); $prevUrl = $prev = isset($aFiles[$key - 1]) ? $aFiles[$key - 1] : false; $nextUrl = $next = isset($aFiles[$key + 1]) ? $aFiles[$key + 1] : false; $plxGlob_arts = clone $plxShow->plxMotor->plxGlob_arts; if ($prev and preg_match('/([0-9]{4}).[home|0-9,]*.[0-9]{3}.[0-9]{12}.([a-z0-9-]+).xml$/', $prev, $capture)) { $prevUrl = $plxShow->plxMotor->urlRewrite('?article' . intval($capture[1]) . '/' . $capture[2]); } if ($prev) { $art = $plxShow->plxMotor->parseArticle(PLX_ROOT . $plxShow->plxMotor->aConf['racine_articles'] . $prev); $nextTitle = STRIP_TAGS($art['title']); } if ($next and preg_match('/([0-9]{4}).[home|0-9,]*.[0-9]{3}.[0-9]{12}.([a-z0-9-]+).xml$/', $next, $capture)) { $nextUrl = $plxShow->plxMotor->urlRewrite('?article' . intval($capture[1]) . '/' . $capture[2]); } if ($next) { $art = $plxShow->plxMotor->parseArticle(PLX_ROOT . $plxShow->plxMotor->aConf['racine_articles'] . $next); $prevTitle = STRIP_TAGS($art['title']); } if ($ordre == 'rsort') { $dummy = $prevUrl; $prevUrl = $nextUrl; $nextUrl = $dummy; } if ($prevUrl) { $links = str_replace('#prevUrl', $prevUrl, $formatPrev); $links = str_replace('#prevTitle', $prevTitle, $links); $links = str_replace('#prevArt', $this->getlang('L_PREV_ART'), $links); $links = str_replace('#prevImg', $prevImg, $links); } if ($nextUrl) { $links .= str_replace('#nextUrl', $nextUrl, $formatNext); $links = str_replace('#nextTitle', $nextTitle, $links); $links = str_replace('#nextArt', $this->getlang('L_NEXT_ART'), $links); } return $links; }
/** * Méthode qui se charger de créer le Singleton plxShow * * @return objet return une instance de la classe plxShow * @author Stephane F **/ public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new plxShow(); } return self::$instance; }
/** * Méthode qui affiche les liens * * @author Stephane F, aruhuno, nIQnutn **/ public function MySocialNetwork() { $plxShow = plxShow::getInstance(); // permet l'utilisation de plxShow $onclick = "onclick=\"javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes');return false;\""; $url = ""; $title = ""; // Test article ?? page statique if ($plxShow->mode() == 'article') { /* Récupération de l'URL */ $url = "?article" . $plxShow->artId(); $url = $plxShow->plxMotor->urlRewrite($url); $url = rawurlencode($url); /* Gestion du titre */ $plxShow->artTitle(); $title = rawurlencode(ob_get_clean()); $label = $this->getParam('share-article'); } elseif ($plxShow->mode() == 'static') { /* Récupération de l'URL */ $url = "?static" . $plxShow->staticId(); $url = $plxShow->plxMotor->urlRewrite($url); $url = rawurlencode($url); /* Gestion du titre */ $plxShow->staticTitle(); $title = ob_get_clean(); $label = $this->getParam('share-page'); } /* Remplacement du motif {$url} et {$title} par l'URL et le titre de l'article */ $pattern = array("{\$url}", "{\$title}"); $urlTitle = array($url, $title); echo "<div class=\"social-network\"><span class=\"share\">" . $label . "</span><ul>"; for ($i = 1; $i <= $this->getParam('maxItems'); $i++) { if ($this->getParam($i . '-param2') == "1") { if ($this->getParam($i . '-param3') != "") { echo "<li><a title=\"" . $this->getParam($i . '-param4') . "\" class=\"" . $this->getParam($i . '-param5') . "\" href=\"" . str_replace($pattern, $urlTitle, $this->getParam($i . "-param3")) . "\" {$onclick} target=\"_blank\" rel=\"nofollow\" ><span>" . $this->getParam($i . '-param4') . "</span></a></li>"; } } } if ($this->getParam('mail-param2') == "1") { echo "<li><a title=\"" . $this->getParam('mail-param4') . "\" class=\"" . $this->getParam('mail-param5') . "\" href=\"" . str_replace($pattern, $urlTitle, $this->getParam("mail-param3")) . "\" target=\"_blank\" rel=\"nofollow\" ><span>" . $this->getParam('mail-param4') . "</span></a></li>"; } echo "</ul></div>"; }
public function productRUrl($key) { # Recupération ID URL $productId = intval($key); if (!empty($productId) and isset($this->aProds[$key])) { return plxShow::getInstance()->plxMotor->urlRewrite('index.php?product' . $productId . '/' . $this->aProds[$key]['url']); } }
include PLX_CORE . 'lib/class.plx.capcha.php'; include PLX_CORE . 'lib/class.plx.erreur.php'; include PLX_CORE . 'lib/class.plx.record.php'; include PLX_CORE . 'lib/class.plx.motor.php'; include PLX_CORE . 'lib/class.plx.feed.php'; include PLX_CORE . 'lib/class.plx.show.php'; include PLX_CORE . 'lib/class.plx.encrypt.php'; include PLX_CORE . 'lib/class.plx.plugins.php'; # Creation de l'objet principal et lancement du traitement $plxMotor = plxMotor::getInstance(); # Hook Plugins eval($plxMotor->plxPlugins->callHook('Index')); $plxMotor->prechauffage(); $plxMotor->demarrage(); # Creation de l'objet d'affichage $plxShow = plxShow::getInstance(); eval($plxMotor->plxPlugins->callHook('IndexBegin')); # On démarre la bufferisation ob_start(); ob_implicit_flush(0); # Traitements du thème if ($plxMotor->style == '' or !is_dir(PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style)) { header('Content-Type: text/plain; charset=' . PLX_CHARSET); echo L_ERR_THEME_NOTFOUND . ' (' . PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . ') !'; } elseif (file_exists(PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template)) { # On impose le charset header('Content-Type: text/html; charset=' . PLX_CHARSET); # Insertion du template include PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template; } else { header('Content-Type: text/plain; charset=' . PLX_CHARSET);
public function ThemeEndBody() { $plxShow = plxShow::getInstance(); $script = $this->getParam('script'); if ($script == 'true') { echo '<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>'; } ?> <script src="<?php echo PLX_PLUGINS; ?> CookieMessage/app/cookie.js"></script> <script> $(document).ready(function () { // activate cookie cutter $.cookieCuttr({ cookieNoMessage: false, // desactiver le message et les cookie cookieAnalytics: false, // les boutons cookieDeclineButton: <?php echo $this->getParam("cookieDeclineButton"); ?> , cookieDeclineButtonText: "<?php echo $this->getParam("cookieDeclineButtonText"); ?> ", cookieAcceptButton: <?php echo $this->getParam("cookieAcceptButton"); ?> , // this will disable non essential cookies cookieAcceptButtonText: "<?php echo $this->getParam("cookieAcceptButtonText"); ?> ", // le message et les liens cookieCutterDeclineOnly: true, // you'd like the CookieCutter to only hide when someone has clicked declined set this to true cookieMessage: "<?php echo $this->getParam('message'); ?> <a href='{{cookiePolicyLink}}' title='read about our cookies'><?php echo $this->getParam('info'); ?> </a>", cookiePolicyLink: '<?php echo "static" . $this->getParam("info_lien"); ?> ', // if applicable, enter the link to your privacy policy here... cookieOverlayEnabled: <?php echo $this->getParam('full'); ?> , // true, afficher le message sur la page cookieExpires: <?php echo $this->getParam('time'); ?> , cookieNotificationLocationBottom: <?php echo $this->getParam('page'); ?> // true for bottom, false for top }); }); if (jQuery.cookie('cc_cookie_accept') == "cc_cookie_accept") { // placer votre code google analytics } </script> <?php }
public function hamGravatar() { $hamGravatar_size = $this->getParam('hamGravatar_size'); $hamGravatar_defaut = $this->getParam('hamGravatar_defaut'); $hamGravatar_defaut_url = $this->getParam('hamGravatar_defaut_url'); $hamGravatar_rated = $this->getParam('hamGravatar_rated'); $plxShow = plxShow::getInstance(); $type = $plxShow->plxMotor->plxRecord_coms->f('type'); if ($type == 'admin') { $email = $plxShow->plxMotor->plxRecord_coms->f('mail'); if ($email != '') { $hamGravatar = $email; } $author = $plxShow->plxMotor->plxRecord_coms->f('author'); foreach ($plxShow->plxMotor->aUsers as $user) { if ($user['name'] == $author) { $hamGravatar = plxUtils::strCheck($user['email']); } } } else { $hamGravatar = plxUtils::strCheck($plxShow->plxMotor->plxRecord_coms->f('mail')); } if ($hamGravatar_defaut == 'url') { $hamGravatar_d = urlencode($hamGravatar_defaut_url); } else { $hamGravatar_d = $hamGravatar_defaut; } $hamGravatar_mail = md5(strtolower(trim($hamGravatar))); echo 'http://www.gravatar.com/avatar.php?gravatar_id=' . $hamGravatar_mail . '&d=' . $hamGravatar_d . '&s=' . $hamGravatar_size . '&r=' . $hamGravatar_rated; }
public function PP_msg($msg, $exit = false, $status = 'error') { if (!empty($msg)) { if (!isset($plxMotor)) { $plxMotor = plxMotor::getInstance(); } if (!isset($plxShow)) { $plxShow = plxShow::getInstance(); } # Traitements du thème if ($plxMotor->style == '' or !is_dir(PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style)) { header('Content-Type: text/plain'); echo $status == 'error' ? '<span class="error">' . $this->getLang($msg) . '</span>' : $this->getLang($msg); } elseif (file_exists(PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template)) { # On impose le charset header('Content-Type: text/html; charset=' . PLX_CHARSET); # Insertion du template include PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template . 'header.php'; ?> <section> <div id="container"> <div class="width-sidebar"> <article role="article" id="static-page-<?php echo $plxShow->staticId(); ?> "> <header> <h1> <?php echo 'PickyPaste ' . ($status == 'error' ? '- ' . $this->getLang('L_ERROR') : ''); ?> </h1> </header> <section> <?php echo $status == 'error' ? '<span class="error">' . $this->getLang($msg) . '</span>' : $this->getLang($msg); ?> </section> </article> </div> <?php if ($this->getParam('sidebar') == 1) { include PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template . 'sidebar.php'; } ?> </div> </section> <?php include PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template . 'footer.php'; } else { header('Content-Type: text/plain'); echo $status == 'error' ? '<span class="error">' . $this->getLang($msg) . '</span>' : $this->getLang($msg); } } if ($exit) { exit; } }