2011-08-31 Miguel de Dios <miguel.dedios@artica.es>

* include/functions.php: fixed in function "string2image" when generate a
	image in other location, now have one more parameter, $homeurl, by default
	empty string.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-08-31 11:27:01 +00:00
parent 4e2113b839
commit 1272ea9275
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2011-08-31 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php: fixed in function "string2image" when generate a
image in other location, now have one more parameter, $homeurl, by default
empty string.
2011-08-31 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/users/user_edit.php: Reload page to update skin.

View File

@ -1205,7 +1205,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_au
*/
function string2image($string, $width, $height, $fontsize = 3,
$degrees = '0', $bgcolor = '#FFFFFF', $textcolor = '#000000',
$padding_left = 4, $padding_top = 1) {
$padding_left = 4, $padding_top = 1, $home_url = '') {
global $config;
@ -1222,12 +1222,14 @@ function string2image($string, $width, $height, $fontsize = 3,
$stringFile = str_replace('/', '___', $string);
// Generate the image
$file_url = 'attachment/string2image-'.$stringFile.'.gif';
$file_url = $config['attachment_store'] . '/string2image-'.$stringFile.'.gif';
imagegif($rotated, $file_url);
imagedestroy($rotated);
$file_url = str_replace('#','%23',$file_url);
$file_url = str_replace('%','%25',$file_url);
$file_url = str_replace($config['attachment_store'], $home_url . 'attachment', $file_url);
return $file_url;
}