Recent Topics

1 Oct 01, 2006 05:33    

Hello gentlemen.
I've come across a road block in what essentially maybe the last step in finalizing my site... (summerlong project :D) Basically, the seperate tabs which link to the seperate blogs are listed by the dates of which they were created, as opposed to an easily identifiable alphabetical order. Such is what I'm looking for a solution to!

I'm using B2evo 1.8.2. I have come across 'solutions' to such a problem on these forums, only to discover these solutions were for earlier versions. So a little help on your behalf would be excellent and greatly appreciated! Attached is the 'blog tabs' that I'm speaking about. Y'know, just in case I worded it wrongly, you would be able to see what I was talking about! :D

Much thanks in advanced.

______
www.UpHayes.org

2 Oct 01, 2006 15:43

I don't know how to do it for the back office, but the publicly displayed bloglist is a pretty easy hack. BTW this is not a 'stock' feature of b2evolution. You get blog number order, which also happens to be the date of blog creation order.

Lemme know if alphabetizing it for the visitors is worth pasting in here.

4 Oct 02, 2006 01:46

I don't know - it just happens that way. There is no built in method to make it be one way or another, so you'd have to hack something to change it. Your screen shot shows the back office tabs - correct? I have no idea how to alphabetize that, but I did recently alphabetize the public side. If that's also something you want let me know and I'll dig up the hack.

5 Oct 02, 2006 01:51

I just thought of something. Seeing the number of each blog is easy - click on your blog settings tab and it will list blogs in numerical order including the number for each blog. Finding where in the code it makes up the list for the back office is the part I don't know about.

6 Oct 02, 2006 04:44

That isn't the backoffice, actually. It's what displays on the main pages. That's my concern, alphabetically organizing it for the public view. You can see it firsthand on my site. The link is right below.
______
www.UpHayes.org

7 Oct 02, 2006 05:15

Ah. I see. It looks so much like the back office ones I thought that's what it was. So the hack for this is very simple but I'll explain a bit before I go into it. It's always best to do hacks in your skin because you'll probably be able to keep your skin intact as you upgrade your b2evolution installation. Hacks anywhere else tend to maybe not carry forward. This hack CAN happen in the your_installation/skins folder, but I moved it to the your_installation/skins/my_skin by moving the contents of skins/_bloglist.php to skins/my_skin/_bloglist.php. If you check the _bloglist.php file in most skins it has a few 'decorator' values then calls skins/_bloglist.php to do all the mechanics of making a bloglist.

Anyway that's what I did: copied skins/_bloglist.php to skins/my_skin/_bloglist.php then made the following edit. Find, towards the end of the full version of that file name, something that looks like this - then make it be like this:

	$blog_link .= $blog_item_end;
	$blog_links[] = $blog_link;
	}

sort($blog_links); // new line
reset($blog_links); // new line

// Output:
echo $blog_list_start;

I then went one step further. I wanted my "home" link to be listed first, but alphabetically that wasn't the case. I viewed my source code and took the bit for that link and added it with a conditional statement to the same area you add the stuff above. Like this:

// Output:
echo $blog_list_start;
if( $blog == 1 ) { ?>
	<a href="http://mydomain.tld/index.php" class="BlogButtonCurr" title="Home Page">Home</a> &bull; 
	<?php } else { ?>
	<a href="http://mydomain.tld/index.php" class="BlogButton" title="Home Page">Home</a> &bull; 
	<?php }
echo implode( $blog_list_separator, $blog_links );
echo $blog_list_end;


The only trick there is calling the proper class if the visitor is on the home page or not.

Hope it helps!

8 Oct 02, 2006 23:04

No sir, that did me no good. I'm starting to worry now.. :-/

I've attached my copies of the original _bloglist of both the /skins and /skins/skinname directories in case that may aid our search for the solution.

I appreciate your help :)

______
www.UpHayes.org

9 Oct 03, 2006 05:13

Hey, thanks for the help thus far, EdB. I've decided to go the surefire route and just manually alphabetize the blogs. :)

Thanks again!


Form is loading...