1
skyrider
Stop image uploading into forums.
  • 2004/7/26 22:59

  • skyrider

  • Just popping in

  • Posts: 85

  • Since: 2004/6/8 1


I've looked all thru the config files and can't see how to stop people (registred members or not) uploading images with forum messages.

I'm sure it's possible... but how?

2
ackbarr
Re: Stop image uploading into forums.

there's actually two possible issues here

1. a user can upload an image to your XOOPS site using the XOOPS Image Manager (if enabled)
2. a user can link to an image to be displayed within a message post using either the Resized Image icon or by using the [ img ] bbtag (as demonstrated in this text).

if you are talking about preventing #1, go to Administration Menu -> System -> Images and modify each category listed so that only administrators can upload images.

if you are talking about #2, I don't believe there is a way at the moment (without hacking the textsanitizer class). I would recommend adding a feature request for newBB2 at the newBB Project Page at dev.xoops.org

3
skyrider
Re: Stop image uploading into forums.
  • 2004/7/27 1:36

  • skyrider

  • Just popping in

  • Posts: 85

  • Since: 2004/6/8 1


Quote:
if you are talking about #2, I don't believe there is a way at the moment (without hacking the textsanitizer class). I would recommend adding a feature request for newBB2 at the newBB Project Page at dev.xoops.org


That's the problem... some guy has decided to bugger about by sending porn pics up. Yes I can 'ban' him but we all know what happens then :)

I suppose I'll just have to keep watching and deleting... but I *will* go and leave a feature req. as suggested.

Thanks for the help.

4
ajaxbr
Re: Stop image uploading into forums.
  • 2004/7/27 2:55

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


You can try opening /class/module.textsanitizer.php and commenting this out (e.g., by putting /* and */ around this block or // at the beginning of each line).
$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";
        if (
$allowimage != 1) {
            
$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">\4</a>';
            
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\2" target="_blank">\3</a>';
        } else {
            
$replacements[] = '<img src="\3" align="\2" alt="" />';
            
$replacements[] = '<img src="\1" alt="" />';
            
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\4" align="\2" alt="\4" />';
            
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\2" alt="\3" />';
        }

This will break ALL instances of [img], so be careful.

5
ajaxbr
Re: Stop image uploading into forums.
  • 2004/7/27 3:04

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Another less destructive way of deleting images is hacking templates or themes. You can try opening newBB templates and replacing
<{foreach item=topic_post from=$topic_posts}>
    <{include 
file="db:newbb_thread.html" topic_post=$topic_post}>
  <{/foreach}>
with

<{foreach item=topic_post from=$topic_posts}>
    <{include 
file="db:newbb_thread.html" topic_post=$topic_post|regex_replace:"/<img.*>/":""|regex_replace:"//>/":">"|strip}>}>
  <{/foreach}>

6
Josem
Re: Stop image uploading into forums.
  • 2004/8/23 12:12

  • Josem

  • Just popping in

  • Posts: 18

  • Since: 2004/8/22


I am having the hardest time setting newBB to show the icons when posting a message. What I get is either "x" instead of the image or nothing (depending on the operating system).
I am talking about all the icons I can see now using the XOOPS site when posting this message.

I wonder if there is a setting I missed.

Login

Who's Online

79 user(s) are online (36 user(s) are browsing Support Forums)


Members: 0


Guests: 79


more...

Donat-O-Meter

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

Latest GitHub Commits