Problème ligne de code !

Résolu/Fermé
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015 - 24 févr. 2010 à 17:37
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015 - 24 févr. 2010 à 23:43
Bonjour,

je fais un site de bourse sous joomla et en installant un module voila la phrase que je vois :

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /web/boursee/www/administrator/components/com_wisroyq/include/config.php on line 24

Qu'est ce qui doit être changé à cette ligne ???

Merci d'avance
A voir également:

7 réponses

SamC7 Messages postés 105 Date d'inscription mardi 2 février 2010 Statut Membre Dernière intervention 6 octobre 2011 12
24 févr. 2010 à 17:39
Pourrais-tu nous montrer la ligne 24 du fichier en question... config.php ?
0
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015
24 févr. 2010 à 17:41
La ligne en question :

private $_version = '3.4';
0
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015
24 févr. 2010 à 17:45
Est ce que cela peut venir de ma version PHP de mon hebergement ? Il me semble que je suis en PHP 4.

Si c'est cela. Et ce que je peux passer en PHP 5 sans en affecter mon site ?
0
SamC7 Messages postés 105 Date d'inscription mardi 2 février 2010 Statut Membre Dernière intervention 6 octobre 2011 12
24 févr. 2010 à 17:46
Je pense qu'il s'agit d'un problème avec le point.. essaie de le remplacer par une virgule... parfois sa marche...
En faite vu que le point en php est l'outil de concaténation...
0
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015
24 févr. 2010 à 18:01
J'ai fait le remplacement, et il n'y a aucun changement, j'ai toujours la même phrase.

Si quelqu'un à une autre idée ??
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015
24 févr. 2010 à 18:53
Je fais un petit [up] parce que c'est un module très important pour moi !

Voici le code en entier :

<?php

/*
 * @package Joomla 1.5
 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL, see LICENSE.php
 *
 * @component WISro Yahoo Quotes Component
 * lastmod 2009.12.22
 * @copyright copyright (c) 2009 Cristi Teodoreanu - wis.ro
 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 */

