Parse error, expecting `T_OLD_FUNCTION' or `T
Résolu
gnoute
Messages postés
80
Date d'inscription
Statut
Membre
Dernière intervention
-
sparttan -
sparttan -
Bonjour,
Je fait un site oscommerce et j'ai une erreur que j'arrive pas à résoudre :
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:\program files\easyphp1-8\www\catalog\admin\includes\classes\box.php on line 75
voilà le code :
<?php
/*
$Id: box.php,v 1.7 2003/06/20 16:23:08 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
Example usage:
$heading = array();
$heading[] = array('params' => 'class="menuBoxHeading"',
'text' => BOX_HEADING_TOOLS,
'link' => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=tools'));
$contents = array();
$contents[] = array('text' => SOME_TEXT);
$box = new box;
echo $box->infoBox($heading, $contents);
*/
class box extends tableBlock {
function box() {
$this->heading = array();
$this->contents = array();
}
function infoBox($heading, $contents) {
$this->table_row_parameters = 'class="infoBoxHeading"';
$this->table_data_parameters = 'class="infoBoxHeading"';
$this->heading = $this->tableBlock($heading);
$this->table_row_parameters = '';
$this->table_data_parameters = 'class="infoBoxContent"';
$this->contents = $this->tableBlock($contents);
return $this->heading . $this->contents;
}
function menuBox($heading, $contents) {
global $menu_dhtml; // add for dhtml_menu
if ($menu_dhtml == false ) { // add for dhtml_menu
$this->table_data_parameters = 'class="menuBoxHeading"';
if (isset($heading[0]['link'])) {
$this->table_data_parameters .= ' onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . $heading[0]['link'] . '\'"';
$heading[0]['text'] = ' <a href="' . $heading[0]['link'] . '" class="menuBoxHeadingLink">' . $heading[0]['text'] . '</a> ';
} else {
$heading[0]['text'] = ' ' . $heading[0]['text'] . ' ';
}
$this->heading = $this->tableBlock($heading);
$this->table_data_parameters = 'class="menuBoxContent"';
$this->contents = $this->tableBlock($contents);
return $this->heading . $this->contents;
} else {
// Replaced this to make sure that the correct id is passed to the menu
$url = parse_url($heading[0]['link']);
$params = explode("&", $url["query"]);
foreach($params AS $param) {
list($key, $value) = explode("=", $param);
if ($key == "selected_box")
$selected = $value;
}
// Eof replacement
$dhtml_contents = $contents[0]['text'];
$change_style = array ('<br>'=>' ','<BR>'=>' ', 'a href='=> 'a class="menuItem" href=','class="menuBoxContentLink"'=>' ');
$dhtml_contents = strtr($dhtml_contents,$change_style);
$dhtml_contents = '<div id="'.$selected.'Menu" class="menu" onmouseover="menuMouseover(event)">'. $dhtml_contents . '</div>';
return $dhtml_contents;
}
}
?>
quelqu'un aurait une idée ?
merci
Je fait un site oscommerce et j'ai une erreur que j'arrive pas à résoudre :
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:\program files\easyphp1-8\www\catalog\admin\includes\classes\box.php on line 75
voilà le code :
<?php
/*
$Id: box.php,v 1.7 2003/06/20 16:23:08 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
Example usage:
$heading = array();
$heading[] = array('params' => 'class="menuBoxHeading"',
'text' => BOX_HEADING_TOOLS,
'link' => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=tools'));
$contents = array();
$contents[] = array('text' => SOME_TEXT);
$box = new box;
echo $box->infoBox($heading, $contents);
*/
class box extends tableBlock {
function box() {
$this->heading = array();
$this->contents = array();
}
function infoBox($heading, $contents) {
$this->table_row_parameters = 'class="infoBoxHeading"';
$this->table_data_parameters = 'class="infoBoxHeading"';
$this->heading = $this->tableBlock($heading);
$this->table_row_parameters = '';
$this->table_data_parameters = 'class="infoBoxContent"';
$this->contents = $this->tableBlock($contents);
return $this->heading . $this->contents;
}
function menuBox($heading, $contents) {
global $menu_dhtml; // add for dhtml_menu
if ($menu_dhtml == false ) { // add for dhtml_menu
$this->table_data_parameters = 'class="menuBoxHeading"';
if (isset($heading[0]['link'])) {
$this->table_data_parameters .= ' onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . $heading[0]['link'] . '\'"';
$heading[0]['text'] = ' <a href="' . $heading[0]['link'] . '" class="menuBoxHeadingLink">' . $heading[0]['text'] . '</a> ';
} else {
$heading[0]['text'] = ' ' . $heading[0]['text'] . ' ';
}
$this->heading = $this->tableBlock($heading);
$this->table_data_parameters = 'class="menuBoxContent"';
$this->contents = $this->tableBlock($contents);
return $this->heading . $this->contents;
} else {
// Replaced this to make sure that the correct id is passed to the menu
$url = parse_url($heading[0]['link']);
$params = explode("&", $url["query"]);
foreach($params AS $param) {
list($key, $value) = explode("=", $param);
if ($key == "selected_box")
$selected = $value;
}
// Eof replacement
$dhtml_contents = $contents[0]['text'];
$change_style = array ('<br>'=>' ','<BR>'=>' ', 'a href='=> 'a class="menuItem" href=','class="menuBoxContentLink"'=>' ');
$dhtml_contents = strtr($dhtml_contents,$change_style);
$dhtml_contents = '<div id="'.$selected.'Menu" class="menu" onmouseover="menuMouseover(event)">'. $dhtml_contents . '</div>';
return $dhtml_contents;
}
}
?>
quelqu'un aurait une idée ?
merci
A voir également:
- Parse error, expecting `T_OLD_FUNCTION' or `T
- Or - Guide
- Eespt technical error ✓ - Forum TNT / Satellite / Réception
- Carre or bercy ✓ - Forum Loisirs / Divertissements
- X64 or x86 ✓ - Forum Windows
- Fan error lenovo - Forum Refroidissement
8 réponses
Super :-)
Quelques conseils pour téviter ca :
-indente mieux ton code
-commente le un peu plus
Mais sinon, avec quel éditeur tu fais ce code ?
Avec le bloc notes ?
a plus
Quelques conseils pour téviter ca :
-indente mieux ton code
-commente le un peu plus
Mais sinon, avec quel éditeur tu fais ce code ?
Avec le bloc notes ?
a plus
Un petit conseil : evite de mélanger php et HTML comme tu l'a fait. Je ve dire, evite de renvoyer carrément des String rempli de HTML.
L'idéal c'est que ta page HTML s'adapte en fonction des résultats de tes fonctions et conditions de vérifications, et pas que tes fonctions php te renvoie de l'HTML barbare, c'est sale comme code.
C'est juste un conseil, et c'est vachement moins chiant à lire.
L'idéal c'est que ta page HTML s'adapte en fonction des résultats de tes fonctions et conditions de vérifications, et pas que tes fonctions php te renvoie de l'HTML barbare, c'est sale comme code.
C'est juste un conseil, et c'est vachement moins chiant à lire.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
merciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
enfin quelqu'un m'a répondu et ça marche !!!!!!!!!!!!!
ça fait 4h que je me prenais la tête avec
merci merci merci merci
enfin quelqu'un m'a répondu et ça marche !!!!!!!!!!!!!
ça fait 4h que je me prenais la tête avec
merci merci merci merci
Problème de version de php supportée par le serveur.
Mettre en php5 sur le serveur
pour ovh: http://guide.ovh.com/printPage/php5chezovh
pour 1&1: http://blog.fgribreau.com/2008/04/activer-php5-sur-1and1.html
Mettre en php5 sur le serveur
pour ovh: http://guide.ovh.com/printPage/php5chezovh
pour 1&1: http://blog.fgribreau.com/2008/04/activer-php5-sur-1and1.html
bah en fait, c'est une contrib pour oscommerce. je l'ai donc pris tel quel et je l'ai édité avec notepad++
Ah ?
Et il n'a pas des fonctions "bien pratiques" ?
Moi, j'utilies PSPad, ce que je trouve bien c'est que lorsque le curseur est a coté d'un délimiteur (parenthèses, accolade, crochet), il surligne automatiquement le délimiteur qui va avec.
C'est pratique pour voir si on n'en a pas oublié ou mis en trop.
Et il n'a pas des fonctions "bien pratiques" ?
Moi, j'utilies PSPad, ce que je trouve bien c'est que lorsque le curseur est a coté d'un délimiteur (parenthèses, accolade, crochet), il surligne automatiquement le délimiteur qui va avec.
C'est pratique pour voir si on n'en a pas oublié ou mis en trop.