Hello,
I've installed a module in OSCommerce for cross sales promotions, but the module has a problem with the code. I have been looking at it for a while and cannot seem to see it, was hoping a little extra eyes might help.
Here is the error I am receiving:
Parse error: syntax error, unexpected T_IF in
/strange/webroot/sites/dev/dev.shoplenak.com/admin/includes/functions/general.php on line
20
Here is the code it is refering to:
<?php
/*
$Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
//Cache
function rdel($path, $deldir = true) {
// $path est le chemin relatif au fichier php
// $deldir (paramètre optionel, par dĂ©faut Ă* vrai) permet de dire si vous souhaitez supprimer le rĂ©pertoire (vrai) ou le vider uniquement
(faux)
// on vĂ©rifie d'abord que le nom du repertoire contient "/" Ă* la fin, sinon on le lui rajoute
if ($path[strlen($path)-1] != "/")
$path .= "/";
if (is_dir($path)) {
$d = opendir($path);
while ($f = readdir($d)) {
if ($f != "." && $f != "..") {
$rf = $path . $f; // chemin relatif au fichier php
if (is_dir($rf)) // si c'est un répertoire on appel récursivement la fonction
rdel($rf);
else // sinon on efface le fichier
unlink($rf);
}
}
closedir($d);
if ($deldir) // si $deldir est vrai on efface le répertoire
rmdir($path);
}
else {
unlink($path);
}
}
//Fin cache
Thanks!
Ben