Recent Topics

1 Jun 30, 2006 09:23    

Hey guys i'm extremely new to how a blog works and php, and i don't really know how to search what i'm looking for.

I'm looking for a way to display a summary(title &thumbnail) of the last post from each catagory in a sidebar on the main page of my site (seperate from my blog page but still the same site.)

Anyone know how i need to search for this?

Or better yet how to do it?

I'm using v1.6

Thanks

2 Jul 01, 2006 19:22

Should i post this under "Hacks & Plugins" ????

3 Jul 01, 2006 20:35

In general it'd be a lot easier to have b2evolution make your main page even if nothing from the blog goes there. This is because in order to get content out of the blog portion you'll need to initialize the blog, so if you're going to do that you might as well let it do it's thing.

You can, in your blog settings, say that the default blog is blog #2, then make your index.php file be bits and pieces of the blog (sidebar stuff eh?) but the actual content could be your existing main page.

As to making only one post from each category show up: that'd be a hack that I don't think has been done but shouldn't be too hard. Depending on the version you go with of course. 0.9.2 is a lot easier to get hackage for because it's been out for a while and lots of people know how to hack it very well. The thumbnail thing is something that b2evo doesn't do, but - again with some hackage - it can be done. You would have to make the thumbnails, but then getting those integrated with your post titles won't be hard.

Check out http://wonderwinds.com/rackblog.php a bit. What looks like categories is really "the blog used as a linkblog". The thumbnails beneath the most recent post used to be in the sidebar but it makes the sidebar way too long so I moved them to the main content area. The way I wrote the code is that the image name has to be "post_title.jpg" and the thumbnail name has to be "post_title_small.jpg". The post title is, of course, "Post Title".

Point is lots of stuff can be done but it's much easier to start with b2evolution building all the pages you want b2evolution stuff on. Got link where we can see what you've got and what you want to incorporate into it?

4 Jul 02, 2006 22:17

yeah the site is http://www.ajourneyforyouth.com

It's our church youth site. on the home page, in the side bar on the right, is kind of what i'm wanting to do. the bac actually says "photo albums but that's just what i threw up there.

so how do i make b2 build another page and link to the stuff from the other?

5 Jul 03, 2006 00:50

Here's the short version - all I have time for today because I gotta go to work. Make your skin's _main.php do like this:

<?php

if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );

?>
<!DOCTYPE html blah blah blah>

(leave all this stuff alone)

</head>
<body>
<div id="wrapper">

<?php 
	/**
	 * --------------------------- BLOG LIST INCLUDED HERE -----------------------------
	 */
	require( dirname(__FILE__).'/_bloglist.php' );
	// ----------------------------- END OF BLOG LIST ---------------------------- ?>

<div class="pageHeader">

<h1 id="pageTitle"><?php $Blog->disp( 'name', 'htmlbody' ) ?></h1>

<div class="pageSubTitle"><?php $Blog->disp( 'tagline', 'htmlbody' ) ?></div>

</div>

<div class="bPosts">

<!-- ======== START OF MAIN AREA ========== -->

<?php // ----------------- START OF POSTS ------------------- ?>

(In here is where you would put the html that makes your static main page content)

</div>
<!-- ======= START OF SIDEBAR ======= -->

(In here is where you put the sidebar stuff you want on the static main page sidebar)
	

</div>
<div id="pageFooter">

(assuming you have a footer section....)

</div>
	
<?php
	log_hit();	// log the hit on this page
	debug_info(); // output debug info if requested
?>
</div>
</div>
</body>
</html>


That way your main page isn't really written by b2evolution but all the sidebar stuff is. After that b2evolution does all the linking. The skin would only be used for the blog that you tell your settings tab is the "default blog on index.php"

6 Jul 03, 2006 20:59

Thanks man i'll try to play with this as soon as i get off work today.

I appreciate you taking the time

7 Jul 04, 2006 03:46

ok i'm lost, sorry javascript:emoticon(':oops:')

I understand the concept of using b2evolution to make the page for me and basically side shrinking it and leaving the rest of the page open for me.

What i don't get is:

1. How do i have two differnet blogs that carry the same posts

2. How do i set #1 up in b2evolution?

8 Jul 04, 2006 16:51

CArringt wrote:

1. How do i have two differnet blogs that carry the same posts

