![]() |
Add a new Block with PHP content?
hello,
I just tried to add a new block (Forum Blocks Manager) with PHP content type but there is always error. just tried: PHP Code:
|
And the error is?
|
Is this the only code you're using?
That wount work;) 1. You have to use vB::$db-> instead of $vbulletin->db 2. You'll need to fetch the query. 3. You'll need to add the results to an array or to a template 4. You'll need to return it |
Quote:
|
If you want to see an example, here's a real simple block that just spits out the user's username:
PHP Code:
|
I've done things in a slightly different way....
I was making widget (not sure how these differ from sidebar blocks) But I made completely blank template, with just {vb:raw output} in it, and in my php area just include() an external file and have the out stored in $output. Means I can edit the included file however I want, and I can re-use that template too. |
All times are GMT. The time now is 11:17 AM. |
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:
|