vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Is $bbuserinfo['x'] limited to certain templates? (https://vborg.vbsupport.ru/showthread.php?t=121415)

Dark_Konoko 07-17-2006 02:06 PM

Is $bbuserinfo['x'] limited to certain templates?
 
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:
HTML Code:

<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:

HTML Code:

$post[fieldX]
Replacing X with the correct Field Id.

Paul M 07-17-2006 02:26 PM

Quote:

Originally Posted by Dark_Konoko
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

Quote:

Originally Posted by peterska2
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.


All times are GMT. The time now is 07:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01154 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete