/** * Joom!Fish - Multi Lingual extention and translation manager for Joomla! * Copyright (C) 2003-2009 Think Network GmbH, Munich * * All rights reserved. The Joom!Fish project is a set of extentions for * the content management system Joomla!. It enables Joomla! * to manage multi lingual sites especially in all dynamic information * which are stored in the database. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. * * The "GNU Lesser General Public License" (LGPL) is available at * http: *www.gnu.org/copyleft/lgpl.html * ----------------------------------------------------------------------------- * $Id: ReadMe,v 1.2 2005/03/15 11:07:01 akede Exp $ * @package joomfish * @subpackage system.jfdatabase_bot * @version 2.0 * */ /** ensure this file is being included by a parent file */ defined( '_JEXEC' ) or die( 'Restricted access' ); // In PHP5 this should be a instance_of check // Currently Joom!Fish does not need to be active in Administrator // This might be an extended version if($mainframe->isAdmin()) { return; } jimport('joomla.filesystem.file'); // Joom!Fish router only gets activated if essential files are missing //if ( !file_exists( JPATH_PLUGINS .DS. 'system' .DS. 'jfdatabase' .DS. 'jfdatabase.class.php' )) { if ( !JFile::exists( dirname(__FILE__) .DS. 'jfrouter' .DS. 'contact.php' )) { JError::raiseNotice('no_jf_plugin', JText::_('Joom!Fish router plugin not installed correctly. Plugin not executed')); return; } if(JFile::exists(JPATH_SITE .DS. 'components' .DS. 'com_joomfish' .DS. 'helpers' .DS. 'defines.php')) { require_once( JPATH_SITE .DS. 'components' .DS. 'com_joomfish' .DS. 'helpers' .DS. 'defines.php' ); JLoader::register('JoomfishManager', JOOMFISH_ADMINPATH .DS. 'classes' .DS. 'JoomfishManager.class.php' ); JLoader::register('JoomFishVersion', JOOMFISH_ADMINPATH .DS. 'version.php' ); JLoader::register('JoomFish', JOOMFISH_PATH .DS. 'helpers' .DS. 'joomfish.class.php' ); } else { JError::raiseNotice('no_jf_extension', JText::_('Joom!Fish extension not installed correctly. Plugin not executed')); return; } /** * Language Determination and basic routing for Joomfish */ class plgSystemJFRouter extends JPlugin{ /** * stored configuration from plugin * * @var object configuration information */ var $_config = null; function plgSystemJFRouter(& $subject, $config) { global $mainframe; if ($mainframe->isAdmin()) { // This plugin is only relevant for use within the frontend! return; } parent::__construct($subject, $config); // put params in registry so I have easy access to them later $conf =& JFactory::getConfig(); $conf->setValue("jfrouter.params",$this->params); // Must do this here in case other plugins instantiate language! // Get the router $app = &JFactory::getApplication(); $router = &$app->getRouter(); // Joomfish aware siterouter if ($this->params->get("jfrouter",1)){ if (file_exists(dirname(__FILE__).DS."jfrouterpro".DS."jfrouter.php")){ include_once(dirname(__FILE__).DS."jfrouterpro".DS."jfrouter.php"); $config =& JFactory::getConfig(); $opts['mode'] = $config->getValue('config.sef'); $router = new JFRouter($opts); } } // end Joomfish aware siterouter // atttach build rules for language $router->attachBuildRule("routeJFRule"); // This gets the language from the router before any other part of Joomla can load the language !! $uri = &JURI::getInstance(); $this->parseJFRule($router, $uri); } function _discoverJFLanguage ( ) { static $discovered; if (isset($discovered) && $discovered){ return; } $discovered=true; $registry =& JFactory::getConfig(); // Find language without loading strings $locale = $registry->getValue('config.language'); // Attention - we need to access the site default values // #12943 explains that a user might overwrite the orignial settings based on his own profile $langparams = JComponentHelper::getParams('com_languages'); $registry->setValue("config.defaultlang",$langparams->get("site")); // get params from registry in case function called statically $params = $registry->getValue("jfrouter.params"); $determitLanguage = $params->get( 'determitLanguage', 1 ); $newVisitorAction = $params->get( 'newVisitorAction', 'browser' ); $use302redirect = $params->get( 'use302redirect', 0 ); $enableCookie = $params->get( 'enableCookie', 1 ); // get instance of JoomFishManager to obtain active language list and config values $jfm =& JoomFishManager::getInstance(); $client_lang = ''; $lang_known = false; $jfcookie = JRequest::getVar('jfcookie', null ,"COOKIE"); if (isset($jfcookie["lang"]) && $jfcookie["lang"] != "") { $client_lang = $jfcookie["lang"]; $lang_known = true; } $uri =& JURI::getInstance(); if ($requestlang = JRequest::getVar('lang', null ,"REQUEST")){ if( $requestlang != '' ) { $client_lang = $requestlang; $lang_known = true; } } if ( !$lang_known && $determitLanguage && key_exists( 'HTTP_ACCEPT_LANGUAGE', $_SERVER ) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) { switch ($newVisitorAction) { // usesing the first defined Joom!Fish language case 'joomfish': $activeLanguages = $jfm->getActiveLanguages(); reset($activeLanguages); $first = key($activeLanguages); $client_lang = $activeLanguages[$first]->getLanguageCode(); break; case 'site': // We accept that this default locale might be overwritten by user settings! $jfLang = TableJFLanguage::createByJoomla( $locale ); $client_lang = $jfLang->getLanguageCode(); break; // no language chooses - assume from browser configuration case 'browser': default: // language negotiation by Kochin Chang, June 16, 2004 // retrieve active languages from database $active_iso = array(); $active_isocountry = array(); $active_code = array(); $activeLanguages = $jfm->getActiveLanguages(); if( count( $activeLanguages ) == 0 ) { return; } foreach ($activeLanguages as $alang) { $active_iso[] = $alang->iso; if( eregi('[_-]', $alang->iso) ) { $isocountry = split('[_-]',$alang->iso); $active_isocountry[] = $isocountry[0]; } $active_code[] = $alang->shortcode; } // figure out which language to use - browser languages are based on ISO codes $browserLang = explode(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]); foreach( $browserLang as $blang ) { if( in_array($blang, $active_iso) ) { $client_lang = $blang; break; } $shortLang = substr( $blang, 0, 2 ); if( in_array($shortLang, $active_isocountry) ) { $client_lang = $shortLang; break; } // compare with code if ( in_array($shortLang, $active_code) ) { $client_lang = $shortLang; break; } } break; } } // get the name of the language file for joomla $jfLang = TableJFLanguage::createByShortcode($client_lang, false); if( $jfLang === null && $client_lang!="") { $jfLang = TableJFLanguage::createByISO( $client_lang, false ); } else if( $jfLang === null) { $jfLang = TableJFLanguage::createByJoomla( $locale ); } if( !$lang_known && $use302redirect ) { // using a 302 redirect means that we do not change the language on the fly the first time, but with a clean reload of the page $href= "index.php"; $hrefVars = ''; $queryString = JRequest::getVar('QUERY_STRING', null ,"SERVER"); if( !empty($queryString) ) { $vars = explode( "&", $queryString ); if( count($vars) > 0 && $queryString) { foreach ($vars as $var) { if( eregi('=', $var ) ) { list($key, $value) = explode( "=", $var); if( $key != "lang" ) { if( $hrefVars != "" ) { $hrefVars .= "&"; } // ignore mosmsg to ensure it is visible in frontend if( $key != 'mosmsg' ) { $hrefVars .= "$key=$value"; } } } } } } // Add the existing variables if( $hrefVars != "" ) { $href .= '?' .$hrefVars; } if( $jfLang->getLanguageCode() != null ) { $ulang = 'lang=' .$jfLang->getLanguageCode(); } else { // it's important that we add at least the basic parameter - as of the sef is adding the actual otherwise! $ulang = 'lang='; } // if there are other vars we need to add a & otherwiese ? if( $hrefVars == '' ) { $href .= '?' . $ulang; } else { $href .= '&' . $ulang; } $registry->setValue("config.multilingual_support", true); global $mainframe; $mainframe->setUserState('application.lang',$jfLang->code); $registry->setValue("config.jflang", $jfLang->code); $registry->setValue("config.lang_site",$jfLang->code); $registry->setValue("config.language",$jfLang->code); $registry->setValue("joomfish.language",$jfLang); $href = JRoute::_($href,false); header( 'HTTP/1.1 303 See Other' ); header( "Location: ". $href ); exit(); } if( isset($jfLang) && $jfLang->code != "" && ($jfLang->active || $jfm->getCfg("frontEndPreview") )) { $locale = $jfLang->code; } else { $jfLang = TableJFLanguage::createByJoomla( $locale ); if( !$jfLang->active ) { ?>

Joom!Fish config error: Default language is inactive!
 
Please check configuration, try to use first active language

