1
wishcraft
IMG Tag - Suggested fix

How are you here is the quick fix to the DHTML Form XOOPS code [img]

You have to edit /class/module.textsantizer.php

Insert on Line 322

$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";
    
$replacements[] = '<a href="\3" target="_blank">\3</a>';
    
$replacements[] = '<a href="\1" target="_blank">\1</a>';
    
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\4" target="_blank">\5</a>';
    
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\2" target="_blank">\3</a>';

Look up my background sound hack - it would be kewl to have a shockwave playback on that then with tempo control, you could set a preset tempo for the forum and have remixes while you read..

:-])

For example I think the system module should be more exploited with more options like insertable refs' like this for the global system.

For example for bullet point you set:

$patterns[] = "/[li]([^"()?&'<>]*)[/li]/sU";
    $replacements[] = '
<li>\1</li>';
    $patterns[] = "/[ul]([^"()?&'
<>]*)[/ul]/sU";
    
$replacements[] = '<ul>\1</ul>';
vCard (*.vcf): Dr. Simon Antony Roberts.vcf
Follow, Like & Read:-

x.com/EmpressFX
facebook.com/DrAntonyRoberts

2
ghia
Re: IMG Tag - Suggested fix
  • 2009/1/12 10:55

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


These image tags, aren't they already added by the extensions from the textsanitiser as defined in /class/textsanitizer/image/image.php?
I believe there is somewhere also a configuration option or preference to allow images in DHTML or not.

But you are right, you can do a lot with this kind of replacements.

PS: Check your code. The code window may be unable to display some sequences properly (as eg \.). Use the quote window instead.