Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 03:15 am EST

Geeklog Forums

Detecting GL cookie?


Anonymous

Anonymous
Howdy, I currently use a "splash" screen. Basically I run on IIS and I have index.html set as the default document, clicking this page launches GLs index.php I only want users to see the splash screen once, is it possible to detect a GL cookie when the html page first loads? Thanks..
 Quote

Status: offline

rawdata

Forum User
Full Member
Registered: 02/17/03
Posts: 236
Sure it is, but this requires you to write custom code to be added to your splash page.
 Quote

Anonymous

Anonymous
What the uninformative rawdata meant to say was: Write some javascript to detect if the cookie exists and use that in your index.html. "detect cookies in javascript" on google gave: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var tmpcookie = new Date(); chkcookie = (tmpcookie.getTime() + ''); document.cookie = "chkcookie=" + chkcookie + "; path=/"; if (document.cookie.indexOf(chkcookie,0) < 0) { window.location = 'nocookies.html'; } else { window.location = 'cookies.html'; } //--> </SCRIPT> Hope that helps, Sven
 Quote

Anonymous

Anonymous
It's really nice you know how to use a search engine, but why didn't you provide this person an html compliant script and one he doesn't still need to modify? Better yet, why are giving one that generates a new cookie rather than detecting the geeklog one? Inquiring minds want to know. You're showing your own ignorance there Sven. Try it again.
 Quote

Status: offline

jlhughes

Forum User
Full Member
Registered: 04/25/02
Posts: 154
Rather than a separate splash screen and a complicated cookie trap, try this:

1. Create a new staticpage and take the content of your existing splash screen and paste it into the new staticpage.

2. Name the staticpage frontpage.

3. Set the label for the page to nonews. Leave the left blocks on so that users can sign in. (If you DON'T put nonews as the label, content appropriate to anonymous visitors will be displayed below the staticpage.)

The only modification needed to Geeklog is a simple change in index.php.

Find the line:

Text Formatted Code

if (empty ($topic)) {
 

and replace it with:

Text Formatted Code

if (( empty($topic) ) && (empty($_USER['uid'])) ) {
 

Now when anonymous visitors go to the site all they see is the contents of the frontpage staticpage and whatever blocks you provide for anonymous visitors.

After they log in, the staticpage disappears and they are presented with the site stories appropriate to their user settings.

I use this set up a school where only parents are allowed to see content and anonymous visitors are limited to the splash screen and some generic stuff.

 Quote

Anonymous

Anonymous
This is a really cool idea and I will use, but not for my splash screen solution. I want users to see the splash screen once and no more; not force anonymous users to always see it. Your idea is awesome though and I will put together a "benefits of registering" page! Basically, like somebody mentioned up higher in this thread, I think I need a small bit of code which runs on my splash page (index.html) and checks for the presence of a GL cookie and bypasses if it finds it. If anybody has done this or can lend some advice I would appreciate it. Again, thanks..
 Quote

Status: offline

donm1021

Forum User
Chatty
Registered: 12/31/05
Posts: 56
Quote by jlhughes: Rather than a separate splash screen and a complicated cookie trap, try this:


1. Create a new staticpage and take the content of your existing splash screen and paste it into the new staticpage.


2. Name the staticpage frontpage.


3. Set the label for the page to nonews. Leave the left blocks on so that users can sign in. (If you DON'T put nonews as the label, content appropriate to anonymous visitors will be displayed below the staticpage.)


The only modification needed to Geeklog is a simple change in index.php.


Find the line:

Text Formatted Code
<br />if (empty ($topic)) {<br />


and replace it with:

Text Formatted Code
<br />if (( empty($topic) ) && (empty($_USER['uid'])) ) {<br />


Now when anonymous visitors go to the site all they see is the contents of the frontpage staticpage and whatever blocks you provide for anonymous visitors.


After they log in, the staticpage disappears and they are presented with the site stories appropriate to their user settings.


I use this set up a school where only parents are allowed to see content and anonymous visitors are limited to the splash screen and some generic stuff.



I can't seem to get this to work at all? I have created the static page and changed the index.php... but no matter what I do the static "frontpage" will not display whenever a user comes to the site and has not yet logged in?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Note that this thread is 3 years old ...

The static pages plugin supports splash screens for a while now.

bye, Dirk
 Quote

All times are EST. The time is now 03:15 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