miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Stop the direct Image Codes ([img]), and force [imgs=...[/imgs] instead

 
Author Steve Shaw
Partaker
#1 | Posted: 9 Sep 2013 21:39 
Paul, is there a way to stop people from making image links that do not use the code as defined by the 'camera' bb code for pictures button?

So that something like this won't call up the full image directly:

Too Big

But is changed into the correct format instead?

Correct Image

Does that make sense?

Author Paul
Lead Developer 
#2 | Posted: 9 Sep 2013 22:11 
Sorry, I'm not sure I'm getting this properly? It should work by default that way.

It's IMGS tag versus IMG. IMG is up to display full size picture, IMGS is up to fit the picture to the width, which is defined in $GLOBALS['imgsWidth'] of bb_codes.php. IMGS is inserted by default, may be some of your users became clever and started to remove the S letter? who knows...

Author Guest
~
#3 | Posted: 11 Sep 2013 00:28 
If you want [img] pasted instead of [imgs] when the proper bb btn is clicked, modify main_post_form.html

Author Steve Shaw
Partaker
#4 | Posted: 19 Sep 2013 15:01 
I think that's the problem...

Some users are not using the 'BBcode for the picture' button, and are pasting their own code using [img, rather than [imgs...
Can that be stopped?

I used the wrong term in the title/original post I think...

Steve

Author Paul
Lead Developer 
#5 | Posted: 19 Sep 2013 15:18 
Steve Shaw:
Can that be stopped?
You can completely disable [img] tag in bb_codes.php.
Alternatively, you can transform all [img]'s to the same format which is provided by [imgs].

Steve Shaw:
are pasting their own code using [img, rather than [imgs...
Pity :) you should have your own rules for the website, and not allow others rules. Any website has its own rules.
Any user considering these rules wrong, should leave the website. Not sure what else can be done in this case.

I'm meeting this quite often. "Hey, why this and that doesn't work here, but it works there?"
The answer is simple: "That's why".

Author Steve Shaw
Partaker
#6 | Posted: 19 Sep 2013 15:21 
Yep - I agree.
But I don't think it's malicious by the users.

So, how can I edit bb_codes.php to make all images tags follow the [imgs... format?
(You know I'm a dunce at this code stuff! ;o)

Steve

Author Paul
Lead Developer 
#7 | Posted: 19 Sep 2013 15:29 
1. remove all [img]-related tags (both from enCodeBB or deCodeBB functions).

2. change [imgs...] or [imgs] tags having this:

\[img[s]*=...
\[img[s]*\]
This will allow to use either [img] either [imgs], but all codes will be transformed to the [imgs] hyper-linked approach of displaying.

Author Steve Shaw
Partaker
#8 | Posted: 19 Sep 2013 15:48 
Mmmm... I really can't workout what to delete and what to edit...

This really is just beyond my capabilities ;-(

I just don't have the skills needed.

Author Paul
Lead Developer 
#9 | Posted: 19 Sep 2013 15:53 
1. open bb_codes.php for editing (my recommendation is to use Notepad2)

2. Locate all codes which do contain [img=..] or [img] - remove them or disable them, putting double slash in front //

3. Follow my solution above to fix [imgs] codes to have 's' letter put alternatively.

If you can't even do this, ... then you need to hire somebody... possibly me :)

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Stop the direct Image Codes ([img]), and force [imgs=...[/imgs] instead
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