Member only – can’t configure it properly

Started by Macwitty, March 02, 2008, 06:24:12 AM

Previous topic - Next topic

Macwitty

This is my first php forum to set up so I feel a bit stupid. I hope you will be patient with these questions as I think they have been answered before but I can't find it. Have spent some hours by searching and reading in this forum. Learned a lot! but have still problem.

First and maybe most important the forum is up and the installation went along without any problem. (Much easier than a cgi forum I set up before)
I'm using 1.14 and SMF Default Theme - Core

This should be a forum only for members who are pre registered by the administrator. No guest is allowed what so ever

I started with untick "Allow guest to brows the forum" in Feature and Options, admin panel

OK but it looked a bit silly with
1. "Welcome Guest. Please login or register" up left
2. a button with "Register"
3. a big box Warning and "Only registered members are allowed to access this section. Please login below or register an account with The lounge.
4. News was displayed for guests
When no one will be allowed to register and guest should not be able to read the news

I then took a big breath and went to edit the files in Themes/default /language
index.english.php - I could take away the text in # 1 above but the log in boxes was still there
Login.english.php - I could make a nice text for a log in

Remain problem how to take away
boxes in #1 up left
The button with "Register"
How to hide the news

Of course I didn't give up - instead I started to read about another way - using ssi. If I understood it right I could instead have a separate "first" page with login. That sounds maybe better. But here I'm totally stack and think I make something basically wrong - but this is what I tried

1. Upload "ssi_examples.shtml" at the same level as the forum folder (named eforum)
2. Made a document "test.shtml" with the following code
<?php require("/path/to/eforum/SSI.php"); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>

<body>
<hr />
<h3>Login Function: &lt;!--#include virtual=&quot;./SSI.php?ssi_function=login&quot; --&gt;</h3>
<!--#include virtual="./SSI.php?ssi_function=login" -->
<hr />
</body>

</html>


3. Tried to enter http://www.mydomain.com/test.shtml but get
Login Function: <!--#include virtual="./SSI.php?ssi_function=login" -->
[an error occurred while processing this directive]

Then I noticed that "ssi_examples.shtml" and "ssi_examples.php" was included in the forum packed and already in my forum folder

Removed the one I hade sent up - same result
Tried with moving "test.shtml" into the forum folder - went to http://www.mydomain.com/eforum/test.shtml - same result

Sorry for a long message but I wanted to make clear what I have done to let you know where I am.


It's never too late to give up
and I'm not in a hurry

greyknight17

Try this instead for the main page to login:

Quote<?php
include('/pathTo/SSI.php');
if ($context['user']['is_guest'])
   {
      ssi_welcome();
      ssi_login();
   }
else
   {
      ssi_welcome();
      ssi_logout();
   }
?>

If you still want to do those 4 edits you mentioned above, let us know.

Macwitty

Witch one is "the main page to login" ?
I use SMF Default Theme - Core

Tried to replace everything with this few lines in

Login.template.php in default
Got a blank page when I tried to enter the forum
(Restored it with a saved copy and forum worked fine)

In default/language I tried the same with
Login.english.php

and got hte same result - a blank page

I think I maybe editing a wrong page ;)



It's never too late to give up
and I'm not in a hurry

greyknight17

Do not edit any of the SMF files for this. You said you wanted to try giving that "first page" with the login a try. So create a test page like test.php and copy/paste the code I gave you above (change the path to SSI.php accordingly though). It should bring you to a page asking you to login if you are not logged in already.

Macwitty

Sorry, I think I have been doing to many things today

Still, dont get it right - only get blank page when I enter http://www.mydomain.com/test.php

I might do something wrong when I change the path

I have the login page "test.php" in the root

At he same level i have the folder "eforum" with everything for the forum
In this folder is "SSI.php" and "ssi_examples.shtml" and "ssi_examples.php"

When I tried to change the path I did it in line 2
include('/pathTo/SSI.php');
to
include('/pathTo/eforum/SSI.php');

(also by chanse tried include('/eforum/SSI.php'); but as expected no page)

Direct url to SSI.php is
http://www.mydomain.com/eforum/SSI.php
(there I get the message: Please don't access SSI.php by URL directly; you may want to use the path ('SSI.php') or add ?ssi_function=something.

If it possible to say if my changing of path is correct?

If so maybe I have changed to many pages today and make some mistake why the whole forum is corrupt in some way. Maybe the best it to delete the whole forum and install it again.
The good thing with all changes I have done is that I have started to understand the differnt parts.


It's never too late to give up
and I'm not in a hurry

greyknight17


Macwitty

Thanks - the path was right - I got a page

But with Welcome, Guest. Please login or register.
Isn't it possible to take away "or register" as it just lead to page with Error has occured "Sorry, registration is currently disabled."
It's never too late to give up
and I'm not in a hurry

greyknight17

Sure, just remove the following from the login and logout part:

ssi_welcome();

Macwitty

Tanks greyknight17!

Sorry not answering before. Work has taken to much time but now I'm back again and will do the last part of the configuration
It's never too late to give up
and I'm not in a hurry

Advertisement: