PDA

View Full Version : Optionally open thread in new window


ericgtr
18 Dec 2005, 19:03
This is something my users really enjoy. Appended to the end of each thread title in the forumdisplay is an image that they can click on to open it in a new window.

In your threadbit template find:

<strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong>


Add this underneath:

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="New Window" width="16" height="16" border="0"></a>


Now upload this image to your forums/images/misc directory http://www.guitars101.com/vb/images/bgold/misc/new_window.gif

That's it! :)

rb290
18 Dec 2005, 20:00
good stuff!
i shall click install.

GoNz00
18 Dec 2005, 20:09
thanks :)

works on 3.5.2

ericgtr
18 Dec 2005, 20:37
thanks :)

works on 3.5.2

Good to know, thanks. Glad it's getting some use :)

Mark.B
18 Dec 2005, 21:40
Nice idea, I've adapted this to work in 3.0 and used it there.

Allan
18 Dec 2005, 23:45
Nice idea :)

click install

The Realist
19 Dec 2005, 20:51
Dont show up on my forums.

ericgtr
19 Dec 2005, 21:25
Dont show up on my forums.

Did you upload the image to your board/images/misc directory? If you have a special theme you may have to upload it there.

The Realist
20 Dec 2005, 09:38
yep and still no show.

ericgtr
20 Dec 2005, 15:54
yep and still no show.

Hmm.. Are you using 3.5.0? (it says that under your avatar) I am not sure what (if any) differences there are between the two versions. I would doulbe check your threadbit template and look for similarities.

Breathex
30 Dec 2005, 05:42
nice hack thanks, installed

Mastar
30 Dec 2005, 16:06
Not showing on mine either. Vb3.52 I uploaded the images and point the link directly to the image and still nothing.

bashy
30 Dec 2005, 16:35
Wheres the image as i would likr o try this?

Bashy

Mastar
30 Dec 2005, 17:04
K! Found my problem and hope it solves anyone else's.

Look for this:

<if condition="$show['gotonewpost']">
<strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong>

<else />

Then you place the Mod Coding after:

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="New Window" width="16" height="16" border="0"></a>

The images doesn't show on the end like the above image but rather to the left of the title.

or you can place it after:

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>

To make it show on the right of the thread title.

cbr929rrerion
02 Jan 2006, 06:32
where can we put this in 3.5 to work on forumdisplay and showthread

cbr929rrerion
02 Jan 2006, 06:35
clicks install also

GamerJunk.net
02 Jan 2006, 07:41
It's only showing up on one of my threads wtf? lol

cbr929rrerion
02 Jan 2006, 19:42
Yeah I noticed its not showing on all of mine either.. like 1/2 of them..

macgyver24
17 Apr 2006, 14:34
I could not make it work with the instructions so here is what worked for me on the latest version of vb. Find the line bellow in the same place the original instructions say to in the threadbit template but instead look for the line bellow and add the code above or bellow it. If you add above it the icon will be to the left if you add bellow it the icon will be to the right. I have attached my threadbit for admin or anyone else to see.

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>

Here is mine to the right:

<else />
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="New Window" width="16" height="16" border="0"></a>
</if>

Admin/Mod ... Please edit my post accordingly I know you want it your way so please make changes as you see fit. I hope this helps anyone else with problems.

virtualno
23 Apr 2006, 22:57
U can also add like this:

<a href="showthread.php?goto=lastpost&$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="New Window" width="16" height="16" border="0"></a>

to go to last post.

I think that is better.

Titania
30 Apr 2006, 07:25
That's cool :D

I combined macgyver24 and virtualno's tweaks and added a new image (attached) to my forum/images/misc directory to have the option of both :)

I've attached a screen grab from my board as an example too.


<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="New Window" width="16" height="16" border="0"></a>
<a href="showthread.php?goto=lastpost&$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window_last.gif" alt="New Window" width="16" height="16" border="0"></a>

filmking
30 Apr 2006, 20:17
Thanks Titania and Virtualno... finally got it working. And thanks to original author too

fib
01 May 2006, 18:06
Just an addition -it needs done for both a new post (strong) thread and a read thread.

This may be a longer way around (I am no expert but this worked for me)
Thank you to the original poster and the others.

Mine turned out like this

<if condition="$show['gotonewpost']"><a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a></if>
$thread[movedprefix]
$thread[typeprefix]
$thread[moderatedprefix]
<if condition="$show['gotonewpost']">
<strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong>

<!-- 1st entry for post in new window -->
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="open this thread in a new window" width="16" height="16" border="0"></a>
<!-- end 1st -->
<else />
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>

<!-- 2nd entry for post in new window -->
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="open this thread in a new window" width="16" height="16" border="0"></a>
<!-- end 2nd -->

</if>


I have added the start of the if so you can see how it falls in.
I realise that I am no expert so be gentle.

ar2
10 May 2006, 21:00
I've got a little problem, "open in new window" icon appears only next to unread threads, when the subject have been read already there is no icon.

any suggestions ?


forum.hdtv.com.pl

mcyates
23 May 2006, 09:40
I could not make it work with the instructions so here is what worked for me on the latest version of vb. Find the line bellow in the same place the original instructions say to in the threadbit template but instead look for the line bellow and add the code above or bellow it. If you add above it the icon will be to the left if you add bellow it the icon will be to the right. I have attached my threadbit for admin or anyone else to see.

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>

Here is mine to the right:

<else />
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" target="_blank"><img src="$stylevar[imgdir_misc]/new_window.gif" alt="New Window" width="16" height="16" border="0"></a>
</if>

Admin/Mod ... Please edit my post accordingly I know you want it your way so please make changes as you see fit. I hope this helps anyone else with problems.

Thank You very much ,this works for my forum which is version 3.5.4

Thanks again :)

Darat
29 May 2006, 13:12
Just an addition -it needs done for both a new post (strong) thread and a read thread.

This may be a longer way around (I am no expert but this worked for me)
Thank you to the original poster and the others.

Mine turned out like this

...snip...

I have added the start of the if so you can see how it falls in.
I realise that I am no expert so be gentle.

Since you want it to appear which ever condition is met by the IF statement just put the code either above or below the IF ELSE section code depending whether you want it to display to the right or left of the thread title.

________________

I found the original icon a bit too vibrant on my board so I toned it down, I also cut the original icon down to make it very small (but it's not now as clear as the original icon as to what it does.) If anyone wants to use these versions feel free to do so.