Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Update for critical security issue in PHPMailer included in release Vanilla 2.3.1
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.

adding wordpress functions to vanilla

edited September 2006 in Vanilla 1.0 Help
found an article on the web about how to get wordpress functions to work in the vanilla themes, which would be cool, once you have integrated wp with vanilla.

this is how it should work:

1. add <?php require_once('../wp-blog-header.php'); ?> to the end of conf/database.php. that inclues the wp-functions.

2. edit the beginning of library/Framework/Framework.Class.MySQL.php so that it looks like this:
class MySQL extends Database { function CloseConnection() { if ($this->Connection) @mysql_close($this->Connection); global $wpdb; $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); } apparently, this needs to be done to reconnect wordpress to the database because vanilla will close the connection early .

seemed easy enough, but i was wrong:

Fatal error: Cannot instantiate non-existent class: wpdb in /www/htdocs/forum/library/Framework/Framework.Class.MySQL.php on line 18

line 18 is $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);

does anyone know a solution to this? i really would like to include some sidebar functions and the same dropdown menu i use on my blog, but it uses wp-functions.


This discussion has been closed.