Page 2 of 3

Re: Replace [img]-tag?

Posted: Mon Feb 22, 2010 4:50 pm
by Brf
It looks like you can probably use that. Replace the existing code with yours. Replace {URL} with $1

Just be aware that that code will not work if a user uses
[url=www.example.com][img]image.jpg[/img][/url]
because you would end up with nested links, one for your image and one for their url.

Re: Replace [img]-tag?

Posted: Thu Jan 06, 2011 10:42 am
by King-Nothing
Old thread, but I finally tested this.

When using the bbcode, all old images where automatically "converted" into Higjslide. But when posting a new image using the IMG-tag, only a small grey box appears and no image.

Re: Replace [img]-tag?

Posted: Thu Jan 06, 2011 11:57 am
by AmigoJack
Which lightbox are you actually using? They mostly work purely on JavaScript, so they most probably could be adjusted to just pick all the images in each post and then do what they're intended to. This way you'd have no (serious) modifications at all - just an additional JS file to be included in viewtopic_body.html.

Re: Replace [img]-tag?

Posted: Thu Jan 06, 2011 9:43 pm
by King-Nothing
I`m using Highslide Attachment Mod: http://www.phpbb3bbcodes.com/viewtopic.php?f=8&t=13

Re: Replace [img]-tag?

Posted: Fri Jan 14, 2011 7:54 am
by AmigoJack
That was a challenging one. The following instructions are meant for the prosilver style (but could work with any style) and have been tested in FireFox 3.5.5 only so far. It will create a lightbox gallery with fancy JS animations for all pictures in a post. Smilies are ignored (at least those which have a path component of /smilies/).

Download Highslide. Create a folder /styles/highslide/ and extract the contents of the folder highslide/ from inside the archive there (so you end up having the file /styles/highslide/highslide-with-gallery.js). In fact, you don't need to extract all the files - only the folder graphics/ and the files highslide.css, highslide-ie6.css and highslide-with-gallery.js are needed. Obviously you should never install a phpBB style/theme with the name "highslide".

Open /styles/prosilver/template/overall_header.html and find:

Code: Select all

</head>
Before, add:

Code: Select all

<link rel="stylesheet" type="text/css" href="styles/highslide/highslide.css" />
Open /styles/prosilver/template/viewtopic_body.html and find:

Code: Select all

<!-- BEGIN postrow -->
Before, add:

Code: Select all

<script type="text/javascript" src="styles/highslide/highslide-with-gallery.js"></script>
<script type="text/javascript"> //<![CDATA[
	hs.graphicsDir= 'styles/highslide/graphics/';
	hs.wrapperClassName= 'wide-border';

	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;

	// Add the controlbar
	hs.addSlideshow({
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: 0.75,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});

	function extendImg( e ) {
		var eA, eI, iE, iCnt, eL= e.childNodes;
		for( iE= 0, iCnt= eL.length; iE< iCnt; iE++ ) {
			if( eL[iE].tagName&& eL[iE].tagName.toLowerCase()== 'img'&& !eL[iE].src.match( /\/smilies\// ) ) {
				eI= document.createElement( 'img' );
				eI.setAttribute( 'style', 'max-height: 100px; max-width: 100px;' );
				eI.src= eL[iE].src;
				eA= document.createElement( 'a' );
				eA.href= eI.src;
				eA.className= 'highslide';
				eA.setAttribute( 'onclick', 'return hs.expand( this )' );
				eL[iE].parentNode.replaceChild( eA, eL[iE] );
				eA.appendChild( eI );
			} else extendImg( eL[iE] );
		}
	}
//]]>
</script>
Find:

Code: Select all

			<div class="content">{postrow.MESSAGE}</div>
Replace with:

Code: Select all

<div id="m{postrow.POST_ID}" class="content"><div class="highslide-gallery">{postrow.MESSAGE}</div></div>
<script type="text/javascript"> //<![CDATA[
	extendImg( document.getElementById( 'm{postrow.POST_ID}' ) );
//]]>
</script>
Purge your templates cache.

Re: Replace [img]-tag?

Posted: Thu Jun 28, 2012 4:10 pm
by Jabhi
I already have these edits with highslide attachment mod.
styles/prosilver/template/overall_header.html
Find :

Code: Select all

<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js"></script>
After add :

Code: Select all

<script type="text/javascript" src="{ROOT_PATH}highslide/highslide-full.js"></script>
<link href="{ROOT_PATH}highslide/highslide.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
// <![CDATA[
hs.graphicsDir = '{ROOT_PATH}highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
//hs.dimmingOpacity = 0.75;

// Add the controlbar
hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: 0.75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});
// ]]>
</script>
styles/prosilver/template/attachment.html
Find :

Code: Select all

			<dt><a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}" /></a></dt>
Replace with :

Code: Select all

			<dd class="highslide-gallery"><a href="{_file.U_DOWNLOAD_LINK}/{_file.DOWNLOAD_NAME}" class="highslide" onclick="return hs.expand(this, { slideshowGroup: '{_file.THUMB_POST_ID}' })"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}" /></a><div class="highslide-caption">{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}</div></dd>
And includes/functions_content.php
Find :

Code: Select all

						'THUMB_IMAGE'		=> $thumbnail_link,
After add :

Code: Select all

						'THUMB_POST_ID'      => $attachment['post_msg_id'],
So what are the further edits, Thanks.

Re: Replace [img]-tag?

Posted: Fri Jun 29, 2012 5:46 am
by AmigoJack
If you only use my modifications all [img] tags and all pictures as inline attachments are affected. If you want that behaviour, undo your (previous) modifications.

Re: Replace [img]-tag?

Posted: Fri Jun 29, 2012 6:36 pm
by Jabhi
Okey, Thank you ...

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 5:21 am
by Jabhi
Still it opens twice ...

susy.netai.net/viewtopic.php?f=2&p=4

Edit : Sorry that was my problem, All working fine except attached images are opening in smaller size. Thanks.

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 5:51 am
by AmigoJack
Because you still have modifications in /styles/prosilver/template/attachment.html unrelated to my instructions.

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 5:56 am
by Jabhi
I corrected it, Please check the site and CTRL+F5 . The attached images are opens as small images, not in its original size.
But the image with bb code works fine.
Another problem, It counts all image in a topic instead of counting a single post.

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 9:28 am
by AmigoJack
  1. Highslide can't download - it just operates on directly accessible pictures.
  2. Your attached images are not inline attached, so we are only seeing previews/thumbnails at 100% (which are files on their own), whereas the originals would be a download.
  3. The [img] inserted picture is already an original - it is just displayed zoomed (in other words: you don't see it in 100%).
Do you now understand why the scenario just is like it is?

As for having galleries per post: do you still want that or do you realize that Highslide won't make you happy?

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 11:01 am
by Mick
Also, for these type of requests you should be asking in the MODs forums not support.

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 11:38 am
by Jabhi
AmigoJack wrote:
  1. Your attached images are not inline attached, so we are only seeing previews/thumbnails at 100% (which are files on their own), whereas the originals would be a download.
Sorry, but how to attach inline, I did like below
-uploaded the image
-click place inline. Is that inline attach ?
Mick wrote:Also, for these type of requests you should be asking in the MODs forums not support.
Sorry for that, But i am not the topic starter, AmigoJack asked me to reply here, So I replied ...

Re: Replace [img]-tag?

Posted: Wed Jul 04, 2012 12:04 pm
by AmigoJack
Jabhi wrote:-uploaded the image
-click place inline. Is that inline attach ?
Yes, it is. Sorry, I mixed it up with a setting in ACP > Posting > Attachments > Attachment settings > Image category settings [Assigned extension group: Images] > Create thumbnail which must be No, so no thumbnails are created. Set it and create another test post.
Jabhi wrote:i am not the topic starter, AmigoJack asked me to reply here
I'm sure Mick is referring either to your original post or to your "Another problem". But I understand that if you're not aware of the concepts and terminology you also don't know how to classify your need exactly (and thus create a post/topic at the appropriate place).