<?php addPollenPlugin('extrapage', 'extrapage_sitemap'); addSmartyPlugin('insert', 'google_sitemap_fct', 'google_sitemap'); /** * extrapage_sitemap * This is the extrapagesite map event function * This function check the name of the page and if it is sitemap.xml, generate the site map. * * @param unknown_type $strPage * @param unknown_type $site * @return unknown */ function extrapage_sitemap($strPage, &$site) { if ($strPage == 'sitemap.xml') { $strTplFile = dirname(__FILE__) . SLASH . 'google_sitemap.tpl'; if (!$site->template_exists($strTplFile)) { setError('Error in plugin google site map. Can not find the google_sitemap.tpl file.'); printFatalHtmlError(); die; } header('Content-Type: text/xml;'); $site->display($strTplFile); return true; } return false; } /** * google_sitemap_fct * This is the smarty function used in the google_sitemap.tpl.
<?php addPollenPlugin('extrapage', 'images_tools_extrapage_imagestoolsresize'); addPollenPlugin('uploadfile', 'images_tools_OnUpload_ResizeImage'); addPollenPlugin('addPluginsTabs', 'images_tools_TabConfig'); addSmartyPlugin('output', 'images_tools_addjs_fancyzoom_and_ifixpng'); addSmartyPlugin('output', 'images_tools_change_image_src_to_autoresize'); function images_tools_TabConfig($tabExtraPlugins) { $oPlugin = new PPluginDir(dirname(__FILE__)); $oConfigFile =& $oPlugin->oConfig; $tabExtraPlugins[] = array('FRAG_NAME' => 'plugins_imagestools', 'TAB_NAME' => _('Images Tools'), 'TAB_CONTENT' => $oConfigFile->DisplayEditor()); return true; } function images_tools_extrapage_imagestoolsresize($strPage, &$site) { if ($strPage != 'imagestoolsresize.php') { return false; } require SITE_PATH . 'core/lib/pimage.php'; if (!isset($_GET['img']) || !isset($_GET['width']) || !isset($_GET['height'])) { return false; } $strImgUrl = urldecode($_GET['img']); if (strstr($strImgUrl, '..') !== FALSE) { return false; } //check that image is a sub file of POLLEN MEDIAS directory if (!($oDirUpload = getFileObjectAndFind(MEDIAS_PATH))) { return false; }
<?php addPollenPlugin('adminmainmenu', 'admin_btn_news'); addPollenPlugin('extrapage', 'extrapage_rss_feed'); addPollenPlugin('getpagecontent', 'news_content'); addSmartyPlugin('insert', 'insert_newsrss', 'news_rss'); addSmartyPlugin('insert', 'tplfct_news_rss', 'rss_page'); /** * tplfct_news_rss * This is the template function rss_page use by the get feed template rss_page * * @param array $params, parameters from the template * @param Pollen CMS object $smarty * @return the feed in xml */ function tplfct_news_rss($params, &$smarty) { $strTplChannel = '<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"> <channel> <title>%CHANNEL_TITLE%</title> <link>%CHANNEL_LINK%</link> <description>%CHANNEL_DESCRIPTION%</description> <pubDate>%CHANNEL_PUBDATE%</pubDate> <generator>%CHANNEL_GENERATOR%</generator> %ITEMS% </channel> </rss> '; $strServerUrl = strstr(SITE_URL, 'http') ? '' : 'http://' . $_SERVER['SERVER_NAME'] . ''; $tabInfosChannel = array('title' => 'test', 'link' => $strServerUrl . SITE_URL, 'description' => 'ceci est la description', 'pubDate' => gmdate('D, d M Y H:i:s', time()) . ' GMT', 'generator' => 'POLLEN CMS');
<?php addSmartyPlugin('insert', 'se_search', 'search'); addSmartyPlugin('output', 'add_paginate'); function add_paginate($source, &$smarty) { $oDir = new PDirCategory(dirname(__FILE__)); $strUrl = $oDir->getUrl(); $strNewHead = '<!-- add by plugin search engine to paginates the results --> <script type="text/javascript" src="' . $strUrl . 'include/jquery.paginate.js" ></script> '; return str_replace('</head>', $strNewHead . "\n</head>", $source); } function se_search($params, &$smarty) { $keyword = isset($params['keywords']) ? $params['keywords'] : 'null'; $modifytext = isset($params['modifytext']) ? $params['modifytext'] : true; $modifyscore = isset($params['modifyscore']) ? $params['modifyscore'] : true; /* library */ require dirname(__FILE__) . SLASH . 'include/lib.searchengine.php'; $result_search_engine = query_search_engine($keyword); if ($result_search_engine === false) { printError(); return; } $iScoreMax = $result_search_engine[0]['score']; foreach ($result_search_engine as &$elem) { if ($modifyscore) { $pourcent = intval($elem['score'] * 100 / $iScoreMax); $elem['score'] = $pourcent; }
<?php addSmartyPlugin('output', 'add_phpmyvisites_tag'); addPollenPlugin('addPluginsTabs', 'tabPhpMyVisitesConfig'); function tabPhpMyVisitesConfig($tabExtraPlugins) { $oPlugin = new PPluginDir(dirname(__FILE__)); $oConfigFile =& $oPlugin->oConfig; $tabExtraPlugins[] = array('FRAG_NAME' => 'plugins_phpmyvisites', 'TAB_NAME' => _('Php My Visites'), 'TAB_CONTENT' => $oConfigFile->DisplayEditor()); return true; } function add_phpmyvisites_tag($source, &$smarty) { $oPlugin = new PPluginDir(dirname(__FILE__)); $oConfigFile =& $oPlugin->oConfig; if ($oConfigFile->getDirectParam('PHP_MYVISITES_ACTIVATE') !== "true") { return $source; } $id = intval($oConfigFile->getDirectParam("PHP_MYVISITES_ID")); $strPhpmvUrl = $oConfigFile->getDirectParam("PHP_MYVISITES_URL"); if ($id != '' && $id > 0 && $strPhpmvUrl != '' && strstr($source, '</body>') !== FALSE) { $strPageName = preg_replace('/^' . preg_quote(SITE_URL, '/~') . '/', '', $smarty->oPageCurrent->getUrl()); $strphpmv = ' <!-- Add By PhpMyVisites Plugin --> <div style="display:none"> <a href="http://www.phpmyvisites.us/" title="phpMyVisites | Open source web analytics" onclick="window.open(this.href);return(false);"> <script type="text/javascript"> <!-- var a_vars = Array(); var pagename = "' . $strPageName . '";