1
panigrc
Images with title
  • 2005/4/21 11:59

  • panigrc

  • Not too shy to talk

  • Posts: 133

  • Since: 2005/4/14


This little hack ads title tag with the value of image's name. Also fixed the center align function.

imagemanager.php :
$lcode '[img align=left title=\''.$images[$i]->getVar('image_nicename').'\']'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'[/img]';
$code '[img align=center title=\''.$images[$i]->getVar('image_nicename').'\']'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'[/img]';
$rcode '[img align=right title=\''.$images[$i]->getVar('image_nicename').'\']'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'[/img]';


and

module.textsanitizer.php :
I added one more pattern with the title attribute
$patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()'<>]*)[/img]/sU";
$patterns[] = "/[img]([^"()'<>]*)[/img]/sU";
$patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"
]?)([0-9]*)\3]([^"()'<>]*)[/img]/sU";
$patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()'<>]*)[/img]/sU";
[
b]$patterns[] = "/[img align=(['"]?)(left|center|right)\1 title=(['"]?)([^"()'<>]*)\3]([^"()'<>]*)[/img]/sU";[/b]

$replacements[] = '
';
//$replacements[] = '';
$replacements[] = '';
$replacements[] = '.XOOPS_URL.'/image.php?id=\4" alt="\4"  title="\4" />
';
//$replacements[] = '';
$replacements[] = '.XOOPS_URL.'/image.php?id=\2" alt="\3" title="\3" />';
[
b]$replacements[] = '
';[/b]


I know its not very clean but it works .
It also has one bug. If the name of the image has ' or " then the imagemanager can't paste the code.
Thats all.

2
hervet
Re: Images with title
  • 2005/4/23 7:10

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hi,

May be you could post it here :
http://sourceforge.net/tracker/?func=add&group_id=41586&atid=430842

Bye,
Hervé

Login

Who's Online

348 user(s) are online (245 user(s) are browsing Support Forums)


Members: 0


Guests: 348


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits