Posted on: 10/31/02 12:17am
By: jlhughes
I have a site that requires that you sign in before you can access any features. I have created a staticpages frontpage nonews article.
The problem is that I didn't want this to be what people see after they sign in. Once signed in, I wanted people to see the regular collection of stories.
I found a very simple hack of the staticpages hack in index.php.
Find the line that says:
if (( empty($topic) ) )
and change it to:
if (( empty($topic) ) && (empty($_USER['uid'])) )
Now the staticpages hack tests for both no topic and no userid (an anonymous visitor).
staticpages frontpage for only anonymous users
Posted on: 01/08/03 12:51pm
By: muskrat
Thanks, that's just what I want to do. Problem is, the line you indicated to look for does not appear in the index.php that I have for staticpages. Version problem maybe?
The version I have has this at the top (for version checking purposes)
// $Id: index.php,v 1.3 2002/04/23 04:22:03 mlimburg Exp $
I'm not clever enough w/PHP to find the corresponding place and change it...
staticpages frontpage for only anonymous users
Posted on: 01/12/03 04:42am
By: Anonymous (Anonymous)
there are a few lines that say
if (( empty($topic) ) ), but none of them are an exact match. is there an approximate line #? or...?
more questions still to come.
staticpages frontpage for only anonymous users
Posted on: 01/12/03 08:44am
By: odDonnellE
if one follows these steps, what will the registered users see?----me
staticpages frontpage for only anonymous users
Posted on: 03/13/03 08:21am
By: schmaxelander
Right now version 1.38 is actual. As in Id: index.php,v 1.38 2002/12/01 10:12:18 dhaun Exp
You should find the first line with something like if (empty ($topic))
and edit there.
Nevertheless I have another solution posted in another comment.
~ Alex
staticpages frontpage for only anonymous users
Posted on: 03/13/03 08:23am
By: schmaxelander
You should find the first line saying something like if (empty ($topic))
and edit there.
Should be around line 76 or so.
Nevertheless I posted another solution in another comment.
~ Alex
staticpages frontpage for only anonymous users
Posted on: 03/13/03 08:25am
By: schmaxelander
The loggid in user might see nothing...
I posted a solution for this in another comment.
~ Alex
Addon: Staticpages frontpage for anonymous OR logged in users
Posted on: 03/13/03 08:38am
By: schmaxelander
Got a solution for the problem of either showing the static page to anonymous users or not showing a page to loggid in users.
You could do something like this:
// Get the title of the static page to use
if (empty ($topic)) {
// Anonymous user get a special frontpage
if ( empty($_USER['uid']) ) {
$staticpage_title = 'anonymous_frontpage';
} else {
$staticpage_title = 'frontpage';
}
}
Then the system choses the normal static page named 'frontpage' and shows it to every logged in user - or it choses 'anonymous_frontpage' and shows it to anonymous users.
So you can have a static page 'anonymous_frontpage' with content for anonymous users and a page 'frontpage' for logged in users.
Haven't yet found a way to do both but I think this solution might be better than nothing.
BTW this also works with the hack by
James Fryer where you can add a static page to every topic.
~ Alex