forked from e107inc/e107
-
Notifications
You must be signed in to change notification settings - Fork 0
/
membersonly.php
92 lines (75 loc) · 2.17 KB
/
membersonly.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Copyright (C) 2008-2009 e107 Inc
| http://e107.org
|
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/membersonly.php,v $
| $Revision$
| $Date$
| $Author$
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
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
{
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>");
return str_replace($srch,$repl, LAN_MEMBERS_3);
}
}
function sc_membersonly_returntohome()
{
return "<a class='alert-link' href='".e_HTTP."index.php'>".LAN_MEMBERS_4."</a>";
}
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>");
return str_replace($srch,$repl, LAN_MEMBERS_2);
}
}
require_once(HEADERF);
$mem = new membersonly;
$BODY = e107::getParser()->parseTemplate( $MEMBERSONLY_TEMPLATE['default']['body'],true,$mem);
echo $MEMBERSONLY_TEMPLATE['default']['header'];
e107::getRender()->tablerender($MEMBERSONLY_TEMPLATE['default']['caption'], $BODY, 'membersonly');
echo $MEMBERSONLY_TEMPLATE['default']['footer'];
require_once(FOOTERF);
?>