Welcome to Geeklog, Anonymous Thursday, July 25 2024 @ 02:27 am EDT

Geeklog Forums

Intro & Body Story Access


Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
Is it possible to allow anonymous users to view the story information on the site but when they click on "read more" link to the body of the story, require anonymous users to create an account?

If this question has already been asked, I apologize but I couldn't find it anywhere.

Thanks,

Lee
 Quote

Status: offline

THEMike

Forum User
Moderator
Registered: 07/25/03
Posts: 141
Location:Sheffield, UK
Without hacking the code, no I don't think so.

However, I think it's a very easy hack to make:

Text Formatted Code

// Main
if (!SEC_inGroup('Logged-in Users')
{
    COM_Refresh($_CONF['site_url'] . '/staticpages/index.php/signuptoreadblurb');
}

 


That should work.
 Quote

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
Mike,
Thanks for your response, which file would this go into?


Lee
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
In article.php, after the include for lib-common.php, I would think (untested ...).

bye, Dirk
 Quote

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
No it doesn't go there I get the following:


Parse error: parse error in C:geeklog-1.3.11rc1public_htmlarticle.php on line 49


Lee
 Quote

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
It goes under //Main in the article.php. Seems to be working!
Big Celebration

Thanks,

Lee
 Quote

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
Spoke too soon, I'm getting that parse error as mentioned previously.


Lee
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The parse error is because of a missing ')' in Mike's code. It's also missing something else. Try this:
Text Formatted Code
if (!SEC_inGroup('Logged-in Users'))
{
    echo COM_Refresh($_CONF['site_url'] . '/staticpages/index.php/signuptoreadblurb');
    exit;
}
 

Right after the require_once ('lib-common.php'); Works for me ...

bye, Dirk
 Quote

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
Now I'm getting a window "Page Cannot Be Found" so I guess it's calling the page but what it's looking for is not in the appropriate place. Is there another name or location for that user login page?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yeah, it's trying to call up a static page where you could explain to people that they have to log in first, etc.

Why not simply create such a page?

bye, Dirk
 Quote

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
You're absolutely right on with the static page and I will ultimately use your suggestioin but in trying to understand how it works I annotated it to refer to the following..."users.php?mode=new" and it works and displays a page
which is pretty close to what I want.
I'd like to know where is the verbage for this page referenced...if I wanted to modify, text or graphics?

Thanks

Lee
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
Embarassed Thanks
 Quote

Status: offline

Flernk

Forum User
Chatty
Registered: 07/31/03
Posts: 46
I love this hack, it is so helpful. I was wondering if it's possible to expand on it.

The site I'm building is subscription based with two levels of access, "Basic" and "Advanced". Is there away to restrict Anonymous users to intro text only, Basic Users to a specific set of stories (perhaps from the "Basic" group), and give Advanced Users the right to see everything?
 Quote

All times are EDT. The time is now 02:27 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content