Page 1 of 1

How to edit [img] BBCODE?

Posted: Wed May 04, 2011 7:06 pm
by scottybt
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

Re: How to edit [img] BBCODE?

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

Re: How to edit [img] BBCODE?

Posted: Wed May 04, 2011 7:29 pm
by scottybt
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?

Re: How to edit [img] BBCODE?

Posted: Wed May 04, 2011 7:37 pm
by 4_seven
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.

Re: How to edit [img] BBCODE?

Posted: Wed May 04, 2011 8:05 pm
by 4_seven
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) ;)