Announcement

Collapse
No announcement yet.

userid's in templetes hooks?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • masterross
    replied
    I've handled it

    thx!

    Leave a comment:


  • masterross
    replied
    Last thing

    What var should I use in hook member_complete hook?

    I've tried regiter almost every var bu without success:

    PHP Code:
    $templater vB_Template::Create('memberinfo_Modtools');
     
    $templater->register('memberinfo',  $memberinfo);
      
    $templater->register('prepared',  $prepared);
     
    $templater->register('userinfo',  $userinfo);
     
    $templater->register('member',  $member);

     
    $templater->register('post',  $post);
    $template_hook[profile_sidebar_first] .=  $templater->render(); 

    Leave a comment:


  • masterross
    replied
    thx Lynn

    I was strayed from the memberaction_dropdown template.
    Now all is ok!

    Thx once again!

    Leave a comment:


  • Lynne
    replied
    If you are using either of the postbit_display_* hooks, then the correct variable to use is $post, not $memberinfo.

    Leave a comment:


  • masterross
    replied
    Thx mate,

    This was the first thing that I did but doesnt works

    I've tried in this 2 plugin hook locations:
    postbit_display_complete
    postbit_display_start


    But no IDs

    Any help will be appreciated!

    Leave a comment:


  • Lynne
    replied
    You need to register memberinfo for use in *your* template.

    Code:
    [COLOR=#000000][COLOR=#007700][/COLOR][COLOR=#0000BB]$templater [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]vB_Template[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]Create[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'postbit_modtools'[/COLOR][COLOR=#007700]);
    [/COLOR][/COLOR] $[COLOR=#000000][COLOR=#0000BB]templater[/COLOR][/COLOR]->register('memberinfo',  $memberinfo);
    [COLOR=#000000][COLOR=#007700][/COLOR][COLOR=#0000BB]$template_hook[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]memberaction_dropdown_items[/COLOR][COLOR=#007700]] .=  [/COLOR][COLOR=#0000BB]$templater[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]render[/COLOR][COLOR=#007700]();[/COLOR][/COLOR]

    Leave a comment:


  • masterross
    replied
    Any help?

    Leave a comment:


  • masterross
    replied
    Thx for reply Lynn
    I read and use this thread already.

    I know that memberinfo array should be registered but how to do it?
    Cant I just use already registered array in function construct_memberaction_dropdown?

    And if I should fetch again users' ids using this:

    PHP Code:
        $memberinfo = array('userid' => SOMETHING); 
    What should be this SOMETHING?

    Leave a comment:


  • Lynne
    replied
    You need to register any variables for use in a template. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide

    Leave a comment:


  • masterross
    started a topic [Forum] userid's in templetes hooks?

    userid's in templetes hooks?

    Hi

    I'm trying to add some additional mod options when you click on username in postbit.

    First I made template postbit_modtools

    Code:
    <li class="left"><a  href="modcp/user.php?do=avatar&userid={vb:raw  memberinfo.userid}"><img src="{vb:stylevar  imgdir_siteicons}/settings.png" alt="" /> {vb:rawphrase  editavatar}</a></li>
    than I made plugin in postbit _display_start:

    PHP Code:
        if (THIS_SCRIPT == 'showthread')
            {
                    
    $templater vB_Template::Create('postbit_modtools');
                     
    $template_hook[memberaction_dropdown_items] .=  $templater->render();



            } 
    The problem is that userid's doesnt fetch in that way

    Any ideas?
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X