Are you asking how to do this or why this happens? If you want to make it happen you'll have to enable "cross posting across multiple blogs". If you're asking "why does everything show up in blog #1" it's because blog #1 is an aggregator blog meaning every post in every blog (that is visible to the viewer in it's specific blog) shows up in blog #1. Some people find that annoying so to them we say "use blog 2 as your blog and blog 3 as your linkblog".

CArringt wrote:

2. How do i set #1 up in b2evolution?

There really isn't much special about setting up blog #1 other than understanding that all posts from all blogs show up there. If that's an irritant to you then you have to not use blog #1 as your primary blog.

Hope it helps, and if not ask away!

9 Jul 25, 2006 21:42

ok lol here they come.
Sorry i'm just noww getting around to this but i've been out of town

I created a new blog by logging in and selecting "create new"

1. How do i get my site to automatically direct the person to the "new blog" as the home page (www.blahblah.com)

As i was doing this i noticed it create a link blog on the right side of the page that contained all the articles from my original blog. This is what i want...Sort of... The link blog that it created contain the entire post up to a jump. i just want it to display the title and discription and maybe a thumbnail.

10 Jul 26, 2006 01:47

CArringt wrote:

1. How do i get my site to automatically direct the person to the "new blog" as the home page (www.blahblah.com)

For that you go to your settings tab and use the drop-down box to make "new blog" be your initial blog on index.php. Sorry but I don't have my blog open right now so I can't say exactly what the text is for the field you need. It should be obvious though, and I'm pretty certain it's on your settings tab. App settings tab in the latest (1.8) release.

CArringt wrote:

As i was doing this i noticed it create a link blog on the right side of the page that contained all the articles from my original blog. This is what i want...Sort of... The link blog that it created contain the entire post up to a jump. i just want it to display the title and discription and maybe a thumbnail.

Each blog can have it's own linkblog, including using itself as it's linkblog. Or any other blog. You set that up on your blogs tab then pick a blog then use the dropdown box for which will be your linkblog.

To make a linkblog show ONLY the title you have to edit either skins/skinname/_linkblog.php or skins/_linkblog.php and find this:

	while( $Item = $LinkblogList->get_item() )
	{
		echo $linkblog_item_before;
		$Item->title();
		echo ' ';
		$Item->content( 1, 0, T_('more'), '[', ']' );	// Description + more link
		echo ' ';
		$Item->permanent_link( '#icon#' );
		echo $linkblog_item_after;
	}


Now make it be this:

	while( $Item = $LinkblogList->get_item() )
	{
		echo $linkblog_item_before;
		$Item->title();
		echo ' ';
		// $Item->permanent_link( '#icon#' ); // uncomment this line to get a permalink to the linkblog post.
		echo $linkblog_item_after;
	}


To get a description is sort of odd, or hard. Linkblogs link to posts, and posts don't have a 'description'. They have post content. What you *could* do is use the MORE and NO TEASER bits when you post. Put your 'description' before MORE and NO TEASER and ignore the above edit. Then the first bit (description) will show up on the linkblog, but only the stuff after NO TEASER will show up on the permalink page.

An icon in there I can't help you with right now. Too many irons in the fire again, and the one that matters the most to me is the redhead I'm seeing tomorrow ;)

11 Jul 27, 2006 17:32

EdB wrote:

CArringt wrote:

1. How do i get my site to automatically direct the person to the "new blog" as the home page (www.blahblah.com)

For that you go to your settings tab and use the drop-down box to make "new blog" be your initial blog on index.php. Sorry but I don't have my blog open right now so I can't say exactly what the text is for the field you need. It should be obvious though, and I'm pretty certain it's on your settings tab. App settings tab in the latest (1.8) release.

I get how to make it my first blog, but how do i make it my initial page that the website directs to.

12 Jul 27, 2006 18:27

Okay that's not so hard. Everything in your "blog_page" folder needs to move UP one level to your root directory, then you change your $baseurl value in your conf/_config.php file. Or conf/_basic_config.php file for version 1.8. You would also have to change the navigation bar you currently have on your web.

13 Aug 04, 2006 00:27

Is it possible to write my homepage as a php document and then add a function to it like this

<?php
		// -------------------------- LINKBLOG INCLUDED HERE -----------------------------
		require( dirname(__FILE__).'blog_page/skins/nifty_corners/_linkblog.php' );
		// -------------------------------- END OF LINKBLOG ----------------------------------
	?>