$activeLanguages = $jfm->getActiveLanguages(); if( count($activeLanguages) > 0 ) { $jfLang = $activeLanguages[0]; $locale = $jfLang->code; } else { // No active language defined - using system default is only alternative! } } $client_lang = ($jfLang->shortcode!='') ? $jfLang->shortcode : $jfLang->iso; } if ($enableCookie){ setcookie( "lang", "", time() - 1800, "/" ); setcookie( "jfcookie", "", time() - 1800, "/" ); setcookie( "jfcookie[lang]", $client_lang, time()+24*3600, '/' ); } if( defined("_JLEGACY") ) { $GLOBALS['iso_client_lang'] = $client_lang; $GLOBALS['mosConfig_lang'] = $jfLang->code; } $registry->setValue("config.multilingual_support", true); global $mainframe; $mainframe->setUserState('application.lang',$jfLang->code); $registry->setValue("config.jflang", $jfLang->code); $registry->setValue("config.lang_site",$jfLang->code); $registry->setValue("config.language",$jfLang->code); $registry->setValue("joomfish.language",$jfLang); // Force factory static instance to be updated if necessary $lang =& JFactory::getLanguage(); if ($jfLang->code != $lang->getTag()){ // Must not assign by reference in order to overwrite the existing reference to the static instance of the language $lang = JFactory::_createLanguage(); } // no need to set locale for this ISO code its done by JLanguage // overwrite with the valued from $jfLang $jfparams = JComponentHelper::getParams("com_joomfish"); $overwriteGlobalConfig = $jfparams->get( 'overwriteGlobalConfig', 0 ); if($overwriteGlobalConfig ) { // We should overwrite additional global variables based on the language parameter configuration $params = new JParameter($jfLang->params); $paramarray = $params->toArray(); foreach ($paramarray as $key=>$val) { $registry->setValue("config.".$key,$val); if (defined("_JLEGACY")){ $name = 'mosConfig_'.$key; $GLOBALS[$name] = $val; } } } } /** * Custom handlers to deal with bad component routers e.g. for contact */ function procesCustomBuildRule($router, &$uri){ $option = $uri->getVar("option",""); if (strpos($option,"com_")!==0) return; $option = substr($option,4); $customFile = dirname(__FILE__).DS."jfrouter".DS.$option.".php"; if (file_exists($customFile)){ include_once($customFile); if (function_exists("JFRouterHelper".ucfirst($option))){ $function = "JFRouterHelper".ucfirst($option); $function ($router, $uri); } } } function parseJFRule($router, &$uri){ //echo "got here too lang = ".$uri->getVar("lang","")."
"; $route = $uri->getPath(); $conf =& JFactory::getConfig(); $params = $conf->getValue("jfrouter.params"); $sefordomain = $params->get("sefordomain","sefprefix"); if ($sefordomain == "subdomain"){ $host = $uri->getHost(); // TODO cache the indexed array $rawsubdomains = $params->getValue("sefsubdomain",array()); $subdomains = array(); $jfm =& JoomFishManager::getInstance(); $langs = $jfm->getLanguagesIndexedById(); foreach ($rawsubdomains as $domain) { list($langid,$domain) = split("::",$domain,2); $domain = strtolower(str_replace("http://","",$domain)); $domain = str_replace("https://","",$domain); $domain = preg_replace("#/$#","",$domain); //$domain = str_replace("/","",$domain); $subdomains[$domain]=$langs[$langid]->shortcode; } if (array_key_exists($host, $subdomains)){ $lang = $subdomains[$host]; // This get over written later - really stupid !!! $uri->setVar("lang",$lang); JRequest::setVar('lang', $lang ); // I need to discover language here since menu is loaded in router plgSystemJFRouter::_discoverJFLanguage(); $config =& JFactory::getConfig(); // TODO fix this for HTTPS $config->setValue('config.live_site',"http://".$host); $config->setValue("joomfish.current_host",$host); return array("lang"=>$lang); } } else { // Consider stripping base path from URI /* $live_site = JURI::base(); $livesite_uri = new JURI($live_site); $livesite_path = $livesite_uri->getPath(); $route = str_replace($livesite_path,"",$route); */ $jfm =& JoomFishManager::getInstance(); $langs = $jfm->getLanguagesIndexedById(); $sefprefixes = $params->getValue("sefprefixes",array()); // Workaround if some language prefixes are missing if (!is_array($sefprefixes)){ $sefprefixes = array(); } if (count($sefprefixes)hasprefix = true; } } foreach ($langs as $lang) { if (!isset($lang->hasprefix)){ $sefprefixes[] = $lang->id."::".$lang->shortcode; } } } $segments = explode('/', $route); $seg=0; while ($seg0){ $segcompare = substr($segments[$seg],0, strpos($segments[$seg],".")); // Trap for pdf, feed of html info in the extension if (strpos($segments[$seg],$prefix.".")===0){ $format = str_replace($prefix.".","",$segments[$seg]); //$uri->setVar("format",$format); //JRequest::setVar('format', $format); } } else { $segcompare = $segments[$seg]; } // does the segment match the prefix if ($segcompare==$prefix){ unset($segments[$seg]);//array_shift($segments); $uri->setPath(implode("/",$segments)); $lang = $langs[$langid]->shortcode; // This get over written later - really stupid !!! $uri->setVar("lang",$lang); JRequest::setVar('lang', $lang); // I need to discover language here since menu is loaded in router plgSystemJFRouter::_discoverJFLanguage(); return array("lang"=>$lang); } } $seg++; } } plgSystemJFRouter::_discoverJFLanguage(); return array(); } } function routeJFRule($router, &$uri){ $registry =& JFactory::getConfig(); $multilingual_support= $registry->getValue("config.multilingual_support",false); $jfLang = $registry->getValue("joomfish.language", false); if ($multilingual_support && $jfLang){ if ($uri->getVar("lang","")==""){ $uri->setVar("lang",($jfLang->shortcode!='') ? $jfLang->shortcode : $jfLang->iso); } // this is dependent on Joomfish router being first!! $lang=$uri->getVar("lang",""); $conf =& JFactory::getConfig(); // This may not ready at this stage $params = $conf->getValue("jfrouter.params"); // so load plugin parameters directly if (is_null($params)){ $params =& JPluginHelper::getPlugin("system", "jfrouter"); $params = new JParameter($params->params); } $sefordomain = $params->get("sefordomain","sefprefix"); if ($sefordomain == "subdomain"){ // If I set config_live_site I actually don't need this function at all let alone this logic ? Apart from language switcher. // TODO cache the indexed array $rawsubdomains = $params->getValue("sefsubdomain",array()); $subdomains = array(); $jfm =& JoomFishManager::getInstance(); $langs = $jfm->getLanguagesIndexedById(); foreach ($rawsubdomains as $domain) { list($langid,$domain) = split("::",$domain,2); $domain = strtolower(str_replace("http://","",$domain)); $domain = str_replace("https://","",$domain); $domain = preg_replace("#/$#","",$domain); //$domain = str_replace("/","",$domain); $subdomains[$langs[$langid]->shortcode]=$domain; } if (array_key_exists($lang,$subdomains)) { $uri->setHost($subdomains[$lang]); $uri->delVar("lang"); $registry->setValue("joomfish.sef_host",$subdomains[$lang]); plgSystemJFRouter::procesCustomBuildRule($router, $uri); return; } } else { // Get the path data $route = $uri->getPath(); //Add the suffix to the uri if($router->_mode == JROUTER_MODE_SEF && $route && !$lang!==""){ $jfm =& JoomFishManager::getInstance(); $jfLang = $jfm->getLanguageByShortcode($lang); if (!$jfLang) return; $sefprefixes = $params->getValue("sefprefixes",array()); // Workaround if some language prefixes are missing $langs = $jfm->getLanguagesIndexedById(); if (!is_array($sefprefixes)){ $sefprefixes = array(); } if (count($sefprefixes)hasprefix = true; } } foreach ($langs as $lang) { if (!isset($lang->hasprefix)){ $sefprefixes[] = $lang->id."::".$lang->shortcode; } } } foreach ($sefprefixes as $prefix) { list($langid,$prefix) = split("::",$prefix,2); if ($jfLang->id == $langid){ $uri->setPath($uri->getPath()."/".$prefix); $uri->delVar("lang"); plgSystemJFRouter::procesCustomBuildRule($router, $uri); return; } } } } } return; } /** * Joom!Fish - Multi Lingual extention and translation manager for Joomla! * Copyright (C) 2003-2009 Think Network GmbH, Munich * * All rights reserved. The Joom!Fish project is a set of extentions for * the content management system Joomla!. It enables Joomla! * to manage multi lingual sites especially in all dynamic information * which are stored in the database. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. * * The "GNU Lesser General Public License" (LGPL) is available at * http: *www.gnu.org/copyleft/lgpl.html * ----------------------------------------------------------------------------- * $Id: ReadMe,v 1.2 2005/03/15 11:07:01 akede Exp $ * @package joomfish * @subpackage system.jfdatabase_bot * @version 2.0 * */ /** ensure this file is being included by a parent file */ defined( '_JEXEC' ) or die( 'Restricted access' ); // In PHP5 this should be a instance_of check // Currently Joom!Fish does not need to be active in Administrator // This might be an extended version if($mainframe->isAdmin()) { return; } // Joom!Fish bot get's only activated if essential files are missing //if ( !file_exists( JPATH_PLUGINS .DS. 'system' .DS. 'jfdatabase' .DS. 'jfdatabase.class.php' )) { if ( !file_exists( dirname(__FILE__) .DS. 'jfdatabase' .DS. 'jfdatabase_inherit.php' )) { JError::raiseNotice('no_jf_plugin', JText::_('Joom!Fish plugin not installed correctly. Plugin not executed')); return; } jimport('joomla.filesystem.file'); if(JFile::exists(JPATH_SITE .DS. 'components' .DS. 'com_joomfish' .DS. 'helpers' .DS. 'defines.php')) { require_once( JPATH_SITE .DS. 'components' .DS. 'com_joomfish' .DS. 'helpers' .DS. 'defines.php' ); JLoader::register('JoomfishManager', JOOMFISH_ADMINPATH .DS. 'classes' .DS. 'JoomfishManager.class.php' ); JLoader::register('JoomFishVersion', JOOMFISH_ADMINPATH .DS. 'version.php' ); JLoader::register('JoomFish', JOOMFISH_PATH .DS. 'helpers' .DS. 'joomfish.class.php' ); } else { JError::raiseNotice('no_jf_extension', JText::_('Joom!Fish extension not installed correctly. Plugin not executed')); return; } /** * Exchange of the database abstraction layer for multi lingual translations. */ class plgSystemJFDatabase extends JPlugin{ /** * stored configuration from plugin * * @var object configuration information */ var $_config = null; function plgSystemJFDatabase(& $subject, $config) { global $mainframe; if ($mainframe->isAdmin()) { // This plugin is only relevant for use within the frontend! return; } parent::__construct($subject, $config); // put params in registry so I have easy access to them later $conf =& JFactory::getConfig(); $conf->setValue("jfdatabase.params",$this->params); $this->_config = array( 'adapter' => $this->params->get('dbadapter', "inheritor") ); if(defined('JOOMFISH_PATH')) { $this->_jfInitialize(); } else { JError::raiseNotice('no_jf_component', JText::_('Joom!Fish component not installed correctly. Plugin not executed')); } } /** * During this event we setup the database and link it to the Joomla! ressources for future use * @return void */ function onAfterInitialise() { global $mainframe; if ($mainframe->isAdmin()) { // This plugin is only relevant for use within the frontend! return; } $this->_setupJFDatabase(); } function onAfterRender() { $buffer = JResponse::getBody(); $info = ""; $db =& JFactory::getDBO(); $info .= "
"; uasort($db->profileData,array($this,"sortprofile")); foreach ($db->profileData as $func=>$data) { $info .= "$func = ".round($data["total"],4)." (".$data["count"].")
"; } $info .= "
"; $buffer = str_replace("JFTimings",$info,$buffer); JResponse::setBody($buffer); } function sortprofile($a,$b){ return $a["total"]>=$b["total"]?-1:1; } /** * Setup for the Joom!Fish database connectors, overwriting the original instances of Joomla! * Which connector is used and which technique is based on the extension configuration * @return void */ function _setupJFDatabase(){ if ($this->_config["adapter"] == "decorator") { if (file_exists( JPATH_ADMINISTRATOR .DS. 'components' .DS. 'com_joomfish' .DS. 'jfdatabase_decorator.class.php' )) { require_once( JPATH_ADMINISTRATOR .DS. 'components' .DS. 'com_joomfish' .DS. 'jfdatabase_decorator.class.php' ); $db = & JFactory::getDBO(); $db = new JFDatabase(); $conf =& JFactory::getConfig(); $conf->setValue('config.mbf_content', 1 ); $conf->setValue('config.multilingual_support', 1 ); // TODO: check on legacy mode on or off $GLOBALS['database'] = $db; } } else { if (file_exists( dirname(__FILE__).DS.'jfdatabase'.DS.'jfdatabase_inherit.php' )) { require_once( dirname(__FILE__).DS.'jfdatabase'.DS.'jfdatabase_inherit.php' ); $conf =& JFactory::getConfig(); $host = $conf->getValue('config.host'); $user = $conf->getValue('config.user'); $password = $conf->getValue('config.password'); $db = $conf->getValue('config.db'); $dbprefix = $conf->getValue('config.dbprefix'); $dbtype = $conf->getValue('config.dbtype'); $debug = $conf->getValue('config.debug'); $driver = $conf->getValue('config.dbtype'); $options = array("driver"=>$driver, "host"=>$host, "user"=>$user, "password"=>$password, "database"=>$db, "prefix"=>$dbprefix,"select"=>true); $db = & JFactory::getDBO(); $db = new JFDatabase($options); $debug = $conf->getValue('config.debug'); $db->debug($debug); if ($db->getErrorNum() > 2) { JError::raiseError('joomla.library:'.$db->getErrorNum(), 'JDatabase::getInstance: Could not connect to database
' . $db->getErrorMsg() ); } $conf->setValue('config.mbf_content', 1 ); $conf->setValue('config.multilingual_support', 1 ); // legacy mode only // check on legacy mode on/off by testing existence of $database global if (defined('_JLEGACY') && array_key_exists('database',$GLOBALS)){ $GLOBALS['database'] = new mldatabase($options); $GLOBALS['database']->debug($conf->getValue('config.debug')); } //echo phpinfo(); } } } /** This function initialize the Joom!Fish manager in order to have * easy access and prepare certain information. * @access private */ function _jfInitialize ( ) { /* ToDo: check if we really need this any longer. Should be removed latest with 2.1 * @deprecated */ $GLOBALS[ '_JOOMFISH_MANAGER'] =& JoomFishManager::getInstance(); } } /** * @version $Id: jceutilities.php 2008-01-07 $ * @package JCEUtilites * @copyright Copyright (C) 2006/2007/2008 Ryan Demmer. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. */ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin'); /** * JCE Utiltiies Plugin * * @package JCE Utilities * @subpackage System */ class plgSystemJCEUtilities extends JPlugin { /** * Constructor * * For php4 compatability we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.0 */ function plgSystemJCEUtilities(&$subject, $config) { parent::__construct($subject, $config); // load plugin parameters $this->_plugin = JPluginHelper::getPlugin( 'system', 'jceutilities' ); $this->_params = new JParameter( $this->_plugin->params ); } function renderParams( $name, $params, $end ){ $html = ''; if( $name ){ $html .= "'". $name ."':{"; } $i = 0; foreach( $params as $k => $v ){ if( !is_numeric( $v ) ){ $v = '"'. $v .'"'; } if( $i < count( $params ) -1 ){ $v .= ','; } $html .= "'". $k ."':". $v; $i++; } if( $name ){ $html .= "}"; } if( !$end ){ $html .= ","; } return $html; } function onAfterInitialise(){ global $mainframe; if ($mainframe->isAdmin()) { return; } $db =& JFactory::getDBO(); $pop = JRequest::getVar( 'pop', 0, 'int' ); $task = JRequest::getVar( 'task' ); if( $pop || ( $task == 'new' || $task == 'edit' ) ){ return; } $params = $this->_params; $components = $params->get('components', ''); if( $components ){ $excluded = explode( ',', $components ); $option = JRwquest::getVar( 'option', '' ); foreach( $excluded as $exclude ){ if( $option == 'com_'. $exclude || $option == $exclude ){ return; } } } $query = "SELECT published" . "\n FROM #__plugins" . "\n WHERE element = 'jceembed'" . "\n AND folder = 'system'" ; $db->setQuery( $query ); $embed = $db->loadResult(); $lightbox = array( 'legacy' => $params->get( 'legacy', '0' ), 'convert' => $params->get( 'convert', '0' ), 'resize' => $params->get( 'resize', '1' ), 'icons' => $params->get( 'icons', '1' ), 'overlay' => $params->get( 'overlay', '1' ), 'overlayopacity' => $params->get( 'overlayopacity', '0.8' ), 'overlaycolor' => $params->get( 'overlaycolor', '#000000' ), 'fadespeed' => $params->get( 'fadespeed', '500' ), 'scalespeed' => $params->get( 'scalespeed', '500' ) ); $tooltip = array( 'classname' => $params->get( 'tipclass', 'tooltip' ), 'opacity' => $params->get( 'tipopacity', '1' ), 'speed' => $params->get( 'tipspeed', '150' ), 'position' => $params->get( 'tipposition', 'br' ), 'offsets' => "{'x': ". $params->get( 'tipoffsets_x', '16' ) .", 'y': ". $params->get( 'tipoffsets_y', '16' ) ."}" ); $standard = array( 'imgpath' => $params->get( 'imgpath', 'plugins/system/jceutilities/img/' ), 'pngfix' => $params->get( 'pngfix', '1' ) ); $document =& JFactory::getDocument(); $document->addScript( JURI::base() . 'plugins/system/jceutilities/js/jquery-123.js' ); $document->addScript( JURI::base() . 'plugins/system/jceutilities/js/jceutilities-160.js' ); if( !$embed ){ $document->addScript( JURI::base() . 'plugins/system/jceutilities/js/embed.js' ); } $document->addStyleSheet( JURI::base() . 'plugins/system/jceutilities/css/jceutilities-160.css' ); $html = "\tvar jcexhtmlembed=". $params->get('embedstrict', '1') .";"; $html .= "jQuery(document).ready(function(){"; $html .= "jceutilities({"; $html .= $this->renderParams( 'lightbox', $lightbox, false ); $html .= $this->renderParams( 'tootlip', $tooltip, false ); $html .= $this->renderParams( '', $standard, true ); $html .= "});"; $html .= "});"; $document->addScriptDeclaration( $html ); return true; } } ?> /** * @version 1.3 * @package RokBox * @copyright Copyright (C) 2008 RocketTheme, LLC. All rights reserved. * @license GNU/GPL, see LICENSE.php */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); /** * RokBox plugin * * @author Djamil Legato * @package RokBox * @subpackage System */ class plgSystemRokBox extends JPlugin { function plgSystemRokBox(& $subject, $config) { parent::__construct($subject, $config); } /** * Converting the site URL to fit to the HTTP request * */ function onAfterRender() { global $mainframe; $document =& JFactory::getDocument(); $doctype = $document->getType(); // Only render for HTML output if ( $doctype !== 'html' ) { return; } $profiler =& $_PROFILER; ob_start(); $theme = $this->params->get('theme', 'light'); $rokboxJS = $document->baseurl."/plugins/system/rokbox/rokbox.js"; $remoteFolder = $document->baseurl."/plugins/system/rokbox/themes"; $localFolder = dirname($_SERVER['SCRIPT_FILENAME']) . "/plugins/system/rokbox/themes"; if ($theme == 'custom') $theme = $this->params->get('custom-theme', 'sample'); $config_exists = file_exists($localFolder . "/$theme/rokbox-config.js"); echo "\r\n"; echo "\r\n"; // Load style for ie6 or ie7 if exist $browser = $this->getBrowser(); if ($browser == 7 || $browser == 6) { if (file_exists($localFolder . "/$theme/rokbox-style-ie$browser.php")) { echo "\r\n"; } elseif (file_exists($localFolder . "/$theme/rokbox-style-ie$browser.css")) { echo "\r\n"; } } if ($this->params->get('custom-legacy', 0) == 1) { $this->loadManualConfiguration($theme); } else { if ($config_exists) { echo "\r\n"; } else $this->loadManualConfiguration($theme); } $output = ob_get_clean(); $body = JResponse::getBody(); $body = str_replace('', $output.'', $body); JResponse::setBody($body); } function getBrowser() { $agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : false; $ie_version = false; if (eregi("msie", $agent) && !eregi("opera", $agent)){ $val = explode(" ",stristr($agent, "msie")); $ver = explode(".", $val[1]); $ie_version = $ver[0]; $ie_version = ereg_replace("[^0-9,.,a-z,A-Z]", "", $ie_version); } return $ie_version; } function loadManualConfiguration($theme) { echo "\r\n"; } } /** * @version $Id: shsef.php 836 2008-12-30 10:43:20Z silianacom-svn $ * @package sh404SEF * @copyright Copyright (C) 2007 Yannick Gaultier. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.router'); // import base class /** * sh404SEF system plugin * * @author */ class plgSystemShsef extends JPlugin { /** * Constructor * * For php4 compatability we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @access protected * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.5 */ function plgSystemShsef(& $subject, $config) { parent::__construct($subject, $config); } function onAfterInitialise() { global $mainframe; if ($mainframe->isAdmin()) { return; } require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_sh404sef'.DS.'sh404sef.class.php'); $sefConfig = shRouter::shGetConfig(); if (!$sefConfig->Enabled) // go away if not enabled return; DEFINE ('SH404SEF_IS_RUNNING', 1); // include more sh404SEF stuff require_once(JPATH_ROOT.DS.'components'.DS.'com_sh404sef'.DS.'shCache.php'); require_once(JPATH_ROOT.DS.'components'.DS.'com_sh404sef'.DS.'shSec.php'); // override router class with our $shRouter = & $mainframe->getRouter(); $shRouter = new shRouter(); // start decoding URL + decide possible redirects include(JPATH_ROOT.DS.'components'.DS.'com_sh404sef'.DS.'shInit.php'); } /* tentative xhtml output for main component */ function onAfterRoute() { global $mainframe; if (!$mainframe->isAdmin()) { $this->setTemplate( 'beez'); } } function onAfterDispatch() { global $mainframe; if (!$mainframe->isAdmin()) { $this->setTemplate(); // fix base tag when using Joomfish if (defined( 'SH404SEF_IS_RUNNING')) { $document = &JFactory::getDocument(); if (shIsMultilingual() == 'joomfish' && $document->getType() == 'html') { $shPageInfo = & shRouter::shPageInfo(); $document->setBase( $shPageInfo->baseUrl); } } } } function setTemplate( $tpl = null) { static $_template; $sefConfig = shRouter::shGetConfig(); if (!$sefConfig->shEnableTableLessOutput) { // global on/off switch return; } global $mainframe; if (empty($tpl)) { if (empty($_template)) return; $mainframe->setTemplate($_template); // restore old template } else { $_template = $mainframe->getTemplate(); // save current template $mainframe->setTemplate( 'beez'); } } /* page rewriting features - previously in shCustomTags module */ function onAfterRender() { global $mainframe; if ($mainframe->isAdmin()) { return; } $sefConfig = shRouter::shGetConfig(); if (!$sefConfig->Enabled || !$sefConfig->shMetaManagementActivated) { // go away if not enabled return; } require_once(JPATH_ROOT.DS.'components'.DS.'com_sh404sef'.DS.'shPageRewrite.php'); } } /** * Class to create and parse routes for the site application * * @author Johan Janssens * @package Joomla * @since 1.5 */ class shRouter extends JRouter { var $shId = 'sh404SEF for Joomla 1.5'; /** * Class constructor * * @access public */ function __construct($options = array()) { parent::__construct($options); $this->setMode(JROUTER_MODE_SEF); // force SEF mode shIncludeLanguageFile(); } function &shGetMenu() { // cache our own copy of menu system static $shMenu = null; if (empty($shMenu)) { // JMenu may not be loaded yet if (!class_exists('JMenuSite')) require_once(JPATH_ROOT.DS.'includes'.DS.'menu.php'); $shMenu = new JMenuSite(); //$shMenu = &JSite::getMenu(); } return $shMenu; } function &shGetConfig() { static $shConfig = null; if (empty($shConfig)) { // config not read yet $sef_config_file = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_sh404sef'.DS.'config'.DS.'config.sef.php'; if (!is_readable($sef_config_file)) { JError::RaiseError( 500, _COM_SEF_NOREAD."( $sef_config_file )
"._COM_SEF_CHK_PERMS); } require_once($sef_config_file); $shConfig = new SEFConfig(); } return $shConfig; } function &shPageInfo( $pageInfo = null) { static $shPageInfo = null; if (!empty($pageInfo)) { $shPageInfo = $pageInfo; } return $shPageInfo; } function parse(&$uri) { $vars = parent::parse($uri); return $vars; } function &build($url) { $uri =& parent::build($url); return $uri; } function _parseRawRoute(&$uri) { $vars = array(); $menu =& shRouter::shGetMenu(); //Handle an empty URL (special case) if(!$uri->getVar('Itemid') && !$uri->getVar('option')) { $item = $menu->getDefault(); //Set the information in the request $vars = $item->query; //Get the itemid $vars['Itemid'] = $item->id; // Set the active menu item $menu->setActive($vars['Itemid']); return $vars; } //Get the variables from the uri $this->setVars($uri->getQuery(true)); //Get the itemid, if it hasn't been set force it to null $this->setVar('Itemid', JRequest::getInt('Itemid', null)); //Only an Itemid ? Get the full information from the itemid if(count($this->getVars()) == 1) { $item = $menu->getItem($this->getVar('Itemid')); $vars = $vars + $item->query; } // Set the active menu item $menu->setActive($this->getVar('Itemid')); return $vars; } function _parseSefRoute(&$uri) { $vars = array(); include(JPATH_ROOT.DS.'components'.DS.'com_sh404sef'.DS.'sh404sef.php'); if ( shIsMultilingual() == 'joomfish') { $currentLangShortCode = $GLOBALS['shMosConfig_shortcode']; $tmp = explode( '-', str_replace( '_', '-', $GLOBALS['mosConfig_defaultLang'])); $defaultLangShortCode = $tmp[0]; } else { $currentLang = ''; } $shMenu = null; // set active menu if changed if (!empty($vars['Itemid'])) { $newItemid = intval($vars['Itemid']); if (!empty($newItemid)) { $shMenu = & JSite::getMenu(); $shMenu->setActive($newItemid); } } //Set the variables $this->setVars($vars); // set language again, as Joomfish may have set it according to user cookie if ( shIsMultilingual() == 'joomfish' && !empty($vars['lang']) && $vars['lang'] != $currentLangShortCode) { JRequest::setVar('lang', $vars['lang'] ); // we also need to fix the main menu, as joomfish has set it to the wrong language if (empty( $shMenu)) { $shMenu = & JSite::getMenu(); } $sefLang = TableJFLanguage::createByShortcode($vars['lang'], false); JLoader::import('helper', JPATH_ROOT.DS.'modules'.DS.'mod_jflanguageselection', 'jfmodule'); $shMenu->_items = JFModuleHTML::getJFMenu($sefLang->code,$shMenu->_items); // and finally we can set new joomfish language shSetJfLanguage( $vars['lang']); } // last fix is to remove the home flag if other than default language if (shIsMultilingual() == 'joomfish' && !empty($vars['lang']) && $vars['lang'] != $defaultLangShortCode) { if (empty( $shMenu)) { $shMenu = & JSite::getMenu(); } $defaultItem = &$shMenu->getDefault(); $defaultItem->home = 0; } // and finally we can set new joomfish language if ( shIsMultilingual() == 'joomfish' && !empty($vars['lang']) && $vars['lang'] != $currentLangShortCode) { shSetJfLanguage( $vars['lang']); } return $vars; } function _buildRawRoute(&$uri) { if($uri->getVar('Itemid') && count($uri->getQuery(true)) == 2) { //$menu =& JSite::getMenu(); $menu = & shRouter::shGetMenu(); // Get the active menu item $itemid = $uri->getVar('Itemid'); $item = $menu->getItem($itemid); $uri->setQuery($item->query); $uri->setVar('Itemid', $itemid); } } function _buildSefRoute(&$uri) { $sefConfig = &shRouter::shGetConfig(); $shPageInfo = &shRouter::shPageInfo(); $menu = &shRouter::shGetMenu(); shNormalizeNonSefUri( $uri, $menu); // do our job! $query = $uri->getQuery(false); $route = shSefRelToAbs( 'index.php?'.$query, null, $uri); $route = ltrim(str_replace( $GLOBALS['shConfigLiveSite'], '',$route), '/'); $route = $shPageInfo->base.($route == '/' ? '' : $route); //Set query again in the URI //$uri->setQuery($query); // nope : this is done inside shSefRelToAbs, would be simpler to return $query though $uri->setPath($route); } function _processParseRules(&$uri) { $vars = parent::_processParseRules($uri); return $vars; } function _processBuildRules(&$uri) { parent::_processBuildRules($uri); // Get the path data $route = $uri->getPath(); $uri->setPath($route); } function &_createURI($url) { // prevent double Itemid param $itemid = shGetURLVar($url, 'Itemid'); $i = intval($itemid); if (!empty($itemid) && (string)($i) != $itemid) { $tmp = '?Itemid='.$i; $url = str_replace($tmp.$tmp, $tmp, $url); } //Create the URI $uri =& parent::_createURI($url); // Get the itemid form the URI $itemid = $uri->getVar('Itemid'); if(is_null($itemid)) { if($option = $uri->getVar('option')) { $menu = & shRouter::shGetMenu(); $item = $menu->getItem($itemid); if(isset($item) && $item->component == $option) { $uri->setVar('Itemid', $item->id); } } else { if($option = $this->getVar('option')) { $uri->setVar('option', $option); } if($itemid = $this->getVar('Itemid')) { $uri->setVar('Itemid', $itemid); } } } else { if(!$uri->getVar('option')) { $menu = & shRouter::shGetMenu(); $item = $menu->getItem($itemid); $uri->setVar('option', $item->component); } } return $uri; } } defined( '_JEXEC' ) or die( 'Restricted index access' ); $cookie_prefix = "metamorphv2j15-"; $cookie_time = time()+31536000; $template_properties = array('fontstyle','fontfamily','tstyle','mtype'); foreach ($template_properties as $tprop) { $my_session = &JFactory::getSession(); if (isset($_REQUEST[$tprop])) { $$tprop = JRequest::getString($tprop, null, 'get'); // support the font size toggler if ($$tprop=="f-smaller" || $$tprop =="f-larger") { $fsize = "f-default"; if ($my_session->get($cookie_prefix. $tprop)) { $fsize = $my_session->get($cookie_prefix. $tprop); } elseif (isset($_COOKIE[$cookie_prefix. $tprop])) { $fsize = JRequest::getVar($cookie_prefix. $tprop, '', 'COOKIE', 'STRING'); } if ($$tprop=="f-smaller" && $fsize=="f-default") $$tprop = "f-small"; elseif ($$tprop=="f-smaller" && $fsize=="f-small") $$tprop = "f-small"; elseif ($$tprop=="f-smaller" && $fsize=="f-large") $$tprop = "f-default"; elseif ($$tprop=="f-larger" && $fsize=="f-large") $$tprop = "f-large"; elseif ($$tprop=="f-larger" && $fsize=="f-default") $$tprop = "f-large"; elseif ($$tprop=="f-larger" && $fsize=="f-small") $$tprop = "f-default"; } $my_session->set($cookie_prefix.$tprop, $$tprop); setcookie ($cookie_prefix. $tprop, $$tprop, $cookie_time, '/', false); global $$tprop; } } ?> defined( '_JEXEC' ) or die( 'Restricted index access' ); global $tstyle; // set default vars $fontstyle = "f-" . $default_font; $fontfamily = $font_family; $tstyle = $default_style; $mtype = $menu_type; $thisurl = $this->base . rebuildQueryString($template_properties); //array of properties to look for and store foreach ($template_properties as $tprop) { $my_session = JFactory::getSession(); if ($my_session->get($cookie_prefix.$tprop)) { $$tprop = $my_session->get($cookie_prefix.$tprop); } elseif (isset($_COOKIE[$cookie_prefix. $tprop])) { $$tprop = JRequest::getVar($cookie_prefix. $tprop, '', 'COOKIE', 'STRING'); } } // rebuild the querystring when needed function rebuildQueryString($template_properties) { if (!empty($_SERVER['QUERY_STRING'])) { $parts = explode("&", $_SERVER['QUERY_STRING']); $newParts = array(); foreach ($parts as $val) { $val_parts = explode("=", $val); if (!in_array($val_parts[0], $template_properties)) { array_push($newParts, $val); } } if (count($newParts) != 0) { $qs = implode("&", $newParts); } else { return "?"; } return "?" . $qs . "&"; // this is your new created query string } else { return "?"; } } ?> HOTEL DE FRANCE ANTANANARIVO defined( '_JEXEC' ) or die( 'Restricted index access' ); global $Itemid, $modules_list; if ($mtype!="module") : // menu code $document = &JFactory::getDocument(); $renderer = $document->loadRenderer( 'module' ); $options = array( 'style' => "raw" ); $module = JModuleHelper::getModule( 'mod_mainmenu' ); $topnav = false; $subnav = false; if ($mtype=="splitmenu") : $module->params = "menutype=$menu_name\nstartLevel=0\nendLevel=1\nclass_sfx=top"; $topnav = $renderer->render( $module, $options ); $module = JModuleHelper::getModule( 'mod_mainmenu' ); $module->params = "menutype=$menu_name\nstartLevel=1\nendLevel=9\nclass_sfx"; $options = array( 'style' => "submenu"); $subnav = $renderer->render( $module, $options ); elseif ($mtype=="moomenu" or $mtype=="suckerfish") : $module->params = "menutype=$menu_name\nshowAllChildren=1\nclass_sfx=top"; $topnav = $renderer->render( $module, $options ); endif; endif; // make sure subnav is empty if (strlen($subnav) < 10) $subnav = false; //Are we in edit mode $editmode = false; if (JRequest::getCmd('task') == 'edit' ) : $editmode = true; endif; $showcasemod_count = ($this->countModules('advert1')>0) + ($this->countModules('advert2')>0) + ($this->countModules('advert3')>0); $showcasemod_width = $showcasemod_count > 0 ? ' w' . floor(99 / $showcasemod_count) : ''; $mainmod_count = ($this->countModules('user1')>0) + ($this->countModules('user2')>0) + ($this->countModules('user3')>0); $mainmod_width = $mainmod_count > 0 ? ' w' . floor(99 / $mainmod_count) : ''; $mainmod2_count = ($this->countModules('user4')>0) + ($this->countModules('user5')>0) + ($this->countModules('user6')>0); $mainmod2_width = $mainmod2_count > 0 ? ' w' . floor(99 / $mainmod2_count) : ''; $bottommod_count = ($this->countModules('user7')>0) + ($this->countModules('user8')>0) + ($this->countModules('user9')>0) + ($this->countModules('user10')>0); $bottommod_width = $bottommod_count > 0 ? ' w' . floor(99 / $bottommod_count) : ''; $leftcolumn_width = ($this->countModules('left')>0 or ($subnav and $splitmenu_col=="leftcol")) ? $leftcolumn_width : "0"; $rightcolumn_width = ($this->countModules('right')>0 or ($subnav and $splitmenu_col=="rightcol")) ? $rightcolumn_width : "0"; $template_width = 'margin: 0 auto; width: ' . $template_width . 'px;'; $template_path = $this->baseurl . "/templates/" . $this->template; // module slider configuration $modules_list = array(array("title"=>$ms_title1, "module"=>$ms_module1), array("title"=>$ms_title2, "module"=>$ms_module2), array("title"=>$ms_title3, "module"=>$ms_module3), array("title"=>$ms_title4, "module"=>$ms_module4), array("title"=>$ms_title5, "module"=>$ms_module5)); function rok_isIe7() { $agent=$_SERVER['HTTP_USER_AGENT']; if (stristr($agent, 'msie 7')) return true; return false; } function rok_isIe6() { $agent=$_SERVER['HTTP_USER_AGENT']; if (stristr($agent, 'msie 6')) return true; return false; } ?> // This information has been pulled out of index.php to make the template more readible. // // This data goes between the tags of the template ?> if($show_moduleslider=="true") :?> endif; ?> if($mtype=="moomenu" or $mtype=="suckerfish") :?> endif; ?> if (rok_isIe7()) :?> endif; ?> if (rok_isIe6()) :?> endif; ?> if(rok_isIe6() and $enable_ie6warn=="true") : ?> endif; ?> if($show_moduleslider=="true") :?> endif; ?> if($mtype=="moomenu") :?> endif; ?> if((rok_isIe6() or rok_isIe7()) and ($mtype=="suckerfish" or $mtype=="splitmenu")) : echo "\n"; endif; ?>
Joomfish System Plugin not enabled



Visite Hotel de France 360°

HOTEL DE FRANCE ANTANANARIVO
defined('_JEXEC') or die; jimport('joomla.plugin.plugin'); // Testing and Debuging define( 'LINKR_LIVE', 1 );global $linkr_debug;$linkr_debug=array();$linkr_debug['debug']=0;$linkr_debug['error_reporting']=0;$linkr_debug['display_errors']=0; class Linkr { function init($suppress,$debug=null){global $linkr_debug;jimport('joomla.application.component.helper');$params=&JComponentHelper::getParams('com_linkr');$linkr_debug['debug']=(JDEBUG||$params->get('debug','0'));$linkr_debug['error_reporting']=ini_get('error_reporting');$linkr_debug['display_errors']=ini_get('display_errors');if($suppress){error_reporting(0);ini_set('display_errors',0);}if(!is_null($debug)){Linkr::set($debug);}} function set($debug=0){global $linkr_debug;if($debug==1){$linkr_debug['error_reporting']=error_reporting(E_ALL);$linkr_debug['display_errors']=ini_set('display_errors',1);}elseif($debug==-1) {error_reporting($linkr_debug['error_reporting']);ini_set('display_errors',$linkr_debug['display_errors']);}} function dump($var){if(LINKR_LIVE)return;ob_clean();jexit(var_dump($var));} function log($msg){global $linkr_debug;if(empty($msg)||!$linkr_debug['debug'])return;static $log;if(is_null($log)){jimport('joomla.error.log');$o=array('format'=>'{DATE} {TIME} ({C-IP}), {COMMENT}');$log=&JLog::getInstance('linkr.php',$o);}$log->addEntry(array('comment'=>$msg));} } /** * Linkr Content Plugin * * @package Linkr - Content rendering * @author Frank * @license GNU/GPL, see LICENSE.php */ class plgContentLinkr_content extends JPlugin { var $linkPattern = '#href=[\'"]index.php\?(?=[^\'"]*?option=com_content)(?=[^\'"]*?view=article)([^\'"]*)[\'"]#'; var $settings = array(); var $loaded = array(); /** * Constructor * * For php4 compatability we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.5 */ function plgContentLinkr_content( &$subject, $config ) { parent::__construct( $subject, $config ); $this->loadLanguage( 'plg_content_linkr_content', JPATH_ADMINISTRATOR ); } /** * Get plugin links * * @param float $version Linkr Version * @return array Array of links for plugin */ function onLinkrGetLinks( $version ) { $links = array( 'Files' => 'LinkrHelper.layout(\'load:file\')', 'Articles' => 'LinkrHelper.layout(\'load:article\')', 'Menus' => 'LinkrHelper.layout(\'load:menu\')', 'Contacts' => 'LinkrHelper.layout(\'load:contact\')' ); return $links; } /** * Load javascript * * @param float $version Linkr Version * @return string Javascript for current plugin */ function onLinkrLoadJS( $version ) { return ''; } /** * Linkr magic * * @param object $article The article object (by reference) * @param object $params The article parameters object (by reference) * @return void */ function onPrepareContent( &$article, &$params ) { // Debugging Linkr::init( $this->params->get( 'suppress_notices', 1 ), !LINKR_LIVE ); Linkr::log( '---Linkr Plugin--- Article: '. @$article->title .' ('. @$article->id .')' ); // Set some stuff $this->findRouter(); $this->article = & $article; $this->article->route = $this->route( $article ); $op = strtolower( JRequest::getString( 'option' ) ); $vi = strtolower( JRequest::getString( 'view' ) ); $fm = strtolower( JRequest::getString( 'format', 'html' ) ); if ($fm != 'html') { $this->showBookmarks = false; $this->showRelated = false; } elseif ($op == 'com_content' && $vi == 'article') { $this->showBookmarks = true; $this->showRelated = true; } else { $this->showBookmarks = ($this->params->get( 'bm_fp', 0 )); $this->showRelated = ($this->params->get( 'rel_fp', 0 )); } $sets = $this->getSettings(); if (!$sets || empty( $sets )) { return true; } foreach ($sets as $s) { switch ( $s->get( 'linkr', 'none' ) ) { case 'bookmarks': $this->getBookmarks( $s ); break; case 'related': $this->getRelatedLinks( $s ); break; } } // Done Linkr::set( -1 ); return true; } /** * Creates bookmark list * * @param object $sets The settings for the bookmarks * @return string HTML for bookmark list */ function getBookmarks( $sets ) { if (!$this->showBookmarks) { return $this->remove( $sets->match ); } $badges = trim( $sets->get( 'badges', '' ) ); if (empty( $badges )) { return $this->remove( $sets->match ); } $db = & JFactory::getDBO(); $q = 'SELECT * FROM #__linkr_bookmarks '; if ($badges != '*') { $q .= 'WHERE id IN ('. $badges .') '; } $db->setQuery( $q .'ORDER BY ordering' ); if (!$list = $db->loadObjectList()) { Linkr::log( 'Could not retrieve bookmarks: '. $db->getErrorMsg() ); return $this->remove( $sets->match ); } JHTML::_( 'behavior.tooltip' ); $_size = $sets->get( 'size', $this->params->get( 'bm_size', 'text' ) ); $html = 'html'. $_size; $content = array(); foreach ($list as $bm) { if (!empty( $bm->$html )) { $size = $_size; $code = $bm->$html; } else { $size = ($bm->size) ? $bm->size : 'text'; $def = 'html'. $size; $code = $bm->$def; } if (!empty( $code )) { $this->repBookmarkAnchors( $sets, $code, $bm->text ); $title = JText::sprintf( 'ADD_BM', $bm->text, JString::ucfirst( $bm->name ) ); // Add text if ($size != 'text') { switch ( $sets->get( 'text', 'nn' ) ) { case 'yl': $code = $bm->text .' '. $code; break; case 'yr': $code .= ' '. $bm->text; break; } } $content[] = ''. $code .''; } } if (empty( $content )) { return $this->remove( $sets->match ); } $sep = $this->params->get( 'bm_sep', ' ' ); $sep = ($sep == ' ') ? $sep : ' '. $sep .' '; $content = '
'. implode( $sep, $content ) . '
'; return $this->remove( $sets->match, $content ); } /** * Replaces anchors in bookmark's HTML codes * * @param object $s The settings for the bookmark * @param string $html HTML code for bookmark (by reference) * @param string $text Bookmark text * @return string HTML code for bookmark list */ function repBookmarkAnchors( $s, &$html, $text ) { // [badgespath]: Path to badges folder if (JString::strpos( $html, '[badgespath]' )) { $path = JURI::root() .'components/com_linkr/assets/badges'; $html = JString::str_ireplace( '[badgespath]', $path, $html ); } // [url]: Article URL if (JString::strpos( $html, '[url]' )) { $html = JString::str_ireplace( '[url]', $this->article->route, $html ); } // [title]: Article title if (JString::strpos( $html, '[title]' )) { $title = $s->get( 'articleTitle', '' ); $html = JString::str_ireplace( '[title]', $title, $html ); } // [desc]: Article summary if (JString::strpos( $html, '[desc]' )) { $desc = $s->get( 'articleDesc', '' ); $html = JString::str_ireplace( '[desc]', $desc, $html ); } // [text]: Bookmark text if (JString::strpos( $html, '[text]' )) { $html = JString::str_ireplace( '[text]', $text, $html ); } } /** * Creates cloud of related links * * @param object $sets The settings for the bookmarks * @return string HTML for bookmark list */ function getRelatedLinks( $sets ) { if (!$this->showRelated) { return $this->remove( $sets->match ); } $keywords = $sets->get( 'keywords', '' ); if (empty( $keywords )) { return $this->remove( $sets->match ); } $exclude = trim( $sets->get( 'exclude', '' ) ); $limit = $sets->get( 'limit', $this->params->get( 'rel_limit', 5 ) ); $db = & JFactory::getDBO(); $keywords = JString::str_ireplace( ',', ';', $keywords ); $keywords = @explode( ';', $keywords ); // Build 'WHERE' clause $where = array(); foreach ($keywords as $k) { $k = $db->getEscaped( JString::trim( $k ), true ); $k = $db->Quote( '%'. $k .'%' ); $w = array(); $w[] = 'LOWER(a.title) LIKE '. $k; $w[] = 'LOWER(a.introtext) LIKE '. $k; $w[] = 'LOWER(a.`fulltext`) LIKE '. $k; $w[] = 'LOWER(a.metakey) LIKE '. $k; $w[] = 'LOWER(a.metadesc) LIKE '. $k; $where[] = '('. implode( ') OR (', $w ) .')'; } $where = '('. implode( ') OR (', $where ) .')'; if ($exclude) { $where = '('. $where .') AND a.id NOT IN ('. $exclude .')'; } $q = 'SELECT a.id,a.title,a.alias,a.introtext,a.catid,'. 'a.sectionid,c.title AS category, '. 'CASE WHEN CHAR_LENGTH(a.alias) '. 'THEN CONCAT_WS(":",a.id,a.alias) '. 'ELSE a.id END as slug, '. 'CASE WHEN CHAR_LENGTH(c.alias) '. 'THEN CONCAT_WS(":",c.id,c.alias) '. 'ELSE c.id END as catslug '. 'FROM #__content AS a '. 'LEFT JOIN #__categories AS c ON c.id = a.catid '. 'WHERE a.state = 1 AND '. $where .' '. 'ORDER BY rand()'; $db->setQuery( $q, 0, $limit ); if (!$list = $db->loadObjectList()) { Linkr::log( 'Could not create related article links: '. $db->getErrorMsg() ); return $this->remove( $sets->match ); } $text = $sets->get( 'title', $this->params->get( 'rel_title', JText::_( 'REL_TITLE' ) ) ); $text = urldecode( $text ); $content = '
'. $text .'
    '; $n = count( $list ); for ($i = 0; $i < $n; $i++) { $a = & $list[$i]; $content .= '
  • '. JHTML::link( $this->route( $a, false ), $a->title ); '
  • '; } $content .= '
'; return $this->remove( $sets->match, $content ); } /** * Retrieves settings from anchor in text * * @param interger $off Current position in text * @return array Linkr settings or false if none found */ function getSettings( $off = 0 ) { if (($a = JString::strpos( $this->article->text, '{linkr', $off )) === false) { return $this->getDefaultSettings(); } if (($b = JString::strpos( $this->article->text, '}', $a )) === false) { return false; } if (($c = JString::substr( $this->article->text, $a, $b - $a + 1 )) === false) { return false; } // Format settings $d = str_replace( array( '{', '}' ), '', $c ); if ($d = @explode( ';', $d )) { $s = new JObject(); foreach ($d as $e) { if (strpos( $e, ':' ) !== false) { list($k, $v) = explode( ':', $e ); $s->set( $k, $v ); } else { $s->set( $e, true ); } } $s->set( 'match', $c ); $s->set( 'articleTitle', urlencode( $this->article->title ) ); $s->set( 'articleDesc', urlencode( $this->article->introtext ) ); // Mark as loaded $this->loaded[$s->linkr] = true; $this->settings[] = $s; return $this->getSettings( $b + 1 ); } return false; } /** * Handles default bookmarks and related links * * @return array Linkr settings or false if none found */ function getDefaultSettings() { if (JString::strpos( $this->article->text, '{linkr:none}' ) !== false) { $this->remove( '{linkr:none}' ); return empty( $this->settings ) ? false : $this->settings; } $settings = array(); // Show bookmarking by default if ($this->showBookmarks && ! @$this->loaded['bookmarks'] && $this->params->get( 'def_bm', 0 )) { $q = 'SELECT id FROM #__linkr_bookmarks'; if (!$this->params->get( 'bm_select', 0 )) { $q .= ' WHERE popular = 1'; } $db = & JFactory::getDBO(); $db->setQuery( $q ); if ($badges = $db->loadResultArray()) { $this->article->text .= '{linkr:bookmarks}'; $s = new JObject(); $s->set( 'linkr', 'bookmarks' ); $s->set( 'size', $this->params->get( 'bm_size', 'text' ) ); $s->set( 'separator', $this->params->get( 'bm_sep', ' ' ) ); $s->set( 'badges', implode( ',', $badges ) ); $s->set( 'match', '{linkr:bookmarks}' ); $s->set( 'articleTitle', urlencode( $this->article->title ) ); $s->set( 'articleDesc', urlencode( $this->article->introtext ) ); $settings[] = $s; } } // Show related links by default if ($this->showRelated && ! @$this->loaded['related'] && $this->params->get( 'def_rel', 0 )) { if (!empty( $this->article->metakey )) { $this->article->text .= '{linkr:related}'; $s = new JObject(); $s->set( 'linkr', 'related' ); $s->set( 'keywords', $this->article->metakey ); $s->set( 'limit', $this->params->get( 'rel_limit', 5 ) ); $s->set( 'match', '{linkr:related}' ); $settings[] = $s; } } if (empty( $settings ) && empty( $this->settings )) { return false; } else { $this->settings = array_merge( $settings, $this->settings ); return $this->settings; } } /** * Finds article route * * @param $a Article ID or object * @param bool $full Set to "TRUE" to include site root * @return string Article URL */ function route( $a, $full = true ) { // Make sure we have an article object if (is_numeric( $a )) { $a = $this->_getArticle( $a ); } elseif (is_string( $a )) { preg_match( '/id=(\d+)/i', $a, $id ); $a = $this->_getArticle( $id[1] ); } if (!is_object( $a )) { $route = JRoute::_( 'index.php' ); return ($full) ? $this->_furl . $route : $route; } // Handle uncategorized articles and avoid PHP notices $a->slug = (isset( $a->slug ) && !empty( $a->slug )) ? $a->slug : $a->id; $a->catslug = (isset( $a->catslug ) && !empty( $a->catslug )) ? $a->catslug : 0; $a->sectionid = (isset( $a->sectionid ) && !empty( $a->sectionid )) ? $a->sectionid : 0; // Create article route switch ( $this->router ) { case 'JoomlaSEF': $route = $this->_routeJoomlaSEF( $a ); break; case 'Sh404SEF': case 'SmartSEF': default: $route = $this->_routeOther( $a ); } return ($full) ? $this->_furl . $route : $route; } /** * Retrieves an article object * * @param $id Article ID * @return object Article object */ function _getArticle( $id ) { // Performance check $id = (int) $id; if (!$id) { return null; } static $query; if (!isset( $query )) { $query = 'SELECT a.id,a.catid,a.sectionid, '. 'CASE WHEN CHAR_LENGTH(a.alias) '. 'THEN CONCAT_WS(":",a.id,a.alias) '. 'ELSE a.id END as slug, '. 'CASE WHEN CHAR_LENGTH(c.alias) '. 'THEN CONCAT_WS(":",c.id,c.alias) '. 'ELSE c.id END as catslug '. 'FROM #__content AS a '. 'LEFT JOIN #__categories AS c ON c.id = a.catid '. 'WHERE a.state = 1 AND a.id = %d'; } // Retrieve article from database $db = & JFactory::getDBO(); $db->setQuery( sprintf( $query, $id ) ); if ($a = $db->loadObject()) { return $a; } else { Linkr::log( 'Could not retrieve article (id = "'. $id .'"):'. $db->getErrorMsg() ); return null; } } /** * Removes text from article * * @param string $remove String to remove * @param string $replace String to replace with */ function remove( $text, $replace = '' ) { $this->article->text = JString::str_ireplace( $text, $replace, $this->article->text ); } function _routeJoomlaSEF( $a ) { static $app,$sef,$sefrw,$suffix,$items; // Set static variables if (!isset( $app )) { $app = & JFactory::getApplication( 'site' ); $sef = $app->getCfg( 'sef' ); $sefrw = $app->getCfg( 'sef_rewrite' ); $suffix = $app->getCfg( 'sef_suffix' ); } // Not using SEF if (!$sef) { require_once( JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php' ); return JRoute::_(ContentHelperRoute::getArticleRoute($a->slug,$a->catslug,$a->sectionid)); } if (!isset( $items )) { $menu = & $app->getMenu( 'site' ); $items = $menu->getItems( 'componentid', 20 ); } // We can use JRoute, but if the article is directly linked // to a menu item, then we don't need the article slug that // is automatically added by JRoute. // Find a menu item $route = ''; foreach($items as $i) { if ((@$i->query['view'] == 'article') && (@$i->query['id'] == $a->id)) { $route = $i->route; break; } } // Build URL $url = JURI::base(true) .'/'; if (!empty( $route )) { if ($sefrw) { $url .= $route; } else { $url .= 'index.php/'. $route; } if ($suffix) { $url .= '.html'; } } else { require_once( JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php' ); $url = JRoute::_(ContentHelperRoute::getArticleRoute($a->slug,$a->catslug,$a->sectionid)); } return $url; } function _routeOther( $a ) { // These routers use their own application router. So we can use JRoute. // We just need to make sure we have the form id:slug and not id-slug require_once( JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php' ); $route = ContentHelperRoute::getArticleRoute($a->slug,$a->catslug,$a->sectionid); $route = preg_replace( '/([id|catid]=\d+)(-)/', '$1:', $route ); return JRoute::_( $route ); } function findRouter() { global $mainframe; // This can be done in different ways.. lets look at the class name // since this is not likely to change with future versions $router = & $mainframe->getRouter(); $name = strtolower( get_class( $router ) ); switch ( $name ) { case 'jrouter': case 'jroutersite': case 'jrouteradministrator': $this->router = 'JoomlaSEF'; break; case 'shrouter': $this->router = 'Sh404SEF'; break; case 'smartsefrouter': $this->router = 'SmartSEF'; break; default: $this->router = '?'; } Linkr::log( 'Found routing application: '. $this->router ); // Find the first piece of the URL that can make URLs full URLs // e.g. "http://www.site.com" $this->_furl = str_replace(JURI::base(true).'/','',JURI::base()); } } /** * Joom!Fish - Multi Lingual extention and translation manager for Joomla! * Copyright (C) 2003-2007 Think Network GmbH, Munich * * All rights reserved. The Joom!Fish project is a set of extentions for * the content management system Joomla!. It enables Joomla! * to manage multi lingual sites especially in all dynamic information * which are stored in the database. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. * * The "GNU General Public License" (GPL) is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * ----------------------------------------------------------------------------- * $Id: jfalternative.php 568 2007-07-17 06:29:53Z akede $ * @package joomfish * @subpackage contentbot.alternative_lang * */ // Check to ensure this file is included in Joomla! defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); $mainframe->registerEvent('onPrepareContent', 'botJoomfishAlternative'); function botJoomfishAlternative( &$row, &$params, $page=0 ) { // simple performance check to determine whether bot should process further if ( strpos( $row->text, 'jfalternative' ) === false ) { return true; } // define the regular expression for the bot $regex = "#{jfalternative}(.*?){/jfalternative}#s"; preg_match($regex, $row->text, $matches); if (count($matches)!=2) return true; list($id,$table,$defaultText) = explode("|",$matches[1]); // only support tables at this time. if ($table!="content"){ $row->text = preg_replace( $regex, '', $row->text ); return true; } $db = JFactory::getDBO(); $sql = "SELECT DISTINCT jfl.shortcode, jfl.iso, jfl.name, jfl.image FROM #__jf_content AS jfc, #__languages AS jfl " ."\n WHERE reference_id=$id AND reference_table='".$table."'" ."\n AND jfc.language_id=jfl.id AND jfc.published=1"; $db->setQuery($sql); $alts = $db->loadObjectList(); if (is_array($alts) && count($alts)>0){ $alttext = "
"; $alttext .= JText::_('NO TRANSLATION ALTERNATIVE'); foreach ($alts as $lang) { $lang->shortcode = ($lang->shortcode == '') ? $lang->iso : $lang->shortcode; global $Itemid; $alttext .=" "; if ($params->get("falt_showAS","flag")=="flag"){ if( isset($lang->image) && $lang->image!="" ) { $langImg = '/images/' .$lang->image; } else { $langImg = '/components/com_joomfish/images/flags/' .$lang->shortcode .".gif"; } $langImg ='' .$lang->name. ''; $alttext .=$langImg." "; } else { $alttext .=$lang->name.""; } } $alttext .= "
"; $row->text = preg_replace( $regex, $alttext, $row->text ); } else { global $_JOOMFISH_MANAGER; $alttext = "
"; $alttext .= JText::_('NO TRANSLATION AVAILABLE'); $alttext .= "
"; $row->text = preg_replace( $regex, $alttext, $row->text ); } return true; } ?> /** * @version 1.2 - RokBox - RocketWerx * @thanks to Dennis Pleiter for Wildcards contribution * @package RocketWerx * @copyright Copyright (C) 2008 RocketTheme, LLC. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL */ // no direct access defined( '_JEXEC' ) or die(); jimport( 'joomla.plugin.plugin' ); require_once(dirname(__FILE__) . '/rokbox/imagehandler.php'); class plgContentRokbox extends JPlugin { function plgContentRokbox( &$subject, $params ) { parent::__construct( $subject, $params ); } function onPrepareContent( &$article, &$params, $limitstart ) { global $mainframe; // simple performance check to determine whether bot should process further if ( strpos( $article->text, 'rokbox' ) === false ) { return true; } // Get plugin info $plugin =& JPluginHelper::getPlugin('content', 'rokbox'); // define the regular expression for the bot $regex = "#{rokbox(.*?)}(.*?){/rokbox}#s"; $pluginParams = new JParameter( $plugin->params ); // check whether plugin has been unpublished if ( !$pluginParams->get( 'enabled', 1 ) ) { $article->text = preg_replace( $regex, '', $row->text ); return true; } // find all instances of plugin and put in $matches preg_match_all( $regex, $article->text, $matches ); // Number of plugins $count = count( $matches[0] ); // plugin only processes if there are any instances of the plugin in the text if ( $count ) { // Get plugin parameters $style = $pluginParams->def( 'style', -2 ); $this->plgContentProcessRokboxImages( $article, $matches, $count, $regex, $pluginParams ); } } function plgContentProcessRokboxImages( &$row, &$matches, $count, $regex, &$botParams ) { global $mainframe; $thumb_ext = $botParams->def( 'thumb_ext', '_thumb'); $thumb_class = $botParams->def( 'thumb_class', 'album'); $thumb_width = $botParams->def( 'thumb_width', '100'); $thumb_height = $botParams->def( 'thumb_height', '100'); $thumb_quality = $botParams->def( 'thumb_quality', '90'); $thumb_custom = $botParams->def( 'thumb_custom', 0); $thumb_dir = $botParams->def( 'thumb_dir'); $compatibility = $botParams->def( 'compatibility', 'rokbox'); /* thumbnail settings */ $improve_thumbnails = false; // Auto Contrast, Unsharp Mask, Desaturate, White Balance $thumb_quality = $thumb_quality; $width = $thumb_width; $height = $thumb_height; /* slimbox = lightbox mode */ if ($compatibility == "slimbox") $compatibility = "lightbox"; for ( $i=0; $i < $count; $i++ ) { $thealbum = ''; $thetitle = ''; $thethumb = ''; $thetype = ''; $thesize = ''; $thetext = ''; $themodule = ''; $thethumbcount = 999; if (@$matches[1][$i]) { $inline_params = $matches[1][$i]; // get album $album_matches = array(); preg_match( "#album=\|(.*?)\|#s", $inline_params, $album_matches ); if (isset($album_matches[1])) $thealbum = "(" . trim($album_matches[1]) . ")"; // get size $size_matches = array(); preg_match( "#size=\|(.*?)\|#s", $inline_params, $size_matches ); if (isset($size_matches[1])) $thesize = "[" . trim($size_matches[1]) . "]"; // get title $title_matches = array(); preg_match( "#title=\|(.*?)\|#s", $inline_params, $title_matches ); if (isset($title_matches[1])) $thetitle = $title_matches[1]; // get text $text_matches = array(); preg_match( "#text=\|(.*?)\|#s", $inline_params, $text_matches ); if (isset($text_matches[1])) $thetext = $text_matches[1]; // force image $type_matches = array(); preg_match( "#type=\|(.*?)\|#s", $inline_params, $type_matches ); if (isset($type_matches[1])) $thetype = $type_matches[1]; // get module $module_matches = array(); preg_match( "#module=\|(.*?)\|#s", $inline_params, $module_matches ); if (isset($module_matches[1])) $themodule = "[module=".$module_matches[1]."]"; // get thumb $thumb_matches = array(); preg_match( "#thumb=\|(.*?)\|#s", $inline_params, $thumb_matches ); if (isset($thumb_matches[1])) $thethumb = $thumb_matches[1]; // get thumb count $thumbcount_matches = array(); preg_match( "#thumbcount=\|(.*?)\|#s", $inline_params, $thumbcount_matches ); if (isset($thumbcount_matches[1])) $thethumbcount = $thumbcount_matches[1]; } $onsite=1; $text = ''; $displaythumb = ''; $tmp = glob(trim($matches[2][$i])); if (count($tmp) < 1) { $tmp = array(trim($matches[2][$i])); $onsite=0; } foreach ($tmp as $link){ // Prevent thumbs of thumbs if ( strpos( $link, $thumb_ext ) === false ) { if (strlen($thethumb)) $image_url = trim($thethumb); else $image_url = $link; $extension = substr($image_url,strrpos($image_url,".")); $image_name = substr($image_url,0,strrpos($image_url, ".")); $just_name = substr($image_name,strrpos($image_name,DS)); $full_url = JURI::base() . $link; $full_path = JPATH_ROOT . DS . $link; $thumb_url_custom = JURI::base() . $thumb_dir . DS . $just_name . $thumb_ext . $extension; $thumb_path_custom = JPATH_ROOT. DS . $thumb_dir . DS . $just_name . $thumb_ext . $extension; $thumb_url = JURI::base() . $image_name . $thumb_ext . $extension; $thumb_path = JPATH_ROOT . DS . $image_name . $thumb_ext . $extension; $isimage = ($extension == '.jpg' || $extension == '.jpeg' || $extension == '.bmp' || $extension == '.png' || $extension == '.gif' || $extension == '.JPG' || $extension == '.JPEG' || $extension == '.BMP' || $extension == '.PNG' || $extension == '.GIF'); if ($onsite){ if (!isset($size_matches[1]) && $isimage) { list($image_width,$image_height)=getimagesize($link); $thesize = "[" . $image_width . " " . $image_height . "]"; } $thethumbcount--; if ($thethumbcount<0) $displaythumb = '" style="display: none;'; } if (!strlen($thethumb) && !strlen($thetype) && strlen($thetext) > 0) { if (strlen($themodule)) $text = $text . ''.$thetext.''; else $text = $text . ''.$thetext.''; } else if (!strlen($thethumb) && !strlen($thetype) && !$isimage) { if (strlen($themodule)) $text = $text . ''.$thetitle.''; else $text = $text . ''.$thetitle.''; } else { if (strlen($thethumb) > 0) { if (strlen($themodule)) $text = $text . '' . $thetitle . ''; else $text = $text . '' . $thetitle . ''; } elseif (!$thumb_custom && file_exists($thumb_path)) { // thumbnail exists so can do lightbox with thumbnail if (strlen($themodule)) $text = $text . '' . $thetitle . ''; else $text = $text . '' . $thetitle . ''; } elseif (file_exists($thumb_path_custom)) { if (strlen($themodule)) $text = $text . '' . $thetitle . ''; else $text = $text . '' . $thetitle . ''; } elseif ($isimage || $thetype == 'image') { //try to generate thumbs if ($thumb_custom) $thumb_path = $thumb_path_custom; $rd = new imgRedim(false, $improve_thumbnails, JPATH_CACHE); $image_filename = $full_path; // define source image here $output_filename = $thumb_path; // define destination image here $rd->loadImage($image_filename); $rd->redimToSize($width, $height, true); $rd->saveImage($output_filename, $thumb_quality); $text = $text . '' . $thetitle . ''; } } $text = $text . ' '; } } $row->text = str_replace( $matches[0][$i], $text, $row->text ); } } } ?>

L'Hôtel de France est  situé sur la plus grande artère d’Antananarivo, l’Avenue de l’Indépendance, lieu privilégié des sorties familiales du week-end alignant en semaine ses arcades animées et commerçantes.

  • Entièrement rénové en 2002, tout en gardant son cachet et authenticité, l’Hôtel de France met a votre disposition ses trente chambres spacieuses et confortables, ses deux restaurants ("Ô Poivre vert" et "la Brasserie") et son bar.

 

 

 

  • Ses  chambres à terrasses surplombant l’Avenue de l’Indépendance, vous offrent ainsi une magnifique perspective.
  • Central, il vous permettra d’accéder très rapidement aux lieux touristiques de la ville et aux divers marchés.
  • Les deux restaurants ("Ô Poivre vert" et "la Brasserie"), situés au rez de chaussée, vous proposent un grand choix de plats différents.

 

 

 

Siceh Voyages

buy cialis online order cialis - millpharmacy.com cialis no prescription vernight delivery