Page 2 of 2

Re: PrettyPhoto on [img] tags

Posted: 12 Jun 2011, 20:18
by Dragosvr92
I know that. i was saying that its not a safe way of doing it :|

Re: PrettyPhoto on [img] tags

Posted: 12 Jun 2011, 21:44
by Stoker
Its 100% safe.
The question was how to do it on IMG tags and that is exactly what the code does.

But you can also create a bbcode and use that instead of the IMG code.

Re: PrettyPhoto on [img] tags

Posted: 13 Jun 2011, 00:04
by Stoker
Create this bbcode:

BBCode usage:

Code: Select all

[sigimg]{URL}[/sigimg]
HTML replacement:

Code: Select all

<img src="{URL}" alt="" />
Display on posting page: Yes

Now we need to make sure this bbcode is used when your users is creating their signature.
We can achieve this by replacing the default IMG bbcode with the custom bbcode we just created.

Open styles/prosilver/template/posting_buttons.html
Find:

Code: Select all

<!-- IF S_BBCODE_IMG -->
		<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
	<!-- ENDIF -->
Replace with:

Code: Select all

<!-- IF S_BBCODE_IMG -->
	<!-- IF $SIG_EDIT -->
	<!-- BEGIN custom_tags -->
	<!-- IF custom_tags.BBCODE_TAG eq 'sigimg' -->
		<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="Img" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
	<!-- ENDIF -->
	<!-- END custom_tags -->
	<!-- ELSE -->
		<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
	<!-- ENDIF -->
	<!-- ENDIF -->

PrettyPhoto on [img] tags

Posted: 19 Dec 2011, 14:31
by mobius
first of all thanks. this particular thing helped me a lot. here are few things I found along the way:

The second tweak is based on using the phpbb3 premod release here meaning you have the prettyphoto mod and bbcodeboxlite

1: Open includes/bbcode.php this particular edit I had to modify to this:

Code: Select all

				'img'		=> '<a href="$1" rel="prettyPhoto[group1]" title="" ><img src="$1" alt="' . $user->lang['IMAGE'] . '" class="onerror" width="100" /></a>',
reasons are that here rel="prettyPhoto[group1]" by adding a group all images using the code on the page are seen as a group and you can use the prettyphoto popup to view next image and stuff (like with attachments here and in your mod). the same thing applies to the bbcodes for youtube. Oddly though if you click on a video first it will only see other videos and ignore images, but if you click on an image it see all of the group ( like 1/10 ). second, add title="" so you remove the Udefined error in the name.

EDIT : i read the phpbb3 forum where you posted this mod about groups and stuff. it was then I realised that doing this means all images across all posts will be a group. not a huge problem just not as refined. maybe there is a way to make this edit use a variable that uses the post id?
prettyphoto1.jpg
second part. Your edit to not resize sigs seems to have come before the bbcodebox lite mod. Since it breaks the styling of the IMG button in the profile and stuff so I did this to fix it.

Code: Select all

<!-- IF S_BBCODE_IMG -->
   <!-- IF $SIG_EDIT -->
   <!-- BEGIN custom_tags -->
   <!-- IF custom_tags.BBCODE_TAG eq 'sigimg' -->
      <input type="button" class="buttonz" name="addbbcode{custom_tags.BBCODE_ID}" value="" style="background: url('{ROOT_PATH}images/editor/image.png');" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
   <!-- ENDIF -->
   <!-- END custom_tags -->
   <!-- ELSE -->
      <input type="button" class="buttonz" accesskey="p" name="addbbcode14" value="" style="background: url('{ROOT_PATH}images/editor/image.png');" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
   <!-- ENDIF -->
   <!-- ENDIF -->