vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Using memberaction_dropdown in a custom template? (https://vborg.vbsupport.ru/showthread.php?t=239114)

Cryo 03-26-2010 12:18 AM

Using memberaction_dropdown in a custom template?
 
Hello,

I have a plugin that is acting as a postbit replacement. Basically, the plugin calls my custom template then registers post variables and makes it accessible to the postbit_legacy template. I have this working fine, and everything displays as it should. However, when I attempt to use...

Code:

{vb:raw memberaction_dropdown}
... it does not work, nothing displays at all. How can I make this accessible to my template?

Thanks in advance.

ForumsMods 03-26-2010 03:24 AM

PHP Code:

$memberaction_dropdown construct_memberaction_dropdown($post$template_hook); 


Cryo 03-26-2010 06:13 AM

Thanks very much for the reply. I added in the manner I thought it should be, but the only thing I get is a bracket. If you wouldn't mind, could you point me in the right direction to make this work?

PHP Code:

// Assemble Dropdown
$memberaction_dropdown construct_memberaction_dropdown($post$template_hook);

// Load Avatar Template
$dotemplate vB_Template::create('avatarpanel');
    
    
$dotemplate->register('poster'$this->post);
    
$dotemplate->register('dd'$memberaction_dropdown);
    
$values['avatarpanel'] = $dotemplate->render();
        
    
vB_Template::preRegister('postbit_legacy'$values); 

My template is calling...

Code:

{vb:raw dd.memberaction_dropdown}

King Kovifor 03-27-2010 03:26 AM

If it is within your template, you would want to call just:

HTML Code:

{vb:raw dd}
As

HTML Code:

{vb:raw dd.memberaction_dropdown}
Implies code such as this:

PHP Code:

$dd = array('memberaction_dropdown' => $memberaction_dropdown); 

The registering of a variable is strictly that. You create a variable and assign it a value. In your case dd is defined as $memberaction_dropdown. So where ever you use {vb:raw dd} the contents of $memberaction_dropdown will be displayed.

Cryo 03-27-2010 05:37 PM

Ah, seems so simple now! Thank you both, it worked. :)

wolfe 05-25-2014 09:52 PM

sorry to bump and old thread but i have used this code all is working perfectly except it is showing everyone as offline ?

--------------- Added [DATE]1401058589[/DATE] at [TIME]1401058589[/TIME] ---------------

sorted it forgot to call user.lastactivity, user.lastvisit :)


All times are GMT. The time now is 11:19 PM.

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.00981 seconds
  • Memory Usage 1,727KB
  • 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_code_printable
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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