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.

recent discussions-How to

2»

Comments

  • Is your wordpress installation in your root directory, or a sub-folder? If it's in the root, and your vanilla install is in /forum/ try this:
    if(is_home() || is_page())
    {
       define('VANILLA_DIR', 'forum/');
       include('forum/getdiscussions.php');
    }
    If your wordpress install is in a sub-dir, and vanilla is in the folder /forum/, try:
    if(is_home() || is_page())
    {
       define('VANILLA_DIR', '../forum/');
       include('../forum/getdiscussions.php');
    }
  • this could help ..
  • thanks a lot for this add-on
  • @SirNot--my WP install is in the root and my vanilla install is in a folder in the root (/forum). So, i used the top code and now get all kinds of different errors: Notice: Undefined index: PATH_INFO in /srv/www/htdocs/wp-includes/classes.php on line 1500 Notice: Undefined index: path in /srv/www/htdocs/wp-includes/classes.php on line 1508 Notice: Undefined index: a in /srv/www/htdocs/wp-content/plugins/xdtalk/xdtalk.php on line 560 Notice: Undefined index: g2_sidebarblocksimageFrame in /srv/www/htdocs/wp-content/plugins/wpg2/g2embed.php on line 779 Notice: Undefined index: g2_postalbumFrame in /srv/www/htdocs/wp-content/plugins/wpg2/g2embed.php on line 779 Notice: Undefined index: g2_postimageFrame in /srv/www/htdocs/wp-content/plugins/wpg2/g2embed.php on line 779 Notice: Undefined variable: jsArray in /srv/www/htdocs/wp-content/themes/bloxpress2/functions.php on line 165 Again, here is the code i used in wp-blog-header.php: if(is_home() || is_page()) { define('VANILLA_DIR', 'forum/'); include('forum/getdiscussions.php'); } @scip--i want the latest posts on my front page of my blog. I think your add-on places the posts on the forum page (or does it)?
  • its purpose is integration of latest discussions into other web pages .. exactly what u need :) just read ReadMe.txt provided with extension and comments inside default.php ..
  • What probably happened is that vanilla reset the error level to notice, something wordpress dosn't appear to like... If you wanted you could edit appg/headers.php in vanilla, but it'd be easier to go with scip's solution (although it will cause the number of http queries to double...).
  • Maybe i just am not suppose to get any of these to work because the extension from scip, i can not get that to work either. Here, i think, is the problem with the add-on: I use a ajax theme for WP. And on this theme i do not have a sidebar.php file. What i have to do to include things in the sidebar is make what is called "blocks" by inserting the code that i would normally put in the sidebar.php file into a <name>.php file. And when i include the code from the add-on into my forumposts.php "block", it does not display the latest posts from the forum. How would i edit the appg/headers.php file? Or, maybe i just will put this on the back burner for now.
  • NickENickE New
    edited September 2006
    To edit headers.php, replaceerror_reporting(E_ALL);witherror_reporting(E_ALL ^ E_NOTICE);
    It really is too bad wordpress can't run with notice error level on.
  • Well, that worked for the errors and now i get these errors: Warning: main(forum/appg/settings.php) [function.main]: failed to open stream: No such file or directory in /srv/www/htdocs/forum/getdiscussions.php on line 5 Warning: main() [function.include]: Failed opening 'forum/appg/settings.php' for inclusion (include_path='.:') in /srv/www/htdocs/forum/getdiscussions.php on line 5 Warning: main(forum/appg/init_ajax.php) [function.main]: failed to open stream: No such file or directory in /srv/www/htdocs/forum/getdiscussions.php on line 6 Warning: main() [function.include]: Failed opening 'forum/appg/init_ajax.php' for inclusion (include_path='.:') in /srv/www/htdocs/forum/getdiscussions.php on line 6 # Latest Discussions Fatal error: Call to a member function on a non-object in /srv/www/htdocs/forum/getdiscussions.php on line 11
  • edited September 2006
    i wrote my plugin to output javascript couse i tought that would be the easiest way for normal (read:not-php-trained :) users .. you can include() but include must be at local level( inside class,function) so variables dont mix, then u must global $Configuration(couse it's global in some vanilla functions), than backup $Configuration, then suppress headers etc, etc.. you can of course make direct calls to DB .. @SirNot : "although it will cause the number of http queries to double..." ? dont understand this; what will double? http requests? we are talking about just one http request ..
  • NickENickE New
    edited September 2006
    The browser first has to request for the main page (in this case, the blog entry/index), and as you've integrated the posts via js it has to make a second request to your extension file to get the latest posts. While it is definitely easier to simply include a little bit of javascript, it's not the most efficient method of going about it if both vanilla and the page in question are on the same server.

    @carnold: That is odd. Is forum/ the correct path to your vanilla install relative to your wordpress installation? The definition of VANILLA_DIR has to be the path relative to the current file (ie. wp-blog-header.php).
  • true. you just confused me with that "double" phrase. math is more like 15+1=16, not 1x2=2 in every modern web page (just ask ajax .. he knows :) regards ..
  • So how could i do this for comments within a certain discussion? wayne
  • Can i use this to single out a single Discussion? and category, i'm sure i can just not sure what code to put into the above, it's gotta be easy heh??? wayne
  • edited October 2007
    The problem is unless i can figure this out, i can't use friendly urls, because i use feeds to make my links right now outside vanilla, and the feeds are not shown as friendly urls, so google will follow the dynamic url and then hit me for duplicate content cause i'll have two sets of links for the same page...
  • How could i use the above code and single out a certain category???
  • Good question. Singling out a certain category would be pretty nice.
    SirNot, I have your code working great, but what I'd like to know is if you can get more information than just the titles. Can you get the name of the user that started the discussion, their icon and how many comments have been made?
This discussion has been closed.