Recent Topics

1 Jul 08, 2009 14:04    

My b2evolution Version: Not Entered

b2evolution 1.10.2
I have a blog setup for managers of a football team to add their own stuff.
Each year the under 7's change to the under 8's and their managers go up with them so I simply rename each blog and under 16's fall of the edge and start as under 7's again.
This is quick to do but the blogs tabs are get out of order.

How can I change the order of the blogs so that they are back in sequencial order? Please see my blog and it may become clearer ie u13s needs to move it's postion between u12s and u14s.

http://www.borrasparkalbion.co.uk/blogs/index.php?blog=2

Thanks for your help

Al

3 Jul 08, 2009 15:45

Thanks for the quick reply.
Is there a method you know of that would allow me to do this in V1.10.2 even if it is editing a file with a text editor

I don't want to update to version 2.4 as I am happy with the version I am using and I don't want to run the risk of cocking up a fresh install.

Cheers
Al

4 Jul 08, 2009 16:59

oh.. i dont think there's a quick way to do it in 1.x .. and i believe you should upgrade to 2.x sometime already.. give it a shot, it wouldnt hurt, when you have proper backups

5 Jul 09, 2009 07:59

I did it recently to a 2.4.6 installation by playing with the database directly. A very direct method eh? I forget the tables in 1.10.3 so you would have to figure that out on your own, but it isn't so hard. Obviously evo_blogs is the one that associates a blog to a name (and tagline and long description and so on). So you would need to update that table. The next groovy thing is updating the categories so they know what blog they are associated with. The cool thing is that posts go in categories, so once you update the evo_categories table all the posts will move along with the cats. Oh and probably evo_blogusers as well. I think that one existed way back then.

BACK UP YOUR DATABASE BEFORE YOU DO ANYTHING!!!

Lets see... Obviously you have to make sure the new number isn't in use, but in general you will move blog numbers DOWN. So let's say you have blog #1 and then 12 through 86. You would want to renumber 12 to 2, then all the categories and blogusers that are associated with 12 would have to be associated with 2. Make sense? The bits of the code that work in 246 and are probably a good starting point for trying this in 1103 is this:

UPDATE `evo_blogs` SET `blog_ID` = 8 WHERE `blog_ID` = 10;
UPDATE `evo_blogusers` SET `bloguser_blog_ID` = 8 WHERE `bloguser_blog_ID` = 10;
UPDATE `evo_categories` SET `cat_blog_ID` = 8 WHERE `cat_blog_ID` = 10;
UPDATE `evo_hitlog` SET `hit_blog_ID` = 8 WHERE `hit_blog_ID` = 10;


I see now in the code I used that I also updated the hitlog table. You would want to do that just to keep the stats reasonably accurate. Also you should peruse the database table names and ask yourself if any of them seem like they are really related to blogs somehow. evo_categories and evo_hitlog don't sound like they would be related but they are. evo_blogusers kinda obvious. But as I mentioned I've totally forgotten what it was like in a 1.10.3 installation.

Yeah backup first, and don't try this if you're not comfortable with directly manipulating the living breathing snot out of your database. Else horrible things will happen. Zombies and stuff.

6 May 13, 2010 03:26

Here is some more complete code:
The DELETE line must be in there as the original code will leave this as an orphan.

UPDATE `evo_blogs` SET `blog_ID`                     = 1 WHERE `blog_ID`          = 8; 
UPDATE `evo_blogusers` SET `bloguser_blog_ID`        = 1 WHERE `bloguser_blog_ID` = 8; 
UPDATE `evo_categories` SET `cat_blog_ID`            = 1 WHERE `cat_blog_ID`      = 8; 
UPDATE `evo_hitlog` SET `hit_blog_ID`                = 1 WHERE `hit_blog_ID`      = 8;
DELETE FROM `evo_coll_settings` WHERE `cset_coll_ID` = 1;
UPDATE `evo_coll_settings` SET `cset_coll_ID`        = 1 WHERE `cset_coll_ID`     = 8; 
UPDATE `evo_widget` SET `wi_coll_ID`                 = 1 WHERE `wi_coll_ID`       = 8;


Form is loading...