1 draxeiro Dec 20, 2007 00:58
3 draxeiro 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 amoun 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 amoun 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 edb 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 edb 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 amoun 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 amoun 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 justincsecs 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 edb 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 justincsecs Apr 17, 2008 08:12
WLW worked before, but now that i set different settings it no longer works
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:
I feel quite confident that if you change it to
you will see the change you seek.