1

Topic: Guest access

All,

I have removed all options for Guest, I was wondering how I could go about getting a page just to have the login page and not show the forum title etc.

Have you got any ideas, or is this even possible.

Re: Guest access

Something like Wordpress?

3

Re: Guest access

Garciat wrote:

Something like Wordpress?

Yes, that is perfect. big_smile
Now how does one go about achieving this, any ideas ?

4

Re: Guest access

This type of thing?

http://forums.bauchan.org/devforum/login.php

That is similar to the code over on the PunRes wiki:

http://wiki.punres.org/Add_a_login_form_over_the_header

If 1.2*, run something similar to that code between a header and footer include. smile If 1.3*, specifics on how to code it ain't my strong point, but the same principle applies. big_smile

5 (edited by User33 2008-11-15 03:33)

Re: Guest access

This is as far as I could go with only making a 'login.tpl':

http://garciat.us.to/forums/login/

If you want your forum to look that way, let me know.

6 (edited by User33 2008-11-13 03:57)

Re: Guest access

I have also managed to create an extension that forces guests to log in.

If you're interested, let me know.

7

Re: Guest access

Garciat wrote:

This is as far as I could go with only making a 'login.tpl':

http://garciat.us.to/punbb/login.php

If you want your forum to look that way, let me know.

That great, how does one go about greating that?

With regard to the Guest login, I do not want any guest to be able to login/access the forum.  This is one reason for the restricted first page. smile

Regards

8 (edited by User33 2008-11-15 03:34)

Re: Guest access

Install this extension: http://garciat.us.to/code/punbb/small_login.zip

9 (edited by bach 2008-11-13 13:24)

Re: Guest access

Thanks, how do you go about installing this add-on

Do you just upload them to the server, or is there a process I should follow.  couldn't see anything on the extension forum.

Re: Guest access

Garciat wrote:

Install this extension: http://garciat.us.to/code/punbb/extensi … _login.zip

Nice smile

But I would make it in another way.
No install and uninstall section, only 'hd_template_loaded' hook:

if (FORUM_PAGE == 'login')
    $tpl_main =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <!-- forum_local -->>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- forum_head -->
</head>
<body>

<div id="brd-wrap" class="brd">
<div <!-- forum_page -->>

<div class="hr"><hr /></div>

<div id="brd-main">
    <!-- forum_main -->
</div>

<div class="hr"><hr /></div>

</div>
</div>

</body>
</html>
';

We avoid writting files and some other problems when extension is disabled (see http://fluxbb.org/wiki/developing_exten … e_disabled).

I don't know whether it will work or not, but looking at your code I think it should smile

Re: Guest access

bach wrote:

Thanks, how do you go about installing this add-on

Do you just upload them to the server, or is there a process I should follow.  couldn't see anything on the extension forum.

See instructions: http://punbb.informer.com/wiki/1.3_usag … _punbb_1.3

12

Re: Guest access

I just tried enabling/disabling it and it works smile

13 (edited by User33 2008-11-14 15:50)

Re: Guest access

bach wrote:

Thanks, how do you go about installing this add-on

Do you just upload them to the server, or is there a process I should follow.  couldn't see anything on the extension forum.

  1. Download the file

  2. Unzip the file into your extensions folder (you should see the extension's folder there)

  3. Go to Administration > Extensions

  4. Install the extension

  5. Enjoy smile

Re: Guest access

Garciat wrote:

I just tried enabling/disabling it and it works smile

Ah, yes. It must work.
Sorry, I've a hard day smile
Was I right when I told about permissons for writting a file? smile

15

Re: Guest access

Garciat wrote:
bach wrote:

Thanks, how do you go about installing this add-on

Do you just upload them to the server, or is there a process I should follow.  couldn't see anything on the extension forum.

  1. Download the file

  2. Unzip the file into your extensions folder (you should see the extension's folder there)

  3. Go to Administration > Extensions

  4. Install the extension

  5. Enjoy smile

I have installed the extension and it works big_smile

What I was thinking is rather than having this for the login page can this be on the index page, so a user needs to login or register ?

16

Re: Guest access

So, you want to force all guests to login or register?

17

Re: Guest access

Garciat wrote:

So, you want to force all guests to login or register?

Yeah,
First thing I want people to see is login or register.  I was looking for some information on the coding just so I can understand it.

Cheers

18

Re: Guest access

I could make an extension (with turn on/off), or you could just add this to Line 23 on 'header.php':

if($forum_user['is_guest']) header("Location: ".forum_link($forum_url['login']));

19

Re: Guest access

Garciat wrote:

I could make an extension (with turn on/off), or you could just add this to Line 23 on 'header.php':

if($forum_user['is_guest']) header("Location: ".forum_link($forum_url['login']));

Thanks for this, I think i'll add this code line into the header.php file.  I may see if I can write an extension or this as it would be good practice.  Do you know of any threads etc that could help me write an extension ?

Bach.

20

Re: Guest access

Sorry, I don't know of any links, BUT I learned extension coding with a blank extension template because it's self-explaining. Here you go:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">

<extension engine="1.0">
    <id>Same as folder's name I.e.: pun_pm</id>
    <title>Extension name</title>
    <version>Extension version</version>
    <description>Extension description</description>
    <author>Your name</author>
    
    <minversion>1.3</minversion>
    <maxtestedon>1.3</maxtestedon>
    
    <install>
        <![CDATA[
//Code to run when installing
        ]]>
    </install>
    
    <uninstall>
        <![CDATA[
//Code to run when uninstalling
        ]]>
    </uninstall>
    
    <hooks>
        <hook id="hook_name">
            <![CDATA[
//Code to run when forum script reaches hook
            ]]>
        </hook>
    </hooks>
</extension>