Plugin Directory

Changeset 117772


Ignore:
Timestamp:
05/14/2009 02:15:29 AM (17 years ago)
Author:
jeff_
Message:

better display of first image when its a small image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • articles2sidebar/trunk/article2sidebar.php

    r114916 r117772  
    55Plugin URI: http://www.modulaweb.fr/blog/wp-plugins/article2sidebar/
    66Description: Puts in side bar the excerpt of articles posted in a category called the same as the curent page or posted in the same category than the displayed page. Place en sidebar les articles placés dans une catégorie homonyme avec la page affichée ou de la même catégorie.
    7 Version: 1
     7Version: 1.1
    88Author: Jean-François VIAL
    99Author URI: http://www.modulaweb.fr/
     
    5454            $result = preg_match('/width="([0-9]*)" height="([0-9]*)"/', $postOutput, $matches);
    5555            if ($result) {
    56                 $pagestring = $matches[0];
    57                 $postOutput = str_replace($pagestring, "", $postOutput);
    58             }
    59             if($postOutput != "<p>") { echo str_replace('<img','<img width="45"',$postOutput); }
     56                if ($matches[1]>45 || $matches[2]>45) {
     57                    $pagestring = $matches[0];
     58                    $postOutput = str_replace($pagestring, "", $postOutput);
     59                }
     60            }
     61            if($postOutput != "<p>") {
     62                if (($options['link']>0 || $display_link>0) && (!$display_link == 0))
     63                    echo '<a href="' . $a2spost->post_name . '">';
     64                if ($matches[1]>45 || $matches[2]>45) {
     65                    echo preg_replace('/height="([0-9]*)"/i','',str_replace('<img','<img width="45"',$postOutput));
     66                } else {
     67                    echo $postOutput;
     68                }
     69                if (($options['link']>0 || $display_link>0) && (!$display_link == 0))
     70                    echo '</a>';
     71            }
    6072            echo $a2spost->post_excerpt;
    6173            if (($options['link']>0 || $display_link>0) && (!$display_link == 0))
     
    7890            $result = preg_match('/width="([0-9]*)" height="([0-9]*)"/', $postOutput, $matches);
    7991            if ($result) {
    80                 $pagestring = $matches[0];
    81                 $postOutput = str_replace($pagestring, "", $postOutput);
    82             }
    83             if($postOutput != "<p>") { echo str_replace('<img','<img width="45"',$postOutput); }
     92                if ($matches[1]>45 || $matches[2]>45) {
     93                    $pagestring = $matches[0];
     94                    $postOutput = str_replace($pagestring, "", $postOutput);
     95                }
     96            }
     97            if($postOutput != "<p>") {
     98                if (($options['link']>0 || $display_link>0) && (!$display_link == 0))
     99                    echo '<a href="' . $a2spost->post_name . '">';
     100                if ($matches[1]>45 || $matches[2]>45) {
     101                    echo preg_replace('/height="([0-9]*)"/i','',str_replace('<img','<img width="45"',$postOutput));
     102                } else {
     103                    echo $postOutput;
     104                }
     105                if (($options['link']>0 || $display_link>0) && (!$display_link == 0))
     106                    echo '</a>';
     107            }
    84108            echo $content;
    85109            if (($options['link']>0 || $display_link>0) && (!$display_link == 0))
Note: See TracChangeset for help on using the changeset viewer.