Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

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

  • Humm, this is the person that helped me do this (which resulted in the article you posted from filosofo). Anyway, this is exactly what i did to get mine working. www.mytimewithgod.net then click on forum (still need some css work and little stuff but it is integrated). I could post or send the files that i had to change, if you would like? Chris
  • hey chris,

    that'd be great if you could send the files over. my email address is on my account page. nice work on the integration.
    cheers,
    bo
  • Sent to both of you. I hope it helps :) Of course, i did change the DB info in database.php
This discussion has been closed.