vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   Using your User Profile Fields in your postbit templates (w/ all plugin method) (https://vborg.vbsupport.ru/showthread.php?t=250418)

stl7997 01-11-2011 02:53 AM

1 Attachment(s)
Thank you so much for this article! I was wondering where I need to add a break (see picture) to the code in the template. I would like a break to be done after the 'AE Assignments:' so that everything appears on the line below it.

Thanks in advance!

Lynne 01-11-2011 03:02 AM

Quote:

Originally Posted by stl7997 (Post 2147374)
Thank you so much for this article! I was wondering where I need to add a break (see picture) to the code in the template. I would like a break to be done after the 'AE Assignments:' so that everything appears on the line below it.

Thanks in advance!

Can't you just add a <br /> where you want a break?

stl7997 01-11-2011 09:32 AM

Quote:

Originally Posted by Lynne (Post 2147377)
Can't you just add a <br /> where you want a break?

Yes that is exactly what I want to do, however I'm a complete noob to PHP. I've tried adding the <br /> in different places to the code but cannot get the desired results.

Where would I add the <br /> in this code? Or is this even the right place to place it?

Sorry for such rookie questions :o

PHP Code:

// for single-line fields - using fieldy
if ($post['fieldy']) {
     
$template_hook['postbit_userinfo_right_after_posts'] .= '<dt>' .$vbphrase[fieldy_title]. '</dt> <dd>' .$post[fieldy]. '</dd>';
 }

// for multiple-selection fields - using filedx
if ($post['fieldx'])
{
    
$fieldarrayx $post['profilefieldx'];
    
fetch_profilefield_display($fieldarrayx$post['fieldx']);
    
$template_hook['postbit_userinfo_right_after_posts'] .= '<dt>' .$vbphrase[fieldx_title]. '</dt> <dd>' .$fieldarrayx['value']. '</dd>'



Lynne 01-11-2011 08:16 PM

Put it right after the </dt> and before the <dd> for the field you are adding.

stl7997 01-12-2011 02:20 AM

Quote:

Originally Posted by Lynne (Post 2147698)
Put it right after the </dt> and before the <dd> for the field you are adding.

:up::D

Thanks Lynne!

Sarcoth 01-20-2011 01:28 AM

Can we set this up so only certain users can see postbit addon?
PHP Code:

if (is_member_of($vbulletin->userinfo567))
{
    if (
$post['fieldx'])
    {
        
$template_hook['postbit_userinfo_right_after_posts'] .= '<dt>My FieldX</dt> <dd>' .$post[fieldx]. '</dd>';
    }


I can't seem to get that part to work. Thanks.

Lynne 01-20-2011 03:36 AM

It could be you need to globalize $vbulletin if you are using that variable.

Sarcoth 01-20-2011 03:59 AM

Quote:

Originally Posted by Sarcoth (Post 2151782)
Can we set this up so only certain users can see postbit addon?
PHP Code:

if (is_member_of($vbulletin->userinfo567))
{
    if (
$post['fieldx'])
    {
        
$template_hook['postbit_userinfo_right_after_posts'] .= '<dt>My FieldX</dt> <dd>' .$post[fieldx]. '</dd>';
    }


I can't seem to get that part to work. Thanks.

Quote:

Originally Posted by Lynne (Post 2151812)
It could be you need to globalize $vbulletin if you are using that variable.

Thanks Lynne. I know I had tried that earlier and thought it did not work. Going over my notes I see I used "$global $vbulletin;". I needed to leave out the first $ to fix the problem.

I thought globalizing it could be a security risk in some cases. Is there a problem doing that in this plugin?

Thank you again for the help on that. Now I can go to sleep. :)

Special Pages 03-13-2011 08:55 PM

Very good Lynne. Keep up the good work!

mikem164 03-18-2011 04:28 PM

Just did this and it turned out phenomenal! A big THANKS!


All times are GMT. The time now is 02:35 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01632 seconds
  • Memory Usage 1,750KB
  • 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
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete