1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/membersonly.php

96 lines
2.3 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
2009-11-18 01:06:08 +00:00
| Copyright (C) 2008-2009 e107 Inc
2006-12-02 04:36:16 +00:00
| http://e107.org
2009-07-14 05:31:57 +00:00
|
2006-12-02 04:36:16 +00:00
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/membersonly.php,v $
2010-02-10 18:18:01 +00:00
| $Revision$
| $Date$
| $Author$
2006-12-02 04:36:16 +00:00
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
2017-01-23 09:41:23 -08:00
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
2006-12-02 04:36:16 +00:00
2015-02-14 01:11:44 -08:00
if(deftrue('BOOTSTRAP')) //v2.x
{
$MEMBERSONLY_TEMPLATE = e107::getCoretemplate('membersonly');
}
else // Legacy
{
if(is_readable(THEME."membersonly_template.php"))
{
require_once(THEME."membersonly_template.php");
}
else
{
require_once(e_CORE."templates/membersonly_template.php");
}
$MEMBERSONLY_TEMPLATE['default']['caption'] = $MEMBERSONLY_CAPTION;
$MEMBERSONLY_TEMPLATE['default']['header'] = $MEMBERSONLY_BEGIN;
$MEMBERSONLY_TEMPLATE['default']['body'] = $MEMBERSONLY_TABLE;
$MEMBERSONLY_TEMPLATE['default']['footer'] = $MEMBERSONLY_END;
}
define('e_IFRAME',true);
class membersonly
2006-12-02 04:36:16 +00:00
{
2015-02-14 01:11:44 -08:00
function sc_membersonly_signup()
{
$pref = e107::pref('core');
if (intval($pref['user_reg'])===1)
{
$srch = array("[","]");
$repl = array("<a class='alert-link' href='".e_SIGNUP."'>","</a>");
2015-02-14 01:11:44 -08:00
return str_replace($srch,$repl, LAN_MEMBERS_3);
}
}
function sc_membersonly_returntohome()
{
$pref = e107::pref('core');
if($pref['membersonly_redirect'] == 'login')
{
return "<a class='alert-link' href='".e_HTTP."index.php'>".LAN_MEMBERS_4."</a>";
}
2015-02-14 01:11:44 -08:00
}
function sc_membersonly_restricted_area()
{
return LAN_MEMBERS_1;
}
function sc_membersonly_login()
{
$srch = array("[","]");
$repl = array("<a class='alert-link' href='".e_LOGIN."'>","</a>");
2015-02-14 01:11:44 -08:00
return str_replace($srch,$repl, LAN_MEMBERS_2);
}
2006-12-02 04:36:16 +00:00
}
2015-02-14 01:11:44 -08:00
require_once(HEADERF);
2013-03-20 22:59:37 -07:00
2015-02-14 01:11:44 -08:00
$mem = new membersonly;
2006-12-02 04:36:16 +00:00
2015-02-14 01:11:44 -08:00
$BODY = e107::getParser()->parseTemplate( $MEMBERSONLY_TEMPLATE['default']['body'],true,$mem);
2006-12-02 04:36:16 +00:00
2015-02-14 01:11:44 -08:00
echo $MEMBERSONLY_TEMPLATE['default']['header'];
e107::getRender()->tablerender($MEMBERSONLY_TEMPLATE['default']['caption'], $BODY, 'membersonly');
echo $MEMBERSONLY_TEMPLATE['default']['footer'];
2006-12-02 04:36:16 +00:00
2015-02-14 01:11:44 -08:00
require_once(FOOTERF);
?>