Prevent Adding Signature Images And Links

Started by karlbenson, September 27, 2007, 05:35:50 PM

Previous topic - Next topic

karlbenson



PREVENT ADDING SIGNATURE LINKS AND IMAGES v1.2
By Karl Benson



Introduction
This mod enables the admin to enable/disable the ADDING of signature images and links completely OR unless the user has made a certain number of posts.

It can prevent the ADDING of images and any live links in users signatures.
Admins are excluded so they can add images/links to their own or ANY users profile area.

It does NOT affect any signatures already in use.  ONLY when they come to edit their signature again (or any settings on the same profile page) will any removal of links/images take place.

The mod requires "Automatically link posted URLs" to be enabled to remove plain links without bbcode. (Admin > Posts & Topics > Bulletin Board Code)

Installation
Simply install the package to install this modification on the Default theme.

Manual edits will be required to install on any theme which uses a custom Profile.template.php.

Languages
Supports
o English
o English-utf8
o Greek/Greek-utf8 (Thanks to MinasC)
For any other languages you will need to copy the language strings into Modifications.{LANGUAGE}.php and translate them as necessary.

Features
o Admin Settings (Under Features & Settings)
- Enable ADDING Signature Links
- Minimum Posts Required (Set to 0 or blank for no MIN post limit)
- Enable ADDING Signature Images
- Minimum Posts Required (Set to 0 or blank for no MIN post limit)

Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Changelog
1.0 - 23rd August 2007
o Initial release
1.1 - 25th October 2007
o Improved matching
o Fixed autoconverted links without http:// not being removed
1.2 - 22nd November 2007
o Added Greek/Greek-utf8 (Thanks to MinasC)

Dumpling

Thank you for the mod.

I'm currently using SMF 1.1.4, and I just installed this mod. I know it only says it work on 1.1.3, but I thought I'd give it a try since I want that feature.

It installed fine and the options showed up fine under Features and Options, but there's a slight problem. I set it so it requires a minimum of 10 post before you can put links in the signature under Features and Options, but when I signed on as a regular user (with 1 post) and I tried putting a link in the signature, it WOULD SHOW UP.

Does this mod really not work on SMF 1.1.4, or is there a way for me to work about it?

Thanks in advance.

karlbenson

#2
hey Dumpling.
It does work for 1.1.4.  Its my error that it doesnt say it.  I thought I had updated the information for all of my mods.

It does work on 1.1.4 (i've tested it multiple times on smf 1.1.3 and 1.1.4).

I've attached a screenshot is what I get when
set min posts to post images and/or links to 10
logged in as a user with 1 post
tried to add a link
hit submit (and it was replaced with *link removed*)

Dumpling

#3
Oh!!!! I got it!!!!

But here's the situation, it only disallow the link if it's written like "http://www.examplelink.com", but if you put "www.examplelink.com" -- the mod won't detect it and will allow it to post.


Edit:

Any fix for that?

karlbenson

the mod should remove anything that will be converted into an active link.

eg if you use iurl or url bbcode or if you post a valid url which is automatically converted.

Edit:

as far as I'm aware www.mysite.com shold get removed if it is converted to an active link

Dumpling

#5
*scratch head* I don't know...

I've tried...

www.example.com -- not removed
http://www.example.com -- removed
http://example.com -- removed
example.com -- not removed
[ url] whatever [ /url] -- removed
http://i21.tinypic.com/xknc50.jpg -- removed (ignore the image, it was just convenient; the image itself doesn't pertain to this :P )
[ img] image direct link [ /img] -- removed


Edit:  I just want to let you know that I'm not complaining about your mod. I just want to let you know about what is and isn't working (for me), in case the mod needs some tweaking.


karlbenson

I'll look into it. Of those you posted and were not removed

www.example.com should have been removed because SMF converts it to a link.  I don't know why it wasnt.
:(

This mod isnt intended to remove example.com.  If I start removing that, then users will start posting e x a m p l e . c o m


Dumpling

hahaha. yeah. if only people don't spam like that...sigh xP

could it be my forum's setting? you said when you put www.example.com, it gets removed, right?

karlbenson

on your forum is www.example.com converted to an active link like here.
Or is it plain text.

Is auto convert urls turned on?

Dumpling

Hi karlbenson,

I'm a newbie, so I'm not 100% understanding what exactly you are asking.

I don't know if "auto convert urls" is turned on or not; where would I see that setting/option? Let's say when I put www.example.com in the signature and when it appears in the signature, you can click on it and it will take you to that website. Sorry if I'm giving you trouble.

karlbenson

I understood Dumpling. Thanks for replying.

I havent managed to take a look at it fully just yet (With the football and the rugby world cup). Its only my handwritten list of things to look at tomorrow.

I will do some testing of the mod tomorrow and see what I can come up with.

Dumpling

Okie dokie. Can't wait to hear back from you. :)

karlbenson

Dumpling, I've had a look at this today and I can not see why www.mysite.com isnt getting replaced.
Please bear with me. I'll try to have another look again tonight.

Dumpling

No problem. :) I still wonder if it has something to do with my end instead of your mod. Hm...*puzzling*

karlbenson

No its definately the mod.

I setup a clean test version of smf on my localhost and had the same issue.

Although www.mysite.com gets converted, it isnt getting detected and removed.

Dumpling

Hey karlbenson,

Sorry for the late reply. On the up side, I am glad to hear that you've at least figured that the mod is not detecting/removing www.example.com links. I hope you will be able to figure out what is causing it soon.


PS: I'm not trying to rush you. I'm not in a hurry to use this mod. :) Good luck.

karlbenson

I've finally managed to fix the www. issue and posted v1.1 with some other minor fixes.

Now downloadable from the customize area.

1.1 - 25th October 2007
o Improved matching
o Fixed autoconverted links without http:// not being removed

Dumpling

#17
Yippy! That's great to hear! I'm going to install the new version :) Thank you very muchie!

Edit: Wonderful! Works like a charm *ding*. If I do find any issues, I'll let you know. ;)

karlbenson

If you have any further issues, please don't hesitate to post them.

DeMar

I have a problem during instalation of mod.

Tip Akcija Opis
1. Primjeni ./Themes/default/Profile.template.php                                          Neuspješno - NONE
2. Primjeni ./Sources/Profile.php                                                                     Neuspješno - NONE
3. Primjeni ./Sources/ModSettings.php                                                            Uspješno  - OK
4. Primjeni ./Themes/default/languages/Modifications.english.php                 Uspješno - OK
5. Primjeni ./Themes/default/languages/Modifications.english-utf8.php           Preskačem datoteku - SKIPING

It's in croatian, but you have it in english

[embed-flash(width,height)]

Advertisement: