Recent Topics

1 Feb 10, 2007 20:22    

My b2evolution Version:1.9.2

I have one public blog and one private blog. When I'm logged in as me (the admin), is the search box in the right column supposed to search all blogs, or just the one that I'm currently viewing?

2 Feb 13, 2007 02:54

Just the one you're currently viewing.

3 Feb 13, 2007 02:59

Thanks. Is there a way to get the search box to search all blogs that the user has access to, either as a logged in user or a non-logged in user - whichever the case may be?

4 Feb 13, 2007 04:38

There's not an easy way to do that, but it is possible. You'll have to edit a core file, which is not really recommended since you can break things and your changes will be lost next time you upgrade and so on. But if you really want to, you can open up _blog_main.inc.php and find this part:

	$MainList = & new ItemList(
		$blog, $show_statuses, $p, $m, $w, $cat, $catsel, $author, $order,
		$orderby, $posts, $paged, $poststart, $postend, $s, $sentence, $exact,
		$preview, $unit, $timestamp_min, $timestamp_max, $title, $dstart );

replace it with this:

	$ilblog = (empty($s)) ? $blog : 1;
	$MainList = & new ItemList(
		$ilblog, $show_statuses, $p, $m, $w, $cat, $catsel, $author, $order,
		$orderby, $posts, $paged, $poststart, $postend, $s, $sentence, $exact,
		$preview, $unit, $timestamp_min, $timestamp_max, $title, $dstart );

I tried it out and it seems to work fine. Your title and sidebars will still think you're on the normal blog, but the search results will include posts from all blogs.

5 Feb 13, 2007 05:08

Thanks!

I'm hesitant to hack a core file, for the reasons you mentioned. Is there any possibility of getting a mainline b2evolution change to add a BackOffice option for each blog that indicates whether the search bar for the given blog is to search the blog or all accessible blogs? I would like to set up my site so that my home page is blog 1, and other blogs correspond to different areas or articles within the site. In this kind of setup one definitely wants at least some searches to search the entire site (all blogs). I've seen other people in these forums ask how to set up their site similarly - probably making searches configurable in this way would be of general interest. What do you think?

6 Feb 13, 2007 05:12

You can post your feature request here: [url=http://forums.b2evolution.net//viewforum.php?f=8]Feature Requests[/url]

Also, just so you know. If you search from blog 1 (the Blog All) the results will include all blogs. My hack is just a way to trick the software into thinking you're on blog 1 even when you're not.

7 Feb 13, 2007 05:48

Oh yeah. I asked about it there. Thanks.

8 Feb 13, 2007 18:28

I forgot to answer your concern about private posts. Users will still only see posts that they have permission to view.


Form is loading...