Friday, March 24, 2006

Themes for admin area

It is dirty work, but someone should do it. At last I finished Sapid extension for changing decoration themes of admin area. It is not a beta, only alpha version yet. But it works. Even one theme was designed by me :) If someone interested in it, please, test it and tell me about your experience here in comments.

Download: themes.zip
For version: Sapid CMS 1.2.3.06

Friday, March 03, 2006

Bug with definition of GD. Attempt #2

I have decided to go by the simple way, but 100% correct. If function createimagetruecolor() exists it is determined as GD2 if is not - present GD. Actually, likely, only I still have GD, therefore I had problems with it.
In a file /usr/system/image_resize.inc.php instead of it (contents standard file /usr/system/image_resize.inc.php from Sapid 1.2.3.06):
function _sysB_chkgd2()
{
$rep=false;
if(isset($GLOBALS["gBGDVersion"])) {
$rep=$GLOBALS["gBGDVersion"];
} else {
if(function_exists("gd_info")) {
$gdver=gd_info();
$GLOBALS["gBGDVersion"]=$rep=preg_replace("/^(.*)(\d+?\.?\d+?\.?)(.*)$/", "\\2", $gdver["GD Version"]);
} else {
$arr=get_loaded_extensions();
if(in_array("gd", $arr) and $im=@imagecreatetruecolor(1,1)) {
imagedestroy($im);
$GLOBALS["gBGDVersion"]=$rep="2.0";
}elseif (in_array("gd", $arr) and $im=@imagecreate(1,1)){
imagedestroy($im);
$GLOBALS["gBGDVersion"]=$rep="1.6";
}
}
}
return $GLOBALS["gBGDVersion"];
}
Input next:
function _sysB_chkgd2()
{
$rep=false;
if(isset($GLOBALS["gBGDVersion"])) {
$rep=$GLOBALS["gBGDVersion"];
} else {
$arr=get_loaded_extensions();
if(in_array("gd", $arr) and function_exists(imagecreatetruecolor)) {
$GLOBALS["gBGDVersion"]=$rep="2.0";
}elseif (in_array("gd", $arr) and !function_exists(imagecreatetruecolor)){
$GLOBALS["gBGDVersion"]=$rep="1.6";
}
}
return $GLOBALS["gBGDVersion"];
}
It's all.