How to edit [img] BBCODE?

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
Locked
scottybt
Registered User
Posts: 130
Joined: Sun May 11, 2008 5:39 pm

How to edit [img] BBCODE?

Post by scottybt » Wed May 04, 2011 7:06 pm

Hey.

How do you edit the IMG BBCODE?

I have a BBCODE called "Thumbnail", but would like to make this replace the IMG.

This is the "HTML replacement" in the BBCODE ACP.. would like to put this in use for the IMG.

Code: Select all

<a href="javascript:void(0)" onClick="window.open('{URL}', 'MyPopUp',  'width=950,height=3000,resize=1,toolbar=0,scrollbars=1,screenX=200,screenY=200,left=200,top=200')"><img src="{URL}" style="max-width: 700px; max-height: 1000px;" border=2> </a>
Is this possible? If not, is it possible to disable the IMG button?

Thanks!

Scott

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: How to edit [img] BBCODE?

Post by 4_seven » Wed May 04, 2011 7:21 pm

Current Mods | Mod Base | php(BB) programming | No help via PM

scottybt
Registered User
Posts: 130
Joined: Sun May 11, 2008 5:39 pm

Re: How to edit [img] BBCODE?

Post by scottybt » Wed May 04, 2011 7:29 pm

Thanks for reply.

Al though that's too much editing, especially when backup and closed board is needed. The admins on the board I'm posting for don't really edit any codes. The board is mod free.

Is there any simple way of doing it?

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: How to edit [img] BBCODE?

Post by 4_seven » Wed May 04, 2011 7:37 pm

yes, make an alternative-bbcode ( may [img2] ) and disable the [img] bbcode in acp ;)

other alternative: search for "lytebox mod" or "re img mod". there is an edit in one of both, which transform the original bbcode. so you can check the syntax, how the authors transform it and you can adapt it to your code than.
Current Mods | Mod Base | php(BB) programming | No help via PM

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: How to edit [img] BBCODE?

Post by 4_seven » Wed May 04, 2011 8:05 pm

try

open

includes/bbcode.php

find

Code: Select all

				'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
replace with

Code: Select all

				'img'		=> "<a href='javascript:void(0)' onclick='window.open('$1', 'MyPopUp',  'width=950,height=3000,resize=1,toolbar=0,scrollbars=1,screenX=200,screenY=200,left=200,top=200')'><img src='$1' style='max-width: 700px; max-height: 1000px;' border='2'> </a>",
				// <img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
Clear all Board- and Browser-Caches and post a test [img] in your forum.

Edit: It works, but your JS Code is not valid or the main js is missing. But your Admins know what to do (i think) ;)
Current Mods | Mod Base | php(BB) programming | No help via PM

Locked

Return to “[3.0.x] MOD Requests”