Log in

View Full Version : Is $bbuserinfo['x'] limited to certain templates?


Dark_Konoko
07-17-2006, 02:06 PM
Is $bbuserinfo['x'] limited to certain templates? If so, how does one incorperate user options / profile options into other templates?

For example, a user has requested the ability to force attachments to open in new windows. I've added a set of radio buttons with the options "No" and "Yes" (with No being the default) under field9. I've checked that it in indeed the correct field by adding "$bbuserinfo['field9']" to the forum header (it echo's "No" or "Yes" respectively).

I then edited the postbit_attachment template:
<tr>
<td>
<img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="($show['newwindow']) OR ($bbuserinfo['field9'] == 'Yes')"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize], <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase>)</td>
</tr>

What am I doing wrong? Oh and what is the function of "($show['newwindow'])". I assume there is an option already to force attachments to open in a new window, however I cannot find it anywhere.

Paul M
07-17-2006, 02:12 PM
$bbuserinfo refers to the logged in user. In posts, the data for each poster is in $post.

Dark_Konoko
07-17-2006, 02:20 PM
Mmm still no luck using "$postuserinfo['field9'] == 'Yes'". I am making a stupid mistake? Thanks for the quick reply by the way Paul.

Guest190829
07-17-2006, 02:26 PM
You would use:


$post[fieldX]


Replacing X with the correct Field Id.

Paul M
07-17-2006, 02:26 PM
I am making a stupid mistake? Yes. :p

I said $post, not $postuserinfo :)

Dark_Konoko
07-17-2006, 02:38 PM
Heh heh, I sure do feel foolish now :o . I thank you both for your help.

Mmm I've now made the above changes, and they seem to be working correctly. However older attachments do not open in a new window....

... I've not got any hacks/plugins that cache posts. Is there anything in standard vB 3.5.4 which may cause problems?

Dark_Konoko
07-19-2006, 11:29 PM
Shameless bump.

peterska2
07-19-2006, 11:30 PM
check in your attachment types in the ACP. you can set which open in new windows and which don't.

Dark_Konoko
07-19-2006, 11:46 PM
check in your attachment types in the ACP. you can set which open in new windows and which don't.
The thing is I want all attachments to open in a new window on a per user basis, rather then force certain attachments to open in a new window for all users.