Recent Topics

1 Aug 28, 2005 21:49    

I have two blogs (espanol and english) and a one of them being the default one(espanol). But I want that each time the visitors click on the espanol link or enter the site, it shows the espanol blog and the category number 22.

So, I want to redirect the site to index.php?blog=5&cat=22.

I´ve reading about stub files, but I don´t know where to place them, the name I have to assign them, and how to make them...
I think I must change the setting in the blog option in the backoffice.

Thanks!

2 Aug 29, 2005 03:07

Yeah, I think you can do this. Check out the [url=http://b2evolution.net/man/2004/06/04/stub_files]manual page for stub files[/url]. As it says, you can create multiple stub files for a single blog. You can make one called index.php where you override the cat variable to force it to display category 22.

Do you have other categories in the spanish blog besides 22? If so, you can make a second stub file that doesn't override the cat variable (so it will show all categories for that blog). Make that one the stub file that you enter in the backoffice. It will be the one that goes in all of the permalinks.

3 Aug 30, 2005 05:21

Do I have to create a folder in the root directory called "espanol" with and sutb file named index.php inside espanol folder?

I can´t understant how the stub files works...

The file stub index.php file in the "espanol" folder is:

<?php
$blog = 5;  
$cat = 22;
require(dirname(__FILE__)."/b2evocore/_blog_main.php");
?>

And the file stub index.php file in the "english" folder is:

<?php
$blog = 6;  
$cat = 24;
require(dirname(__FILE__)."/b2evocore/_blog_main.php");
?>

Is it right?

Thanks!

4 Aug 30, 2005 05:43

Your new stub goes in the "root directory" of your blog - not in a subfolder. If I follow what you want, anyone going to blahblah/index.php should get espanol cat 22. Correct? You make a stub that forces cat 22 and call it index.php in your installation's top level (may not be your actual root, but I think you catch my meaning).

Now ALL visitors using index.php will get the espanol blog with cat 22.

BTW my stub files are much longer than what you showed, but I just copied the samples. Maybe I have a bunch of extra junk in mine?

Hope it helps!

5 Aug 31, 2005 04:28

Thanks, work great!

But one problem: As I said, I have 2 blogs, one called "espanol" and the another one "English".

When I enter the site, with the stub file, I go to the "espanol" blog, and only the category 22 is shown. Ok.

But, when I click in the "English" blog link, it shows me "english" blog, but all categories too. It would be great if it only shows the category 24 when I load english blog. Is it possible?

Thanks

6 Aug 31, 2005 05:41

Are you using a stub file for the English blog, too? Can't you do the same thing as you did for the Espanol blog.

7 Aug 31, 2005 16:04

I think a have to do the same thing as with the espanol blog. But I can´t create two stub files called index.php in the root directory...

How do I work with two stub files?

8 Aug 31, 2005 16:08

Just give it a different name. If the Spanish blog is called withe the stub file called index.php, then the English blog could be called with a stub file named index2.php, or english.php, or whatever you want.

9 Aug 31, 2005 22:09

Ok, but how do I config in the back office that the English blog have to be called from a stub file called, i.e. english.php ??

Thanks!!!!

10 Aug 31, 2005 22:21

Blogs tab > English blog

Preferred access type: Other blog through stub file (Advanced)
URL blog name / Stub name: english.php

12 Sep 01, 2005 03:28

It doesn´t work!!!!!

It´s ok, when I loaded the site, it enters to "espanol" cat=22, but, if in that blog I click on the link to other category, It stuck in cat=22, and I can´t visit other categories!!!

13 Sep 02, 2005 16:42

Does anyone how to solve this?

14 Sep 02, 2005 18:00

You don't want any stub files that force the category set in the admin area. Make stubs that just call the blog and use them for the admin. Then make your stubs that force the category as well. Now to link to them, you'll need to edit yourskinname/_main.php and make manual links.


Form is loading...