defined('_JEXEC') or die();
global $mainframe;
$lang = $mainframe->getCfg('lang');
if(file_exists(JPATH_COMPONENT.DS.'..'.DS.'com_wisroyq'.DS.'language'.DS.$lang.'.php')) {
	require_once(JPATH_COMPONENT.DS.'..'.DS.'com_wisroyq'.DS.'language'.DS.$lang.'.php');
	include_once(JPATH_COMPONENT.DS.'..'.DS.'com_wisroyq'.DS.'language'.DS.'english.php');
} else {
	require_once(JPATH_COMPONENT.DS.'..'.DS.'com_wisroyq'.DS.'language'.DS.'english.php');
}
class WISroYQConfiguration {
   private $_version = '3,4';
   private $_revision = 'rev.2';
   private $config_settings = array(
                 array('version', 				'3.4', 														'software'),
                 array('name', 					'WISro Yahoo Quotes Component',								'software'),
                 array('copyright', 			'(c) 2009 Cristi Teodoreanu www.wis.ro',					'software'),
                 array('data', 					'<a href="https://finance.yahoo.com/" alt="Yahoo Finance" target="_blank">Yahoo! Finance</a>','software'),
                 array('server', 				'download.finance.yahoo.com', 								'configuration'),
                 array('document', 				'/d/quotes.csv?f=%PARAMETERS%&s=', 							'configuration'),
                 array('cache', 				'60', 														'configuration'),
                 array('chart', 				'z', 														'configuration'),
                 array('columns-display', 		'1', 														'configuration'),
                 array('chart-time-frame', 		'1d', 														'configuration'),
                 array('chart-scale', 			'on', 														'configuration'),
                 array('chart-size', 			'm', 														'configuration'),
                 array('chart-type', 			'b', 														'configuration'),
                 array('chart-bottom', 			'v', 														'configuration'),
                 array('chart-bottom-param', 	'', 														'configuration'),
                 array('chart-overlay', 		'', 														'configuration'),
                 array('chart-overlay-param', 	'', 														'configuration'),
                 array('icon', 					'1', 														'configuration'),
                 array('variation', 			'1', 														'configuration'),
                 array('category', 				'l1 c1 p2', 												'display'),
                 array('symbol', 				'l1 c1 p2 a b v e8 w x', 									'display'),
                 /* ver.2.0 */
                 array('chart-server', 			'ichart.finance.yahoo.com', 								'configuration'),
                 /* ver.3.0 */
                 array('revision', 				'rev.0', 													'software'),
                 //3.0.1 - added optional 'powered by' display
                 array('powered_by', 			'1', 														'configuration'),
                 //3.1.0 - added optional usage and display info of Search module
                 //3.2.0 - added support for more than 200 elems/categ, sort ordering logic fix
				 //3.4.0 - added optional link-to-category for each symbol
				 //		 - added symbols's story (detailed description)
				 array('symbol-linked', 		'', 														'configuration'),
				 array('symbol-details', 		'', 														'configuration'),				 
         );
    private $_updates = array (
                // version 2.0 to 3.0
                "CREATE TABLE IF NOT EXISTS `#__wisroyq_relationships` ( `symbol_id` INT( 11 ) NOT NULL , `category_id` INT( 11 ) NOT NULL, INDEX (`symbol_id`), INDEX `category` ( `category_id` )  ) CHARACTER SET `utf8`;",
                "INSERT INTO `#__wisroyq_relationships` SELECT id, category_id FROM `#__wisroyq_symbols`;",
                "ALTER TABLE `#__wisroyq_symbols` DROP `category_id`;",
                "ALTER TABLE `#__wisroyq_symbols` DROP `ordering`;",
                "ALTER TABLE `#__wisroyq_categs` ADD `sort_on` VARCHAR( 20 ) NOT NULL DEFAULT 'symbol', ADD `sort_dir` VARCHAR( 5 ) NOT NULL DEFAULT 'DESC';",
                "ALTER TABLE `#__wisroyq_categs` ADD `top` INT( 2 ) NOT NULL ;",
				"UPDATE `#__wisroyq_categs` SET `sort_on`='name' WHERE `sort_on` IS NULL;",
				"UPDATE `#__wisroyq_categs` SET `sort_dir`='ASC' WHERE `sort_dir` IS NULL ;",
				"UPDATE `#__wisroyq_categs` SET `top`=0 WHERE `top` IS NULL;",
				// version 3.4
				/* #10 */	"ALTER TABLE `#__wisroyq_symbols` ADD `linked_category_id` INT( 11 ) NOT NULL default '0' ;",
				/* #11 */	"ALTER TABLE `#__wisroyq_symbols` ADD `story` TEXT NOT NULL ;",
     );
    private $_demo = array (
                 //demo data insertion, one line only , executed only if NO data found inside tables
"	INSERT INTO `#__wisroyq_categs` (`id`, `parent_id`, `name`, `description`, `published`, `checked_out`, `checked_out_time`, `ordering`, `access`, `sort_on`, `sort_dir`, `top`) VALUES
		(1, 0, 'Default category', 'Sample category description.', 1, 0, '0000-00-00 00:00:00', 2, 0, 'symbol', 'DESC', 0),
		(2, 1, 'Indices', '', 1, 0, '0000-00-00 00:00:00', 3, 0, 'symbol', 'DESC', 0),
		(3, 0, 'Sample companies', '', 1, 0, '0000-00-00 00:00:00', 2, 0, 'symbol', 'DESC', 0);",
	"INSERT INTO `#__wisroyq_relationships` (`symbol_id`, `category_id`) VALUES
		(1, 2),	(2, 2),	(3, 2),	(4, 2),	(5, 2),	(6, 2),	(7, 2),	(8, 2),	(9, 2),	(10, 2),	(11, 3),(12, 3),	(13, 3),	(14, 3),	(15, 3),	(16, 3),	(17, 3),	(18, 3),	(19, 3),	(20, 3),	(21, 3),	(22, 3);",

	"INSERT INTO `#__wisroyq_symbols` (`id`, `name`, `description`, `published`, `checked_out`, `checked_out_time`, `access`) VALUES
		(1, '^ATX', '', 1, 0, '0000-00-00 00:00:00', 0),
		(2, '^FCHI', '', 1, 0, '0000-00-00 00:00:00', 0),
		(3, '^GDAXI', '', 1, 0, '0000-00-00 00:00:00', 0),
		(4, '^SMSI', '', 1, 0, '0000-00-00 00:00:00', 0),
		(5, '^SSMI', '', 1, 0, '0000-00-00 00:00:00', 0),
		(6, '^FTSE', '', 0, 0, '0000-00-00 00:00:00', 0),
		(7, '^DJA', '', 1, 0, '0000-00-00 00:00:00', 0),
		(8, '^NYA', '', 1, 0, '0000-00-00 00:00:00', 0),
		(9, '^NYI', '', 1, 0, '0000-00-00 00:00:00', 0),
		(10, '^SPSUPX', '', 1, 0, '0000-00-00 00:00:00', 0),
		(11, 'YHOO', '', 1, 0, '0000-00-00 00:00:00', 0),
		(12, 'GOOG', '', 1, 0, '0000-00-00 00:00:00', 0),
		(13, 'MSFT', '', 1, 0, '0000-00-00 00:00:00', 0),
		(14, 'HPQ', '', 1, 0, '0000-00-00 00:00:00', 0),
		(15, 'test', '', 1, 0, '0000-00-00 00:00:00', 0),
		(16, 'BBBY', '', 1, 0, '0000-00-00 00:00:00', 0),
		(17, 'EK', '', 1, 0, '0000-00-00 00:00:00', 0),
		(18, 'HAS', '', 1, 0, '0000-00-00 00:00:00', 0),
		(19, 'BNP.PA', '', 1, 0, '0000-00-00 00:00:00', 0),
		(20, 'NINE', '', 1, 0, '0000-00-00 00:00:00', 0),
		(21, 'NAN', '', 1, 0, '0000-00-00 00:00:00', 0),
		(22, 'MCD', '', 1, 0, '0000-00-00 00:00:00', 0);",
    );
    private $_parameters = array(
            's'	=> _WISROYQ_SYMBOL,
            'n'=> _WISROYQ_NAME,
            'a'=> _WISROYQ_ASK,
            'b'=> _WISROYQ_BID,
            'b4'=> _WISROYQ_BOOK_VALUE,
            'c1'=> _WISROYQ_CHANGE,
            //'c8'=> _WISROYQ_AFTER_HOURS_CHANGE_REAL_TIME,
            'd2'=> _WISROYQ_TRADE_DATE,
            'e7'=> _WISROYQ_EPS_ESTIMATE_CURRENT_YEAR,
            'f6'=> _WISROYQ_FLOAT_SHARES,
            'j'=> _WISROYQ__52_WEEK_LOW,
            'g3'=> _WISROYQ_ANNUALIZED_GAIN,
            //'g6'=> _WISROYQ_HOLDINGS_GAIN_REAL_TIME,
            'j1'=> _WISROYQ_MARKET_CAPITALIZATION,
            'j5'=> _WISROYQ_CHANGE_FROM_52_WEEK_LOW,
            //'k2'=> _WISROYQ_CHANGE_PERCENT_REAL_TIME,
            'k5'=> _WISROYQ_PERCENT_CHANGE_FROM_52_WEEK_HIGH,
            'l2'=> _WISROYQ_HIGH_LIMIT,
            //'m2'=> _WISROYQ_DAY_S_RANGE_REAL_TIME,
            'm5'=> _WISROYQ_CHANGE_FROM_200_DAY_MOVING_AVERAGE,
            'm8'=> _WISROYQ_PERCENT_CHANGE_FROM_50_DAY_MOVING_AVERAGE,
            'o'=> _WISROYQ_OPEN,
            'p2'=> _WISROYQ_CHANGE_IN_PERCENT,
            'q'=> _WISROYQ_EX_DIVIDEND_DATE,
            //'r2'=> _WISROYQ_P_E_RATIO_REAL_TIME,
            'r7'=> _WISROYQ_PRICE_EPS_ESTIMATE_NEXT_YEAR,
            's7'=> _WISROYQ_SHORT_RATIO,
            't7'=> _WISROYQ_TICKER_TREND,
            'v1'=> _WISROYQ_HOLDINGS_VALUE,
            'w1'=> _WISROYQ_DAY_S_VALUE_CHANGE,
            'y'=> _WISROYQ_DIVIDEND_YIELD,
            'a2'=> _WISROYQ_AVERAGE_DAILY_VOLUME,
            //'b2'=> _WISROYQ_ASK_REAL_TIME,
            'b6'=> _WISROYQ_BID_SIZE,
            'c3'=> _WISROYQ_COMMISSION,
            'd'=> _WISROYQ_DIVIDEND_SHARE,
            'e'=> _WISROYQ_EARNINGS_SHARE,
            'e8'=> _WISROYQ_EPS_ESTIMATE_NEXT_YEAR,
            'g'=> _WISROYQ_DAY_S_LOW,
            'k'=> _WISROYQ__52_WEEK_HIGH,
            'g4'=> _WISROYQ_HOLDINGS_GAIN,
            'i'=> _WISROYQ_MORE_INFO,
            //'j3'=> _WISROYQ_MARKET_CAP_REAL_TIME,
            'j6'=> _WISROYQ_PERCENT_CHANGE_FROM_52_WEEK_LOW,
            'k3'=> _WISROYQ_LAST_TRADE_SIZE,
            'l'=> _WISROYQ_LAST_TRADE_WITH_TIME,
            'l3'=> _WISROYQ_LOW_LIMIT,
            'm3'=> _WISROYQ__50_DAY_MOVING_AVERAGE,
            'm6'=> _WISROYQ_PERCENT_CHANGE_FROM_200_DAY_MOVING_AVERAGE,
            'p'=> _WISROYQ_PREVIOUS_CLOSE,
            'p5'=> _WISROYQ_PRICE_SALES,
            'r'=> _WISROYQ_P_E_RATIO,
            'r5'=> _WISROYQ_PEG_RATIO,
            't1'=> _WISROYQ_LAST_TRADE_TIME,
            't8'=> _WISROYQ__1_YR_TARGET_PRICE,
            //'v7'=> _WISROYQ_HOLDINGS_VALUE_REAL_TIME,
            //'w4'=> _WISROYQ_DAY_S_VALUE_CHANGE_REAL_TIME,
            'a5'=> _WISROYQ_ASK_SIZE,
            //'b3'=> _WISROYQ_BID_REAL_TIME,
            'c'=> _WISROYQ_CHANGE_N_PERCENT_CHANGE,
            //'c6'=> _WISROYQ_CHANGE_REAL_TIME,
            'd1'=> _WISROYQ_LAST_TRADE_DATE,
            'e1'=> _WISROYQ_ERROR_INDICATION_RETURNED_FOR_SYMBOL_CHANGED_INVALID,
            'e9'=> _WISROYQ_EPS_ESTIMATE_NEXT_QUARTER,
            'h'=> _WISROYQ_DAY_S_HIGH,
            'g1'=> _WISROYQ_HOLDINGS_GAIN_PERCENT,
            //'g5'=> _WISROYQ_HOLDINGS_GAIN_PERCENT_REAL_TIME,
            //'i5'=> _WISROYQ_ORDER_BOOK_REAL_TIME,
            'j4'=> _WISROYQ_EBITDA,
            //'k1'=> _WISROYQ_LAST_TRADE_REAL_TIME_WITH_TIME,
            'k4'=> _WISROYQ_CHANGE_FROM_52_WEEK_HIGH,
            'l1'=> _WISROYQ__WISROYQ_LAST_TRADE_PRICE_ONLY,
            'm'=> _WISROYQ_DAY_S_RANGE,
            'm4'=> _WISROYQ__200_DAY_MOVING_AVERAGE,
            'm7'=> _WISROYQ_CHANGE_FROM_50_DAY_MOVING_AVERAGE,
            'n4'=> _WISROYQ_NOTES,
            'p1'=> _WISROYQ_PRICE_PAID,
            'p6'=> _WISROYQ_PRICE_BOOK,
            'r1'=> _WISROYQ_DIVIDEND_PAY_DATE,
            'r6'=> _WISROYQ_PRICE_EPS_ESTIMATE_CURRENT_YEAR,
            's1'=> _WISROYQ_SHARES_OWNED,
            't6'=> _WISROYQ_TRADE_LINKS,
            'v'=> _WISROYQ_VOLUME,
            'w'=> _WISROYQ__52_WEEK_RANGE,
            'x'=> _WISROYQ_STOCK_EXCHANGE,
                );
    public $_chart_time_frame = array(
    '1d'	=>	_WISROYQ_CHART_TIME_FRAME_1d,
    '5d'	=>	_WISROYQ_CHART_TIME_FRAME_5d,
    '3m'	=>	_WISROYQ_CHART_TIME_FRAME_3m,
    '6m'	=>	_WISROYQ_CHART_TIME_FRAME_6m,
    '1y'	=>	_WISROYQ_CHART_TIME_FRAME_1y,
    '2y'	=>	_WISROYQ_CHART_TIME_FRAME_2y,
    '5y'	=>	_WISROYQ_CHART_TIME_FRAME_5y,
    'my'	=>	_WISROYQ_CHART_TIME_FRAME_my,
    );
    public $_chart_scale = array(
        'on'  => _WISROYQ_CHART_SCALE_ON,
        'off' => _WISROYQ_CHART_SCALE_OFF,
    );
    public $_chart_size = array(
        's'	=>	_WISROYQ_CHART_SIZE_SMALL,
        'm'	=>	_WISROYQ_CHART_SIZE_MEDIUM,
        'l'	=>	_WISROYQ_CHART_SIZE_LARGE,
    );
    public $_chart_type = array(
        'b'	=>	_WISROYQ_CHART_TYPE_BAR,
        'l'	=>	_WISROYQ_CHART_TYPE_LINE,
        'c'	=>	_WISROYQ_CHART_TYPE_CANDLE,
    );
    public $_chart_bottom = array(
        ''  =>  _WISROYQ_NOT_USED,
        'v'	=>	_WISROYQ_CHART_BOTTOM_v,
        'm'	=>	_WISROYQ_CHART_BOTTOM_m,
        'f'	=>  _WISROYQ_CHART_BOTTOM_f,
        'p'	=>  _WISROYQ_CHART_BOTTOM_p,
        'r' =>  _WISROYQ_CHART_BOTTOM_r,
        'ss'=> _WISROYQ_CHART_BOTTOM_ss,
        'fs' => _WISROYQ_CHART_BOTTOM_fs,
        'vm' => _WISROYQ_CHART_BOTTOM_vm,
        'w'	=> _WISROYQ_CHART_BOTTOM_w,
    );
    public $_chart_bottom_params = array(
        ''  =>  '',
        'v'	=>	'',
        'm'	=>	_WISROYQ_PERIOD_COMBO,
        'f'	=>	_WISROYQ_PERIOD,
        'p'	=>	_WISROYQ_PERIOD,
        'r' =>  _WISROYQ_PERIOD,
        'ss'=>	'',
        'fs' => '',
        'vm'	=>	'',
        'w'	=>	_WISROYQ_PERIOD,
    );
    public $_chart_overlay = array(
        ''  =>  _WISROYQ_NOT_USED,
        's'	=>	_WISROYQ_CHART_OVERLAY_s,
        'd'	=>	_WISROYQ_CHART_OVERLAY_d,
        'b'	=>	_WISROYQ_CHART_OVERLAY_b,
        'p'	=>	_WISROYQ_CHART_OVERLAY_p,
        'm' =>  _WISROYQ_CHART_OVERLAY_m,
        'e' =>	_WISROYQ_CHART_OVERLAY_e,
    );
	public $_symbol_details = array(        
        ''	=>	_WISROYQ_SYMBOL_DETAILS_NONE,
        't'	=>	_WISROYQ_SYMBOL_DETAILS_TOP,
        'b'	=>	_WISROYQ_SYMBOL_DETAILS_BOTTOM,        
    );
	public $_symbol_linked = array(        
        ''	=>	_WISROYQ_DISPLAY_LINK_NONE,
        'c'	=>	_WISROYQ_DISPLAY_LINK_CATEGORY,
        's'	=>	_WISROYQ_DISPLAY_LINK_SYMBOL,        
        'b'	=>	_WISROYQ_DISPLAY_LINK_BOTH,        		
    );
    public $_chart_overlay_params = array(
        ''  =>  '',
        's'	=>	'',
        'd'	=>	'',
        'b'	=>	'',
        'p'	=>	'',
        'm' =>  _WISROYQ_DAYS,
        'e'=>	_WISROYQ_DAYS,
    );
    public $_chart_server = array (
        'ichart.finance.yahoo.com'	       =>	'Global Yahoo! Finance',
        'de.ichart.yahoo.com'	           =>	'Germany Yahoo! Finanzen',
        'fr.ichart.yahoo.com'	           =>	'France Yahoo! Finance',
        'it.ichart.yahoo.com'	           =>	'Italia Yahoo! Finanza',
        'es.ichart.yahoo.com'	           =>	'Espana Yahoo! Finanza',
        'uk.ichart.yahoo.com'	           =>	'UK & Ireland Yahoo! Finance',
    );
    private  $query_parameters = null; // 'sn...'
    private $_data = null;

