Recent Topics

1 May 04, 2007 20:50    

My b2evolution Version: 1.9.x

hey guys,

i tried looking for this subject throughout the forum with no luck, although i found the embed article helpful.

I still haven't found a way to make the search function on the b2e software search all blogs. I thought all posts went into one database? basically I created different blogs for different subject (so each blog could have a unique URL) and I wanted to be able to cross search between them. Is this possible?

Thanks in advance. ;)
yoskippy.com

2 May 04, 2007 21:13

There is http://forums.b2evolution.net/viewtopic.php?t=10791 that you might want to try, or you can give the oldest dirty trick in the book a shot. See the way it works is that it only searches the blog you're on. Since blog #1 is an aggregator blog being on blog #1 means you're actually on all the blogs. Therefore searching from blog #1 searches across all blogs.

Open your skins/yourskin/_main.php and find the bit that makes the search box:

	<div class="bSideItem">
		<h3 class="sideItemTitle"><?php echo T_('Search') ?></h3>
		<?php form_formstart( $Blog->dget( 'blogurl', 'raw' ), 'search', 'SearchForm' ) ?>
			<p><input type="text" name="s" size="30" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /><br />
			<input type="radio" name="sentence" value="AND" id="sentAND" <?php if( $sentence=='AND' ) echo 'checked="checked" ' ?>/><label for="sentAND"><?php echo T_('All Words') ?></label><br />
			<input type="radio" name="sentence" value="OR" id="sentOR" <?php if( $sentence=='OR' ) echo 'checked="checked" ' ?>/><label for="sentOR"><?php echo T_('Some Word') ?></label><br />
			<input type="radio" name="sentence" value="sentence" id="sentence" <?php if( $sentence=='sentence' ) echo 'checked="checked" ' ?>/><label for="sentence"><?php echo T_('Entire phrase') ?></label></p>
			<input type="submit" name="submit" class="submit" value="<?php echo T_('Search') ?>" />
		</form>
	</div>

Now trick it into always thinking it's on blog #1:

<?php $saved_blog = $blog; // the oldest dirty trick in the book
$blog = 1; // tricking b2evolution is fun ... and easy! ?>
	<div class="bSideItem">
		<h3 class="sideItemTitle"><?php echo T_('Search') ?></h3>
		<?php form_formstart( $Blog->dget( 'blogurl', 'raw' ), 'search', 'SearchForm' ) ?>
			<p><input type="text" name="s" size="30" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /><br />
			<input type="radio" name="sentence" value="AND" id="sentAND" <?php if( $sentence=='AND' ) echo 'checked="checked" ' ?>/><label for="sentAND"><?php echo T_('All Words') ?></label><br />
			<input type="radio" name="sentence" value="OR" id="sentOR" <?php if( $sentence=='OR' ) echo 'checked="checked" ' ?>/><label for="sentOR"><?php echo T_('Some Word') ?></label><br />
			<input type="radio" name="sentence" value="sentence" id="sentence" <?php if( $sentence=='sentence' ) echo 'checked="checked" ' ?>/><label for="sentence"><?php echo T_('Entire phrase') ?></label></p>
			<input type="submit" name="submit" class="submit" value="<?php echo T_('Search') ?>" />
		</form>
	</div>
<?php $blog = $saved_blog; // undoing the dirty trick ?>

Untested, but should work.

3 May 07, 2007 21:02

I tried the hack you gave me (yippiii i know the buzz word!) but it didnt work.

I tried the hack in the link you gave me and it worked out. very nice. thanks alot.

i check out your site, very clean and easy to read (sideboob too!). I have to figure out how to change the look of posts, titles, get rid of time posted (looks too business) and comments.

i also have to find some plugins for e-mail a friend and all that good stuff. see how excited i am!!

thanks again.
cheers
-mike

4 May 08, 2007 01:11

In your installation package you should have seen a skin called "skinners_guide". It is not intended for public display. Rather it's goal is to show you how you can do different things with your skin. Hopefully it will guide you onto the path of customizing your skin far enough that you can begin to do what you want with any skin.

5 Apr 24, 2008 20:27

b2evolution 2.4.1
Hello,
I've been looking for a way to search all blogs, and I can't find a way to implement the above answers into version 2.4.1.

¿Any ideas?

Thanks in advance


Form is loading...