mariovaldez.net

MV.net forums
It is currently 14 Jul 2016, 00:45

All times are UTC - 7 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: logo size
PostPosted: 10 Jun 2003, 12:39 
Here is a patch for more control over the logo size... :D

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


Report this post
Top
  
Reply with quote  
 Post subject: Sub directories
PostPosted: 10 Jun 2003, 12:57 
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 .="


Report this post
Top
  
Reply with quote  
 Post subject: Decription
PostPosted: 12 Jun 2003, 06:43 
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. :lol:

Hope this explains what this code is trying to acomplish. :!:


Report this post
Top
  
Reply with quote  
PostPosted: 14 Jun 2003, 06:51 
User avatar

Joined: 06 Mar 2003, 03:21
Posts: 447
Location: Monterrey, NL, Mexico
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group