    public function __construct() {
           $this->updateVersion();
           $this->loadConfig();
           $this->query_parameters = array('symbol' => 'sn', 'category' => 'sn' );
           $this->query_parameters['symbol'] .= str_replace(' ', '', $this->_data['display']['symbol']);
           $this->query_parameters['category'] .= str_replace(' ', '', $this->_data['display']['category']);
   	}
    public function getServer() {
           return $this->_data['configuration']['server'];
    }
    public function getDocument($type) {
           // type = 'symbol' / 'category'
           return str_replace("%PARAMETERS%",$this->query_parameters[$type], $this->_data['configuration']['document']);
    }
    public function getCache() {
           return $this->_data['configuration']['cache'];
    }
    public function getParameters($type) {
             return explode(' ', trim($this->_data['display'][$type]));
    }
    public function getParameterDescription($param=NULL) {
           if($param) {
             if(array_key_exists($param, $this->_parameters) )
               return $this->_parameters[$param];
             else
               return _WISROYQ_PARAM_NOT_FOUND;
           }
           else {
             return $this->_parameters;
           }
    }
    public function getInfo() {
        return $this->_data['software'];
    }
	public function getSymbolDetails($val=null) {
        if($val==null) $val = $this->getValue('symbol-details','configuration');
        foreach($this->_symbol_details as $k => $v)  {
          if($val == $k) return $v;
        }
        return _WISROYQ_NOT_FOUND;
    }
	public function getSymbolLinked($val=null) {
        if($val==null) $val = $this->getValue('symbol-linked','configuration');
        foreach($this->_symbol_linked as $k => $v)  {
          if($val == $k) return $v;
        }
        return _WISROYQ_NOT_FOUND;
    }	
    public function getChartDisplay($val=null) {
        if($val==null) $val = $this->getValue('chart','configuration');
        switch($val) {
          case 'z' : return _WISROYQ_CUSTOM_CHART_DISPLAY;
          case 't' : return _WISROYQ_SMALL_CHART_DISPLAY;
          default: return _WISROYQ_PARAM_NOT_USED;
        }
    }
    public function getChartServer($val=null) {
        if($val==null) $val = $this->getValue('chart-server','configuration');
        foreach($this->_chart_server as $k => $v)  {
          if($val == $k) return $v;
        }
        return WISROYQ_NOT_FOUND;
    }
    public function getChartTimeFrame($val=null) {
        if($val==null) $val = $this->getValue('chart-time-frame','configuration');
        foreach($this->_chart_time_frame as $k => $v)  {
          if($val == $k) return $v;
        }
        return _WISROYQ_NOT_FOUND;
    }
    public function getChartScale($val=null) {
        if($val==null) $val = $this->getValue('chart-scale','configuration');
        foreach($this->_chart_scale as $k => $v)  {
          if($val == $k) return $v;
        }
        return _WISROYQ_NOT_FOUND;
    }
    public function getChartSize($val=null) {
        if($val==null) $val = $this->getValue('chart-size','configuration');
        foreach($this->_chart_size as $k => $v)  {
          if($val == $k) return $v;
        }
        return _WISROYQ_NOT_FOUND;
    }
    public function getChartType($val=null) {
        if($val==null) $val = $this->getValue('chart-type','configuration');
        foreach($this->_chart_type as $k => $v)  {
          if($val == $k) return $v;
        }
        return _WISROYQ_NOT_FOUND;
    }
    public function getMiniChart($params=true, $val=null) {
        if($val==null) $val = $this->getValue('chart-bottom','configuration');
        foreach($this->_chart_bottom as $k => $v)  {
          if($val == $k) return $v . ($params?' '.$this->_chart_bottom_params[$k]:'');
        }
        return _WISROYQ_NOT_FOUND;
    }
    public function getChartOverlay($params=true, $val=null) {
        if($val==null) $val = $this->getValue('chart-overlay','configuration');
        foreach($this->_chart_overlay as $k => $v)  {
          if($val == $k) return $v . ($params?' '.$this->_chart_overlay_params[$k]:'');
        }
        return _WISROYQ_NOT_FOUND;
    }
    public function loadConfig() {
      $db		=& JFactory::getDBO();
      $query = 'SELECT * '
			. ' FROM #__wisroyq_config ';
	  // build list of categories
      $db->setQuery($query);

      $rows = $db->loadObjectList();
      foreach($rows as $row) {
        $this->_data[$row->info][$row->key] = $row->value;
       }
      //if no list for symbol details, fill in with all parameters available
      if(!trim($this->_data['display']['symbol']))
        $this->_data['display']['symbol'] = implode(' ', array_keys($this->_parameters));
    }
    public function saveConfig($values) {
      $db		=& JFactory::getDBO();
      //$this->setValue('cache',$_POST['cache'],'configuration');
      //loading edited information
      foreach(array_keys($this->_data['configuration']) as $key) {
            //if(!$_POST[$key] && $key != 'cache') continue;
            $this->_data['configuration'][$key] = $_POST[$key];
        }
      //update display parameters
      $this->_data['display']['symbol'] = '';
      $this->_data['display']['category'] = '';
      foreach($this->_parameters as $param) {
            $key = array_search($param, $this->_parameters);
            if(!$key) continue;
            if(array_search($param, $this->_parameters))
              $symbol_value = $_POST['symbol-'.array_search($param, $this->_parameters)][0]=='on';
            if($symbol_value)
              $this->_data['display']['symbol'] .= "$key ";
            if(array_search($param, $this->_parameters))
              $category_value = $_POST['category-'.array_search($param, $this->_parameters)][0]=='on';
            if($category_value)
              $this->_data['display']['category'] .= "$key ";
      }
      $this->_data['display']['symbol'] = trim($this->_data['display']['symbol']);
      $this->_data['display']['category'] = trim($this->_data['display']['category']);
      foreach(array_keys($this->_data) as $categ) {
        foreach(array_keys($this->_data[$categ]) as $key) {
            $element = $this->_data[$categ][$key];
            $query = "UPDATE  #__wisroyq_config as a "
  			  . " SET `value`='".$element."' WHERE `key`='".$key."' AND `info`='".$categ."'";
             $db->setQuery($query);
            if(!$db->query()) {
                  return $db->getErrorMsg();
            }
        }
      }
      return;
    }

