Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Nominate XOOPS!

Learn XOOPS Core

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $15.00
Net Balance: $14.11
Left to go: $85.89

Donations
Anonymous ($15)Jul-20

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 Abuse adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap Captcha cell cent chronolabs Clicks content CĂN demo docek download Dresses evden eve facebook Fat Food for free Gateway Google Guide herre Home Honeypot Human HỘ IP iPhone jQuery List log Loss mobile module modules Monster new newbb news NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Smoking Solution Spam Studio support tags tdmcreate template The Theme themes User userlog web weight Wishcraft xoops Xortify

New Users

Registering user

# 137617

nasro

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 2005/4/21 6:59 Images with title
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[] = '<div align="\2"><img src="\3" alt="" /></div>';
//$replacements[] = '<img src="\3" align="\2" alt="" />';
$replacements[] = '<img src="\1" alt="" />';
$replacements[] = '<div align="\2"><img src="'.XOOPS_URL.'/image.php?id=\4" alt="\4"  title="\4" /></div>';
//$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\4" align="\2" alt="\4" />';
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\2" alt="\3" title="\3" />';
[
b]$replacements[] = '<div align="\2"><img src="\5" alt="\4"  title="\4" /></div>';[/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.

Top

panigrc
Not too shy to talk
Not too shy to talk
Joined:
2005/4/13 19:25
From Greece
Group:
Registered Users
Posts: 133
(Show More) (Show Less)


#2 Posted on: 2005/4/23 2:10 Re: Images with title
Hi,

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

Bye,
Hervé

Top

hervet
Friend of XOOPS
Friend of XOOPS
Joined:
2003/11/4 7:49
From France
Group:
Registered Users
Posts: 1948
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]