##############################################################
## MOD Title: Pron  v1.2
## MOD Author: pservit, DiMk@, Anders.
## MOD ReWrite: Pandora < admin@pandoraUA.org > (CyberPunk - Pandora)
## MOD Version: 1.2
## :         XXX
## Installation Level: Easy
## Installation Time: 1 Min
## Files To Edit: templates/default/css/theme_default.css
##		  viewforum.php
##		  viewtopic.php
##
## Included Files: 18.php
##		   templates/default/18.tpl
##		   includes/18_questions.php
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: n/a
##############################################################
## MOD History:
##
##    07.09.2008 - Version 0.1.2
##    	- Add viewtopic.php access :)
##
##    01.09.2008 - Version 0.1.1
##    	- Add to Russian/English table
##
##    01.09.2008 - Version 0.1.1
##    	- Fix permissions (guest to view forum access forbidden)
##
##    31.08.2008 - Version 0.1.0
##    	- initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

# 
#-----[ SQL ]------------------------------------------------ 
# 

ALTER TABLE `bb_users` ADD `user_not_kid` INT( 11 ) NOT NULL DEFAULT '0';

# 
#-----[ COPY ]------------------------------------------------ 
# 

18.php
templates/default/18.tpl
includes/18_questions.php

# 
#-----[ OPEN ]------------------------------------------------ 
# 

templates/default/css/theme_default.css

# 
#-----[ ADD END FILE ]------------------------------------------------ 
# 

/* ---------------------------------- *
     18+ Control Style
 * ---------------------------------- */
#q18 {
	text-align: center;
	padding: 20px;
}

#q18 * {
	text-align: left;
}

#q18 .message {
	font-weight: bold;
	margin: 17px;
	font-size: 16pt;
	font-family: Arial, Verdana;
	color: #CC3333;
}

#q18 .over18 {
	margin: 17px;
	font-weight: bold;
}

#q18 .over18 span {
	color: #006699;
}

#q18 .i_am_cool {
	font-weight: bold;
	margin: 0px 17px;
	margin-top: 30px;
	color: #006699;
}

#q18 .test {
	border: 1px solid #CCCCCC;
	margin: 17px;
	padding: 15px;
	background-color: #EAEAEA;
}

#q18 .rules {
	margin: 10px;
	font-style: italic;
}

#q18 .q_title {
	margin-bottom: 5px;
}

#q18 .q_answer.red input {
	border: 2px solid #CC3333;
}

#q18 .q_answer.green input {
	border: 2px solid #33CC33;
}

#q18 .q_answer input {
	font-weight: normal;
	width: 300px;
	font-size: 14px;
}

#q18 ol {
	margin: 0 35px;
}

#q18 ol li {
	font-weight: bold;
	padding-bottom: 17px;
}

# 
#-----[ OPEN ]------------------------------------------------ 
# 

viewforum.php

# 
#-----[ FIND ]------------------------------------------------ 
# 

// Redirect to login page if not admin session
$mod_redirect_url = '';

if ($is_auth['auth_mod'])
{
	$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : $_SERVER['REQUEST_URI'];
	$redirect = url_arg($redirect, 'mod', 1, '&');
	$mod_redirect_url = "login.$phpEx?redirect=$redirect&admin=1";

	if ($moderation && !$userdata['session_admin'])
	{
		redirect($mod_redirect_url);
	}
}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Murzilka redirect section:
$porno_forums = array_flip(explode(',', $bb_cfg['porno_forums']));
if ( isset($porno_forums[$forum_id]) && !$userdata["user_not_kid"] ) {
     $url = urlencode(($_SERVER["REQUEST_URI"]));
     redirect(append_sid("18.$phpEx?ru=$url", true));
}
// Murzilka section!

# 
#-----[ OPEN ]------------------------------------------------ 
# 

viewtopic.php

# 
#-----[ FIND ]------------------------------------------------ 
# 

if ($is_auth['auth_mod'])
{
	$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : $_SERVER['REQUEST_URI'];
	$redirect = url_arg($redirect, 'mod', 1, '&');
	$mod_redirect_url = "login.$phpEx?redirect=$redirect&admin=1";

	if ($moderation && !$userdata['session_admin'])
	{
		redirect($mod_redirect_url);
	}
}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Murzilka redirect section:
$porno_forums = array_flip(explode(',', $bb_cfg['porno_forums']));
if ( isset($porno_forums[$forum_id]) && !$userdata["user_not_kid"] ) {
     $url = urlencode(($_SERVER["REQUEST_URI"]));
     redirect(append_sid("18.$phpEx?ru=$url", true));
}
// Murzilka section!

# 
#-----[ OPEN ]------------------------------------------------ 
# 

language/lang_english/lang_main.php

# 
#-----[ ADD FOR END FILE ]------------------------------------------------ 
# 

$lang['Pron18_guest_not_access'] = 'You are a guest and do not have a right of access to this section<br/><br/><a href="%s">Return back</a>';

# 
#-----[ OPEN ]------------------------------------------------ 
# 

language/lang_russian/lang_main.php

# 
#-----[ ADD FOR END FILE ]------------------------------------------ 
# 

$lang['Pron18_guest_not_access'] = '         <br/><br/><a href="%s"> </a>';

# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM