Recent Topics

1 Feb 08, 2010 18:10    

My b2evolution Version:

Ok, I have several sites set up on my domain, and I have been using Blogger to publish news posts for each of them. I installed b2evo recently and I do like the funcationality, but the problem is it's installed on a subdomain right now, and I would like to just pull the blog posts, without a layout, to be included in my current sites. I made a template that's basicly just the post parts I need, without any template formating, and that works fine. I just can't include it. I'm honestly not sure there is a way to do that, but I'd really like to find out since my sites are a lot more than just a blog, so I prefer to handle the rest of it myself.

2 Feb 08, 2010 23:55

Check out php files in root of b2evo blog directory. You should be able to get some ideas from files such as blog1.php, default.php, multiblogs.php etc.

3 Feb 09, 2010 00:00

See, I tried that, but it just appears blank. In fact, it won't even move on to the footer include, just stops. I've tried use the code in the blog stub page, but that either isn't possible, or I don't know how to make it read correctly. I'm guessing the path is wrong, but I've tried it with the relative path and the absolute path, with no luck.

4 Feb 09, 2010 00:32

Does the blog works just by itself? Does the blog works by calling all those php files?
If you see blank page, there must be some errors. Do you have access to error log to see what's they are?

5 Feb 09, 2010 01:34

The blogs themselves work. Here's what I have:

http://www.dubird.net/b2news/blogs/index.php?blog=1

That's the one I want to pull into the main site. Here's the page where I'm trying to pull it in:

http://www.dubird.net/index_blog.php

and the code I'm trying:


<?php include("header.php"); ?>

<div class=twitter>currently i am:
<ul id="twitter_update_list"></ul>
</div>
<div class=blogname>follow me on <a href=http://twitter.com/dubird>twitter</a></div>

<P>
<BR>
<P>

<?php
/**
 * This is a stub file for displaying a b2evolution blog.
 *
 * A stub file is used to anchor a particular blog in a particular location of your website.
 * More info: {@link http://manual.b2evolution.net/Stub_file}
 *
 * b2evolution - {@link http://b2evolution.net/}
 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
 * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
 */

# First, select which blog you want to display here!
# You can find these numbers in the back-office under the Blogs section.
# You can also create new blogs over there. If you do, you may duplicate this file for the new blog.
$blog = 1;

# You could *force* a specific skin here with this setting: (otherwise, default will be used)
# $skin = 'custom';

# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();

# Here you can set a limit before which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the past
$timestamp_min = '';

# Here you can set a limit after which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the future
$timestamp_max = 'now';

# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...

/**
 * That's it, now let b2evolution do the rest! :)
 * Note: if you put this file in a subdirectory, you will need to adjust the path below, for example:
 * require_once dirname(__FILE__).'/../conf/_config.php';
 */
require_once dirname(__FILE__).'/b2news/blogs/conf/_config.php';

require $inc_path.'_blog_main.inc.php';
?>

<?php include("footer.php"); ?>

I've tried both the relative path (as above) and the absolute path, neither one works. I did try using a path on the include file as well, and that doesn't work either.

6 Feb 09, 2010 02:49

Try the following:

1. set $skin = ''

2. try to base your code from multiblogs.php - I'm working on something similar to what you're doing and based my code from this script without much problem.

If this doesn't help, then you'll need a real b2evo guru to assist you. :p

7 Feb 09, 2010 02:59

No, still doesn't do it. I think it just doesn't know where to find the b2evo install, even when I give it the path to search. So I'm totally not sure what to do.

Well, I guess I could install it in the root directory, but the other sites I want to use it on will still need to be in subdirectories, so that won't really help.

8 Feb 09, 2010 04:17

This is weird...

I've tested multiblogs.php (and codes based on it) with b2evo installed in different levels of subdirectories or even different directory tree and it worked for me. I have also tried include b2evo files with relative and absolute paths without any problem.

9 Feb 09, 2010 04:37

well, what's a sample code of what you've done? maybe i'm missing something that's not odvious. wouldn't be the first time. ^^;

10 Feb 10, 2010 00:04

My test codes are basically changing the HTML components of multiblogs.php here and there, adding function calls to see the result, echoing some variables to see what values returned, comment/uncomment some settings/codes to see what happens etc...

Just copy this file to domain root and change the relative path to where b2evo blogs are. If you can't get multiblogs.php to work I doubt that samples of my test code will be of any help.

Have you check if there are any errors in httpd error log? If you don't have access, turn on with 'ini_set("display_errors",1);' to display any errors on browser. Perhaps you can find some clues to what's wrong?

11 Feb 10, 2010 14:57

Try turning errors and warnings on, chances are you're getting a cookie error ;)

¥

12 Feb 10, 2010 18:11

Ok, finally found how to turn the debugging on, and it wasn't a cookie error. I didn't need the path that I was putting in front of the include file, that was the first problem. Then, when I tried to remove the extra code I didn't need, turns out I accidently removed something important. So I started again, and just removed one piece at a time until I had it looking the way I want. I'm still not entierly sure what I was deleting that I shouldn't have been, but I finally got it to work. Thanks for pointing me in the right direction! ^_^


Form is loading...