[[ Correcting the compatibility or "ADMIN/linuxpici.class.php" with PHP 4/PHP 5 ]]
As PHP 4 doesn't to care about a PHP 5 class, as long as we create another constructor using the class-name, we copy our orignal file (linuxpici.class.php) to "linuxpici.class.php4.php".
The PHP 4 class is done.
Then we copy the orignal file (linuxpici.class.php) to "linuxpici.class.php5.php" and we remove the PHP 4 contructor from line 38 to 41 (include).
The PHP 5 class is done.
Now we need to load the PHP 4 or the PHP 5 version of this class, considering each server.
The only file including this class is "ADMIN/get_picture.php at line 193.
Remove the line 193 :
And replace her by :
if(phpversion() >= 5)
That's it ! Picidae will load the correct version of the class for each server. Furthermore, if you need to modify the linuxpici.class.php file, you modify the PHP 4 version, and you copy its content to the PHP 5 version, then you remove the PHP 4 contrsuctor for the PHP 5 version, and it's done !
[[ BUG fixes ]]
I found to bug (I mean, PHP warned me about 2 problems) :
Search for (line 140) :
if ($ps_array) return true;
Replace it by :
if (isset($ps_array) AND $ps_array) return true;
Search for (line 183) :
$addStmt = "UPDATE $this->DB_table set loading = '2' where pic = '$idx';";
Replace by :
$addStmt = "UPDATE $this->DB_table set loading = '2' where pic = '" .$this->idx. "';";