vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Side Blocks (https://vborg.vbsupport.ru/showthread.php?t=257501)

Mastar 01-21-2011 12:27 AM

Side Blocks
 
How can I get in the sideblock using something like:

PHP Code:

{vb:raw post.username

Actually I would like to get the forum leaders avatar, username and a profile field to appear in the sideblock!

Lynne 01-21-2011 01:09 AM

You would need to write a php block and put in the code to output what you want.

Mastar 01-21-2011 02:42 AM

Do you know where can I find a sample or something I can reference from?

Lynne 01-21-2011 02:46 AM

There are a few blocks modifications in the mods forums. So, go download a couple of those and check out the code.

Mastar 01-21-2011 07:07 AM

I've searched but didn't locate any, can you point me to one plz!

Lynne 01-21-2011 02:35 PM

There are several.
https://vborg.vbsupport.ru/forumdisp...c&daysprune=-1
https://vborg.vbsupport.ru/forumdisp...c&daysprune=-1

Mastar 01-21-2011 04:51 PM

I know how to add the content in the sideblocks but I don't know how to get the vbulletin var to get the content there, if I just put {vb:raw post.username} to show the person's username it show just {vb:raw post.username} it doesn't render the actual username.

Lynne 01-21-2011 05:38 PM

First off, you need to define the variable $post to use it in the block.

But, besides that, variables are not html. You would need to create a PHP block to output a variable and there is an example there on how to do output in a php block:
Code:

$my_output = 'Hello, world.';
return $my_output;

An example using a variable:
Code:

$my_output = '<p>Hello '. vB::$vbulletin->userinfo[username].'</p>';
return $my_output;


Mastar 01-21-2011 05:49 PM

Do I need to put anything for the template used?

I tried that code and even the sample code that is there in the ACP, nothing in the template used area and the block didn't appear!

Thanks!

Lynne 01-21-2011 06:50 PM

You need a template for it to use. Just leave that as default block_html

http://www.vbulletin.com/forum/showt...10#post2105310


All times are GMT. The time now is 02:14 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.01088 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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