The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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:
|
#2
|
||||
|
||||
why convert it? just install a php code widget on wordpress, chdir to the forum directory require global.php, change back and bam.
|
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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.
|
#5
|
|||
|
|||
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
|
#6
|
|||
|
|||
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.
|
#7
|
|||
|
|||
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
|
#8
|
|||
|
|||
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.
|
#9
|
|||
|
|||
yeah ill need to look into that, thanks for the help though
|
#10
|
|||
|
|||
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:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|