and have it refer back to the _linkblog file?

I'm sorry if this seems like a no brainer or stupid question

14 Aug 04, 2006 05:06

Ok I think i cheated on this big time but I got it working.

    I copied the entier blog folder to another folder, that I named "home_page_blog" Then I made sure I had my blog settings right. I only have one blog so i told it to link blog to it's self I then created a index.php file and set it in my base folder on my server (public_html) and deleted the current index page (index.html) I changed the code around on index.php to look like this
    <?php
    /**
     * This is the main public interface file!
     *
     * This file is NOT mandatory. You can delete it if you want.
     * You can also replace the contents of this file with contents similar to the contents
     * of a_stub.php, a_noskin.php, multiblogs.php, etc.
     *
     * b2evolution - {@link http://b2evolution.net/}
     * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
     * @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
     *
     * {@internal Note: we need at least one file in the main package}}
     *
     * @package main
     */
    
    /**
     * First thing: Do the minimal initializations required for b2evo:
     */
    require_once dirname(__FILE__).'/home_page_blog/conf/_config.php';
    
    require_once $inc_path.'_main.inc.php';
    
    // Check if a specific blog has been requested in the URL:
    param( 'blog', 'integer', '', true );
    
    if( empty($blog) )
    { // No blog requested by URL param, let's try to match something in the URL
    	$Debuglog->add( 'No blog param received, checking extra path...', 'detectblog' );
    
    	if( preg_match( '#^(.+?)index.php/([^/]+)#', $ReqHost.$ReqPath, $matches ) )
    	{ // We have an URL blog name:
    		$Debuglog->add( 'Found a potential URL blog name: '.$matches[2], 'detectblog' );
    		if( (($Blog = & $BlogCache->get_by_urlname( $matches[2], false )) !== false) )
    		{ // We found a matching blog:
    			$blog = $Blog->ID;
    		}
    	}
    
    	if( empty($blog) )
    	{ // No blog identified by URL name, let's try to match the absolute URL
    		if( preg_match( '#^(.+?)index.php#', $ReqHost.$ReqPath, $matches ) )
    		{ // Remove what's not part of the absolute URL
    			$ReqAbsUrl = $matches[1];
    		}
    		else
    		{
    			$ReqAbsUrl = $ReqHost.$ReqPath;
    		}
    		$Debuglog->add( 'Looking up absolute url : '.$ReqAbsUrl, 'detectblog' );
    
    		if( (($Blog = & $BlogCache->get_by_url( $ReqAbsUrl, false )) !== false) )
    		{ // We found a matching blog:
    			$blog = $Blog->ID;
    			$Debuglog->add( 'Found matching blog: '.$blog, 'detectblog' );
    		}
    	}
    
    	if( empty($blog) )
    	{ // Still no blog requested, use default
    		$blog = $Settings->get('default_blog_ID');
    		$Debuglog->add( 'Using default blog '.$blog, 'detectblog' );
    	}
    
    	if( empty($blog) )
    	{ // No specific blog to be displayed:
    		// we are going to display the default page:
    		require dirname(__FILE__).'/home_page_blog/default.php';
    		exit();
    	}
    }
    
    // A blog has been requested... Let's set a few default params:
    
    # You could *force* a specific skin here with this setting:
    # $skin = 'basic';
    
    # This setting retricts posts to those published, thus hiding drafts.
    # You should not have to change this.
    $show_statuses = array();
    
    # You could *force* a specific link blog here with this setting: (otherwise, default will be used)
    # $linkblog = 4;
    
    # This is the list of categories to restrict the linkblog to (cats will be displayed recursively)
    # Example: $linkblog_cat = '4,6,7';
    $linkblog_cat = '';
    
    # This is the array if categories to restrict the linkblog to (non recursive)
    # Example: $linkblog_catsel = array( 4, 6, 7 );
    $linkblog_catsel = 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! :)
    require $inc_path.'_blog_main.inc.php';
    
    ?>
    This is the code for index.php found in your blog folder. Then I edited the _main.php file of my skin (in my setup it was in /home_page_blog/skins/nifty_corners/ I had to do a little work between this file and _linkblog to get the look I wanted but you can see the final here http://www.ajourneyforyouth.com/[/list:u]


Form is loading...