Recent Topics

1 Sep 19, 2006 02:25    

How do I change the default category when a blog opens from "ALL" to be a different category? I receive a server error when I try to edit categories, so I apologize if this is evident when editing categories. Thanks for any help.

2 Sep 20, 2006 01:09

I don't really understand your question.

Normally, when a blog opens to a different category (other than "all") there's a title at the top saying "Blah Category" and the sidebar category list still shows up, so you can select ANY category you want.

I'm more interested in your server error when you try to edit categories. That's not very nice. What's it say? (Seems that's the priority now ... getting that to work properly).

A link to your site would be good too. :D

3 Sep 21, 2006 18:47

Here is the error message I get.

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request."

My .htaccess seems good. I do not have access to the server log on my host and support is difficult so, I have not spent much time on this. It is occurring in version 1.6. and I am testing and preparing to upgrade. I do not have this problem with the new version on the same server.

To explain my original question. The people that I have set this up for request that when they go to the blog they do not see the "All" category by default or first. They have a category "Opinions" that they wish to be shown first by default instead of "All". The ability to choose any cat is still on the sidebar. Is this difficult to achieve? I do not have a problem with the current method and am very happy with this app, but am inquiring anyway.

Thanks much for your response.

4 Sep 21, 2006 21:25

Drums,

Thanks for the explanation. I understand the issue better.

Of course, there is no "default" category, per se. The "all" is, basically, category-less, listing ANY (and ALL) categories, in chronological order.

IF you want to limit the starting point to a specific category, you can add the following to your index.php file (or stub file, if you're starting there):


param('cat','integer','##');

where ## == the number of the "Opinions" category.

Not difficult, eh?

I'm still baffled by the internal server error, as this points to some problem with the install. If it's not a problem on the new install, then maybe the problem has healed itself? (v1.6 is not a stable, nor recommended release, now that v1.8 is available).

Hope this helps.

Cheers,

5 Sep 22, 2006 19:57

Helps very much. Now I know where to edit. Thank you. I do not like leaving problems unsolved or having them solve themselves without explanation, however, as I am upgrading to 1.8 ...

6 Sep 22, 2006 20:44

Good!!

I hear you, but then again, why solve an old problem, when there's no new one to replace it!! :D

If you need anything else ... don't hesitate to post.

Cheers,

7 Nov 02, 2006 21:04

Hi - I'm currently stuck with version 0.92, and the

param('cat', 'integer', '##')

doesn't work for me, because param is not recognized. How can I set the 'default' category in 0.92?

Thanks for any help;

Garey Mills

8 Nov 02, 2006 22:52

garey,

The solution is easier, but requires a bit of explanation.

All you need to do to restrict your 0.9.x version of b2evo to a specific category is add

 $cat = ##;

to your index.php (or stub file). Note that ## is the category number, which you can find by mousing over a category link and looking at the url in the status bar on the lower left. The number will show as a URL parameter.

That's the easy part.

The more difficult part is that by doing this (or the "param(cat,integer,#)" for v1.x) ... you're really RESTRICTING the blog to show ONLY that one category. At first, you'll be joyous, thinking ... "Wonderful, my default category came up. I'm golden."

Try changing to another category. :(

You'll soon see that you're default category is the ONLY category you'll EVER see. (Probably not what you want).

To achieve what you want will require a sneaky operation.

You'll need to have two stub files (or a stub and an index.php). One (which resticts your blog to a category) will be the one you link to. (I'd recommend using the index.php file as the restrictor, since it's got the benefit of not needing to be typed in ... people can go to http://yoursite.com and the browser will automatically pull up the index.php file (which restricts your blog to one category).

THEN ... create a stub file (copy a_stub.php and change it so that it does NOT restrict your blog to any particular category). THIS stub file will be the one you use when you define your blog location, in the back-office.

Blogs Tab -> Blog Name -> Access Parameters

>> set "Preferred Access type" to "Other through advanced"
>> set URL/Stub name to "yourStub.php"

What you're essentially doing is a switcharoo ... you call the one (index.php file, which restricts) for all your external links. Then, internally, b2evo uses the other (stub.php, which doesn't restrict) so that all of the other categories can be accessed.

It's a long reply, but hopefully, helpful. ;)

To see it set up in the reverse of what I suggested ... (stub restricts and index doesn't) ... you can go [url=http://randsco.com/blogD/restrictStub.php]Here[/url]. It'll default to Adventures, Cycling, Hiking. Then when you move around inside, it'll quickly revert to "normal".

Cheers,

9 Nov 03, 2006 00:01

garey wrote:

Hi - I'm currently stuck with version 0.92, and the

param('cat', 'integer', '##')

doesn't work for me, because param is not recognized. How can I set the 'default' category in 0.92?

Thanks for any help;

Garey Mills

Nevermind -

My stub file didn't have this line at top

require_once( dirname(__FILE__).'/b2evocore/_main.php' );

Putting it in made everything work.

Thanks for the tip;

Garey Mills

10 Oct 02, 2007 05:46

I used to use this method to display one specific category on first entering a blog by adding a line like this:

# First blog will be displayed the regular way (why bother?)
require(dirname(__FILE__).'/b2evocore/_main.php'); param( 'cat', 'integer', 135 );
$blog = 10; // 2 is for "demo blog A" or your upgraded blog (depends on your install

to my stub files.

However, it no longer works, of course, in Florida.

I have tried changing it to:

......
require(dirname(__FILE__).'/inc/_blog_main.inc.php'); param( 'cat', 'integer', 135 ); ...........
but I'm getting a "can't access that file directly" error.

Any ideas on how I can restrict to a specific category on entry to a blog?

Many thanks in advance.

11 Oct 02, 2007 06:08

Try:

$cat = '135';
$blog = 10;

Good luck

12 Oct 02, 2007 08:20

Thanks for the reply but that didn't work.

Gawd

I've just wasted a day trying to make Florida behave like I used to have my blogs in sparkle working.

All I want to do is list the categories of a blog in order of ID rather than aphabetically (easy change to ORDER_BY cat_ID in sparkle) and to display ONLY the posts of a selected category (a simple catsel command in sparkle) but all this seems lost now.

13 Oct 02, 2007 08:49

Hi obtuse,

You sound tired ;)

cat might work without the quotes. It works *with* the quotes on my 1.10 blog.

try:

orderby cat_ID;


and

catsel[];

See the manual: http://manual.b2evolution.net/Stub_file for the stub files and http://manual.b2evolution.net/URL_Parameters for the contents of the stub files.

These manuals haven't changed from 1.6, so some information will be outdated. Mind this: the functionality of the stub files is not lost, things just got another name.

Good luck


Form is loading...