![]() |
Side Blocks
How can I get in the sideblock using something like:
PHP Code:
|
You would need to write a php block and put in the code to output what you want.
|
Do you know where can I find a sample or something I can reference from?
|
There are a few blocks modifications in the mods forums. So, go download a couple of those and check out the code.
|
I've searched but didn't locate any, can you point me to one plz!
|
|
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.
|
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.'; Code:
$my_output = '<p>Hello '. vB::$vbulletin->userinfo[username].'</p>'; |
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! |
You need a template for it to use. Just leave that as default block_html
http://www.vbulletin.com/forum/showt...10#post2105310 |
I've copy and paste what you did there leaving the template block.html there set the type to php and nothing is coming up on the side. I'm thinking its vb 4.1.1 issues?
|
No, it isn't a vb 4.1.1 issue because I tried that exact code I posted in a php block.
Please post your *exact* code and all the exact settings on the block page that you are creating. Also, do you have blocks on in the first place? vboptions > forum sidebar > set those to what you want |
Title: TEST PHP
Content Type: PHP Content: PHP Code:
Template to Use: block.html |
The template is not called block.html. It is block_html (as I said a few posts above and in the article I linked you to).
It works just fine for me if I have the correct template in that field. |
Thanks that was it!!!!
Appreciate it! |
Haha thanks so much Lynne. I really appreciate your hard work! Please DO NOT delete this thread! I need it. :) lol thanks!
|
All times are GMT. The time now is 05:49 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|