Seite 3 von 6

Verfasst: 25.06.2004 23:58
von Markus67
Hi ...

Danke ... habs inzwischen über eine "Timeout" Funktion gelöst :wink:

Markus

Verfasst: 26.07.2004 12:56
von Doc Lecter
HI! Wie genau hast du das nun gelöst?! Kann man mal ne Demo sehen?! :) Brauche nämlich auch noch sowas!

Verfasst: 26.07.2004 13:00
von Markus67
Hi ...

Demo gibts bei www.westieforum.de ...

Einfach mal ein bischen durch die Seiten klicken ... und dann beobachte mal oben den Header :wink:

Markus

Verfasst: 26.07.2004 13:13
von Doc Lecter
Oha, sehr interessant! Gibts da nun nen MOD für oder wie haste das gemacht?

Verfasst: 26.07.2004 13:23
von Markus67
Hi ...

Einen MOD gibt es nicht dafür ...

Ich hab mir das mal "proggen" lassen ...

timeout.zip

Markus

Verfasst: 26.07.2004 13:40
von Doc Lecter
Jou schankedön! Werd ich nachher mal ausprobieren :o)

Verfasst: 26.07.2004 14:05
von kangaroojack
G'day all,

netter mod. wie hats du das gemacht ?

Verfasst: 26.07.2004 14:07
von Markus67
Hi ...

steht doch in der timeout.zip drin :wink:

Markus

Verfasst: 26.07.2004 14:50
von Berndte
Hallo,

ich habe auch starkes Interesse an dieser Funktion, da bei mir eigentlich immer so 70 Gäste und nur 20 Registrierte im Forum sind.... die meisten von denen sind sicher auch registriert nur nicht eingeloggt (deshalb kommen auch keine Privaten Nachrichten bei denen an)

Meine Fragen nun...

-leider ist in der ZIP die Installationsanleitung
verrutscht und schlecht zu lesen... kann du die hier bitte nochmal mit Quote einbauen?

-klappt das auch mit einem "nomalen" PhpBB (2.0.8 bei mir)?

Gruss Bernd

Verfasst: 26.07.2004 14:52
von Markus67
Hi ...

das ist die install.txt

Code: Alles auswählen

##############################################################
## MOD Title: Timeout Mod 
## MOD Author: itst < sc@itst.org > (Sascha Carlin) http://www.itst.org/
## MOD Description: This mods allows guests to surf the forums for a predefined time.
##                  After this time runs out (a little countdown is shown in the header)
##                  they must either login or register. All other attempts to access the
##		    forums are redirected to a info page.
##
##		    All setting are done via constants.php. The text for the info page is
##		    set via lang_main.php.
##		    You don't need to use the shipped timeout.php. You can use any file
##		    you want, even a file outside phpBB.
##
## MOD Version: 0.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit:
##                  includes/constants.php
##                  includes/page_header.php
##                  includes/sessions.php
##                  language/*/lang_main.php
##                  templates/*/overall_header.tpl
##  
## Included Files:  timeout.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##                  If you use more than one language/template, you will want to change all your
##                  lang_main.php and overall_header.tpl files.
##
##############################################################
## MOD History:
##
##   2004-03-22 - Version 0.1
##      INITIAL RELEASE
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php 

#
#-----[ FIND ]------------------------------------------
#
define('PAGE_GROUPCP', -11);

#
#-----[ AFTER, ADD ]------------------------------------------
#
define('TIMEOUT_PAGE', -99);

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
//Timeout Mod
//

// 10 minutes * 60 seconds = 600 seconds
define('TIMEOUT_SECONDS', 600);

// After 15 minutes all requests will be forwared to this page
define('TIMEOUT_FORWARD', 'timeout.' . $phpEx);

// Whether to show the timeout countdown.
define('TIMEOUT_SHOWCOUNTDOWN', TRUE);

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php 

#
#-----[ FIND ]------------------------------------------
#
//
// Login box?
//

#
#-----[ BEFORE, ADD ]------------------------------------------
#
if (TIMEOUT_SHOWCOUNTDOWN && ($userdata['timeout_countdown'] <> ''))
{
	$template->assign_block_vars('switch_timeout_countdown', array());
	$template->assign_vars(array(
		'TIMEOUT_COUNTDOWN' => sprintf($lang['Timeout_Countdown'], $userdata['timeout_countdown']))
	);
}

#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php 

#
#-----[ FIND ]------------------------------------------
#
			//
			// Do not check IP assuming equivalence, if IPv4 we'll check only first 24
			// bits ... I've been told (by vHiker) this should alleviate problems with
			// load balanced et al proxies while retaining some reliance on IP security.
			//

#
#-----[ BEFORE, ADD ]------------------------------------------
#

			if ($userdata['user_id'] == ANONYMOUS)
			{
				if (($thispage_id == TIMEOUT_PAGE) || ($thispage_id == PAGE_LOGIN) || ($thispage_id == PAGE_REGISTER) || ($thispage_id == PAGE_PROFILE))
				{
                        		$page_id = FALSE;
				} else
				{
					$page_id = TRUE;
				}

				if (($userdata['session_start'] < ($current_time - TIMEOUT_SECONDS)) && $page_id)
				{
					redirect(append_sid(TIMEOUT_FORWARD, true));
				} else
				{
					$userdata['timeout_countdown'] = @date("i:s", $userdata['session_start'] - ($current_time - TIMEOUT_SECONDS));
				}
			 }

#
#-----[ OPEN ]------------------------------------------
#
languages/*/lang_main.php 

#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!

#
#-----[ BEFORE, ADD ]------------------------------------------
#
//Timeout Mod
$lang['Timeout_Message'] = '<b>Your session expired.</b><br /><br />After %d minutes you must either <a href="%s">login</a> or <a href="%s">register</a> to continue browsing these forums.';
$lang['Timeout_Countdown'] = '%s to go.';

#
#-----[ OPEN ]------------------------------------------
#
templates/*/overall_header.tpl 

#
#-----[ FIND ]------------------------------------------
#
			<tr>
				<td><a href="{U_INDEX}"><img src="templates/subSilver/images/logo_phpBB.gif" border="0" alt="{L_INDEX}" vspace="1" /></a></td>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
			<!-- BEGIN switch_timeout_countdown -->
			<tr>
			        <td align="right" colspan="2"><span class="gensmall">{TIMEOUT_COUNTDOWN}</span></td>
			</tr>
			<!-- END switch_timeout_countdown -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Funktioniert mit 2.0.8

Markus