From 1272ea92751554cee3525ddd7f7a2483a2de509e Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 31 Aug 2011 11:27:01 +0000 Subject: [PATCH] 2011-08-31 Miguel de Dios * 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 --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions.php | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7c0e77dcc0..11a34b5004 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-08-31 Miguel de Dios + + * 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 * operation/users/user_edit.php: Reload page to update skin. diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 6a04026a88..2151b4f193 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -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; }