mariovaldez.net http://www.mariovaldez.net/webapps/forums/ |
|
logo size http://www.mariovaldez.net/webapps/forums/viewtopic.php?f=8&t=31 |
Page 1 of 1 |
Author: | iPsymon [ 10 Jun 2003, 12:39 ] |
Post subject: | logo size |
Here is a patch for more control over the logo size... cm_lib_inc.php function fcm_articlelist_box Line 317 - 337 Code: if ($cm_logoimage) {
// Begin Modified by Mark Coudriet //echo "<IMG SRC=\"getfile.php?cm_path=$cm_path&cm_file=" . fcm_urlencode ($cm_logoimage) . "\" BORDER=\"0\" ALT=\"$cm_boxtitle\" WIDTH=\"$cm_doclogo_width\" HEIGHT=\"$cm_doclogo_height\">"; global $cm_mainroot; $cm_logoimage_ck = $cm_mainroot . $cm_path . "/" . $cm_logoimage; $cm_logo_size = getimagesize ($cm_logoimage_ck); $cm_logo_X = $cm_logo_size [0]; $cm_logo_Y = $cm_logo_size [1]; if ($cm_logo_X > $cm_doclogo_width && $cm_logo_Y > $cm_doclogo_height) { echo "<IMG SRC=\"getfile.php?cm_path=$cm_path&cm_file=" . fcm_urlencode ($cm_logoimage) . "\" BORDER=\"0\" ALT=\"$cm_boxtitle\" WIDTH=\"$cm_doclogo_width\" HEIGHT=\"$cm_doclogo_height\">"; } else if ($cm_logo_Y > $cm_doclogo_height) { echo "<IMG SRC=\"getfile.php?cm_path=$cm_path&cm_file=" . fcm_urlencode ($cm_logoimage) . "\" BORDER=\"0\" ALT=\"$cm_boxtitle\" HEIGHT=\"$cm_doclogo_height\">"; } else if ($cm_logo_X > $cm_doclogo_width) { echo "<IMG SRC=\"getfile.php?cm_path=$cm_path&cm_file=" . fcm_urlencode ($cm_logoimage) . "\" BORDER=\"0\" ALT=\"$cm_boxtitle\" WIDTH=\"$cm_doclogo_width\">"; } else { echo "<IMG SRC=\"getfile.php?cm_path=$cm_path&cm_file=" . fcm_urlencode ($cm_logoimage) . "\" BORDER=\"0\" ALT=\"$cm_boxtitle\">"; } // End Modified |
Author: | iPsymon [ 10 Jun 2003, 12:57 ] |
Post subject: | Sub directories |
You will also need to change the: function fcm_echo_articlelist_box If you use the code. You will have to change all the "echo" statements to "$cm_boxstring .=" |
Author: | iPsymon [ 12 Jun 2003, 06:43 ] |
Post subject: | Decription |
I didn't explain this very well yesterday. What this patch does is let the administrator set the max logo height & width in the config file. Then as long as an image does not exceed the max logo height, or the max width, or both the max logo height & width, it will display the original dimensions of the image without distorting it. If the image is too long, it will set the width. If the image is too high, it will set the height. If it is both, then it will set both height & width. If it is neither, then the image will maintain it's original size. Hope this explains what this code is trying to acomplish. |
Author: | mvaldez [ 14 Jun 2003, 06:51 ] |
Post subject: | Patch to avoid logo distortions... |
Psymon: > Then as long as an image does not exceed the max > logo height, or the max width, or both the max > logo height & width, it will display the original > dimensions of the image without distorting it. Ok, I get it now. Good idea. I recoded your patch so the comparison is done in an existing function (fcm_check_logoimage) and the corrected dimensions are calculated there. I'll add it in the next beta release (0.6.0 beta 8). Regards, Mario A. Valdez-Ramirez. |
Page 1 of 1 | All times are UTC - 7 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |