@@ 41-55 (lines=15) @@ | ||
38 | if (!extension_loaded('gd')) { |
|
39 | trigger_error('GD library is not loaded', E_USER_WARNING); |
|
40 | return false; |
|
41 | } else { |
|
42 | $required_functions = array( |
|
43 | 'imagecreatetruecolor' , |
|
44 | 'imagecolorallocate' , |
|
45 | 'imagefilledrectangle' , |
|
46 | 'imagejpeg' , |
|
47 | 'imagedestroy' , |
|
48 | 'imageftbbox'); |
|
49 | foreach ($required_functions as $func) { |
|
50 | if (!function_exists($func)) { |
|
51 | trigger_error('Function ' . $func . ' is not defined', E_USER_WARNING); |
|
52 | return false; |
|
53 | } |
|
54 | } |
|
55 | } |
|
56 | return true; |
|
57 | } |
|
58 |
@@ 131-140 (lines=10) @@ | ||
128 | ||
129 | function publisher_createLogo($dirname) |
|
130 | { |
|
131 | if (!extension_loaded("gd")) { |
|
132 | return false; |
|
133 | } else { |
|
134 | $required_functions = array("imagecreatetruecolor", "imagecolorallocate", "imagefilledrectangle", "imagejpeg", "imagedestroy", "imageftbbox"); |
|
135 | foreach ($required_functions as $func) { |
|
136 | if (!function_exists($func)) { |
|
137 | return false; |
|
138 | } |
|
139 | } |
|
140 | } |
|
141 | ||
142 | if (!XoopsLoad::fileExists($imageBase = \XoopsBaseConfig::get('root-path') . "/modules/" . $dirname . "/images/module_logo.png") || !XoopsLoad::fileExists($font = \XoopsBaseConfig::get('root-path') . "/modules/" . $dirname . "/images/VeraBd.ttf")) { |
|
143 | return false; |