PrettyPhoto on [img] tags
- Dragosvr92
- BBCoder II
- Posts: 21
- Joined: 28 May 2011, 16:53
- BBCodes: 4
- Favourite MOD: Please Wait
- Location: Romania
- Contact:
Re: PrettyPhoto on [img] tags
I know that. i was saying that its not a safe way of doing it
- Stoker
- Site Admin
- Posts: 3536
- Joined: 12 May 2008, 23:26
- BBCodes: 239
- Favourite BBCode: Anipro
- Favourite MOD: PrettyPhoto
- Location: Denmark
- Contact:
Re: PrettyPhoto on [img] tags
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.
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.
Board rules! No PM support
- Stoker
- Site Admin
- Posts: 3536
- Joined: 12 May 2008, 23:26
- BBCodes: 239
- Favourite BBCode: Anipro
- Favourite MOD: PrettyPhoto
- Location: Denmark
- Contact:
Re: PrettyPhoto on [img] tags
Create this bbcode:
BBCode usage:
HTML replacement:
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:
Replace with:
BBCode usage:
Code: Select all
[sigimg]{URL}[/sigimg]
Code: Select all
<img src="{URL}" alt="" />
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 -->
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 -->
Board rules! No PM support
PrettyPhoto on [img] tags
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:
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?
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.
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>',
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?
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 -->