    public function setValue($key, $val, $section) {
            $this->_data[$section][$key] = $val;
    }
    public  function getYesNoValue($key, $section='configuration') {
           if(array_key_exists($key, $this->_data[$section]) ) {
               $text =  $this->_data[$section][$key]? JText::_(_WISROYQ_YES):JText::_(_WISROYQ_NO);
               $color = $this->_data[$section][$key]?'green':'red';
               return "<b><font color=\"$color\">$text</font></b>";
           }
             else
               return _WISROYQ_PARAM_NOT_FOUND;
    }
    public  function getYesNo($someText) {
               $text =  ($someText>0)? JText::_(_WISROYQ_YES):JText::_(_WISROYQ_NO);
               $color = ($someText>0)?'green':'red';
               return "<b><font color=\"$color\">$text</font></b>";
    }
    public  function getValue($key, $section='display') {
           if(@array_key_exists($key, $this->_data[$section]) )
               return $this->_data[$section][$key];
             else
               return _WISROYQ_PARAM_NOT_FOUND;
    }
    public  function updateVersion() {
       $db =& JFactory::getDBO();
       $query = "SELECT value as version FROM `#__wisroyq_config` WHERE `key`='version' AND `info`='software'";
       $db->setQuery($query);
       $result = $db->loadObject();
       $existing_version = $result->version;
       $query = "SELECT value as revision FROM `#__wisroyq_config` WHERE `key`='revision' AND `info`='software'";
       $db->setQuery($query);
       $result = $db->loadObject();
       $existing_revision = $result->revision;
       if( $this->_version != $existing_version ||
                          $this->_revision != $existing_revision) {
         foreach($this->config_settings as $set) {
           $query = "SELECT count(*) as recno FROM `#__wisroyq_config` WHERE `key`='".$set[0]."' AND `info`='".$set[2]."'";
           $db->setQuery($query);
           $result = $db->loadObject();
           if(!$result->recno) {
                   $query = "INSERT INTO `#__wisroyq_config` (`key`, `value`, `info`) VALUES ('".$set[0]."', 	'".$set[1]."',		'".$set[2]."');";
                   $db->setQuery($query);
                   if(!$db->query()) {
                     echo $db->getErrorMsg()."<br/>";
                   }
           }
         }
          foreach($this->config_settings as $set) {
           $query = "SELECT count(*) as recno FROM `#__wisroyq_config` WHERE `key`='".$set[0]."' AND `info`='".$set[2]."'";
           $db->setQuery($query);
           $result = $db->loadObject();
           if(!$result->recno) {
                   $query = "INSERT INTO `#__wisroyq_config` (`key`, `value`, `info`) VALUES ('".$set[0]."', 	'".$set[1]."',		'".$set[2]."');";
                   $db->setQuery($query);
                   if(!$db->query()) {
                     echo $db->getErrorMsg()."<br/>";
                   }
           }
          }//END foreach config settings

          $query = "SELECT count(*) as recno FROM `#__wisroyq_symbols`";
          $db->setQuery($query);
          $result = $db->loadObject();
          $_recno = $result->recno;
          $update_nbr = 0;
          foreach($this->_updates as $set) {
              $update_nbr++;
              switch($update_nbr) {
               case 2:
                if($_recno && floatval($existing_version) < 3.0) {
                  $db->setQuery($set);
                 @$db->query();
                }
                break;
				 // 3.4 add extra fields to symbol's table
				case 10:
				 case 11:
                if(floatval($existing_version) < 3.4) {
                  $db->setQuery($set);
                 @$db->query();
                }
                break;
              default:				
                 $db->setQuery($set);
                 @$db->query();
              }
          }//END foreach update queries

          if(!$_recno) {
           foreach($this->_demo as $set) {
               $db->setQuery($set);
               @$db->query();
           }//END foreach demo queries
        }//if demo data set needs to be loaded
        //database version update
        $query = "UPDATE `#__wisroyq_config` set `value`='".$this->_version."' WHERE `key`='version' AND `info`='software'";
        $db->setQuery($query);
  	    if(!$db->query()) {
                  return $db->getErrorMsg();
         }
        $query = "UPDATE `#__wisroyq_config` set `value`='".$this->_revision."' WHERE `key`='revision' AND `info`='software'";
        $db->setQuery($query);
  	    if(!$db->query()) {
                  return $db->getErrorMsg();
        }
       }
    }
}
?><code>
</code>
0
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015
24 févr. 2010 à 20:20
Personne pour m'aider ??
0
boursee Messages postés 29 Date d'inscription mardi 23 février 2010 Statut Membre Dernière intervention 12 novembre 2015
24 févr. 2010 à 23:43
C'est bon j'ai réussi à me débrouiller !

C'était bien une question de PHP !
0