PDA

View Full Version : Open attachments in new window (User Selection)


Logikos
19 Jul 2004, 18:36
This will give your users the option to open attachments in a new window. I wrote this cause i see some people like the fact that vB doesn't open a new window for attachments. But some people do like that, like myself. So why not make everyone happy :p

Querys: 1
File Edits: 1 (profile.php)
Template Edits: 2
Phrases: 1
ScreenShote: Attached.


If there are any problems, please post them here as i only tested on my local boards. I will support this. And give updates if there are bugs found.

Please click the install button if you use.

Enjoy!



you want this hack? Go to my site...

floleb7
19 Jul 2004, 20:10
1 query just for this ?

Logikos
19 Jul 2004, 20:19
Well if you can come up with a no query way then that would be better, it only took me 15 mins to write the hack, and i found that to be the best way ATM.

Boofo
19 Jul 2004, 21:00
1 query just for this ?
How do you figure it is adding an extra query? It looks like it is using the query that is already there to me. ;)

Logikos
19 Jul 2004, 21:15
i need to add that query too store the info for each user.

alkatraz
19 Jul 2004, 21:52
cool idea

i just hold SHIFT when I click to open any link in a new window (in IE)

Zachery
19 Jul 2004, 21:56
why not just use a user profile field ?

Logikos
19 Jul 2004, 22:36
you could do that as well.

ImportPassion
20 Jul 2004, 00:09
i don't know why they changed this in 3.03. sucks ass

Logikos
20 Jul 2004, 00:42
i don't know why they changed this in 3.03. sucks ass
Cause it don't meet XHTML standereds

scotty
20 Jul 2004, 09:17
there is a way to implement that feature *without* hacking the files (/me looks at zachery :) ):

- add a new user profile field: Single-Selection Radio Buttons
- title: "Open attachment in new window?"
- in options put "yes" and "no"
- after creating the field, remember the field number (e.g. 25)
- look into the "postbit_attachment*" templates and put into the href-tag (just before the closing ">" the following condition:
<if condition="($bbuserinfo[field25]=="yes")"> target="_blank"</if>
if you would like to make it standard, then put the following condition inside:
<if condition="(($bbuserinfo[field25]=="yes") OR ("$bbuserinfo[field25]==""))"> target="_blank"</if>
questions?

Tim Wheatley
20 Jul 2004, 23:19
Was just gonna post that Scotty. :)

Merjawy
21 Jul 2004, 00:14
<if condition="($bbuserinfo[field25]=="yes")"> target="_blank"<if>


<if condition="(($bbuserinfo[field25]=="yes") OR ("$bbuserinfo[field25]==""))"> target="_blank"<if>

isn't the last <if> in both line supposed to be </if> :)

And thanks to both

Natch
21 Jul 2004, 01:55
If you still wanted xhtml compliance regardless of what the user has selected, why not use onclick="if(window.open(this.href)) return false" as the statement in the conditional?

EDIT:// <if condition="$bbuserinfo[fieldxx]=='Yes'||$bbuserinfo[fieldxx]==''"> onclick="window.open(this.href);return false;"</if>This works :)

cnczone
21 Jul 2004, 04:28
nothing is working

scotty
21 Jul 2004, 10:51
isn't the last <if> in both line supposed to be </if> :)
sorry, you are right!

cnczone
21 Jul 2004, 20:25
You're hack does not work for me.