Recent Topics

1 Dec 20, 2007 00:58    

My b2evolution Version: 2.x

Hi there,

I've recently installed b2evolution and am I am very pleased with the easy install and user-friendliness of the script. Also the great people on this forum help out a lot :)

So I am hoping you guys and gals can give me a hand also :)

I am currently trying to set up a number of private blogs.

I've switched off all group permissions except admin and set up user permissions for the bloggers who can read/write on that particular blog.

The posts I've given the status protected.

Also I have added $login_required = true; to index.php

I think this is just about all that needs to be done to set up private blogs.

The end-result is that upon visiting the url where the blogs are located visitors are presented with the login box. So the blogs are not public.

But after logging in the users do not automatically end up on the blog they're members of but rather on the list of blogs or one of the other blogs (providing which was one defined in the admin as the start up blog).

If a user for blog B ends up on blog A no text is displayed. So that's good. But he/she should really end up on the blog he's a member of!

How can I make sure the user does actually end up on the correct blog?

Also one other question: upon writing a blog message a user needs to click on protected before saving the message. How can I make sure this radiobutton is selected by default?

Thanks a lot for your help!

Kind regards,
Arno

2 Dec 21, 2007 17:14

I see two questions here. First is that the user does not get to the proper blog in the back office. Sorry, but I can't help you with that one. It might be easy, but if so it is not something I've figure out or stumbled upon.

Second is easy: you want the default post status to be "protected" instead of "published". Please check out your conf/_admin.php file and groove to line 101 (or thereabouts) and notice this bit:

$default_post_status = 'published';


I feel quite confident that if you change it to

$default_post_status = 'protected';

you will see the change you seek.

3 Dec 21, 2007 18:46

Hi Ed,

Thanks a lot for answering part 2 of my question :)

With regards to the first question: the user doesn't have to get to the back office but to rather to the proper blog itself. He or she can jump to the back office from there after all.

Any idea if that's an option?

If not, my 2nd option would be to just change the page that shows the list of blogs (when you don't set a particular blog as opening blog). If you don't have permission to view a certain blog it will just display the others as blank. It's less beautiful than a redirect but it will suffice.

If I now look at the page that is displayed I see lots of info on b2evo and stuff like that. Which file do I need to edit to change the content?

Thanks!

4 Mar 30, 2008 01:19

Hi draxerio and Ed

I've just done an auto install via my host Version 1.10.2 and will upgrade once I have an understanding of waht I can do an d am happy with it.

On the issue of getting to the Blog of choice after logging in, I was wanting the same for a BBphp but never solved it.

However the idea would be to add a cookie for the user which will record their chosen blog or a choice in the users profile.

I will attempt such in due course, although someone else may do it first.

All the best

5 Mar 30, 2008 03:42

Hi Here's an update on a private blog Version 1.10.2

I have edited [/inc/_main.inc.php]

about line 797 to 803

if( !isset($login_required) )

{

	$login_required = false;

}

to



if( ($_GET['blog'] == 2 || !isset($_GET['blog'])) && !isset($login_required) )

{

	$login_required = false;

}
else{$login_required = true;}

Now initially anyone can get to my deafult blog 2 but on trying to access any other are asked to login first. They are then taken straight to the blog they requested.

6 Mar 30, 2008 04:05

You can accomplish the same thing without a core file hack.

The absolutely easiest way is to mark a post "protected" when posting something you don't want a logged in person who is also a member of the blog to see your post. Next up is to put "$login_required = true;" in your stub file, assuming you use stub files. For some reason it seems people get a bit intimidated by stub files, so a way without stubs would be nice? Therefore the third method would be to put the same in your skin's ... whatever it was called back in 1.* days ... _main.php file with a check to see what blog you're on. Like so:

if( $blog != 2 ) { // 2 for the situation above
$login_required = true;
}

Upgrade now before you get too comfortable with 1.* stuff. Everything is different. Pretty much everything, but yeah more than enough different to make it be like ice cream and something different than ice cream but equally satisfying and even more so.

7 Mar 30, 2008 04:08

By the way another nice trick to work with is using the is_logged_in() function. For example

if( is_logged_in() ) {
// do stuff for logged in people
} else {
// do stuff for regular visitors
}


What this way doesn't do is send people to the login page. So you can actually hide an entire blog from people without giving any hints of why they can't see it.

if( ! is_logged_in() ) {
exit;
}


Or something like that to just dump the non-important-person out without mercy or concern. Or ice cream. They get NO ice cream :>

8 Mar 30, 2008 04:15

Thanks Ed.
1 I'm going to check my code to improve it, its good to learn.
2. Try out your options and
3. Upgrade very soon.

I'm on dialup so having my host automatically install it saved some time.

EDIT

Just fixed my code in the previous post of mine, as I hadn't put the bit in for a URL with no blog no. :oops:

9 Mar 30, 2008 07:32

Ok I have installed 2.4.1 and used the following code at line 365 in [/inc/_main.inc.php] to force a login on one blog:


if( $blog == 2)
 {$login_required = true;}
 else
  {$login_required = false;}

Thanks Ed

10 Apr 17, 2008 06:55

hello, i set the login required to true, and everything seems to be as i was looking for it to be, the only problem i have now is that Live Writer will not post. anyone have any idea why? or maybe other reasons why live writer acts up so much? i am not the main blogger on this blogsite, but the main blogger will only use live writer. she likes the ability to easily change the font in live writer. what do you all think i should do?

thanks in advance

11 Apr 17, 2008 07:15

I think you'll be better off setting the default post status to "protected", but even then I dunno if WLW will be able to be seen as ... well hell yes it will be logged in so it can post with a status of protected which means no one will see posts - just the frame of the blog.

12 Apr 17, 2008 08:12

WLW worked before, but now that i set different settings it no longer works


Form is loading...