The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using the new PHP Block
I'm trying to use the new vb4 sidebar php block.
I enter something very simple like PHP Code:
Also can I access vb variables and bbcode in the block? |
#2
|
||||
|
||||
Take a look at the template that is used to output the php block and you'll see exactly what it expects - it expects you to create a variable $output and it will output it in the block.
|
#3
|
|||
|
|||
Quote:
Stupid question... but which template do I need to look for? I'm not sure how to find the template :erm: |
#4
|
||||
|
||||
To find the template, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)
|
#5
|
|||
|
|||
Well, maybe I am a little slow..
tried the same thing... custom html/php block template name: block_html it expects the variable content so i did a $content='test'; and... the block is there but empty... populated with the blocktitle only.. (its the default block title) I even added a: global $content; Any ideas? thx in advance... F. |
#6
|
||||
|
||||
I wish vb has called these different blocks something completely different.
- If using the php block on the CMS page, you need to set your output to the variable $output. PHP Code:
PHP Code:
|
#7
|
|||
|
|||
Thank you lynne,
works perfectly as always... To bad you cant use the template vars $content and $blockinfo["title"] or return an array. The advantage would have been to be able to phrase the title of the block for multilanguage purposes.. Example: blocktitle: the newest 5 images.. (where 5 would be the amount of new images calculated in the php block..) OR blocktitle depending on language...(for us multilanguage users) As i run a chinese, german and english board, the titles are very important... But anyway i hope i'll find a way... I'm allready happy to see any content F. |
#8
|
||||
|
||||
Put it as a Suggestion over on vb.com and then put it in the Bug Tracker with a link to the thread about it.
|
#9
|
|||
|
|||
Quote:
answer: not planned for the moment... BUT I think I found a way of doing it In theory... but I'll run some tests tomorrow... Simply.. As you can use your own template... make a new one.. containing only: HTML Code:
<li> {vb:raw content} </li> I guess they didnt plan it that way.. but it should be possible... as I said.. i'm off now.. but i'll test tomorow.. F. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|