Recent Topics

Additional Link Blogs

Started by on Sep 12, 2004 – Contents updated: Sep 12, 2004

Sep 12, 2004 13:27    

Hi all,

Is there anyone out there who can advise me on how to add a section underneath my LinkBlog that is almost exactly the same as a linkblog, so essentially, two link blogs...

Anyone help? If you need my URL to see what i mean, you can.

Sep 12, 2004 15:47 has an internal and external linkblog. It used to open links in the external linkblog in new windows but I've seen the theoretical visitor-controlling light. Now it's plain-jane links in the same window. I think. I can hardly ever remember which hacks I've got active and which hacks I've bagged. Especially when I hack my hacks.

If that's what you're looking for do a search for external linkblog (all words) and my name. I'm pretty sure I put the hack on the forum somewhere.

Sep 12, 2004 16:20

thats what i'm looking for, but i cant figure it out from those posts...

Basically i am after making a blog to list the paintball kit that i am using, with a link to a picture/manufacturer. In addition to my link blog...

Have a look at

It needs to be dynamic because my kit could change at any time.

Thanks for your help EdB

Sep 12, 2004 17:10

My second linkblog IS dynamic. No matter which linkblog I add a link to I do it via the back office. Modify _main.php, create a new file in skins/skinname and skins folders, create a new blog for the second linkblog.

Another method: add a bloglist section to your _main.php and create a new blog for the paintball kit with another new blog for your paintball kit links. Problem is the clean skin might not have any styling for a bloglist so you will probably have to modify skins/skinname/_bloglist and maybe touch up your css file. MAYBE - I am not sure. Either way it'll require hacking.

Third method: choose a skin with a bloglist feature already in it so you know the styling will match. Then there is no hacking at all: just create a blog for paintball kit stuff and a new linkblog for appropriate related links. Everything for this method will be done via the back office.

Sep 12, 2004 18:00

Okay, i now have two linkblogs... but its the same linkblog twice...

I have two files in my directory _linkblog.php and _kitblog.php

What do i have to do in _kitblog.php to reference the Kitblog blog that i have created through Back Office?


Sep 12, 2004 19:23

Yes, and you will need to create 2 additional files. I just went over what I did and I have hacks upon hacks upon hacks in both my linkblogs. Ignoring the extra stuff, this is what you need to do. First in your /skins/skinname/_main.php file:

<?php require( dirname(__FILE__).'/_linkblog.php' ); // REGULAR LINKBLOG INCLUDED HERE ?>

<?php require( dirname(__FILE__).'/_kitblog.php' ); // EXTRA LINKBLOG INCLUDED HERE ?>

Since you've chosen kitblog.php for your extra I'm using that name, but I put an "_" in front of it just to follow convention. Notice how I'm not calling for a div or identifying the section name? In my skin all that stuff is over in the linkblog file. I just looked at 'clean' and it seems to be the same, but whatever your skin uses as the block of code that makes linkblog is what you want to copy for your kitblog.

Next, in /skins/skinname/ folder you make a copy of the _linkblog.php file and name it _kitblog.php. I see where I have a mod that tells it "even though you already set a parameter I want you to change it now". The file normally says

	# global linkblog delimiters:
	if(!isset($linkblog_main_start)) $linkblog_main_start = '<div class="bSide.......blah......blah.......

but I changed BOTH linkblog and linkblog2 (kitblog for you) to say like this:

	# global linkblog delimiters:
	$linkblog_main_start = '<div class="bSide.......blah......blah.......

Third, and finally, you do the same copy & rename of the file in your /skins/ folder. This file needs to be modified so that it knows to use your extra blog, otherwise it will use the linkblog you set up in your back office.

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

	$linkblog = 4;

	if( !isset( $linkblog ) )
	{	// No link blog explicitely specified, we use default:
		$linkblog = $Blog->get('links_blog_ID');

Note one extra line stating that linkblog is #4. My setup is to use blog#2 as default, blog#3 as linkblog, and blog#4 as the extra linkblog. Oh you might want to also do the part about changing from "if(!isset)" to the direct "variable = value" in the skins level but I don't think it's critical. Good luck with it! It's not all that bad of a hack, and I see where the thread I have this in elsewhere is sort of convuluted. This version works and gives you a normal linkblog, meaning you get the contents of the linkblog post displayed on your sidebar. That's one of my hacks - no text on the sidebar but if there is text in the post then I get the permalink icon. The other hack I did was to use some of the text as my mouse-over.

Time to go flying! Life is good when you can run off a mountain and fall up.

Sep 12, 2004 19:47

Got it working...

Thanks matey!

Mar 09, 2005 10:48

personman wrote:

... I just changed the $linkbloglimit in one from 20 to 4 and it applied to both of them ...

That's the "if(!isset....." thing that starts the lines that define the 'decorator' variables. Since they get set by the first linkblog the second one ends up using the values from the first. What I ended up doing was removing those bits from each _linkblog file so that the second one can give new values.

Mar 09, 2005 14:58

That did it. Thanks, EdB!

Form is loading...

b2evolution CCMS – This forum is powered by b2evolution CMS, a complete engine for your website.