View Full Version : Open attachments in new window (User Selection)
Logikos
19 Jul 2004, 19: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, 21:10
1 query just for this ?
Logikos
19 Jul 2004, 21: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.
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, 22:15
i need to add that query too store the info for each user.
alkatraz
19 Jul 2004, 22:52
cool idea
i just hold SHIFT when I click to open any link in a new window (in IE)
Zachery
19 Jul 2004, 22:56
why not just use a user profile field ?
Logikos
19 Jul 2004, 23:36
you could do that as well.
ImportPassion
20 Jul 2004, 01:09
i don't know why they changed this in 3.03. sucks ass
Logikos
20 Jul 2004, 01:42
i don't know why they changed this in 3.03. sucks ass
Cause it don't meet XHTML standereds
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
if you would like to make it standard, then put the following condition inside:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
questions?
Tim Wheatley
21 Jul 2004, 00:19
Was just gonna post that Scotty. :)
Merjawy
21 Jul 2004, 01: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
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://
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This works :)
cnczone
21 Jul 2004, 05:28
nothing is working
isn't the last <if> in both line supposed to be </if> :)
sorry, you are right!
cnczone
21 Jul 2004, 21:25
You're hack does not work for me.
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.