![]() |
Converting vBulletin widget to WordPress
Hi, I have a snippet of code that I found and use as a widget to display the next 5 upcoming events in my calendar. I am looking to port this over to WordPress as that is now my homepage. The code is below. Any assistance would be greatly appreciated. Thanks
PHP Code:
|
why convert it? just install a php code widget on wordpress, chdir to the forum directory require global.php, change back and bam.
|
How would I do that? WordPress and vBulletin are both installed on the root of my website. When i chdir i get this error:
Fatal error: Access to undeclared static property: VB::$db thanks |
If vb's global.php is in the same directory as the script that's running your code, then you don't need to chdir. If you still get that error, try removing the VB:: from in front of $db.
|
I did that, I removed the VB:: and now nothing shows up (atleast no errors), but now I am not sure what to check next. thanks
|
A vb widget only sets $output to the widget html. I don't know how a WordPress widget works, but unless it works exactly the same way then you're probably not going to get any output.
|
hm, ok. is there any way to figure out how to display the text? Or am I going to need to have a widget made from scratch that queries the table. thanks
|
I think what you need is some info on how to write a WordPress widget (which may be quite different than a vb widget even though they're both called widgets). Of course this is a vb forum and not WP, but someone here probably knows. Or you could try a wordpress forum.
|
yeah ill need to look into that, thanks for the help though
|
To follow up on this, I got it working. I needed to echo out the output and remove the vB:: and other small things. But it works now.
PHP Code:
|
All times are GMT. The time now is 04:14 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:
|