View Full Version : Open attachments in new window (User Selection)
Logikos
07-18-2004, 10:00 PM
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
07-19-2004, 07:10 PM
1 query just for this ?
Logikos
07-19-2004, 07:19 PM
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
07-19-2004, 08:00 PM
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
07-19-2004, 08:15 PM
i need to add that query too store the info for each user.
alkatraz
07-19-2004, 08:52 PM
cool idea
i just hold SHIFT when I click to open any link in a new window (in IE)
Zachery
07-19-2004, 08:56 PM
why not just use a user profile field ?
Logikos
07-19-2004, 09:36 PM
you could do that as well.
ImportPassion
07-19-2004, 11:09 PM
i don't know why they changed this in 3.03. sucks ass
Logikos
07-19-2004, 11:42 PM
i don't know why they changed this in 3.03. sucks ass
Cause it don't meet XHTML standereds
scotty
07-20-2004, 08:17 AM
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
07-20-2004, 10:19 PM
Was just gonna post that Scotty. :)
Merjawy
07-20-2004, 11:14 PM
<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
07-21-2004, 12:55 AM
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
07-21-2004, 03:28 AM
nothing is working
scotty
07-21-2004, 09:51 AM
isn't the last <if> in both line supposed to be </if> :)
sorry, you are right!
cnczone
07-21-2004, 07:25 PM
You're hack does not work for me.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.