Fork me on GitHub
Current releases are 2.1.5 (31 Oct 2014) and 2.0.18.13 (5 Aug 2014)

Ready for 2.1? Find out if your plugins are compatible. 2.0 will no longer be updated after Dec 2014.

adding wordpress functions to vanilla

edited September 2006 in Vanilla 1.0 Help
hey,
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.
cheers

Comments

This discussion has been closed.