Changeset 1646

Show
Ignore:
Timestamp:
05/13/2007 07:14:15 PM (20 months ago)
Author:
jeena
Message:

implemented title attribute for images

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/scripts/bbcode.php

    r1624 r1646  
    4141        else return true; 
    4242    } 
     43                $title = empty($attributes["title"]) ? "" : " title='".$attributes["title"]."'"; 
    4344 
    4445    if (isset($attributes['class']) AND isset($attributes['caption'])) $class_caption = " class='img ".htmlspecialchars($attributes['class'])."'"; 
    4546    elseif (isset($attributes['class'])) $class = " class='".htmlspecialchars($attributes['class'])."'"; 
    4647 
    47     if (strpos($content, "http://") === 0) return "<img src='".htmlspecialchars($content)."'".$class." alt='".$attributes['alt']."' />"; 
     48    if (strpos($content, "http://") === 0) return "<img src='".htmlspecialchars($content)."'".$class." alt='".$attributes['alt']."'".$title." />"; 
    4849    else { 
    4950        list($img_width, $img_height, $img_type, $img_attr) = @getimagesize(JLOG_BASEPATH.'/img'.DIRECTORY_SEPARATOR.htmlspecialchars($content)); 
    50         $img = "<img src='".JLOG_PATH."/img/".htmlspecialchars($content)."'".$class." alt='".$attributes['alt']."' style='width: ".$img_width."px;' />"; 
     51        $img = "<img src='".JLOG_PATH."/img/".htmlspecialchars($content)."'".$class." alt='".$attributes['alt']."' style='width: ".$img_width."px;'".$title." />"; 
    5152    } 
    5253