mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 20:08:55 +00:00
- fixed a few bugs
- added user_add() function - check posted images ([img]) for same domain/scipt and php files - auth_api.html updated to the coding guidelines look&feel - introduced ability to force non page-updates (cron is using it) - correctly resend coppa email git-svn-id: file:///svn/phpbb/trunk@6048 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ce3b07eee7
commit
01b4145381
45 changed files with 1847 additions and 1411 deletions
|
@ -16,7 +16,8 @@ $phpbb_root_path = './';
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include($phpbb_root_path . 'common.' . $phpEx);
|
||||||
|
|
||||||
$user->session_begin();
|
// Do not update users last page entry
|
||||||
|
$user->session_begin(false);
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
|
|
||||||
$cron_type = request_var('cron_type', '');
|
$cron_type = request_var('cron_type', '');
|
||||||
|
|
|
@ -1,109 +1,371 @@
|
||||||
<html>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../styles/subSilver/theme/stylesheet.css" type="text/css" />
|
<title>Auth API</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||||
|
<meta name="resource-type" content="document" />
|
||||||
|
<meta name="description" lang="en" content="Olympus coding guidelines document" />
|
||||||
|
<meta name="keywords" lang="en" content="" />
|
||||||
|
<meta name="author" content="phpBB Group" />
|
||||||
|
<meta name="copyright" content="phpBB Group" />
|
||||||
|
<meta name="MSSmartTagsPreventParsing" content="true" />
|
||||||
|
<link rel="shortcut icon" href="" />
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<!--
|
<!--
|
||||||
p {font-size:125%;}
|
|
||||||
pre {font-size:125%;line-height:150%;}
|
/*
|
||||||
h2 {font-size:175%;color:red;padding-top:4px;}
|
The original "subSilver" theme for phpBB2
|
||||||
h3 {font-size:150%;color:blue;padding-top:4px;}
|
Created by subBlue design :: http://www.subBlue.com
|
||||||
p {padding-top:4px;padding-bottom:4px;}
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: white;
|
||||||
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
|
margin: 0px;
|
||||||
|
border: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 8pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
height: 0px;
|
||||||
|
border: solid #D1D7DC 0px;
|
||||||
|
border-top-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title, h1 {
|
||||||
|
font: bold 18pt 'Trebuchet MS', Verdana, sans-serif;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font: bold 12pt Arial, Helvetica, sans-serif;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font: bold 10pt Arial, Helvetica, sans-serif;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paragraph {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Structure
|
||||||
|
*/
|
||||||
|
#logo {
|
||||||
|
background: #fff url(header_bg.jpg) repeat-x top right;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title {
|
||||||
|
color: #12749b;
|
||||||
|
float: right;
|
||||||
|
margin: 10px 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
margin-left: 25px;
|
||||||
|
margin-right: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.good {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bad {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
margin-left: 75px;
|
||||||
|
font-size: 70%;
|
||||||
|
color: #006600;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
color: #006600;
|
||||||
|
font-weight: normal;
|
||||||
|
font-family: 'Courier New', monospace;
|
||||||
|
border-color: #D1D7DC;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
background-color: #FAFAFA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indent p {
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Anchors
|
||||||
|
*/
|
||||||
|
a {
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link, a:active, a:visited {
|
||||||
|
color: #006699;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #DD6900;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.nav {
|
||||||
|
color: #006699;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.nav:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
p a {
|
||||||
|
font-size: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu li a {
|
||||||
|
font-size: 100%;
|
||||||
|
}
|
||||||
//-->
|
//-->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!--[if IE]>
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
scrollbar-face-color: #DEE3E7;
|
||||||
|
scrollbar-highlight-color: white;
|
||||||
|
scrollbar-shadow-color: #DEE3E7;
|
||||||
|
scrollbar-3dlight-color: #D1D7DC;
|
||||||
|
scrollbar-arrow-color: #006699;
|
||||||
|
scrollbar-track-color: #EFEFEF;
|
||||||
|
scrollbar-darkshadow-color: #98AAB1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<a name="top"></a>
|
|
||||||
<div id="wrapcentre">
|
|
||||||
|
|
||||||
<h1>Using the <i><u>auth</u></i> class</h1>
|
<div id="logo">
|
||||||
|
<div id="title">Auth API</div>
|
||||||
|
<a href="index.php"><img src="header_left.jpg" alt="phpBB Logo" /></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>What is it?</h2>
|
<a name="top"></a><div id="main">
|
||||||
|
|
||||||
<p>The <i><u>auth</u></i> class contains methods related to authorisation users to access various board functions, e.g. posting, viewing, replying, logging in (and out), etc. If you need to check whether a user can carry out a task or handle user login/logouts this class is required.</p>
|
<p>This is an explanation of how to use the phpBB auth/acl API. This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p>
|
||||||
|
|
||||||
<h2>Initialisation</h2>
|
<h1>Auth API</h1>
|
||||||
|
|
||||||
<p>To use any methods contained with the <i><u>auth</u></i> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:
|
<ol class="menu">
|
||||||
|
<li><a href="#intro">Introduction</a></li>
|
||||||
|
<li><a href="#methods">Methods</a>
|
||||||
|
<ol type="i">
|
||||||
|
<li><a href="#acl">acl</a></li>
|
||||||
|
<li><a href="#acl_get">acl_get</a></li>
|
||||||
|
<li><a href="#acl_gets">acl_gets</a></li>
|
||||||
|
<li><a href="#acl_getf">acl_getf</a></li>
|
||||||
|
<li><a href="#acl_getf_global">acl_getf_global</a></li>
|
||||||
|
<li><a href="#acl_cache">acl_cache</a></li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
<li><a href="#admin_related">Admin related functions</a></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
<pre>$auth = new auth();</pre>
|
<hr />
|
||||||
|
|
||||||
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <i><u>auth_admin</u></i> methods you will need to instantiate this seperately but in the same way.</p>
|
<a name="intro"></a><h1>1. Introduction</h1>
|
||||||
|
|
||||||
<h3><i>acl</i></h3>
|
<div class="paragraph">
|
||||||
|
|
||||||
<p>The <i>acl</i> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:
|
<h3>What is it?</h3>
|
||||||
|
|
||||||
<pre>$auth->acl(<i>userdata</i>);</pre>
|
<p>The <code>auth</code> class contains methods related to authorisation users to access various board functions, e.g. posting, viewing, replying, logging in (and out), etc. If you need to check whether a user can carry out a task or handle user login/logouts this class is required.</p>
|
||||||
|
|
||||||
<p>Where userdata is the array containing the aforementioned data.</p>
|
<h3>Initialisation</h3>
|
||||||
|
|
||||||
<h3><i>acl_get</i></h3>
|
<p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p>
|
||||||
|
|
||||||
<p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p>
|
<blockquote><pre>
|
||||||
|
$auth = new auth();
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
<pre>$result = $auth->acl_get(<i>option</i>[, <i>forum</i>]);</pre>
|
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this seperately but in the same way.</p>
|
||||||
|
|
||||||
<p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p>
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<p>The method returns a positive integer when the user is allowed to carry out the option and a zero if denied or the other way around if the option is prefixed with an exclamation mark.</p>
|
<hr />
|
||||||
|
|
||||||
<p>If you specify a forum and there is also a global setting for the specified option then this method will return a positive integer if one of them evaluates to a positive integer. An example would be the m_approve option which can be set per forum but also globally. If a user has the global option he will automatically have m_approve in every forum.</p>
|
<a name="methods"></a><h1>2. Methods</h1>
|
||||||
|
|
||||||
<p>There are some special options or <i>flags</i> which are used as prefixes for other options, e.g. 'f_' or 'm_'. These flags will automatically be set to a positive integer if the user has one or more permissions with the given prefix. A local setting will result in the flag being set only locally (so it will require a forum id to retrieve). If a user has one or more global permissions with the prefix acl_get will return a positive integer regardless of the forum id.</p>
|
<p>Following are the methods you are able to use.</p>
|
||||||
|
|
||||||
<h3><i>acl_gets</i></h3>
|
<a name="acl"></a><b>2.i. acl</b>
|
||||||
|
<br /><br />
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
<p>This method is funtionally similar to <i>acl_get</i> in that it returns information on whether a user can or cannot carry out a given task. The difference here is the ability to test several different options in one go. This may be useful for testing whether a user is a moderator or an admin in one call. Rather than having to call and check <i>acl_get</i> twice.</p>
|
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
|
||||||
|
|
||||||
<p>The method should be called thus:</p>
|
<blockquote><pre>
|
||||||
|
$auth->acl(<code>userdata</code>);
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
<pre>$result = $auth->acl_gets(<i>option1</i>[, <i>option2</i>, ..., <i>optionN</i>, <i>forum</i>]);</pre>
|
<p>Where userdata is the array containing the aforementioned data.</p>
|
||||||
|
|
||||||
<p>As with the <i>acl_get</i> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p>
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<p>The method will return a positive integer if acl_get for one of the options evaluates to a positive integer (combines permissions with OR).</p>
|
|
||||||
|
|
||||||
<h3><i>acl_getf</i></h3>
|
<a name="acl_get"></a><b>2.ii. acl_get</b>
|
||||||
|
<br /><br />
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
<p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p>
|
<p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p>
|
||||||
|
|
||||||
<pre>$result = $auth->acl_getf(<i>option</i>[, <i>clean</i>])</pre>
|
<blockquote><pre>
|
||||||
|
$result = $auth->acl_get(<code>option</code>[, <code>forum</code>]);
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>Just like in the <i>acl_get</i> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p>
|
<p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p>
|
||||||
|
|
||||||
<p>The method returns an associative array of the form:</p>
|
<p>The method returns a positive integer when the user is allowed to carry out the option and a zero if denied or the other way around if the option is prefixed with an exclamation mark.</p>
|
||||||
|
|
||||||
<pre>array(<i>forum_id1</i> => array(<i>option</i> => <i>integer</i>), <i>forum_id2</i> => ...)</pre>
|
<p>If you specify a forum and there is also a global setting for the specified option then this method will return a positive integer if one of them evaluates to a positive integer. An example would be the m_approve option which can be set per forum but also globally. If a user has the global option he will automatically have m_approve in every forum.</p>
|
||||||
|
|
||||||
<p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <i>acl_get(option, forum_id)</i> would return.</p>
|
<p>There are some special options or <em>flags</em> which are used as prefixes for other options, e.g. 'f_' or 'm_'. These flags will automatically be set to a positive integer if the user has one or more permissions with the given prefix. A local setting will result in the flag being set only locally (so it will require a forum id to retrieve). If a user has one or more global permissions with the prefix acl_get will return a positive integer regardless of the forum id.</p>
|
||||||
|
|
||||||
<h3><i>acl_getf_global</i></h3>
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <i>acl_getf(option, true)</i> returned one or more forums but it's faster. It should be called in the following way:</p>
|
|
||||||
|
|
||||||
<pre>$result = acl_getf_global(<i>option</i>)</pre>
|
<a name="acl_gets"></a><b>2.iii. acl_gets</b>
|
||||||
|
<br /><br />
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
<p>As with the previous methods option is a string specifying the permission which has to be checked.</p>
|
<p>This method is funtionally similar to <code>acl_get</code> in that it returns information on whether a user can or cannot carry out a given task. The difference here is the ability to test several different options in one go. This may be useful for testing whether a user is a moderator or an admin in one call. Rather than having to call and check <code>acl_get</code> twice.</p>
|
||||||
|
|
||||||
<p>This method returns either zero or a positive integer.</p>
|
<p>The method should be called thus:</p>
|
||||||
|
|
||||||
<h3><i>acl_cache</i></h3>
|
<blockquote><pre>
|
||||||
|
$result = $auth->acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <i>acl</i>.</p>
|
<p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p>
|
||||||
|
|
||||||
<p></p>
|
<p>The method will return a positive integer if <code>acl_get</code> for one of the options evaluates to a positive integer (combines permissions with OR).</p>
|
||||||
|
|
||||||
<h2>Admin related functions</h2>
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<p>A number of additional methods are available related to <i><u>auth</u></i>. These handle more basic functions such as adding user and group permissions, new options and clearing the user cache. These methods are contained within a seperate class, <i><u>auth_admin</u></i>. This can be found in includes/acp/auth.php.</p>
|
|
||||||
|
|
||||||
<p>To use any methods this class contains it first needs to be instantiated seperately from <i><u>auth</u></i>. This is achieved in the same way as <i><u>auth</u></i>:</p>
|
<a name="acl_getf"></a><b>2.iv. acl_getf</b>
|
||||||
|
<br /><br />
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
<pre>$authadmin = new auth_admin();</pre>
|
<p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p>
|
||||||
|
|
||||||
<p>This instance gives you access to both the methods of this specific class and that of <i><u>auth</u></i>.</p>
|
<blockquote><pre>
|
||||||
|
$result = $auth->acl_getf(<code>option</code>[, <code>clean</code>]);
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
|
<p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p>
|
||||||
|
|
||||||
|
<p>The method returns an associative array of the form:</p>
|
||||||
|
|
||||||
|
<blockquote><pre>
|
||||||
|
array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <em>forum_id2</em> => ...)
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
|
<p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
|
|
||||||
|
<a name="acl_getf_global"></a><b>2.v. acl_getf_global</b>
|
||||||
|
<br /><br />
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
|
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p>
|
||||||
|
|
||||||
|
<blockquote><pre>
|
||||||
|
$result = acl_getf_global(<code>option</code>)
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
|
<p>As with the previous methods option is a string specifying the permission which has to be checked.</p>
|
||||||
|
|
||||||
|
<p>This method returns either zero or a positive integer.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
|
|
||||||
|
<a name="acl_cache"></a><b>2.vi. acl_cache</b>
|
||||||
|
<br /><br />
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
|
<p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <code>acl</code>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<a name="admin_related"></a><h1>3. Admin related functions</h1>
|
||||||
|
|
||||||
|
<div class="paragraph">
|
||||||
|
|
||||||
|
<p>A number of additional methods are available related to <code>auth</code>. These handle more basic functions such as adding user and group permissions, new options and clearing the user cache. These methods are contained within a seperate class, <code>auth_admin</code>. This can be found in <code>includes/acp/auth.php</code>.</p>
|
||||||
|
|
||||||
|
<p>To use any methods this class contains it first needs to be instantiated seperately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p>
|
||||||
|
|
||||||
|
<blockquote><pre>
|
||||||
|
$auth_admin = new auth_admin();
|
||||||
|
</pre></blockquote>
|
||||||
|
|
||||||
|
<p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a href="#top">Top</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer"> $Id$
|
||||||
|
<br /><br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -184,13 +184,14 @@ body {
|
||||||
<h1>Coding Guidelines</h1>
|
<h1>Coding Guidelines</h1>
|
||||||
|
|
||||||
<ol class="menu">
|
<ol class="menu">
|
||||||
<li><a href="#defaults">Defaults</a></li>
|
<li><a href="#defaults">Defaults</a>
|
||||||
<ol type="i">
|
<ol type="i">
|
||||||
<li><a href="#editorsettings">Editor Settings</a></li>
|
<li><a href="#editorsettings">Editor Settings</a></li>
|
||||||
<li><a href="#fileheader">File Header</a></li>
|
<li><a href="#fileheader">File Header</a></li>
|
||||||
<li><a href="#locations">File Locations</a></li>
|
<li><a href="#locations">File Locations</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
<li><a href="#code">Code Layout/Guidelines</a></li>
|
</li>
|
||||||
|
<li><a href="#code">Code Layout/Guidelines</a>
|
||||||
<ol type="i">
|
<ol type="i">
|
||||||
<li><a href="#namingvars">Variable/Function Naming</a></li>
|
<li><a href="#namingvars">Variable/Function Naming</a></li>
|
||||||
<li><a href="#codelayout">Code Layout</a></li>
|
<li><a href="#codelayout">Code Layout</a></li>
|
||||||
|
@ -198,6 +199,7 @@ body {
|
||||||
<li><a href="#optimizing">Optimizations</a></li>
|
<li><a href="#optimizing">Optimizations</a></li>
|
||||||
<li><a href="#general">General Guidelines</a></li>
|
<li><a href="#general">General Guidelines</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
|
</li>
|
||||||
<li><a href="#styling">Styling</a></li>
|
<li><a href="#styling">Styling</a></li>
|
||||||
<li><a href="#templating">Templating</a></li>
|
<li><a href="#templating">Templating</a></li>
|
||||||
<li><a href="#changes">Guidelines Changelog</a></li>
|
<li><a href="#changes">Guidelines Changelog</a></li>
|
||||||
|
@ -218,7 +220,7 @@ body {
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
$mode{TAB}{TAB}= request_var('mode', '');
|
$mode{TAB}{TAB}= request_var('mode', '');
|
||||||
$search_id{TAB}= request_var('search_id', '');
|
$search_id{TAB}= request_var('search_id', '');
|
||||||
</blockquote></pre>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
|
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
|
||||||
|
|
||||||
|
@ -853,15 +855,15 @@ $submit = (isset($_POST['submit'])) ? true : false;
|
||||||
$start = request_var('start', '0');
|
$start = request_var('start', '0');
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p class="good">// Getting an array, keys are integers, value defaults to 0
|
<p class="good">// Getting an array, keys are integers, value defaults to 0</p>
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
$mark_array = request_var('mark', array(0));
|
$mark_array = request_var('mark', array(0));
|
||||||
</blockquote></pre>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p class="good">// Getting an array, keys are strings, value defaults to 0
|
<p class="good">// Getting an array, keys are strings, value defaults to 0</p>
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
$action_ary = request_var('action', array('' => 0));
|
$action_ary = request_var('action', array('' => 0));
|
||||||
</blockquote></pre>
|
</pre></blockquote>
|
||||||
|
|
||||||
<h3>Login checks/redirection: </h3>
|
<h3>Login checks/redirection: </h3>
|
||||||
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
|
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
|
||||||
|
@ -918,7 +920,6 @@ trigger_error('NO_FORUM');
|
||||||
<a name="styling"></a><h1>3. Styling</h1>
|
<a name="styling"></a><h1>3. Styling</h1>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
|
|
||||||
<a name="styling"></a>
|
|
||||||
<h3>General things</h3>
|
<h3>General things</h3>
|
||||||
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms).</p>
|
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms).</p>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package acm
|
* @package acm
|
||||||
* @ignore
|
|
||||||
* ACM Database Caching
|
* ACM Database Caching
|
||||||
*/
|
*/
|
||||||
class acm
|
class acm
|
||||||
|
|
|
@ -222,12 +222,16 @@ class acp_forums
|
||||||
|
|
||||||
$acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id'] . '&select_all_groups=1';
|
$acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id'] . '&select_all_groups=1';
|
||||||
|
|
||||||
// Redirect to permissions
|
|
||||||
$message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
|
$message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
|
|
||||||
|
|
||||||
// redirect directly to permission settings screen
|
// Redirect to permissions
|
||||||
if ($action == 'add' && !$forum_perm_from)
|
if ($auth->acl_get('a_fauth'))
|
||||||
|
{
|
||||||
|
$message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
|
||||||
|
}
|
||||||
|
|
||||||
|
// redirect directly to permission settings screen if authed
|
||||||
|
if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth'))
|
||||||
{
|
{
|
||||||
meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
|
meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ class acp_language
|
||||||
'HIDDEN' => $hidden_data,
|
'HIDDEN' => $hidden_data,
|
||||||
|
|
||||||
'S_CONNECTION_SUCCESS' => (request_var('test_connection', '') && $test_connection === true) ? true : false,
|
'S_CONNECTION_SUCCESS' => (request_var('test_connection', '') && $test_connection === true) ? true : false,
|
||||||
'S_CONNECTION_FAILED' => (request_var('test_connection', '') && $test_connection === false) ? true : false
|
'S_CONNECTION_FAILED' => (request_var('test_connection', '') && $test_connection !== true) ? true : false
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -327,9 +327,9 @@ class acp_language
|
||||||
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
|
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$transfer->open_session())
|
if (($result = $transfer->open_session()) !== true)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['ERR_CONNECTING_SERVER'] . adm_back_link($this->u_action));
|
trigger_error($user->lang[$result] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$transfer->rename($lang_path . $file, $lang_path . $file . '.bak');
|
$transfer->rename($lang_path . $file, $lang_path . $file . '.bak');
|
||||||
|
|
|
@ -59,19 +59,8 @@ class acp_main
|
||||||
|
|
||||||
set_config('num_users', $config['num_users'] + sizeof($mark_ary), true);
|
set_config('num_users', $config['num_users'] + sizeof($mark_ary), true);
|
||||||
|
|
||||||
// Get latest username
|
// Update latest username
|
||||||
$sql = 'SELECT user_id, username
|
update_last_username();
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
|
||||||
ORDER BY user_id DESC';
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
set_config('newest_user_id', $row['user_id'], true);
|
|
||||||
set_config('newest_username', $row['username'], true);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
else if ($action == 'delete')
|
else if ($action == 'delete')
|
||||||
{
|
{
|
||||||
|
@ -368,7 +357,7 @@ class acp_main
|
||||||
{
|
{
|
||||||
while (($file = readdir($avatar_dir)) !== false)
|
while (($file = readdir($avatar_dir)) !== false)
|
||||||
{
|
{
|
||||||
if ($file{0} != '.' && strpos($file, 'index.') === false)
|
if ($file{0} != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
|
||||||
{
|
{
|
||||||
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
|
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,20 +297,8 @@ class acp_users
|
||||||
set_config('num_users', $config['num_users'] - 1, true);
|
set_config('num_users', $config['num_users'] - 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get latest username
|
// Update latest username
|
||||||
$sql = 'SELECT user_id, username
|
update_last_username();
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
|
||||||
ORDER BY user_id DESC';
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($row)
|
|
||||||
{
|
|
||||||
set_config('newest_user_id', $row['user_id'], true);
|
|
||||||
set_config('newest_username', $row['username'], true);
|
|
||||||
}
|
|
||||||
|
|
||||||
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id));
|
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,10 @@ class bbcode
|
||||||
var $template_bitfield = 0;
|
var $template_bitfield = 0;
|
||||||
var $template_filename = '';
|
var $template_filename = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* Init bbcode cache entries if bitfield is specified
|
||||||
|
*/
|
||||||
function bbcode($bitfield = 0)
|
function bbcode($bitfield = 0)
|
||||||
{
|
{
|
||||||
if ($bitfield)
|
if ($bitfield)
|
||||||
|
@ -33,6 +37,9 @@ class bbcode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Second pass bbcodes
|
||||||
|
*/
|
||||||
function bbcode_second_pass(&$message, $bbcode_uid = '', $bbcode_bitfield = false)
|
function bbcode_second_pass(&$message, $bbcode_uid = '', $bbcode_bitfield = false)
|
||||||
{
|
{
|
||||||
if ($bbcode_uid)
|
if ($bbcode_uid)
|
||||||
|
@ -97,12 +104,12 @@ class bbcode
|
||||||
$message = str_replace(':' . $this->bbcode_uid, '', $message);
|
$message = str_replace(':' . $this->bbcode_uid, '', $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/**
|
||||||
// bbcode_cache_init()
|
* Init bbcode cache
|
||||||
//
|
*
|
||||||
// requires: $this->bbcode_bitfield
|
* requires: $this->bbcode_bitfield
|
||||||
// sets: $this->bbcode_cache with bbcode templates needed for bbcode_bitfield
|
* sets: $this->bbcode_cache with bbcode templates needed for bbcode_bitfield
|
||||||
//
|
*/
|
||||||
function bbcode_cache_init()
|
function bbcode_cache_init()
|
||||||
{
|
{
|
||||||
global $user, $phpbb_root_path;
|
global $user, $phpbb_root_path;
|
||||||
|
@ -119,7 +126,7 @@ class bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = '';
|
$sql = '';
|
||||||
$bbcode_ids = array();
|
$bbcode_ids = $rowset = array();
|
||||||
$bitlen = strlen(decbin($this->bbcode_bitfield));
|
$bitlen = strlen(decbin($this->bbcode_bitfield));
|
||||||
|
|
||||||
for ($bbcode_id = 0; $bbcode_id < $bitlen; ++$bbcode_id)
|
for ($bbcode_id = 0; $bbcode_id < $bitlen; ++$bbcode_id)
|
||||||
|
@ -140,13 +147,12 @@ class bbcode
|
||||||
if ($sql)
|
if ($sql)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$rowset = array();
|
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . BBCODES_TABLE . "
|
FROM ' . BBCODES_TABLE . "
|
||||||
WHERE bbcode_id IN ($sql)";
|
WHERE bbcode_id IN ($sql)";
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$rowset[$row['bbcode_id']] = $row;
|
$rowset[$row['bbcode_id']] = $row;
|
||||||
|
@ -161,123 +167,159 @@ class bbcode
|
||||||
case 0:
|
case 0:
|
||||||
$this->bbcode_cache[$bbcode_id] = array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'str' => array(
|
'str' => array(
|
||||||
'[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id)
|
'[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id)
|
||||||
),
|
),
|
||||||
'preg' => array(
|
'preg' => array(
|
||||||
'#\[quote(?:="(.*?)")?:$uid\](.)#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
|
'#\[quote(?:="(.*?)")?:$uid\](.)#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('str' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'[b:$uid]' => $this->bbcode_tpl('b_open', $bbcode_id),
|
'str' => array(
|
||||||
'[/b:$uid]' => $this->bbcode_tpl('b_close', $bbcode_id)
|
'[b:$uid]' => $this->bbcode_tpl('b_open', $bbcode_id),
|
||||||
));
|
'[/b:$uid]' => $this->bbcode_tpl('b_close', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('str' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'[i:$uid]' => $this->bbcode_tpl('i_open', $bbcode_id),
|
'str' => array(
|
||||||
'[/i:$uid]' => $this->bbcode_tpl('i_close', $bbcode_id)
|
'[i:$uid]' => $this->bbcode_tpl('i_open', $bbcode_id),
|
||||||
));
|
'[/i:$uid]' => $this->bbcode_tpl('i_close', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[url:$uid\]((.*?))\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id),
|
'preg' => array(
|
||||||
'#\[url=([^\[]+?):$uid\](.*?)\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id)
|
'#\[url:$uid\]((.*?))\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id),
|
||||||
));
|
'#\[url=([^\[]+?):$uid\](.*?)\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
if ($user->optionget('viewimg'))
|
if ($user->optionget('viewimg'))
|
||||||
{
|
{
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => $this->bbcode_tpl('img', $bbcode_id)
|
'preg' => array(
|
||||||
));
|
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => $this->bbcode_tpl('img', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id))
|
'preg' => array(
|
||||||
));
|
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id)),
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[size=([\-\+]?[1-2]?[0-9]):$uid\](.*?)\[/size:$uid\]#s' => $this->bbcode_tpl('size', $bbcode_id)
|
'preg' => array(
|
||||||
));
|
'#\[size=([\-\+]?[1-2]?[0-9]):$uid\](.*?)\[/size:$uid\]#s' => $this->bbcode_tpl('size', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'!\[color=(#[0-9A-F]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!s' => $this->bbcode_tpl('color', $bbcode_id)
|
'preg' => array(
|
||||||
));
|
'!\[color=(#[0-9A-F]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!s' => $this->bbcode_tpl('color', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('str' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'[u:$uid]' => $this->bbcode_tpl('u_open', $bbcode_id),
|
'str' => array(
|
||||||
'[/u:$uid]' => $this->bbcode_tpl('u_close', $bbcode_id)
|
'[u:$uid]' => $this->bbcode_tpl('u_open', $bbcode_id),
|
||||||
));
|
'[/u:$uid]' => $this->bbcode_tpl('u_close', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise' => "\$this->bbcode_second_pass_code('\$1', '\$2')"
|
'preg' => array(
|
||||||
));
|
'#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise' => "\$this->bbcode_second_pass_code('\$1', '\$2')",
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 9:
|
case 9:
|
||||||
$this->bbcode_cache[$bbcode_id] = array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'preg' => array(
|
'preg' => array(
|
||||||
'#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1",
|
'#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1",
|
||||||
'#(\[list=([^\[]+):$uid\])[\n]{1}#' => "\$1",
|
'#(\[list=([^\[]+):$uid\])[\n]{1}#' => "\$1",
|
||||||
'#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')",
|
'#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')",
|
||||||
),
|
),
|
||||||
'str' => array(
|
'str' => array(
|
||||||
'[list:$uid]' => $this->bbcode_tpl('ulist_open_default', $bbcode_id),
|
'[list:$uid]' => $this->bbcode_tpl('ulist_open_default', $bbcode_id),
|
||||||
'[/list:u:$uid]' => $this->bbcode_tpl('ulist_close', $bbcode_id),
|
'[/list:u:$uid]' => $this->bbcode_tpl('ulist_close', $bbcode_id),
|
||||||
'[/list:o:$uid]' => $this->bbcode_tpl('olist_close', $bbcode_id),
|
'[/list:o:$uid]' => $this->bbcode_tpl('olist_close', $bbcode_id),
|
||||||
'[*:$uid]' => $this->bbcode_tpl('listitem', $bbcode_id),
|
'[*:$uid]' => $this->bbcode_tpl('listitem', $bbcode_id),
|
||||||
'[/*:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id),
|
'[/*:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id),
|
||||||
'[/*:m:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id)
|
'[/*:m:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id)
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[email:$uid\]((.*?))\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id),
|
'preg' => array(
|
||||||
'#\[email=([^\[]+):$uid\](.*?)\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id)
|
'#\[email:$uid\]((.*?))\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id),
|
||||||
));
|
'#\[email=([^\[]+):$uid\](.*?)\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id)
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 11:
|
case 11:
|
||||||
if ($user->optionget('viewflash'))
|
if ($user->optionget('viewflash'))
|
||||||
{
|
{
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash', $bbcode_id)
|
'preg' => array(
|
||||||
));
|
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash', $bbcode_id),
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->bbcode_cache[$bbcode_id] = array('preg' => array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id)))
|
'preg' => array(
|
||||||
));
|
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id)))
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 12:
|
case 12:
|
||||||
$this->bbcode_cache[$bbcode_id] = array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'str' => array(
|
'str' => array(
|
||||||
'[/attachment:$uid]' => $this->bbcode_tpl('inline_attachment_close', $bbcode_id)),
|
'[/attachment:$uid]' => $this->bbcode_tpl('inline_attachment_close', $bbcode_id)
|
||||||
|
),
|
||||||
'preg' => array(
|
'preg' => array(
|
||||||
'#\[attachment=([0-9]+):$uid\]#' => $this->bbcode_tpl('inline_attachment_open', $bbcode_id))
|
'#\[attachment=([0-9]+):$uid\]#' => $this->bbcode_tpl('inline_attachment_open', $bbcode_id)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (isset($rowset[$bbcode_id]))
|
if (isset($rowset[$bbcode_id]))
|
||||||
{
|
{
|
||||||
if ($this->template_bitfield & (1 << $bbcode_id))
|
if ($this->template_bitfield & (1 << $bbcode_id))
|
||||||
{
|
{
|
||||||
// The bbcode requires a custom template to be loaded
|
// The bbcode requires a custom template to be loaded
|
||||||
|
|
||||||
if (!$bbcode_tpl = $this->bbcode_tpl($rowset[$bbcode_id]['bbcode_tag'], $bbcode_id))
|
if (!$bbcode_tpl = $this->bbcode_tpl($rowset[$bbcode_id]['bbcode_tag'], $bbcode_id))
|
||||||
{
|
{
|
||||||
// For some reason, the required template seems not to be available,
|
// For some reason, the required template seems not to be available, use the default template
|
||||||
// use the default template
|
|
||||||
|
|
||||||
$bbcode_tpl = (!empty($rowset[$bbcode_id]['second_pass_replace'])) ? $rowset[$bbcode_id]['second_pass_replace'] : $rowset[$bbcode_id]['bbcode_tpl'];
|
$bbcode_tpl = (!empty($rowset[$bbcode_id]['second_pass_replace'])) ? $rowset[$bbcode_id]['second_pass_replace'] : $rowset[$bbcode_id]['bbcode_tpl'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -285,7 +327,6 @@ class bbcode
|
||||||
// In order to use templates with custom bbcodes we need
|
// In order to use templates with custom bbcodes we need
|
||||||
// to replace all {VARS} to corresponding backreferences
|
// to replace all {VARS} to corresponding backreferences
|
||||||
// Note that backreferences are numbered from bbcode_match
|
// Note that backreferences are numbered from bbcode_match
|
||||||
|
|
||||||
if (preg_match_all('/\{(URL|EMAIL|TEXT|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
|
if (preg_match_all('/\{(URL|EMAIL|TEXT|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
|
||||||
{
|
{
|
||||||
foreach ($m[0] as $i => $tok)
|
foreach ($m[0] as $i => $tok)
|
||||||
|
@ -307,7 +348,6 @@ class bbcode
|
||||||
if (!empty($rowset[$bbcode_id]['second_pass_replace']))
|
if (!empty($rowset[$bbcode_id]['second_pass_replace']))
|
||||||
{
|
{
|
||||||
// The custom BBCode requires second-pass pattern replacements
|
// The custom BBCode requires second-pass pattern replacements
|
||||||
|
|
||||||
$this->bbcode_cache[$bbcode_id] = array(
|
$this->bbcode_cache[$bbcode_id] = array(
|
||||||
'preg' => array($rowset[$bbcode_id]['second_pass_match'] => $bbcode_tpl)
|
'preg' => array($rowset[$bbcode_id]['second_pass_match'] => $bbcode_tpl)
|
||||||
);
|
);
|
||||||
|
@ -323,25 +363,29 @@ class bbcode
|
||||||
{
|
{
|
||||||
$this->bbcode_cache[$bbcode_id] = false;
|
$this->bbcode_cache[$bbcode_id] = false;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return bbcode template
|
||||||
|
*/
|
||||||
function bbcode_tpl($tpl_name, $bbcode_id = -1)
|
function bbcode_tpl($tpl_name, $bbcode_id = -1)
|
||||||
{
|
{
|
||||||
if (empty($bbcode_hardtpl))
|
if (empty($bbcode_hardtpl))
|
||||||
{
|
{
|
||||||
static $bbcode_hardtpl = array(
|
static $bbcode_hardtpl = array(
|
||||||
'b_open' => '<span style="font-weight: bold">',
|
'b_open' => '<span style="font-weight: bold">',
|
||||||
'b_close' => '</span>',
|
'b_close' => '</span>',
|
||||||
'i_open' => '<span style="font-style: italic">',
|
'i_open' => '<span style="font-style: italic">',
|
||||||
'i_close' => '</span>',
|
'i_close' => '</span>',
|
||||||
'u_open' => '<span style="text-decoration: underline">',
|
'u_open' => '<span style="text-decoration: underline">',
|
||||||
'u_close' => '</span>',
|
'u_close' => '</span>',
|
||||||
'img' => '<img src="$1" border="0" />',
|
'img' => '<img src="$1" border="0" />',
|
||||||
'size' => '<span style="font-size: $1px; line-height: normal">$2</span>',
|
'size' => '<span style="font-size: $1px; line-height: normal">$2</span>',
|
||||||
'color' => '<span style="color: $1">$2</span>',
|
'color' => '<span style="color: $1">$2</span>',
|
||||||
'email' => '<a href="mailto:$1">$2</a>'
|
'email' => '<a href="mailto:$1">$2</a>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +398,7 @@ class bbcode
|
||||||
{
|
{
|
||||||
if (($tpl = file_get_contents($this->template_filename)) === false)
|
if (($tpl = file_get_contents($this->template_filename)) === false)
|
||||||
{
|
{
|
||||||
trigger_error('Could not load bbcode template');
|
trigger_error('Could not load bbcode template', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace \ with \\ and then ' with \'.
|
// replace \ with \\ and then ' with \'.
|
||||||
|
@ -383,18 +427,21 @@ class bbcode
|
||||||
return (isset($this->bbcode_template[$tpl_name])) ? $this->bbcode_template[$tpl_name] : ((isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false);
|
return (isset($this->bbcode_template[$tpl_name])) ? $this->bbcode_template[$tpl_name] : ((isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return bbcode template replacement
|
||||||
|
*/
|
||||||
function bbcode_tpl_replace($tpl_name, $tpl)
|
function bbcode_tpl_replace($tpl_name, $tpl)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
static $replacements = array(
|
static $replacements = array(
|
||||||
'quote_username_open' => array('{USERNAME}' => '$1'),
|
'quote_username_open' => array('{USERNAME}' => '$1'),
|
||||||
'color' => array('{COLOR}' => '$1', '{TEXT}' => '$2'),
|
'color' => array('{COLOR}' => '$1', '{TEXT}' => '$2'),
|
||||||
'size' => array('{SIZE}' => '$1', '{TEXT}' => '$2'),
|
'size' => array('{SIZE}' => '$1', '{TEXT}' => '$2'),
|
||||||
'img' => array('{URL}' => '$1'),
|
'img' => array('{URL}' => '$1'),
|
||||||
'flash' => array('{WIDTH}' => '$1', '{HEIGHT}' => '$2', '{URL}' => '$3'),
|
'flash' => array('{WIDTH}' => '$1', '{HEIGHT}' => '$2', '{URL}' => '$3'),
|
||||||
'url' => array('{URL}' => '$1', '{DESCRIPTION}' => '$2'),
|
'url' => array('{URL}' => '$1', '{DESCRIPTION}' => '$2'),
|
||||||
'email' => array('{EMAIL}' => '$1', '{DESCRIPTION}' => '$2')
|
'email' => array('{EMAIL}' => '$1', '{DESCRIPTION}' => '$2')
|
||||||
);
|
);
|
||||||
|
|
||||||
$tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);
|
$tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);
|
||||||
|
@ -407,60 +454,68 @@ class bbcode
|
||||||
return trim($tpl);
|
return trim($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Second parse list bbcode
|
||||||
|
*/
|
||||||
function bbcode_list($type)
|
function bbcode_list($type)
|
||||||
{
|
{
|
||||||
if ($type == '')
|
switch ($type)
|
||||||
{
|
{
|
||||||
$tpl = 'ulist_open_default';
|
case '':
|
||||||
$type = 'default';
|
$tpl = 'ulist_open_default';
|
||||||
$start = 0;
|
$type = 'default';
|
||||||
}
|
$start = 0;
|
||||||
else if ($type == 'i')
|
break;
|
||||||
{
|
|
||||||
$tpl = 'olist_open';
|
case 'i':
|
||||||
$type = 'lower-roman';
|
$tpl = 'olist_open';
|
||||||
$start = 1;
|
$type = 'lower-roman';
|
||||||
}
|
$start = 1;
|
||||||
else if ($type == 'I')
|
break;
|
||||||
{
|
|
||||||
$tpl = 'olist_open';
|
case 'I':
|
||||||
$type = 'upper-roman';
|
$tpl = 'olist_open';
|
||||||
$start = 1;
|
$type = 'upper-roman';
|
||||||
}
|
$start = 1;
|
||||||
else if (preg_match('#^(disc|circle|square)$#i', $type))
|
break;
|
||||||
{
|
|
||||||
$tpl = 'ulist_open';
|
case (preg_match('#^(disc|circle|square)$#i', $type)):
|
||||||
$type = strtolower($type);
|
$tpl = 'ulist_open';
|
||||||
$start = 1;
|
$type = strtolower($type);
|
||||||
}
|
$start = 1;
|
||||||
else if (preg_match('#^[a-z]$#', $type))
|
break;
|
||||||
{
|
|
||||||
$tpl = 'olist_open';
|
case (preg_match('#^[a-z]$#', $type)):
|
||||||
$type = 'lower-alpha';
|
$tpl = 'olist_open';
|
||||||
$start = ord($type) - 96;
|
$type = 'lower-alpha';
|
||||||
}
|
$start = ord($type) - 96;
|
||||||
else if (preg_match('#[A-Z]#', $type))
|
break;
|
||||||
{
|
|
||||||
$tpl = 'olist_open';
|
case (preg_match('#[A-Z]#', $type)):
|
||||||
$type = 'upper-alpha';
|
$tpl = 'olist_open';
|
||||||
$start = ord($type) - 64;
|
$type = 'upper-alpha';
|
||||||
}
|
$start = ord($type) - 64;
|
||||||
else if (is_numeric($type))
|
break;
|
||||||
{
|
|
||||||
$tpl = 'olist_open';
|
case (is_numeric($type)):
|
||||||
$type = 'arabic-numbers';
|
$tpl = 'olist_open';
|
||||||
$start = intval($type);
|
$type = 'arabic-numbers';
|
||||||
}
|
$start = intval($type);
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
$tpl = 'olist_open';
|
default:
|
||||||
$type = 'arabic-numbers';
|
$tpl = 'olist_open';
|
||||||
$start = 1;
|
$type = 'arabic-numbers';
|
||||||
|
$start = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl));
|
return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Second parse quote tag
|
||||||
|
*/
|
||||||
function bbcode_second_pass_quote($username, $quote)
|
function bbcode_second_pass_quote($username, $quote)
|
||||||
{
|
{
|
||||||
// when using the /e modifier, preg_replace slashes double-quotes but does not
|
// when using the /e modifier, preg_replace slashes double-quotes but does not
|
||||||
|
@ -479,6 +534,9 @@ class bbcode
|
||||||
return $quote;
|
return $quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Second parse code tag
|
||||||
|
*/
|
||||||
function bbcode_second_pass_code($type, $code)
|
function bbcode_second_pass_code($type, $code)
|
||||||
{
|
{
|
||||||
// when using the /e modifier, preg_replace slashes double-quotes but does not
|
// when using the /e modifier, preg_replace slashes double-quotes but does not
|
||||||
|
@ -494,6 +552,8 @@ class bbcode
|
||||||
$code = substr($code, 41);
|
$code = substr($code, 41);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$code = str_replace("\t", ' ', $code);
|
$code = str_replace("\t", ' ', $code);
|
||||||
$code = str_replace(' ', ' ', $code);
|
$code = str_replace(' ', ' ', $code);
|
||||||
|
@ -504,6 +564,7 @@ class bbcode
|
||||||
{
|
{
|
||||||
$code = substr($code, 1);
|
$code = substr($code, 1);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');
|
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');
|
||||||
|
|
|
@ -2265,6 +2265,8 @@ function get_database_size()
|
||||||
{
|
{
|
||||||
global $db, $user, $table_prefix;
|
global $db, $user, $table_prefix;
|
||||||
|
|
||||||
|
$database_size = false;
|
||||||
|
|
||||||
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
|
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
|
||||||
switch (SQL_LAYER)
|
switch (SQL_LAYER)
|
||||||
{
|
{
|
||||||
|
@ -2289,7 +2291,7 @@ function get_database_size()
|
||||||
FROM ' . $db_name;
|
FROM ' . $db_name;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$dbsize = 0;
|
$database_size = 0;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB')))
|
if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB')))
|
||||||
|
@ -2298,25 +2300,17 @@ function get_database_size()
|
||||||
{
|
{
|
||||||
if (strstr($row['Name'], $table_prefix))
|
if (strstr($row['Name'], $table_prefix))
|
||||||
{
|
{
|
||||||
$dbsize += $row['Data_length'] + $row['Index_length'];
|
$database_size += $row['Data_length'] + $row['Index_length'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$dbsize += $row['Data_length'] + $row['Index_length'];
|
$database_size += $row['Data_length'] + $row['Index_length'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$dbsize = $user->lang['NOT_AVAILABLE'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$dbsize = $user->lang['NOT_AVAILABLE'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -2327,7 +2321,7 @@ function get_database_size()
|
||||||
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||||
FROM sysfiles';
|
FROM sysfiles';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$dbsize = ($row = $db->sql_fetchrow($result)) ? intval($row['dbsize']) : $user->lang['NOT_AVAILABLE'];
|
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -2343,7 +2337,6 @@ function get_database_size()
|
||||||
|
|
||||||
if ($row['proname'] == 'pg_database_size')
|
if ($row['proname'] == 'pg_database_size')
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT oid
|
$sql = "SELECT oid
|
||||||
FROM pg_database
|
FROM pg_database
|
||||||
WHERE datname = '" . $db->dbname . "'";
|
WHERE datname = '" . $db->dbname . "'";
|
||||||
|
@ -2358,26 +2351,22 @@ function get_database_size()
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$dbsize = $row['size'];
|
$database_size = $row['size'];
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$dbsize = $user->lang['NOT_AVAILABLE'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
|
|
||||||
$dbsize = $user->lang['NOT_AVAILABLE'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_int($dbsize))
|
if ($database_size !== false)
|
||||||
{
|
{
|
||||||
$dbsize = ($dbsize >= 1048576) ? sprintf('%.2f ' . $user->lang['MB'], ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f ' . $user->lang['KB'], ($dbsize / 1024)) : sprintf('%.2f ' . $user->lang['BYTES'], $dbsize));
|
$database_size = ($database_size >= 1048576) ? sprintf('%.2f ' . $user->lang['MB'], ($database_size / 1048576)) : (($database_size >= 1024) ? sprintf('%.2f ' . $user->lang['KB'], ($database_size / 1024)) : sprintf('%.2f ' . $user->lang['BYTES'], $database_size));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$database_size = $user->lang['NOT_AVAILABLE'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $dbsize;
|
return $database_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -827,11 +827,12 @@ class jabber
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a string to utf8 encoding.
|
* Converts a string to utf8 encoding.
|
||||||
* @private
|
|
||||||
*
|
*
|
||||||
* @param string $string has to have the same encoding as {@link encoding the encoding attribute} is set to.
|
* @param string $string has to have the same encoding as {@link encoding the encoding attribute} is set to.
|
||||||
*
|
*
|
||||||
* @return boolean True on success, false on failure.
|
* @return boolean True on success, false on failure.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _conv_utf8(&$string)
|
function _conv_utf8(&$string)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ class smtp_class
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try EHLO first
|
// Try EHLO first
|
||||||
$this->server_send("EHLO [{$local_host}]");
|
$this->server_send("EHLO {$local_host}");
|
||||||
if ($err_msg = $this->server_parse('250', __LINE__))
|
if ($err_msg = $this->server_parse('250', __LINE__))
|
||||||
{
|
{
|
||||||
// a 503 response code means that we're already authenticated
|
// a 503 response code means that we're already authenticated
|
||||||
|
@ -1012,7 +1012,7 @@ class smtp_class
|
||||||
}
|
}
|
||||||
|
|
||||||
// If EHLO fails, we try HELO
|
// If EHLO fails, we try HELO
|
||||||
$this->server_send("HELO [{$local_host}]");
|
$this->server_send("HELO {$local_host}");
|
||||||
if ($err_msg = $this->server_parse('250', __LINE__))
|
if ($err_msg = $this->server_parse('250', __LINE__))
|
||||||
{
|
{
|
||||||
return ($this->numeric_response_code == 503) ? false : $err_msg;
|
return ($this->numeric_response_code == 503) ? false : $err_msg;
|
||||||
|
|
|
@ -510,7 +510,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
list($width, $height, $type, ) = getimagesize($source);
|
list($width, $height, $type, ) = @getimagesize($source);
|
||||||
|
|
||||||
if (!$width || !$height)
|
if (!$width || !$height)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
/**
|
/**
|
||||||
* @package phpBB3
|
* @package phpBB3
|
||||||
* Transfer class, wrapper for ftp/sftp/ssh
|
* Transfer class, wrapper for ftp/sftp/ssh
|
||||||
* @todo check for available extensions
|
|
||||||
*/
|
*/
|
||||||
class transfer
|
class transfer
|
||||||
{
|
{
|
||||||
|
@ -62,7 +61,7 @@ class transfer
|
||||||
|
|
||||||
if (!$fp)
|
if (!$fp)
|
||||||
{
|
{
|
||||||
trigger_error('Unable to create temporary file ' . $temp_name);
|
trigger_error('Unable to create temporary file ' . $temp_name, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@fwrite($fp, $contents);
|
@fwrite($fp, $contents);
|
||||||
|
@ -100,7 +99,6 @@ class transfer
|
||||||
global $phpbb_root_path;
|
global $phpbb_root_path;
|
||||||
|
|
||||||
$dir = str_replace($phpbb_root_path, '', $dir);
|
$dir = str_replace($phpbb_root_path, '', $dir);
|
||||||
|
|
||||||
$dir = explode('/', $dir);
|
$dir = explode('/', $dir);
|
||||||
$dirs = '';
|
$dirs = '';
|
||||||
|
|
||||||
|
@ -108,7 +106,7 @@ class transfer
|
||||||
{
|
{
|
||||||
$result = true;
|
$result = true;
|
||||||
|
|
||||||
if ($dir[$i] == '..' || $dir[$i] == '.')
|
if (strpos($dir[$i], '.') === 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +114,7 @@ class transfer
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . $dirs . $cur_dir))
|
if (!file_exists($phpbb_root_path . $dirs . $cur_dir))
|
||||||
{
|
{
|
||||||
// make the directory
|
// create the directory
|
||||||
$result = $this->_mkdir($dir[$i]);
|
$result = $this->_mkdir($dir[$i]);
|
||||||
$this->_chmod($dir[$i], $this->dir_perms);
|
$this->_chmod($dir[$i], $this->dir_perms);
|
||||||
}
|
}
|
||||||
|
@ -262,11 +260,19 @@ class ftp extends transfer
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
return array('host' => 'localhost' , 'username' => 'anonymous', 'password' => '', 'root_path' => $user->page['root_script_path'], 'port' => 21, 'timeout' => 10);
|
return array(
|
||||||
|
'host' => 'localhost',
|
||||||
|
'username' => 'anonymous',
|
||||||
|
'password' => '',
|
||||||
|
'root_path' => $user->page['root_script_path'],
|
||||||
|
'port' => 21,
|
||||||
|
'timeout' => 10
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init FTP Session
|
* Init FTP Session
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _init()
|
function _init()
|
||||||
{
|
{
|
||||||
|
@ -275,7 +281,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
if (!$this->connection)
|
if (!$this->connection)
|
||||||
{
|
{
|
||||||
return false;
|
return 'ERR_CONNECTING_SERVER';
|
||||||
}
|
}
|
||||||
|
|
||||||
// attempt to turn pasv mode on
|
// attempt to turn pasv mode on
|
||||||
|
@ -284,13 +290,13 @@ class ftp extends transfer
|
||||||
// login to the server
|
// login to the server
|
||||||
if (!@ftp_login($this->connection, $this->username, $this->password))
|
if (!@ftp_login($this->connection, $this->username, $this->password))
|
||||||
{
|
{
|
||||||
return false;
|
return 'ERR_UNABLE_TO_LOGIN';
|
||||||
}
|
}
|
||||||
|
|
||||||
// change to the root directory
|
// change to the root directory
|
||||||
if (!$this->_chdir($this->root_path))
|
if (!$this->_chdir($this->root_path))
|
||||||
{
|
{
|
||||||
return 'Unable to change directory';
|
return 'ERR_CHANGING_DIRECTORY';
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -298,6 +304,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Directory (MKDIR)
|
* Create Directory (MKDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _mkdir($dir)
|
function _mkdir($dir)
|
||||||
{
|
{
|
||||||
|
@ -306,6 +313,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove directory (RMDIR)
|
* Remove directory (RMDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _rmdir($dir)
|
function _rmdir($dir)
|
||||||
{
|
{
|
||||||
|
@ -314,6 +322,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove directory (RMDIR)
|
* Remove directory (RMDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _rename($old_handle, $new_handle)
|
function _rename($old_handle, $new_handle)
|
||||||
{
|
{
|
||||||
|
@ -322,6 +331,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change current working directory (CHDIR)
|
* Change current working directory (CHDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _chdir($dir = '')
|
function _chdir($dir = '')
|
||||||
{
|
{
|
||||||
|
@ -335,6 +345,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* change file permissions (CHMOD)
|
* change file permissions (CHMOD)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _chmod($file, $perms)
|
function _chmod($file, $perms)
|
||||||
{
|
{
|
||||||
|
@ -347,23 +358,19 @@ class ftp extends transfer
|
||||||
$chmod_cmd = 'CHMOD 0' . $perms . ' ' . $file;
|
$chmod_cmd = 'CHMOD 0' . $perms . ' ' . $file;
|
||||||
$err = $this->_site($chmod_cmd);
|
$err = $this->_site($chmod_cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload file to location (PUT)
|
* Upload file to location (PUT)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _put($from_file, $to_file)
|
function _put($from_file, $to_file)
|
||||||
{
|
{
|
||||||
// get the file extension
|
// get the file extension
|
||||||
$file_extension = strtolower(substr(strrchr($to_file, '.'), 1));
|
$file_extension = strtolower(substr(strrchr($to_file, '.'), 1));
|
||||||
|
|
||||||
// extension list for files that need to be transfered as binary.
|
|
||||||
// Taken from the old EasyMOD which was taken from the attachment MOD
|
|
||||||
// $extensions = array('ace', 'ai', 'aif', 'aifc', 'aiff', 'ar', 'asf', 'asx', 'au', 'avi', 'doc', 'dot', 'gif', 'gtar', 'gz', 'ivf', 'jpeg', 'jpg', 'm3u', 'mid', 'midi', 'mlv', 'mp2', 'mp3', 'mp2v', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpv2', 'pdf', 'png', 'ppt', 'ps', 'rar', 'rm', 'rmi', 'snd', 'swf', 'tga', 'tif', 'wav', 'wax', 'wm', 'wma', 'wmv', 'wmx', 'wvx', 'xls', 'zip') ;
|
|
||||||
// $is_binary = in_array($file_extension, $extensions);
|
|
||||||
// $mode = ($is_binary) ? FTP_BINARY : FTP_ASCII;
|
|
||||||
|
|
||||||
// We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced)
|
// We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced)
|
||||||
$mode = FTP_BINARY;
|
$mode = FTP_BINARY;
|
||||||
|
|
||||||
|
@ -379,6 +386,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete file (DELETE)
|
* Delete file (DELETE)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _delete($file)
|
function _delete($file)
|
||||||
{
|
{
|
||||||
|
@ -387,6 +395,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close ftp session (CLOSE)
|
* Close ftp session (CLOSE)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _close()
|
function _close()
|
||||||
{
|
{
|
||||||
|
@ -401,6 +410,7 @@ class ftp extends transfer
|
||||||
/**
|
/**
|
||||||
* Return current working directory (CWD)
|
* Return current working directory (CWD)
|
||||||
* At the moment not used by parent class
|
* At the moment not used by parent class
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _cwd()
|
function _cwd()
|
||||||
{
|
{
|
||||||
|
@ -410,6 +420,7 @@ class ftp extends transfer
|
||||||
/**
|
/**
|
||||||
* Return list of files in a given directory (LS)
|
* Return list of files in a given directory (LS)
|
||||||
* At the moment not used by parent class
|
* At the moment not used by parent class
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _ls($dir = './')
|
function _ls($dir = './')
|
||||||
{
|
{
|
||||||
|
@ -418,6 +429,7 @@ class ftp extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FTP SITE command (ftp-only function)
|
* FTP SITE command (ftp-only function)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _site($command)
|
function _site($command)
|
||||||
{
|
{
|
||||||
|
@ -462,11 +474,19 @@ class ftp_fsock extends transfer
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
return array('host' => 'localhost' , 'username' => 'anonymous', 'password' => '', 'root_path' => $user->page['root_script_path'], 'port' => 21, 'timeout' => 10);
|
return array(
|
||||||
|
'host' => 'localhost',
|
||||||
|
'username' => 'anonymous',
|
||||||
|
'password' => '',
|
||||||
|
'root_path' => $user->page['root_script_path'],
|
||||||
|
'port' => 21,
|
||||||
|
'timeout' => 10
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init FTP Session
|
* Init FTP Session
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _init()
|
function _init()
|
||||||
{
|
{
|
||||||
|
@ -478,7 +498,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
if (!$this->connection || !$this->_check_command())
|
if (!$this->connection || !$this->_check_command())
|
||||||
{
|
{
|
||||||
return false;
|
return 'ERR_CONNECTING_SERVER';
|
||||||
}
|
}
|
||||||
|
|
||||||
@stream_set_timeout($this->connection, $this->timeout);
|
@stream_set_timeout($this->connection, $this->timeout);
|
||||||
|
@ -486,18 +506,18 @@ class ftp_fsock extends transfer
|
||||||
// login
|
// login
|
||||||
if (!$this->_send_command('USER', $this->username))
|
if (!$this->_send_command('USER', $this->username))
|
||||||
{
|
{
|
||||||
return false;
|
return 'ERR_UNABLE_TO_LOGIN';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->_send_command('PASS', $this->password))
|
if (!$this->_send_command('PASS', $this->password))
|
||||||
{
|
{
|
||||||
return false;
|
return 'ERR_UNABLE_TO_LOGIN';
|
||||||
}
|
}
|
||||||
|
|
||||||
// change to the root directory
|
// change to the root directory
|
||||||
if (!$this->_chdir($this->root_path))
|
if (!$this->_chdir($this->root_path))
|
||||||
{
|
{
|
||||||
return 'Unable to change directory';
|
return 'ERR_CHANGING_DIRECTORY';
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -505,6 +525,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Directory (MKDIR)
|
* Create Directory (MKDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _mkdir($dir)
|
function _mkdir($dir)
|
||||||
{
|
{
|
||||||
|
@ -513,6 +534,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove directory (RMDIR)
|
* Remove directory (RMDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _rmdir($dir)
|
function _rmdir($dir)
|
||||||
{
|
{
|
||||||
|
@ -521,6 +543,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change current working directory (CHDIR)
|
* Change current working directory (CHDIR)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _chdir($dir = '')
|
function _chdir($dir = '')
|
||||||
{
|
{
|
||||||
|
@ -534,6 +557,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* change file permissions (CHMOD)
|
* change file permissions (CHMOD)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _chmod($file, $perms)
|
function _chmod($file, $perms)
|
||||||
{
|
{
|
||||||
|
@ -542,6 +566,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload file to location (PUT)
|
* Upload file to location (PUT)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _put($from_file, $to_file)
|
function _put($from_file, $to_file)
|
||||||
{
|
{
|
||||||
|
@ -577,6 +602,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete file (DELETE)
|
* Delete file (DELETE)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _delete($file)
|
function _delete($file)
|
||||||
{
|
{
|
||||||
|
@ -585,6 +611,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close ftp session (CLOSE)
|
* Close ftp session (CLOSE)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _close()
|
function _close()
|
||||||
{
|
{
|
||||||
|
@ -599,6 +626,7 @@ class ftp_fsock extends transfer
|
||||||
/**
|
/**
|
||||||
* Return current working directory (CWD)
|
* Return current working directory (CWD)
|
||||||
* At the moment not used by parent class
|
* At the moment not used by parent class
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _cwd()
|
function _cwd()
|
||||||
{
|
{
|
||||||
|
@ -609,6 +637,7 @@ class ftp_fsock extends transfer
|
||||||
/**
|
/**
|
||||||
* Return list of files in a given directory (LS)
|
* Return list of files in a given directory (LS)
|
||||||
* At the moment not used by parent class
|
* At the moment not used by parent class
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _ls($dir = './')
|
function _ls($dir = './')
|
||||||
{
|
{
|
||||||
|
@ -631,6 +660,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a command to server (FTP fsock only function)
|
* Send a command to server (FTP fsock only function)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _send_command($command, $args = '', $check = true)
|
function _send_command($command, $args = '', $check = true)
|
||||||
{
|
{
|
||||||
|
@ -651,6 +681,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens a connection to send data (FTP fosck only function)
|
* Opens a connection to send data (FTP fosck only function)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _open_data_connection()
|
function _open_data_connection()
|
||||||
{
|
{
|
||||||
|
@ -685,6 +716,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes a connection used to send data
|
* Closes a connection used to send data
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _close_data_connection()
|
function _close_data_connection()
|
||||||
{
|
{
|
||||||
|
@ -693,6 +725,7 @@ class ftp_fsock extends transfer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to make sure command was successful (FTP fsock only function)
|
* Check to make sure command was successful (FTP fsock only function)
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function _check_command($return = false)
|
function _check_command($return = false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,29 @@ function user_get_id_name(&$user_id_ary, &$username_ary)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get latest registered username and update database to reflect it
|
||||||
|
*/
|
||||||
|
function update_last_username()
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
// Get latest username
|
||||||
|
$sql = 'SELECT user_id, username
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
||||||
|
ORDER BY user_id DESC';
|
||||||
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($row)
|
||||||
|
{
|
||||||
|
set_config('newest_user_id', $row['user_id'], true);
|
||||||
|
set_config('newest_username', $row['username'], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a username across all relevant tables/fields
|
* Updates a username across all relevant tables/fields
|
||||||
*
|
*
|
||||||
|
@ -96,6 +119,105 @@ function user_update_name($old_name, $new_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add User
|
||||||
|
*/
|
||||||
|
function user_add($user_row, $cp_data = false)
|
||||||
|
{
|
||||||
|
global $db, $config;
|
||||||
|
|
||||||
|
if (empty($user_row['username']) || empty($user_row['group_id']) || empty($user_row['user_email']) || empty($user_row['user_type']))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_ary = array(
|
||||||
|
'username' => $user_row['username'],
|
||||||
|
'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
|
||||||
|
'user_email' => $user_row['user_email'],
|
||||||
|
'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']),
|
||||||
|
'group_id' => $user_row['group_id'],
|
||||||
|
'user_type' => $user_row['user_type'],
|
||||||
|
);
|
||||||
|
|
||||||
|
// These are the additional vars able to be specified
|
||||||
|
$additional_vars = array(
|
||||||
|
'user_permissions' => '',
|
||||||
|
'user_timezone' => 0,
|
||||||
|
'user_dateformat' => $config['default_dateformat'],
|
||||||
|
'user_lang' => $config['default_lang'],
|
||||||
|
'user_style' => $config['default_style'],
|
||||||
|
'user_allow_pm' => 1,
|
||||||
|
'user_actkey' => '',
|
||||||
|
'user_ip' => '',
|
||||||
|
'user_regdate' => time(),
|
||||||
|
|
||||||
|
'user_lastmark' => time(),
|
||||||
|
'user_lastvisit' => 0,
|
||||||
|
'user_lastpost_time' => 0,
|
||||||
|
'user_lastpage' => '',
|
||||||
|
'user_posts' => 0,
|
||||||
|
'user_dst' => 0,
|
||||||
|
'user_colour' => '',
|
||||||
|
'user_avatar' => '',
|
||||||
|
'user_avatar_type' => 0,
|
||||||
|
'user_avatar_width' => 0,
|
||||||
|
'user_avatar_height' => 0,
|
||||||
|
'user_new_privmsg' => 0,
|
||||||
|
'user_unread_privmsg' => 0,
|
||||||
|
'user_last_privmsg' => 0,
|
||||||
|
'user_message_rules' => 0,
|
||||||
|
'user_full_folder' => PRIVMSGS_NO_BOX,
|
||||||
|
'user_emailtime' => 0,
|
||||||
|
|
||||||
|
'user_notify' => 0,
|
||||||
|
'user_notify_pm' => 1,
|
||||||
|
'user_notify_type' => NOTIFY_EMAIL,
|
||||||
|
'user_allow_pm' => 1,
|
||||||
|
'user_allow_email' => 1,
|
||||||
|
'user_allow_viewonline' => 1,
|
||||||
|
'user_allow_viewemail' => 1,
|
||||||
|
'user_allow_massemail' => 1,
|
||||||
|
|
||||||
|
'user_sig' => '',
|
||||||
|
'user_sig_bbcode_uid' => '',
|
||||||
|
'user_sig_bbcode_bitfield' => 0,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Now fill the sql array with not required variables
|
||||||
|
foreach ($additional_vars as $key => $default_value)
|
||||||
|
{
|
||||||
|
$sql_ary[$key] = (isset($user_row[$key])) ? $user_row[$key] : $default_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->sql_transaction('begin');
|
||||||
|
|
||||||
|
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
$user_id = $db->sql_nextid();
|
||||||
|
|
||||||
|
// Insert Custom Profile Fields
|
||||||
|
if ($cp_data !== false && sizeof($cp_data))
|
||||||
|
{
|
||||||
|
$cp_data['user_id'] = (int) $user_id;
|
||||||
|
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
|
||||||
|
$db->sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Place into appropriate group...
|
||||||
|
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||||
|
'user_id' => (int) $user_id,
|
||||||
|
'group_id' => (int) $user_row['group_id'],
|
||||||
|
'user_pending' => 0)
|
||||||
|
);
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
$db->sql_transaction('commit');
|
||||||
|
|
||||||
|
return $user_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove User
|
* Remove User
|
||||||
*/
|
*/
|
||||||
|
@ -193,18 +315,7 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||||
// Reset newest user info if appropriate
|
// Reset newest user info if appropriate
|
||||||
if ($config['newest_user_id'] == $user_id)
|
if ($config['newest_user_id'] == $user_id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT user_id, username
|
update_last_username();
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
|
||||||
ORDER BY user_id DESC';
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
set_config('newest_user_id', $row['user_id'], true);
|
|
||||||
set_config('newest_username', $row['username'], true);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_config('num_users', $config['num_users'] - 1, true);
|
set_config('num_users', $config['num_users'] - 1, true);
|
||||||
|
|
|
@ -89,19 +89,19 @@ class bbcode_firstpass extends bbcode
|
||||||
// order, so it is important to keep [code] in first position and
|
// order, so it is important to keep [code] in first position and
|
||||||
// [quote] in second position.
|
// [quote] in second position.
|
||||||
$this->bbcodes = array(
|
$this->bbcodes = array(
|
||||||
'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#ise' => "\$this->bbcode_code('\$1', '\$2')")),
|
'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#ise' => "\$this->bbcode_code('\$1', '\$2')")),
|
||||||
'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#ise' => "\$this->bbcode_quote('\$0')")),
|
'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#ise' => "\$this->bbcode_quote('\$0')")),
|
||||||
'attachment'=> array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")),
|
'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")),
|
||||||
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
|
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
|
||||||
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
|
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
|
||||||
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
|
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
|
||||||
'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")),
|
'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")),
|
||||||
'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
|
'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
|
||||||
'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
|
'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
|
||||||
'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")),
|
'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")),
|
||||||
'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(=[a-z|0-9|(?:disc|circle|square))]+)?\].*\[/list\]#ise' => "\$this->bbcode_parse_list('\$0')")),
|
'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(=[a-z|0-9|(?:disc|circle|square))]+)?\].*\[/list\]#ise' => "\$this->bbcode_parse_list('\$0')")),
|
||||||
'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")),
|
'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")),
|
||||||
'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
|
'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zero the parsed items array
|
// Zero the parsed items array
|
||||||
|
@ -119,8 +119,8 @@ class bbcode_firstpass extends bbcode
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . BBCODES_TABLE;
|
FROM ' . BBCODES_TABLE;
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$rowset[] = $row;
|
$rowset[] = $row;
|
||||||
|
@ -146,7 +146,8 @@ class bbcode_firstpass extends bbcode
|
||||||
// seem to slash anything else
|
// seem to slash anything else
|
||||||
$in = str_replace("\r\n", "\n", str_replace('\"', '"', $in));
|
$in = str_replace("\r\n", "\n", str_replace('\"', '"', $in));
|
||||||
|
|
||||||
if (!$in)
|
// Trimming here to make sure no empty bbcodes are parsed accidently
|
||||||
|
if (!trim($in))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +169,7 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse size bbcode
|
* Parse size tag
|
||||||
*/
|
*/
|
||||||
function bbcode_size($stx, $in)
|
function bbcode_size($stx, $in)
|
||||||
{
|
{
|
||||||
|
@ -188,7 +189,7 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse color bbcode
|
* Parse color tag
|
||||||
*/
|
*/
|
||||||
function bbcode_color($stx, $in)
|
function bbcode_color($stx, $in)
|
||||||
{
|
{
|
||||||
|
@ -201,7 +202,7 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse u bbcode
|
* Parse u tag
|
||||||
*/
|
*/
|
||||||
function bbcode_underline($in)
|
function bbcode_underline($in)
|
||||||
{
|
{
|
||||||
|
@ -214,7 +215,7 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse b bbcode
|
* Parse b tag
|
||||||
*/
|
*/
|
||||||
function bbcode_strong($in)
|
function bbcode_strong($in)
|
||||||
{
|
{
|
||||||
|
@ -227,7 +228,7 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse i bbcode
|
* Parse i tag
|
||||||
*/
|
*/
|
||||||
function bbcode_italic($in)
|
function bbcode_italic($in)
|
||||||
{
|
{
|
||||||
|
@ -240,44 +241,67 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse img bbcode
|
* Parse img tag
|
||||||
*/
|
*/
|
||||||
function bbcode_img($in)
|
function bbcode_img($in)
|
||||||
{
|
{
|
||||||
global $user, $config;
|
global $user, $config, $phpEx;
|
||||||
|
|
||||||
if (!$this->check_bbcode('img', $in))
|
if (!$this->check_bbcode('img', $in))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$in = trim($in);
|
||||||
|
|
||||||
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
|
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
|
||||||
{
|
{
|
||||||
$stats = getimagesize($in);
|
$stats = @getimagesize($in);
|
||||||
|
|
||||||
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1])
|
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1])
|
||||||
{
|
{
|
||||||
$this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
|
$this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0])
|
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0])
|
||||||
{
|
{
|
||||||
$this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
|
$this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return '[img:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars(trim($in)) . '[/img:' . $this->bbcode_uid . ']';
|
// Is the user trying to link to a php file in this domain and script path?
|
||||||
|
if (strpos($in, ".{$phpEx}") !== false && strpos($in, substr($user->page['root_script_path'], 0, -1)) !== false)
|
||||||
|
{
|
||||||
|
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||||
|
|
||||||
|
// Forcing server vars is the only way to specify/override the protocol
|
||||||
|
if ($config['force_server_vars'] || !$server_name)
|
||||||
|
{
|
||||||
|
$server_name = $config['server_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos($in, $server_name) !== false)
|
||||||
|
{
|
||||||
|
return '[img]' . $in . '[/img]';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '[img:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($in) . '[/img:' . $this->bbcode_uid . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse flash bbcode
|
* Parse flash tag
|
||||||
*/
|
*/
|
||||||
function bbcode_flash($width, $height, $in)
|
function bbcode_flash($width, $height, $in)
|
||||||
{
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
if (!$this->check_bbcode('flash', $in))
|
if (!$this->check_bbcode('flash', $in))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
global $config;
|
$in = trim($in);
|
||||||
|
|
||||||
// Apply the same size checks on flash files as on images
|
// Apply the same size checks on flash files as on images
|
||||||
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
|
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
|
||||||
|
@ -293,7 +317,24 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return '[flash=' . $width . ',' . $height . ':' . $this->bbcode_uid . ']' . $this->bbcode_specialchars(trim($in)) . '[/flash:' . $this->bbcode_uid . ']';
|
// Is the user trying to link to a php file in this domain and script path?
|
||||||
|
if (strpos($in, ".{$phpEx}") !== false && strpos($in, substr($user->page['root_script_path'], 0, -1)) !== false)
|
||||||
|
{
|
||||||
|
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||||
|
|
||||||
|
// Forcing server vars is the only way to specify/override the protocol
|
||||||
|
if ($config['force_server_vars'] || !$server_name)
|
||||||
|
{
|
||||||
|
$server_name = $config['server_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos($in, $server_name) !== false)
|
||||||
|
{
|
||||||
|
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '[flash=' . $width . ',' . $height . ':' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($in) . '[/flash:' . $this->bbcode_uid . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -310,7 +351,7 @@ class bbcode_firstpass extends bbcode
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse code bbcode
|
* Parse code tag
|
||||||
* Expects the argument to start right after the opening [code] tag and to end with [/code]
|
* Expects the argument to start right after the opening [code] tag and to end with [/code]
|
||||||
*/
|
*/
|
||||||
function bbcode_code($stx, $in)
|
function bbcode_code($stx, $in)
|
||||||
|
@ -320,8 +361,6 @@ class bbcode_firstpass extends bbcode
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// $in = trim($in);
|
|
||||||
|
|
||||||
// We remove the hardcoded elements from the code block here because it is not used in code blocks
|
// We remove the hardcoded elements from the code block here because it is not used in code blocks
|
||||||
// Having it here saves us one preg_replace per message containing [code] blocks
|
// Having it here saves us one preg_replace per message containing [code] blocks
|
||||||
// Additionally, magic url parsing should go after parsing bbcodes, but for safety those are stripped out too...
|
// Additionally, magic url parsing should go after parsing bbcodes, but for safety those are stripped out too...
|
||||||
|
@ -367,11 +406,11 @@ class bbcode_firstpass extends bbcode
|
||||||
switch (strtolower($stx))
|
switch (strtolower($stx))
|
||||||
{
|
{
|
||||||
case 'php':
|
case 'php':
|
||||||
$remove_tags = false;
|
$code = trim($code);
|
||||||
$str_from = array('<', '>');
|
|
||||||
$str_to = array('<', '>');
|
$remove_tags = false;
|
||||||
|
$code = str_replace(array('<', '>'), array('<', '>'), $code);
|
||||||
|
|
||||||
$code = str_replace($str_from, $str_to, $code);
|
|
||||||
if (!preg_match('/^\<\?.*?\?\>/is', $code))
|
if (!preg_match('/^\<\?.*?\?\>/is', $code))
|
||||||
{
|
{
|
||||||
$remove_tags = true;
|
$remove_tags = true;
|
||||||
|
@ -386,7 +425,6 @@ class bbcode_firstpass extends bbcode
|
||||||
|
|
||||||
// Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results
|
// Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results
|
||||||
$code = html_entity_decode($code);
|
$code = html_entity_decode($code);
|
||||||
|
|
||||||
$code = highlight_string($code, true);
|
$code = highlight_string($code, true);
|
||||||
|
|
||||||
$str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>','[', ']', '.', ':');
|
$str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>','[', ']', '.', ':');
|
||||||
|
@ -415,9 +453,6 @@ class bbcode_firstpass extends bbcode
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$str_from = array('<', '>', '[', ']', '.', ':');
|
|
||||||
$str_to = array('<', '>', '[', ']', '.', ':');
|
|
||||||
|
|
||||||
$out .= '[code:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($code) . '[/code:' . $this->bbcode_uid . ']';
|
$out .= '[code:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($code) . '[/code:' . $this->bbcode_uid . ']';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -810,7 +845,7 @@ class parse_message extends bbcode_firstpass
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse Message : public
|
* Parse Message
|
||||||
*/
|
*/
|
||||||
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true, $mode = 'post')
|
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true, $mode = 'post')
|
||||||
{
|
{
|
||||||
|
@ -909,7 +944,9 @@ class parse_message extends bbcode_firstpass
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formatting text for display
|
/**
|
||||||
|
* Formatting text for display
|
||||||
|
*/
|
||||||
function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true)
|
function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true)
|
||||||
{
|
{
|
||||||
// If false, then the parsed message get returned but internal message not processed.
|
// If false, then the parsed message get returned but internal message not processed.
|
||||||
|
@ -950,7 +987,9 @@ class parse_message extends bbcode_firstpass
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode message to be placed back into form box
|
/**
|
||||||
|
* Decode message to be placed back into form box
|
||||||
|
*/
|
||||||
function decode_message($custom_bbcode_uid = '', $update_this_message = true)
|
function decode_message($custom_bbcode_uid = '', $update_this_message = true)
|
||||||
{
|
{
|
||||||
// If false, then the parsed message get returned but internal message not processed.
|
// If false, then the parsed message get returned but internal message not processed.
|
||||||
|
@ -973,26 +1012,31 @@ class parse_message extends bbcode_firstpass
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx.
|
/**
|
||||||
// Cuts down displayed size of link if over 50 chars, turns absolute links
|
* Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx.
|
||||||
// into relative versions when the server/script path matches the link
|
* Cuts down displayed size of link if over 50 chars, turns absolute links
|
||||||
|
* into relative versions when the server/script path matches the link
|
||||||
|
*/
|
||||||
function magic_url($server_url)
|
function magic_url($server_url)
|
||||||
{
|
{
|
||||||
// We use the global make_clickable function
|
// We use the global make_clickable function
|
||||||
$this->message = make_clickable($this->message, $server_url);
|
$this->message = make_clickable($this->message, $server_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse Smilies
|
/**
|
||||||
|
* Parse Smilies
|
||||||
|
*/
|
||||||
function smilies($max_smilies = 0)
|
function smilies($max_smilies = 0)
|
||||||
{
|
{
|
||||||
global $db, $user, $phpbb_root_path;
|
global $db, $user, $phpbb_root_path;
|
||||||
static $match;
|
static $match;
|
||||||
static $replace;
|
static $replace;
|
||||||
|
|
||||||
// NOTE: There is a memory leak in this block somewhere :\
|
|
||||||
// See if the static arrays have already been filled on an earlier invocation
|
// See if the static arrays have already been filled on an earlier invocation
|
||||||
if (!is_array($match))
|
if (!is_array($match))
|
||||||
{
|
{
|
||||||
|
$match = $replace = array();
|
||||||
|
|
||||||
// NOTE: obtain_* function? chaching the table contents?
|
// NOTE: obtain_* function? chaching the table contents?
|
||||||
|
|
||||||
// For now setting the ttl to 10 minutes
|
// For now setting the ttl to 10 minutes
|
||||||
|
@ -1020,21 +1064,11 @@ class parse_message extends bbcode_firstpass
|
||||||
}
|
}
|
||||||
$result = $db->sql_query($sql, 600);
|
$result = $db->sql_query($sql, 600);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$match = $replace = array();
|
// (assertion)
|
||||||
|
$match[] = '#(?<=^|[\n ]|\.)' . preg_quote($row['code'], '#') . '#';
|
||||||
do
|
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" border="0" alt="' . $row['emotion'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->';
|
||||||
{
|
|
||||||
// (assertion)
|
|
||||||
$match[] = '#(?<=^|[\n ]|\.)' . preg_quote($row['code'], '#') . '#';
|
|
||||||
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" border="0" alt="' . $row['emotion'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->';
|
|
||||||
}
|
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$match = $replace = array();
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
@ -1056,7 +1090,9 @@ class parse_message extends bbcode_firstpass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse Attachments
|
/**
|
||||||
|
* Parse Attachments
|
||||||
|
*/
|
||||||
function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
|
function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
|
||||||
{
|
{
|
||||||
global $config, $auth, $user, $phpbb_root_path, $phpEx;
|
global $config, $auth, $user, $phpbb_root_path, $phpEx;
|
||||||
|
@ -1302,7 +1338,9 @@ class parse_message extends bbcode_firstpass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse Poll
|
/**
|
||||||
|
* Parse Poll
|
||||||
|
*/
|
||||||
function parse_poll(&$poll)
|
function parse_poll(&$poll)
|
||||||
{
|
{
|
||||||
global $auth, $user, $config;
|
global $auth, $user, $config;
|
||||||
|
|
|
@ -14,18 +14,21 @@
|
||||||
*/
|
*/
|
||||||
class session
|
class session
|
||||||
{
|
{
|
||||||
var $session_id = '';
|
|
||||||
var $cookie_data = array();
|
var $cookie_data = array();
|
||||||
|
var $page = array();
|
||||||
|
var $data = array();
|
||||||
var $browser = '';
|
var $browser = '';
|
||||||
var $host = '';
|
var $host = '';
|
||||||
|
var $session_id = '';
|
||||||
var $ip = '';
|
var $ip = '';
|
||||||
var $page = array();
|
var $load = 0;
|
||||||
var $current_page_filename = '';
|
|
||||||
var $load;
|
|
||||||
var $time_now = 0;
|
var $time_now = 0;
|
||||||
|
var $update_session_page = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract current session page
|
* Extract current session page
|
||||||
|
*
|
||||||
|
* @param string $root_path current root path (phpbb_root_path)
|
||||||
*/
|
*/
|
||||||
function extract_current_page($root_path)
|
function extract_current_page($root_path)
|
||||||
{
|
{
|
||||||
|
@ -39,7 +42,7 @@ class session
|
||||||
if (!$script_name)
|
if (!$script_name)
|
||||||
{
|
{
|
||||||
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
|
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
|
||||||
$page['failover'] = 1;
|
$page_array['failover'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace backslashes and doubled slashes (could happen on some proxy setups)
|
// Replace backslashes and doubled slashes (could happen on some proxy setups)
|
||||||
|
@ -122,22 +125,26 @@ class session
|
||||||
* running on a system which makes such information readily available) and
|
* running on a system which makes such information readily available) and
|
||||||
* halt if it's above an admin definable limit.
|
* halt if it's above an admin definable limit.
|
||||||
*
|
*
|
||||||
|
* @param bool $update_session_page if true the session page gets updated.
|
||||||
|
* This can be set to circumvent certain scripts to update the users last visited page.
|
||||||
|
*
|
||||||
* @todo Introduce further user types, bot, guest
|
* @todo Introduce further user types, bot, guest
|
||||||
* @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example
|
* @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example
|
||||||
*/
|
*/
|
||||||
function session_begin()
|
function session_begin($update_session_page = true)
|
||||||
{
|
{
|
||||||
global $phpEx, $SID, $_SID, $db, $config, $phpbb_root_path;
|
global $phpEx, $SID, $_SID, $db, $config, $phpbb_root_path;
|
||||||
|
|
||||||
$this->time_now = time();
|
// Give us some basic informations
|
||||||
|
$this->time_now = time();
|
||||||
|
$this->cookie_data = array('u' => 0, 'k' => '');
|
||||||
|
$this->update_session_page = $update_session_page;
|
||||||
|
$this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : '';
|
||||||
|
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) $_SERVER['HTTP_HOST'] : 'localhost';
|
||||||
|
$this->page = $this->extract_current_page($phpbb_root_path);
|
||||||
|
|
||||||
$this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
|
||||||
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : 'localhost';
|
|
||||||
|
|
||||||
$this->page = $this->extract_current_page($phpbb_root_path);
|
|
||||||
$this->page['page'] .= (isset($_POST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . 'f=' . intval($_POST['f']) : '';
|
$this->page['page'] .= (isset($_POST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . 'f=' . intval($_POST['f']) : '';
|
||||||
|
|
||||||
$this->cookie_data = array('u' => 0, 'k' => '');
|
|
||||||
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
|
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
|
||||||
{
|
{
|
||||||
// Switch to request_var ... can this cause issues, can a _GET/_POST param
|
// Switch to request_var ... can this cause issues, can a _GET/_POST param
|
||||||
|
@ -190,7 +197,6 @@ class session
|
||||||
WHERE s.session_id = '" . $db->sql_escape($this->session_id) . "'
|
WHERE s.session_id = '" . $db->sql_escape($this->session_id) . "'
|
||||||
AND u.user_id = s.session_user_id";
|
AND u.user_id = s.session_user_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$this->data = $db->sql_fetchrow($result);
|
$this->data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -204,15 +210,15 @@ class session
|
||||||
$s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
|
$s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
|
||||||
$u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
|
$u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
|
||||||
|
|
||||||
$s_browser = ($config['browser_check']) ? substr($this->data['session_browser'], 0, 149) : '';
|
$s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : '';
|
||||||
$u_browser = ($config['browser_check']) ? substr($this->browser, 0, 149) : '';
|
$u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : '';
|
||||||
|
|
||||||
if ($u_ip === $s_ip && $s_browser === $u_browser)
|
if ($u_ip === $s_ip && $s_browser === $u_browser)
|
||||||
{
|
{
|
||||||
$session_expired = false;
|
$session_expired = false;
|
||||||
|
|
||||||
// Check whether the session is still valid if we have one
|
// Check whether the session is still valid if we have one
|
||||||
$method = trim($config['auth_method']);
|
$method = basename(trim($config['auth_method']));
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||||
{
|
{
|
||||||
|
@ -248,10 +254,16 @@ class session
|
||||||
if (!$session_expired)
|
if (!$session_expired)
|
||||||
{
|
{
|
||||||
// Only update session DB a minute or so after last update or if page changes
|
// Only update session DB a minute or so after last update or if page changes
|
||||||
if ($this->time_now - $this->data['session_time'] > 60 || $this->data['session_page'] != $this->page['page'])
|
if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . SESSIONS_TABLE . "
|
$sql_ary = array('session_time' => $this->time_now);
|
||||||
SET session_time = $this->time_now, session_page = '" . $db->sql_escape(substr($this->page['page'], 0, 199)) . "'
|
|
||||||
|
if ($this->update_session_page)
|
||||||
|
{
|
||||||
|
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||||
WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
|
WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
@ -343,7 +355,7 @@ class session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$method = trim($config['auth_method']);
|
$method = basename(trim($config['auth_method']));
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||||
{
|
{
|
||||||
|
@ -373,7 +385,6 @@ class session
|
||||||
AND k.user_id = u.user_id
|
AND k.user_id = u.user_id
|
||||||
AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
|
AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$this->data = $db->sql_fetchrow($result);
|
$this->data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
@ -387,7 +398,6 @@ class session
|
||||||
WHERE user_id = ' . (int) $this->cookie_data['u'] . '
|
WHERE user_id = ' . (int) $this->cookie_data['u'] . '
|
||||||
AND user_type <> ' . USER_INACTIVE;
|
AND user_type <> ' . USER_INACTIVE;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$this->data = $db->sql_fetchrow($result);
|
$this->data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
@ -406,7 +416,6 @@ class session
|
||||||
FROM ' . USERS_TABLE . '
|
FROM ' . USERS_TABLE . '
|
||||||
WHERE user_id = ' . (int) $this->cookie_data['u'];
|
WHERE user_id = ' . (int) $this->cookie_data['u'];
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$this->data = $db->sql_fetchrow($result);
|
$this->data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
@ -448,13 +457,17 @@ class session
|
||||||
'session_last_visit' => (int) $this->data['session_last_visit'],
|
'session_last_visit' => (int) $this->data['session_last_visit'],
|
||||||
'session_time' => (int) $this->time_now,
|
'session_time' => (int) $this->time_now,
|
||||||
'session_browser' => (string) $this->browser,
|
'session_browser' => (string) $this->browser,
|
||||||
'session_page' => (string) substr($this->page['page'], 0, 199),
|
|
||||||
'session_ip' => (string) $this->ip,
|
'session_ip' => (string) $this->ip,
|
||||||
'session_autologin' => ($session_autologin) ? 1 : 0,
|
'session_autologin' => ($session_autologin) ? 1 : 0,
|
||||||
'session_admin' => ($set_admin) ? 1 : 0,
|
'session_admin' => ($set_admin) ? 1 : 0,
|
||||||
'session_viewonline' => ($viewonline) ? 1 : 0,
|
'session_viewonline' => ($viewonline) ? 1 : 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->update_session_page)
|
||||||
|
{
|
||||||
|
$sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
|
||||||
|
}
|
||||||
|
|
||||||
$db->sql_return_on_error(true);
|
$db->sql_return_on_error(true);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||||
|
@ -465,11 +478,10 @@ class session
|
||||||
// Limit new sessions in 1 minute period (if required)
|
// Limit new sessions in 1 minute period (if required)
|
||||||
if ((!isset($this->data['session_time']) || !$this->data['session_time']) && $config['active_sessions'])
|
if ((!isset($this->data['session_time']) || !$this->data['session_time']) && $config['active_sessions'])
|
||||||
{
|
{
|
||||||
$sql = 'SELECT COUNT(*) AS sessions
|
$sql = 'SELECT COUNT(session_id) AS sessions
|
||||||
FROM ' . SESSIONS_TABLE . '
|
FROM ' . SESSIONS_TABLE . '
|
||||||
WHERE session_time >= ' . ($this->time_now - 60);
|
WHERE session_time >= ' . ($this->time_now - 60);
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -482,8 +494,10 @@ class session
|
||||||
$this->session_id = $this->data['session_id'] = md5(unique_id());
|
$this->session_id = $this->data['session_id'] = md5(unique_id());
|
||||||
|
|
||||||
$sql_ary['session_id'] = (string) $this->session_id;
|
$sql_ary['session_id'] = (string) $this->session_id;
|
||||||
|
$sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
|
||||||
|
|
||||||
$db->sql_query('INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
|
$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||||
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
$db->sql_return_on_error(false);
|
$db->sql_return_on_error(false);
|
||||||
|
|
||||||
|
@ -495,6 +509,7 @@ class session
|
||||||
|
|
||||||
$SID = '?sid=';
|
$SID = '?sid=';
|
||||||
$_SID = '';
|
$_SID = '';
|
||||||
|
|
||||||
if (!$bot)
|
if (!$bot)
|
||||||
{
|
{
|
||||||
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
|
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
|
||||||
|
@ -506,11 +521,6 @@ class session
|
||||||
$SID = '?sid=' . $this->session_id;
|
$SID = '?sid=' . $this->session_id;
|
||||||
$_SID = $this->session_id;
|
$_SID = $this->session_id;
|
||||||
|
|
||||||
if ($this->data['user_id'] != ANONYMOUS)
|
|
||||||
{
|
|
||||||
// global $evt;
|
|
||||||
// $evt->trigger(EVT_NEW_SESSION, $this->data);
|
|
||||||
}
|
|
||||||
unset($cookie_expire);
|
unset($cookie_expire);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,7 +545,7 @@ class session
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Allow connecting logout with external auth method logout
|
// Allow connecting logout with external auth method logout
|
||||||
$method = trim($config['auth_method']);
|
$method = basename(trim($config['auth_method']));
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||||
{
|
{
|
||||||
|
@ -576,10 +586,8 @@ class session
|
||||||
FROM ' . USERS_TABLE . '
|
FROM ' . USERS_TABLE . '
|
||||||
WHERE user_id = ' . ANONYMOUS;
|
WHERE user_id = ' . ANONYMOUS;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$this->data = $db->sql_fetchrow($result);
|
$this->data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cookie_expire = $this->time_now - 31536000;
|
$cookie_expire = $this->time_now - 31536000;
|
||||||
|
@ -603,8 +611,6 @@ class session
|
||||||
* data before those sessions are destroyed. In addition this method
|
* data before those sessions are destroyed. In addition this method
|
||||||
* removes autologin key information that is older than an admin defined
|
* removes autologin key information that is older than an admin defined
|
||||||
* limit.
|
* limit.
|
||||||
*
|
|
||||||
* @todo add to cron
|
|
||||||
*/
|
*/
|
||||||
function session_gc()
|
function session_gc()
|
||||||
{
|
{
|
||||||
|
@ -652,7 +658,7 @@ class session
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
set_config('session_last_gc', $this->time_now);
|
set_config('session_last_gc', $this->time_now);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
@ -682,6 +688,7 @@ class session
|
||||||
}
|
}
|
||||||
while ($row = $db->sql_fetchrow($result));
|
while ($row = $db->sql_fetchrow($result));
|
||||||
}
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($del_user_id)
|
if ($del_user_id)
|
||||||
{
|
{
|
||||||
|
@ -698,7 +705,7 @@ class session
|
||||||
// called again to delete other sessions
|
// called again to delete other sessions
|
||||||
set_config('session_last_gc', $this->time_now, true);
|
set_config('session_last_gc', $this->time_now, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['max_autologin_time'])
|
if ($config['max_autologin_time'])
|
||||||
|
@ -791,6 +798,7 @@ class session
|
||||||
{
|
{
|
||||||
$this->session_kill();
|
$this->session_kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine which message to output
|
// Determine which message to output
|
||||||
$till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
|
$till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
|
||||||
$message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
$message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
||||||
|
@ -800,12 +808,7 @@ class session
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($banned)
|
return ($banned) ? true : false;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -816,9 +819,7 @@ class session
|
||||||
* DB. When they revisit with the same key it's automatically updated in both the
|
* DB. When they revisit with the same key it's automatically updated in both the
|
||||||
* DB and cookie. Multiple keys may exist for each user representing different
|
* DB and cookie. Multiple keys may exist for each user representing different
|
||||||
* browsers or locations. As with _any_ non-secure-socket no passphrase login this
|
* browsers or locations. As with _any_ non-secure-socket no passphrase login this
|
||||||
* remains vulnerable to exploit. However, by rotating the keys and seperating them
|
* remains vulnerable to exploit.
|
||||||
* from the password hash it's more secure than 2.0.x. Don't be surprised to see
|
|
||||||
* this backported!
|
|
||||||
*/
|
*/
|
||||||
function set_login_key($user_id = false, $key = false, $user_ip = false)
|
function set_login_key($user_id = false, $key = false, $user_ip = false)
|
||||||
{
|
{
|
||||||
|
@ -843,11 +844,20 @@ class session
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = ($key) ? 'UPDATE ' . SESSIONS_KEYS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . (int) $user_id . " AND key_id = '" . $db->sql_escape(md5($key)) . "'" : 'INSERT INTO ' . SESSIONS_KEYS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
if ($key)
|
||||||
|
{
|
||||||
|
$sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . '
|
||||||
|
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||||
|
WHERE user_id = ' . (int) $user_id . "
|
||||||
|
AND key_id = '" . $db->sql_escape(md5($key)) . "'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||||
|
}
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$this->cookie_data['k'] = $key_id;
|
$this->cookie_data['k'] = $key_id;
|
||||||
unset($sql_ary, $key_id);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -864,13 +874,14 @@ class session
|
||||||
|
|
||||||
$user_id = ($user_id === false) ? $this->data['user_id'] : $user_id;
|
$user_id = ($user_id === false) ? $this->data['user_id'] : $user_id;
|
||||||
|
|
||||||
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE user_id = ' . (int) $user_id;
|
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
|
||||||
|
WHERE user_id = ' . (int) $user_id;
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Let's also clear any current sessions for the specified user_id
|
// Let's also clear any current sessions for the specified user_id
|
||||||
// If it's the current user then we'll leave this session intact
|
// If it's the current user then we'll leave this session intact
|
||||||
$sql_where = 'session_user_id = ' . (int) $user_id;
|
$sql_where = 'session_user_id = ' . (int) $user_id;
|
||||||
$sql_where .= ($user_id === $this->data['user_id']) ? " AND session_id <> '" . $this->session_id . "'" : '';
|
$sql_where .= ($user_id === $this->data['user_id']) ? " AND session_id <> '" . $db->sql_escape($this->session_id) . "'" : '';
|
||||||
|
|
||||||
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
|
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
|
||||||
WHERE $sql_where";
|
WHERE $sql_where";
|
||||||
|
@ -910,6 +921,9 @@ class user extends session
|
||||||
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10);
|
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10);
|
||||||
var $keyvalues = array();
|
var $keyvalues = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup basic user-specific items (style, language, ...)
|
||||||
|
*/
|
||||||
function setup($lang_set = false, $style = false)
|
function setup($lang_set = false, $style = false)
|
||||||
{
|
{
|
||||||
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
|
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
|
||||||
|
@ -931,6 +945,8 @@ class user extends session
|
||||||
$this->timezone = $config['board_timezone'] * 3600;
|
$this->timezone = $config['board_timezone'] * 3600;
|
||||||
$this->dst = $config['board_dst'] * 3600;
|
$this->dst = $config['board_dst'] * 3600;
|
||||||
|
|
||||||
|
/* Browser-specific language setting removed - might re-appear later
|
||||||
|
|
||||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||||
{
|
{
|
||||||
$accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
$accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
|
@ -957,6 +973,7 @@ class user extends session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// We include common language file here to not load it every time a custom language file is included
|
// We include common language file here to not load it every time a custom language file is included
|
||||||
|
@ -966,7 +983,6 @@ class user extends session
|
||||||
die("Language file " . $this->lang_path . "common.$phpEx" . " couldn't be opened.");
|
die("Language file " . $this->lang_path . "common.$phpEx" . " couldn't be opened.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->add_lang($lang_set);
|
$this->add_lang($lang_set);
|
||||||
unset($lang_set);
|
unset($lang_set);
|
||||||
|
|
||||||
|
@ -992,6 +1008,7 @@ class user extends session
|
||||||
AND i.imageset_id = s.imageset_id";
|
AND i.imageset_id = s.imageset_id";
|
||||||
$result = $db->sql_query($sql, 3600);
|
$result = $db->sql_query($sql, 3600);
|
||||||
$this->theme = $db->sql_fetchrow($result);
|
$this->theme = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// User has wrong style
|
// User has wrong style
|
||||||
if (!$this->theme && $style == $this->data['user_style'])
|
if (!$this->theme && $style == $this->data['user_style'])
|
||||||
|
@ -1041,6 +1058,9 @@ class user extends session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the style author specified the theme needs to be cached
|
||||||
|
// (because of the used paths and variables) than make sure it is the case.
|
||||||
|
// For example, if the theme uses language-specific images it needs to be stored in db.
|
||||||
if (!$this->theme['theme_storedb'] && $this->theme['parse_css_file'])
|
if (!$this->theme['theme_storedb'] && $this->theme['parse_css_file'])
|
||||||
{
|
{
|
||||||
$this->theme['theme_storedb'] = 1;
|
$this->theme['theme_storedb'] = 1;
|
||||||
|
@ -1051,8 +1071,10 @@ class user extends session
|
||||||
'theme_storedb' => 1
|
'theme_storedb' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->sql_query('UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
$sql = 'UPDATE ' . STYLES_THEME_TABLE . '
|
||||||
WHERE theme_id = ' . $this->theme['theme_id']);
|
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||||
|
WHERE theme_id = ' . $this->theme['theme_id'];
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
unset($sql_ary);
|
unset($sql_ary);
|
||||||
}
|
}
|
||||||
|
@ -1078,8 +1100,7 @@ class user extends session
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does the user need to change their password? If so, redirect to the
|
// Does the user need to change their password? If so, redirect to the
|
||||||
// ucp profile reg_details page ... of course do not redirect if we're
|
// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
|
||||||
// already in the ucp
|
|
||||||
if (!defined('IN_ADMIN') && $config['chg_passforce'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
|
if (!defined('IN_ADMIN') && $config['chg_passforce'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
|
||||||
{
|
{
|
||||||
if (strpos($this->page['query_string'], 'mode=reg_details') !== false && $this->page['page_name'] == "ucp.$phpEx")
|
if (strpos($this->page['query_string'], 'mode=reg_details') !== false && $this->page['page_name'] == "ucp.$phpEx")
|
||||||
|
@ -1091,13 +1112,22 @@ class user extends session
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
|
/**
|
||||||
//
|
* Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
|
||||||
// $lang_set = array('posting', 'help' => 'faq');
|
*
|
||||||
// $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
|
* @param mixed $lang_set specifies the language entries to include
|
||||||
// $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
|
* @param bool $use_db internal variable for recursion, do not use
|
||||||
// $lang_set = 'posting'
|
* @param bool $use_help internal variable for recursion, do not use
|
||||||
// $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
|
*
|
||||||
|
* Examples:
|
||||||
|
* <code>
|
||||||
|
* $lang_set = array('posting', 'help' => 'faq');
|
||||||
|
* $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
|
||||||
|
* $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
|
||||||
|
* $lang_set = 'posting'
|
||||||
|
* $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
|
||||||
|
* </code>
|
||||||
|
*/
|
||||||
function add_lang($lang_set, $use_db = false, $use_help = false)
|
function add_lang($lang_set, $use_db = false, $use_help = false)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
global $phpEx;
|
||||||
|
@ -1135,6 +1165,10 @@ class user extends session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set language entry (called by add_lang)
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false)
|
function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
global $phpEx;
|
||||||
|
@ -1154,7 +1188,7 @@ class user extends session
|
||||||
{
|
{
|
||||||
if ((include($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx")) === false)
|
if ((include($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx")) === false)
|
||||||
{
|
{
|
||||||
trigger_error("Language file {$this->lang_path}" . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx couldn't be opened.");
|
trigger_error("Language file {$this->lang_path}" . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx couldn't be opened.", E_USER_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($use_db)
|
else if ($use_db)
|
||||||
|
@ -1165,6 +1199,9 @@ class user extends session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format user date
|
||||||
|
*/
|
||||||
function format_date($gmepoch, $format = false, $forcedate = false)
|
function format_date($gmepoch, $format = false, $forcedate = false)
|
||||||
{
|
{
|
||||||
static $lang_dates, $midnight;
|
static $lang_dates, $midnight;
|
||||||
|
@ -1204,6 +1241,9 @@ class user extends session
|
||||||
return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates);
|
return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get language id currently used by the user
|
||||||
|
*/
|
||||||
function get_iso_lang_id()
|
function get_iso_lang_id()
|
||||||
{
|
{
|
||||||
global $config, $db;
|
global $config, $db;
|
||||||
|
@ -1228,7 +1268,9 @@ class user extends session
|
||||||
return $lang_id;
|
return $lang_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get profile fields for user
|
/**
|
||||||
|
* Get users profile fields
|
||||||
|
*/
|
||||||
function get_profile_fields($user_id)
|
function get_profile_fields($user_id)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
@ -1238,14 +1280,17 @@ class user extends session
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE . "
|
$sql = 'SELECT *
|
||||||
|
FROM ' . PROFILE_FIELDS_DATA_TABLE . "
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
|
||||||
$this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
|
$this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify/Get image
|
||||||
|
*/
|
||||||
function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag')
|
function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag')
|
||||||
{
|
{
|
||||||
static $imgs;
|
static $imgs;
|
||||||
|
@ -1310,7 +1355,9 @@ class user extends session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start code for checking/setting option bit field for user table
|
/**
|
||||||
|
* Get option bit field from user options
|
||||||
|
*/
|
||||||
function optionget($key, $data = false)
|
function optionget($key, $data = false)
|
||||||
{
|
{
|
||||||
if (!isset($this->keyvalues[$key]))
|
if (!isset($this->keyvalues[$key]))
|
||||||
|
@ -1318,9 +1365,13 @@ class user extends session
|
||||||
$var = ($data) ? $data : $this->data['user_options'];
|
$var = ($data) ? $data : $this->data['user_options'];
|
||||||
$this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false;
|
$this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->keyvalues[$key];
|
return $this->keyvalues[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set option bit field for user options
|
||||||
|
*/
|
||||||
function optionset($key, $value, $data = false)
|
function optionset($key, $value, $data = false)
|
||||||
{
|
{
|
||||||
$var = ($data) ? $data : $this->data['user_options'];
|
$var = ($data) ? $data : $this->data['user_options'];
|
||||||
|
|
|
@ -17,12 +17,10 @@ if (!defined('IN_PHPBB'))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package phpBB3
|
* @package phpBB3
|
||||||
*
|
|
||||||
* Base Template class.
|
* Base Template class.
|
||||||
*/
|
*/
|
||||||
class template
|
class template
|
||||||
{
|
{
|
||||||
|
|
||||||
/** variable that holds all the data we'll be substituting into
|
/** variable that holds all the data we'll be substituting into
|
||||||
* the compiled templates. Takes form:
|
* the compiled templates. Takes form:
|
||||||
* --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value
|
* --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value
|
||||||
|
@ -156,7 +154,7 @@ class template
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the handle and assign the output to a template variable or return the content.
|
* Display the handle and assign the output to a template variable or return the compiled result.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
|
function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
|
||||||
|
@ -225,44 +223,41 @@ class template
|
||||||
OR template_included LIKE '%" . $db->sql_escape($this->filename[$handle]) . ":%')";
|
OR template_included LIKE '%" . $db->sql_escape($this->filename[$handle]) . ":%')";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
do
|
if ($row['template_mtime'] < filemtime($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/' . $row['template_filename']))
|
||||||
{
|
{
|
||||||
if ($row['template_mtime'] < filemtime($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/' . $row['template_filename']))
|
|
||||||
{
|
|
||||||
if ($row['template_filename'] == $this->filename[$handle])
|
|
||||||
{
|
|
||||||
$compile->_tpl_load_file($handle);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->files[$row['template_filename']] = $this->root . '/' . $row['template_filename'];
|
|
||||||
$compile->_tpl_load_file($row['template_filename']);
|
|
||||||
unset($this->compiled_code[$row['template_filename']]);
|
|
||||||
unset($this->files[$row['template_filename']]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($row['template_filename'] == $this->filename[$handle])
|
if ($row['template_filename'] == $this->filename[$handle])
|
||||||
{
|
{
|
||||||
$this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
|
$compile->_tpl_load_file($handle);
|
||||||
$compile->compile_write($handle, $this->compiled_code[$handle]);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Only bother compiling if it doesn't already exist
|
$this->files[$row['template_filename']] = $this->root . '/' . $row['template_filename'];
|
||||||
if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . $phpEx))
|
$compile->_tpl_load_file($row['template_filename']);
|
||||||
{
|
unset($this->compiled_code[$row['template_filename']]);
|
||||||
$this->filename[$row['template_filename']] = $row['template_filename'];
|
unset($this->files[$row['template_filename']]);
|
||||||
$compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
|
}
|
||||||
unset($this->filename[$row['template_filename']]);
|
}
|
||||||
}
|
|
||||||
|
if ($row['template_filename'] == $this->filename[$handle])
|
||||||
|
{
|
||||||
|
$this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
|
||||||
|
$compile->compile_write($handle, $this->compiled_code[$handle]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Only bother compiling if it doesn't already exist
|
||||||
|
if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . $phpEx))
|
||||||
|
{
|
||||||
|
$this->filename[$row['template_filename']] = $row['template_filename'];
|
||||||
|
$compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
|
||||||
|
unset($this->filename[$row['template_filename']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,8 +350,7 @@ class template
|
||||||
unset($this->_tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
|
unset($this->_tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a new iteration to this block with the variable assignments
|
// Add a new iteration to this block with the variable assignments we were given.
|
||||||
// we were given.
|
|
||||||
$this->_tpldata[$blockname][] = $vararray;
|
$this->_tpldata[$blockname][] = $vararray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +362,6 @@ class template
|
||||||
*
|
*
|
||||||
* Some Examples:
|
* Some Examples:
|
||||||
* <code>
|
* <code>
|
||||||
*
|
|
||||||
* alter_block_array('loop', $vararray); // Insert vararray at the beginning
|
* alter_block_array('loop', $vararray); // Insert vararray at the beginning
|
||||||
* alter_block_array('loop', $vararray, 2); // Insert vararray at position 2
|
* alter_block_array('loop', $vararray, 2); // Insert vararray at position 2
|
||||||
* alter_block_array('loop', $vararray, array('KEY' => 'value')); // Insert vararray at the position where the key 'KEY' has the value of 'value'
|
* alter_block_array('loop', $vararray, array('KEY' => 'value')); // Insert vararray at the position where the key 'KEY' has the value of 'value'
|
||||||
|
@ -379,7 +372,6 @@ class template
|
||||||
* alter_block_array('loop', $vararray, array('KEY' => 'value'), 'change'); // Change/Merge vararray with existing array at the position where the key 'KEY' has the value of 'value'
|
* alter_block_array('loop', $vararray, array('KEY' => 'value'), 'change'); // Change/Merge vararray with existing array at the position where the key 'KEY' has the value of 'value'
|
||||||
* alter_block_array('loop', $vararray, false, 'change'); // Change/Merge vararray with existing array at first position
|
* alter_block_array('loop', $vararray, false, 'change'); // Change/Merge vararray with existing array at first position
|
||||||
* alter_block_array('loop', $vararray, true, 'change'); // Change/Merge vararray with existing array at last position
|
* alter_block_array('loop', $vararray, true, 'change'); // Change/Merge vararray with existing array at last position
|
||||||
*
|
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $blockname the blockname, for example 'loop'
|
* @param string $blockname the blockname, for example 'loop'
|
||||||
|
@ -391,18 +383,17 @@ class template
|
||||||
* int: Position [the position to change or insert at directly given]
|
* int: Position [the position to change or insert at directly given]
|
||||||
*
|
*
|
||||||
* If key is false the position is set to 0
|
* If key is false the position is set to 0
|
||||||
*
|
|
||||||
* If key is true the position is set to the last entry
|
* If key is true the position is set to the last entry
|
||||||
*
|
*
|
||||||
* @param insert|change $mode Mode to execute
|
* @param insert|change $mode Mode to execute
|
||||||
*
|
*
|
||||||
* If insert, the vararray is inserted at the given position (position counting from zero).
|
* If insert, the vararray is inserted at the given position (position counting from zero).
|
||||||
*
|
|
||||||
* If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
|
* If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
|
||||||
*
|
*
|
||||||
* Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
|
* Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
|
||||||
* and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
|
* and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
|
||||||
*
|
*
|
||||||
|
* @return false on error, true on success
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert')
|
function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert')
|
||||||
|
|
|
@ -15,9 +15,12 @@
|
||||||
*/
|
*/
|
||||||
class ucp_activate
|
class ucp_activate
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
global $config, $phpbb_root_path, $phpEx;
|
||||||
|
global $db, $user, $auth, $template;
|
||||||
|
|
||||||
$user_id = request_var('u', 0);
|
$user_id = request_var('u', 0);
|
||||||
$key = request_var('k', '');
|
$key = request_var('k', '');
|
||||||
|
@ -26,60 +29,64 @@ class ucp_activate
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . USERS_TABLE . "
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$user_row = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if (!$row)
|
if (!$user_row)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_USER']);
|
trigger_error('NO_USER');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row['user_type'] <> USER_INACTIVE && !$row['user_newpasswd'])
|
if ($user_row['user_type'] <> USER_INACTIVE && !$user_row['user_newpasswd'])
|
||||||
{
|
{
|
||||||
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||||
trigger_error($user->lang['ALREADY_ACTIVATED']);
|
trigger_error('ALREADY_ACTIVATED');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row['user_actkey'] != $key)
|
if ($user_row['user_actkey'] != $key)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['WRONG_ACTIVATION']);
|
trigger_error('WRONG_ACTIVATION');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_password = ($row['user_newpasswd']) ? true : false;
|
$update_password = ($user_row['user_newpasswd']) ? true : false;
|
||||||
|
|
||||||
if ($update_password)
|
if ($update_password)
|
||||||
{
|
{
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
'user_type' => USER_NORMAL,
|
'user_type' => USER_NORMAL,
|
||||||
'user_actkey' => '',
|
'user_actkey' => '',
|
||||||
'user_password' => $row['user_newpasswd'],
|
'user_password' => $user_row['user_newpasswd'],
|
||||||
'user_newpasswd' => ''
|
'user_newpasswd' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
WHERE user_id = ' . $row['user_id'];
|
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||||
$result = $db->sql_query($sql);
|
WHERE user_id = ' . $user_row['user_id'];
|
||||||
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: check for group membership after password update... active_flip there too
|
|
||||||
if (!$update_password)
|
if (!$update_password)
|
||||||
{
|
{
|
||||||
// Now we need to demote the user from the inactive group and add him to the registered group
|
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
user_active_flip($row['user_id'], $row['user_type'], '', $row['username'], true);
|
|
||||||
|
// Now we need to demote the user from the inactive group and add him to the registered group
|
||||||
|
user_active_flip($user_row['user_id'], $user_row['user_type'], '', $user_row['username'], true);
|
||||||
|
|
||||||
|
// Update last username
|
||||||
|
update_last_username();
|
||||||
|
set_config('num_users', $config['num_users'] + 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
|
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||||
|
|
||||||
$messenger = new messenger();
|
$messenger = new messenger(false);
|
||||||
|
|
||||||
$messenger->template('admin_welcome_activated', $row['user_lang']);
|
$messenger->template('admin_welcome_activated', $user_row['user_lang']);
|
||||||
|
|
||||||
$messenger->replyto($config['board_contact']);
|
$messenger->replyto($config['board_contact']);
|
||||||
$messenger->to($row['user_email'], $row['username']);
|
$messenger->to($user_row['user_email'], $user_row['username']);
|
||||||
|
|
||||||
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
||||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||||
|
@ -88,13 +95,12 @@ class ucp_activate
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'SITENAME' => $config['sitename'],
|
'SITENAME' => $config['sitename'],
|
||||||
'USERNAME' => html_entity_decode($row['username']),
|
'USERNAME' => html_entity_decode($user_row['username']),
|
||||||
|
|
||||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']))
|
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']))
|
||||||
);
|
);
|
||||||
|
|
||||||
$messenger->send($row['user_notify_type']);
|
$messenger->send($user_row['user_notify_type']);
|
||||||
$messenger->save_queue();
|
|
||||||
|
|
||||||
$message = 'ACCOUNT_ACTIVE_ADMIN';
|
$message = 'ACCOUNT_ACTIVE_ADMIN';
|
||||||
}
|
}
|
||||||
|
@ -103,26 +109,6 @@ class ucp_activate
|
||||||
$message = (!$update_password) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
|
$message = (!$update_password) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$update_password)
|
|
||||||
{
|
|
||||||
// Get latest username
|
|
||||||
$sql = 'SELECT user_id, username
|
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
|
||||||
ORDER BY user_id DESC';
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($row)
|
|
||||||
{
|
|
||||||
set_config('newest_user_id', $row['user_id'], true);
|
|
||||||
set_config('newest_username', $row['username'], true);
|
|
||||||
}
|
|
||||||
|
|
||||||
set_config('num_users', $config['num_users'] + 1, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||||
trigger_error($user->lang[$message]);
|
trigger_error($user->lang[$message]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,9 @@ class ucp_attachments
|
||||||
|
|
||||||
if ($delete && sizeof($delete_ids))
|
if ($delete && sizeof($delete_ids))
|
||||||
{
|
{
|
||||||
$s_hidden_fields = array('delete' => 1);
|
$s_hidden_fields = array(
|
||||||
|
'delete' => 1
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($delete_ids as $attachment_id)
|
foreach ($delete_ids as $attachment_id)
|
||||||
{
|
{
|
||||||
|
@ -81,16 +83,14 @@ class ucp_attachments
|
||||||
$sql = 'SELECT COUNT(attach_id) as num_attachments
|
$sql = 'SELECT COUNT(attach_id) as num_attachments
|
||||||
FROM ' . ATTACHMENTS_TABLE . '
|
FROM ' . ATTACHMENTS_TABLE . '
|
||||||
WHERE poster_id = ' . $user->data['user_id'];
|
WHERE poster_id = ' . $user->data['user_id'];
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query($sql);
|
||||||
$num_attachments = $db->sql_fetchfield('num_attachments');
|
$num_attachments = $db->sql_fetchfield('num_attachments');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title
|
$sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title
|
||||||
FROM ' . ATTACHMENTS_TABLE . ' a
|
FROM ' . ATTACHMENTS_TABLE . ' a
|
||||||
LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id
|
LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0)
|
||||||
AND a.in_message = 0)
|
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1)
|
||||||
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id
|
|
||||||
AND a.in_message = 1)
|
|
||||||
WHERE a.poster_id = ' . $user->data['user_id'] . "
|
WHERE a.poster_id = ' . $user->data['user_id'] . "
|
||||||
ORDER BY $order_by";
|
ORDER BY $order_by";
|
||||||
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
|
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
|
||||||
|
@ -146,7 +146,7 @@ class ucp_attachments
|
||||||
|
|
||||||
'U_SORT_FILENAME' => $this->u_action . "&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
|
'U_SORT_FILENAME' => $this->u_action . "&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||||
'U_SORT_FILE_COMMENT' => $this->u_action . "&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
|
'U_SORT_FILE_COMMENT' => $this->u_action . "&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||||
'U_SORT_EXTENSION' => $this->u_action . "&i=$id&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
|
'U_SORT_EXTENSION' => $this->u_action . "&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||||
'U_SORT_FILESIZE' => $this->u_action . "&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
|
'U_SORT_FILESIZE' => $this->u_action . "&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||||
'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
|
'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||||
'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
|
'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
*/
|
*/
|
||||||
class ucp_confirm
|
class ucp_confirm
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $phpbb_root_path, $config, $phpEx;
|
global $db, $user, $phpbb_root_path, $config, $phpEx;
|
||||||
|
@ -56,11 +58,7 @@ class ucp_confirm
|
||||||
|
|
||||||
if (function_exists('imagettfbbox') && function_exists('imagettftext'))
|
if (function_exists('imagettfbbox') && function_exists('imagettftext'))
|
||||||
{
|
{
|
||||||
$policy_modules[] = 'policy_overlap';
|
$policy_modules += array('policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite');
|
||||||
$policy_modules[] = 'policy_shape';
|
|
||||||
$policy_modules[] = 'policy_cells';
|
|
||||||
$policy_modules[] = 'policy_stencil';
|
|
||||||
$policy_modules[] = 'policy_composite';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($policy_modules as $key => $name)
|
foreach ($policy_modules as $key => $name)
|
||||||
|
@ -87,4 +85,5 @@ class ucp_confirm
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -122,26 +122,26 @@ class ucp_main
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('topicrow', array(
|
$template->assign_block_vars('topicrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'TOPIC_ID' => $topic_id,
|
'TOPIC_ID' => $topic_id,
|
||||||
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
|
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
|
||||||
'LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] == ANONYMOUS) ? (($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : $row['topic_last_poster_name'],
|
'LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] == ANONYMOUS) ? (($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : $row['topic_last_poster_name'],
|
||||||
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
||||||
'TOPIC_TYPE' => $topic_type,
|
'TOPIC_TYPE' => $topic_type,
|
||||||
|
|
||||||
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
||||||
'NEWEST_POST_IMG' => $user->img('icon_post_newest', 'VIEW_NEWEST_POST'),
|
'NEWEST_POST_IMG' => $user->img('icon_post_newest', 'VIEW_NEWEST_POST'),
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
||||||
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
|
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
|
||||||
|
|
||||||
'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false,
|
'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false,
|
||||||
'S_UNREAD' => $unread_topic,
|
'S_UNREAD' => $unread_topic,
|
||||||
|
|
||||||
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
|
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
|
||||||
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '',
|
'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '',
|
||||||
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id&view=unread") . '#unread',
|
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id&view=unread") . '#unread',
|
||||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id"))
|
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,10 +174,9 @@ class ucp_main
|
||||||
// 'S_GROUP_OPTIONS' => $group_options,
|
// 'S_GROUP_OPTIONS' => $group_options,
|
||||||
'S_SHOW_ACTIVITY' => ($config['load_user_activity']) ? true : false,
|
'S_SHOW_ACTIVITY' => ($config['load_user_activity']) ? true : false,
|
||||||
|
|
||||||
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user->data['user_id'] . '&sr=posts') : '',
|
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user->data['user_id'] . '&sr=posts') : '')
|
||||||
)
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'subscribed':
|
case 'subscribed':
|
||||||
|
|
||||||
|
@ -198,7 +197,7 @@ class ucp_main
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . "
|
$sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . "
|
||||||
WHERE forum_id IN ($forums)
|
WHERE forum_id IN ($forums)
|
||||||
AND user_id = " .$user->data['user_id'];
|
AND user_id = " . $user->data['user_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$l_unwatch .= '_FORUMS';
|
$l_unwatch .= '_FORUMS';
|
||||||
|
@ -208,7 +207,7 @@ class ucp_main
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . "
|
$sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . "
|
||||||
WHERE topic_id IN ($topics)
|
WHERE topic_id IN ($topics)
|
||||||
AND user_id = " .$user->data['user_id'];
|
AND user_id = " . $user->data['user_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$l_unwatch .= '_TOPICS';
|
$l_unwatch .= '_TOPICS';
|
||||||
|
@ -229,8 +228,8 @@ class ucp_main
|
||||||
FORUMS_TABLE => 'f'
|
FORUMS_TABLE => 'f'
|
||||||
),
|
),
|
||||||
|
|
||||||
'WHERE' => "fw.user_id = " . $user->data['user_id'] . '
|
'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . '
|
||||||
AND f.forum_id = fw.forum_id',
|
AND f.forum_id = fw.forum_id',
|
||||||
|
|
||||||
'ORDER_BY' => 'left_id'
|
'ORDER_BY' => 'left_id'
|
||||||
);
|
);
|
||||||
|
@ -243,6 +242,7 @@ class ucp_main
|
||||||
'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'
|
'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql_array['SELECT'] .= ', ft.mark_time ';
|
$sql_array['SELECT'] .= ', ft.mark_time ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -297,22 +297,21 @@ class ucp_main
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('forumrow', array(
|
$template->assign_block_vars('forumrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
||||||
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
|
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
'FORUM_NAME' => $row['forum_name'],
|
||||||
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
||||||
'LAST_POST_TIME' => $last_post_time,
|
'LAST_POST_TIME' => $last_post_time,
|
||||||
'LAST_POST_AUTHOR' => $last_poster,
|
'LAST_POST_AUTHOR' => $last_poster,
|
||||||
|
|
||||||
'U_LAST_POST_AUTHOR'=> $last_poster_url,
|
'U_LAST_POST_AUTHOR' => $last_poster_url,
|
||||||
'U_LAST_POST' => $last_post_url,
|
'U_LAST_POST' => $last_post_url,
|
||||||
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
|
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
|
||||||
// Subscribed Topics
|
// Subscribed Topics
|
||||||
$start = request_var('start', 0);
|
$start = request_var('start', 0);
|
||||||
|
|
||||||
|
@ -340,8 +339,8 @@ class ucp_main
|
||||||
TOPICS_TABLE => 't'
|
TOPICS_TABLE => 't'
|
||||||
),
|
),
|
||||||
|
|
||||||
'WHERE' => "tw.user_id = " . $user->data['user_id'] . '
|
'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . '
|
||||||
AND t.topic_id = tw.topic_id',
|
AND t.topic_id = tw.topic_id',
|
||||||
|
|
||||||
'ORDER_BY' => 't.topic_last_post_time DESC'
|
'ORDER_BY' => 't.topic_last_post_time DESC'
|
||||||
);
|
);
|
||||||
|
@ -419,41 +418,40 @@ class ucp_main
|
||||||
|
|
||||||
// Send vars to template
|
// Send vars to template
|
||||||
$template->assign_block_vars('topicrow', array(
|
$template->assign_block_vars('topicrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'TOPIC_ID' => $topic_id,
|
'TOPIC_ID' => $topic_id,
|
||||||
'TOPIC_AUTHOR' => topic_topic_author($row),
|
'TOPIC_AUTHOR' => topic_topic_author($row),
|
||||||
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
|
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
|
||||||
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
|
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
|
||||||
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
|
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
|
||||||
'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'],
|
'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'],
|
||||||
'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")),
|
'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")),
|
||||||
'REPLIES' => $replies,
|
'REPLIES' => $replies,
|
||||||
'VIEWS' => $row['topic_views'],
|
'VIEWS' => $row['topic_views'],
|
||||||
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
||||||
'TOPIC_TYPE' => $topic_type,
|
'TOPIC_TYPE' => $topic_type,
|
||||||
|
|
||||||
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
||||||
'NEWEST_POST_IMG' => $user->img('icon_post_newest', 'VIEW_NEWEST_POST'),
|
'NEWEST_POST_IMG' => $user->img('icon_post_newest', 'VIEW_NEWEST_POST'),
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
||||||
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
|
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
|
||||||
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
|
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
|
||||||
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
|
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
|
||||||
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||||
|
|
||||||
'S_TOPIC_TYPE' => $row['topic_type'],
|
'S_TOPIC_TYPE' => $row['topic_type'],
|
||||||
'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
|
'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
|
||||||
'S_UNREAD_TOPIC' => $unread_topic,
|
'S_UNREAD_TOPIC' => $unread_topic,
|
||||||
|
|
||||||
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread',
|
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread',
|
||||||
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
|
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
|
||||||
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '',
|
'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '',
|
||||||
'U_VIEW_TOPIC' => $view_topic_url)
|
'U_VIEW_TOPIC' => $view_topic_url)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'bookmarks':
|
case 'bookmarks':
|
||||||
|
|
||||||
|
@ -495,7 +493,7 @@ class ucp_main
|
||||||
|
|
||||||
if (isset($_POST['unbookmark']))
|
if (isset($_POST['unbookmark']))
|
||||||
{
|
{
|
||||||
$s_hidden_fields = '<input type="hidden" name="unbookmark" value="1" />';
|
$s_hidden_fields = array('unbookmark' => 1);
|
||||||
$topics = (isset($_POST['t'])) ? array_map('intval', array_keys($_POST['t'])) : array();
|
$topics = (isset($_POST['t'])) ? array_map('intval', array_keys($_POST['t'])) : array();
|
||||||
$url = $this->u_action;
|
$url = $this->u_action;
|
||||||
|
|
||||||
|
@ -506,7 +504,7 @@ class ucp_main
|
||||||
|
|
||||||
foreach ($topics as $topic_id)
|
foreach ($topics as $topic_id)
|
||||||
{
|
{
|
||||||
$s_hidden_fields .= '<input type="hidden" name="t[' . $topic_id . ']" value="1" />';
|
$s_hidden_fields['t'][$topic_id] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confirm_box(true))
|
if (confirm_box(true))
|
||||||
|
@ -525,10 +523,12 @@ class ucp_main
|
||||||
$i = 1;
|
$i = 1;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$db->sql_query('UPDATE ' . BOOKMARKS_TABLE . "
|
$sql = 'UPDATE ' . BOOKMARKS_TABLE . "
|
||||||
SET order_id = $i
|
SET order_id = $i
|
||||||
WHERE topic_id = {$row['topic_id']}
|
WHERE topic_id = {$row['topic_id']}
|
||||||
AND user_id = {$user->data['user_id']}");
|
AND user_id = {$user->data['user_id']}";
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -539,7 +539,7 @@ class ucp_main
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
confirm_box(false, 'REMOVE_SELECTED_BOOKMARKS', $s_hidden_fields);
|
confirm_box(false, 'REMOVE_SELECTED_BOOKMARKS', build_hidden_fields($s_hidden_fields));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -569,39 +569,39 @@ class ucp_main
|
||||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
|
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
|
||||||
|
|
||||||
$template->assign_block_vars('topicrow', array(
|
$template->assign_block_vars('topicrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'TOPIC_ID' => $topic_id,
|
'TOPIC_ID' => $topic_id,
|
||||||
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
||||||
'TOPIC_TYPE' => $topic_type,
|
'TOPIC_TYPE' => $topic_type,
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
'FORUM_NAME' => $row['forum_name'],
|
||||||
|
|
||||||
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
|
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
|
||||||
'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false,
|
'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false,
|
||||||
|
|
||||||
'TOPIC_AUTHOR' => topic_topic_author($row),
|
'TOPIC_AUTHOR' => topic_topic_author($row),
|
||||||
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
|
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
|
||||||
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
|
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
|
||||||
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
|
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
|
||||||
'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'],
|
'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'],
|
||||||
'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")),
|
'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")),
|
||||||
|
|
||||||
'POSTED_AT' => $user->format_date($row['topic_time']),
|
'POSTED_AT' => $user->format_date($row['topic_time']),
|
||||||
|
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
||||||
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
|
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
|
||||||
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
||||||
|
|
||||||
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
|
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
|
||||||
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '',
|
'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '',
|
||||||
'U_VIEW_TOPIC' => $view_topic_url,
|
'U_VIEW_TOPIC' => $view_topic_url,
|
||||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
|
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
|
||||||
'U_MOVE_UP' => ($row['order_id'] != 1) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_up=' . $row['order_id']) : '',
|
'U_MOVE_UP' => ($row['order_id'] != 1) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_up=' . $row['order_id']) : '',
|
||||||
'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_down=' . $row['order_id']) : '')
|
'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_down=' . $row['order_id']) : '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'drafts':
|
case 'drafts':
|
||||||
|
|
||||||
|
@ -610,10 +610,10 @@ class ucp_main
|
||||||
|
|
||||||
$user->add_lang('posting');
|
$user->add_lang('posting');
|
||||||
|
|
||||||
$edit = (isset($_REQUEST['edit'])) ? true : false;
|
$edit = (isset($_REQUEST['edit'])) ? true : false;
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
$draft_id = ($edit) ? intval($_REQUEST['edit']) : 0;
|
$draft_id = ($edit) ? intval($_REQUEST['edit']) : 0;
|
||||||
$delete = (isset($_POST['delete'])) ? true : false;
|
$delete = (isset($_POST['delete'])) ? true : false;
|
||||||
|
|
||||||
$s_hidden_fields = ($edit) ? '<input type="hidden" name="edit" value="' . $draft_id . '" />' : '';
|
$s_hidden_fields = ($edit) ? '<input type="hidden" name="edit" value="' . $draft_id . '" />' : '';
|
||||||
$draft_subject = $draft_message = '';
|
$draft_subject = $draft_message = '';
|
||||||
|
@ -672,7 +672,7 @@ class ucp_main
|
||||||
WHERE d.user_id = ' . $user->data['user_id'] . ' ' .
|
WHERE d.user_id = ' . $user->data['user_id'] . ' ' .
|
||||||
(($edit) ? "AND d.draft_id = $draft_id" : '') . '
|
(($edit) ? "AND d.draft_id = $draft_id" : '') . '
|
||||||
AND f.forum_id = d.forum_id
|
AND f.forum_id = d.forum_id
|
||||||
ORDER BY d.save_time DESC';
|
ORDER BY d.save_time DESC';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -681,7 +681,7 @@ class ucp_main
|
||||||
(($edit) ? "AND draft_id = $draft_id" : '') . '
|
(($edit) ? "AND draft_id = $draft_id" : '') . '
|
||||||
AND forum_id = 0
|
AND forum_id = 0
|
||||||
AND topic_id = 0
|
AND topic_id = 0
|
||||||
ORDER BY save_time DESC';
|
ORDER BY save_time DESC';
|
||||||
}
|
}
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -778,9 +778,9 @@ class ucp_main
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)],
|
'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)],
|
||||||
|
|
||||||
'S_DISPLAY_MARK_ALL'=> ($mode == 'watched' || ($mode == 'drafts' && !isset($_GET['edit']))) ? true : false,
|
'S_DISPLAY_MARK_ALL' => ($mode == 'watched' || ($mode == 'drafts' && !isset($_GET['edit']))) ? true : false,
|
||||||
'S_HIDDEN_FIELDS' => (isset($s_hidden_fields)) ? $s_hidden_fields : '',
|
'S_HIDDEN_FIELDS' => (isset($s_hidden_fields)) ? $s_hidden_fields : '',
|
||||||
'S_UCP_ACTION' => $this->u_action)
|
'S_UCP_ACTION' => $this->u_action)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set desired template
|
// Set desired template
|
||||||
|
|
|
@ -116,7 +116,7 @@ class ucp_pm
|
||||||
trigger_error('NO_AUTH_SEND_MESSAGE');
|
trigger_error('NO_AUTH_SEND_MESSAGE');
|
||||||
}
|
}
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.'.$phpEx);
|
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
|
||||||
compose_pm($id, $mode, $action);
|
compose_pm($id, $mode, $action);
|
||||||
|
|
||||||
$tpl_file = 'posting_body';
|
$tpl_file = 'posting_body';
|
||||||
|
@ -134,7 +134,7 @@ class ucp_pm
|
||||||
|
|
||||||
get_folder($user->data['user_id']);
|
get_folder($user->data['user_id']);
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.'.$phpEx);
|
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx);
|
||||||
message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions);
|
message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions);
|
||||||
|
|
||||||
$tpl_file = 'ucp_pm_options';
|
$tpl_file = 'ucp_pm_options';
|
||||||
|
@ -146,7 +146,7 @@ class ucp_pm
|
||||||
$this->p_name = 'pm';
|
$this->p_name = 'pm';
|
||||||
|
|
||||||
// Call another module... please do not try this at home... Hoochie Coochie Man
|
// Call another module... please do not try this at home... Hoochie Coochie Man
|
||||||
include($phpbb_root_path . 'includes/ucp/ucp_main.'.$phpEx);
|
include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx);
|
||||||
|
|
||||||
$module = new ucp_main($this);
|
$module = new ucp_main($this);
|
||||||
$module->main($id, $mode);
|
$module->main($id, $mode);
|
||||||
|
@ -203,8 +203,8 @@ class ucp_pm
|
||||||
// First Handle Mark actions and moving messages
|
// First Handle Mark actions and moving messages
|
||||||
$submit_mark = (isset($_POST['submit_mark'])) ? true : false;
|
$submit_mark = (isset($_POST['submit_mark'])) ? true : false;
|
||||||
$move_pm = (isset($_POST['move_pm'])) ? true : false;
|
$move_pm = (isset($_POST['move_pm'])) ? true : false;
|
||||||
$mark_option = request_var('mark_option', '');
|
$mark_option = request_var('mark_option', '');
|
||||||
$dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX);
|
$dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX);
|
||||||
|
|
||||||
// Is moving PM triggered through mark options?
|
// Is moving PM triggered through mark options?
|
||||||
if (!in_array($mark_option, array('mark_important', 'delete_marked')) && $submit_mark)
|
if (!in_array($mark_option, array('mark_important', 'delete_marked')) && $submit_mark)
|
||||||
|
@ -364,7 +364,7 @@ class ucp_pm
|
||||||
|
|
||||||
if ($action == 'view_folder')
|
if ($action == 'view_folder')
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.'.$phpEx);
|
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx);
|
||||||
view_folder($id, $mode, $folder_id, $folder);
|
view_folder($id, $mode, $folder_id, $folder);
|
||||||
|
|
||||||
$tpl_file = 'ucp_pm_viewfolder';
|
$tpl_file = 'ucp_pm_viewfolder';
|
||||||
|
@ -381,7 +381,7 @@ class ucp_pm
|
||||||
trigger_error('NO_MESSAGE');
|
trigger_error('NO_MESSAGE');
|
||||||
}
|
}
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.'.$phpEx);
|
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx);
|
||||||
view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row);
|
view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row);
|
||||||
|
|
||||||
$tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage';
|
$tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage';
|
||||||
|
@ -391,6 +391,7 @@ class ucp_pm
|
||||||
|
|
||||||
default:
|
default:
|
||||||
trigger_error('NO_ACTION_MODE');
|
trigger_error('NO_ACTION_MODE');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|
|
@ -27,15 +27,19 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
$set_folder_id = FULL_FOLDER_DELETE;
|
$set_folder_id = FULL_FOLDER_DELETE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
$set_folder_id = request_var('full_move_to', PRIVMSGS_INBOX);
|
$set_folder_id = request_var('full_move_to', PRIVMSGS_INBOX);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
$set_folder_id = FULL_FOLDER_HOLD;
|
$set_folder_id = FULL_FOLDER_HOLD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$full_action = 0;
|
$full_action = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($full_action)
|
if ($full_action)
|
||||||
|
@ -65,12 +69,13 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
WHERE folder_name = '" . $db->sql_escape($folder_name) . "'
|
WHERE folder_name = '" . $db->sql_escape($folder_name) . "'
|
||||||
AND user_id = " . $user->data['user_id'];
|
AND user_id = " . $user->data['user_id'];
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($db->sql_fetchrow($result))
|
if ($row)
|
||||||
{
|
{
|
||||||
trigger_error(sprintf($user->lang['FOLDER_NAME_EXIST'], $folder_name));
|
trigger_error(sprintf($user->lang['FOLDER_NAME_EXIST'], $folder_name));
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(folder_id) as num_folder
|
$sql = 'SELECT COUNT(folder_id) as num_folder
|
||||||
FROM ' . PRIVMSGS_FOLDER_TABLE . '
|
FROM ' . PRIVMSGS_FOLDER_TABLE . '
|
||||||
|
@ -85,7 +90,9 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . PRIVMSGS_FOLDER_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
$sql = 'INSERT INTO ' . PRIVMSGS_FOLDER_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||||
'user_id' => (int) $user->data['user_id'], 'folder_name' => $folder_name));
|
'user_id' => (int) $user->data['user_id'],
|
||||||
|
'folder_name' => $folder_name)
|
||||||
|
);
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$message = $user->lang['FOLDER_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>');
|
$message = $user->lang['FOLDER_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>');
|
||||||
|
@ -195,12 +202,12 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
{
|
{
|
||||||
trigger_error(sprintf($user->lang['MOVE_PM_ERROR'], $num_moved, $folder_row['pm_count']));
|
trigger_error(sprintf($user->lang['MOVE_PM_ERROR'], $num_moved, $folder_row['pm_count']));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Remove Messages
|
// Remove Messages
|
||||||
case 2:
|
case 2:
|
||||||
delete_pm($user->data['user_id'], $msg_ids, $remove_folder_id);
|
delete_pm($user->data['user_id'], $msg_ids, $remove_folder_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove folder
|
// Remove folder
|
||||||
|
@ -272,18 +279,21 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
FROM ' . PRIVMSGS_RULES_TABLE . '
|
FROM ' . PRIVMSGS_RULES_TABLE . '
|
||||||
WHERE ' . $db->sql_build_array('SELECT', $rule_ary);
|
WHERE ' . $db->sql_build_array('SELECT', $rule_ary);
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($db->sql_fetchrow($result))
|
if ($row)
|
||||||
{
|
{
|
||||||
trigger_error('RULE_ALREADY_DEFINED');
|
trigger_error('RULE_ALREADY_DEFINED');
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);
|
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Update users message rules
|
// Update users message rules
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_message_rules = 1 WHERE user_id = ' . $user->data['user_id'];
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
|
SET user_message_rules = 1
|
||||||
|
WHERE user_id = ' . $user->data['user_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$message = $user->lang['RULE_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>');
|
$message = $user->lang['RULE_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>');
|
||||||
|
@ -322,9 +332,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// Update users message rules
|
// Update users message rules
|
||||||
if ($row)
|
if (!$row)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_message_rules = 0 WHERE user_id = ' . $user->data['user_id'];
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
|
SET user_message_rules = 0
|
||||||
|
WHERE user_id = ' . $user->data['user_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,8 +361,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$folder[PRIVMSGS_INBOX] = array(
|
$folder[PRIVMSGS_INBOX] = array(
|
||||||
'folder_name' => $user->lang['PM_INBOX'],
|
'folder_name' => $user->lang['PM_INBOX'],
|
||||||
'message_status'=> sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $num_messages, $user->data['message_limit'])
|
'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $num_messages, $user->data['message_limit'])
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'SELECT folder_id, folder_name, pm_count
|
$sql = 'SELECT folder_id, folder_name, pm_count
|
||||||
|
@ -363,8 +375,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
{
|
{
|
||||||
$num_user_folder++;
|
$num_user_folder++;
|
||||||
$folder[$row['folder_id']] = array(
|
$folder[$row['folder_id']] = array(
|
||||||
'folder_name' => $row['folder_name'],
|
'folder_name' => $row['folder_name'],
|
||||||
'message_status'=> sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $row['pm_count'], $user->data['message_limit'])
|
'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $row['pm_count'], $user->data['message_limit'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -402,11 +414,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
$s_delete_checked = ' checked="checked"';
|
$s_delete_checked = ' checked="checked"';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
$s_hold_checked = ' checked="checked"';
|
$s_hold_checked = ' checked="checked"';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,7 +642,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||||
);
|
);
|
||||||
|
|
||||||
$current_value = $rule_string;
|
$current_value = $rule_string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user':
|
case 'user':
|
||||||
$rule_user_id = request_var('rule_user_id', 0);
|
$rule_user_id = request_var('rule_user_id', 0);
|
||||||
|
@ -640,7 +652,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||||
{
|
{
|
||||||
$sql = 'SELECT user_id
|
$sql = 'SELECT user_id
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . USERS_TABLE . "
|
||||||
WHERE username = '" . $db->sql_escape($rule_string) . "'";
|
WHERE LOWER(username) = '" . $db->sql_escape(strtolower($rule_string)) . "'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$rule_user_id = (int) $db->sql_fetchfield('user_id');
|
$rule_user_id = (int) $db->sql_fetchfield('user_id');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -673,7 +685,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||||
);
|
);
|
||||||
|
|
||||||
$current_value = $rule_string;
|
$current_value = $rule_string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group':
|
case 'group':
|
||||||
$rule_group_id = request_var('rule_group_id', 0);
|
$rule_group_id = request_var('rule_group_id', 0);
|
||||||
|
@ -708,7 +720,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
||||||
);
|
);
|
||||||
|
|
||||||
$current_value = $rule_string;
|
$current_value = $rule_string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -35,7 +35,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('pm_colour_info', array(
|
$template->assign_block_vars('pm_colour_info', array(
|
||||||
'IMG' => $user->img("pm_{$var}", ''),
|
'IMG' => $user->img("pm_{$var}", ''),
|
||||||
'CLASS' => "pm_{$var}_colour",
|
'CLASS' => "pm_{$var}_colour",
|
||||||
'LANG' => $user->lang[strtoupper($var) . '_MESSAGE'])
|
'LANG' => $user->lang[strtoupper($var) . '_MESSAGE'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
FROM ' . GROUPS_TABLE . '
|
FROM ' . GROUPS_TABLE . '
|
||||||
WHERE group_id';
|
WHERE group_id';
|
||||||
}
|
}
|
||||||
$sql .= ' IN (' . implode(', ', array_keys($recipient_list[$ug_type])) . ')';
|
$sql .= ' IN (' . implode(', ', array_map('intval', array_keys($recipient_list[$ug_type]))) . ')';
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -185,16 +185,16 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
$template->assign_block_vars('messagerow', array(
|
$template->assign_block_vars('messagerow', array(
|
||||||
'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '',
|
'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '',
|
||||||
|
|
||||||
'FOLDER_ID' => $folder_id,
|
'FOLDER_ID' => $folder_id,
|
||||||
'MESSAGE_ID' => $message_id,
|
'MESSAGE_ID' => $message_id,
|
||||||
'MESSAGE_AUTHOR' => $message_author,
|
'MESSAGE_AUTHOR' => $message_author,
|
||||||
'SENT_TIME' => $user->format_date($row['message_time']),
|
'SENT_TIME' => $user->format_date($row['message_time']),
|
||||||
'SUBJECT' => censor_text($row['message_subject']),
|
'SUBJECT' => censor_text($row['message_subject']),
|
||||||
'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '',
|
'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '',
|
||||||
'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '',
|
'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '',
|
||||||
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
||||||
'FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '',
|
'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '',
|
||||||
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment'] && $config['allow_pm_attach'] && $config['auth_download_pm']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment'] && $config['allow_pm_attach'] && $config['auth_download_pm']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||||
|
|
||||||
'S_PM_DELETED' => ($row['deleted']) ? true : false,
|
'S_PM_DELETED' => ($row['deleted']) ? true : false,
|
||||||
|
@ -207,7 +207,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
unset($folder_info['rowset']);
|
unset($folder_info['rowset']);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
|
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
|
||||||
'S_SHOW_COLOUR_LEGEND' => true)
|
'S_SHOW_COLOUR_LEGEND' => true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,8 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
{
|
{
|
||||||
$row = &$folder_info['rowset'][$message_id];
|
$row = &$folder_info['rowset'][$message_id];
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||||
|
|
||||||
$sql = 'SELECT p.message_text, p.bbcode_uid
|
$sql = 'SELECT p.message_text, p.bbcode_uid
|
||||||
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u
|
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u
|
||||||
WHERE t.user_id = ' . $user->data['user_id'] . "
|
WHERE t.user_id = ' . $user->data['user_id'] . "
|
||||||
|
@ -255,8 +256,19 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
{
|
{
|
||||||
if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type]))
|
if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type]))
|
||||||
{
|
{
|
||||||
$sql = ($ug_type == 'u') ? 'SELECT user_id as id, username as name FROM ' . USERS_TABLE . ' WHERE user_id' : 'SELECT group_id as id, group_name as name FROM ' . GROUPS_TABLE . ' WHERE group_id';
|
if ($ug_type == 'u')
|
||||||
$sql .= ' IN (' . implode(', ', array_keys($address[$message_id][$ug_type])) . ')';
|
{
|
||||||
|
$sql = 'SELECT user_id as id, username as name
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_id';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = 'SELECT group_id as id, group_name as name
|
||||||
|
FROM ' . GROUPS_TABLE . '
|
||||||
|
WHERE group_id';
|
||||||
|
}
|
||||||
|
$sql .= ' IN (' . implode(', ', array_map('intval', array_keys($address[$message_id][$ug_type]))) . ')';
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -311,6 +323,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
$value['bcc'] .= (isset($values['bcc']) && is_array($values['bcc'])) ? ',' . implode(',', $values['bcc']) : '';
|
$value['bcc'] .= (isset($values['bcc']) && is_array($values['bcc'])) ? ',' . implode(',', $values['bcc']) : '';
|
||||||
$value['to'] .= (isset($values['to']) && is_array($values['to'])) ? ',' . implode(',', $values['to']) : '';
|
$value['to'] .= (isset($values['to']) && is_array($values['to'])) ? ',' . implode(',', $values['to']) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the commas which will appear before the first entry.
|
// Remove the commas which will appear before the first entry.
|
||||||
$value['to'] = substr($value['to'], 1);
|
$value['to'] = substr($value['to'], 1);
|
||||||
$value['bcc'] = substr($value['bcc'], 1);
|
$value['bcc'] = substr($value['bcc'], 1);
|
||||||
|
@ -332,14 +345,15 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
$string = substr($string, 0, -1) . $newline;
|
$string = substr($string, 0, -1) . $newline;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'XML':
|
case 'XML':
|
||||||
$mimetype = 'application/xml';
|
$mimetype = 'application/xml';
|
||||||
$filetype = 'xml';
|
$filetype = 'xml';
|
||||||
$string = '<?xml version="1.0"?>' . "\n";
|
$string = '<?xml version="1.0"?>' . "\n";
|
||||||
$string .= "<phpbb>\n";
|
$string .= "<phpbb>\n";
|
||||||
|
|
||||||
foreach ($data as $value)
|
foreach ($data as $value)
|
||||||
{
|
{
|
||||||
|
|
||||||
$string .= "\t<privmsg>\n";
|
$string .= "\t<privmsg>\n";
|
||||||
|
|
||||||
if (is_array($value['to']))
|
if (is_array($value['to']))
|
||||||
|
@ -366,7 +380,9 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
$string .= "\t</privmsg>\n";
|
$string .= "\t</privmsg>\n";
|
||||||
}
|
}
|
||||||
$string .= '</phpbb>';
|
$string .= '</phpbb>';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
header("Content-Type: $mimetype; name=\"data.$filetype\"");
|
header("Content-Type: $mimetype; name=\"data.$filetype\"");
|
||||||
header("Content-disposition: attachment; filename=data.$filetype");
|
header("Content-disposition: attachment; filename=data.$filetype");
|
||||||
|
@ -407,6 +423,11 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||||
{
|
{
|
||||||
$min_post_time = time() - ($sort_days * 86400);
|
$min_post_time = time() - ($sort_days * 86400);
|
||||||
|
|
||||||
|
if (isset($_POST['sort']))
|
||||||
|
{
|
||||||
|
$start = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(t.msg_id) AS pm_count
|
$sql = 'SELECT COUNT(t.msg_id) AS pm_count
|
||||||
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . " p
|
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . " p
|
||||||
WHERE $folder_sql
|
WHERE $folder_sql
|
||||||
|
@ -414,13 +435,7 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||||
AND t.msg_id = p.msg_id
|
AND t.msg_id = p.msg_id
|
||||||
AND p.message_time >= $min_post_time";
|
AND p.message_time >= $min_post_time";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$pm_count = (int) $db->sql_fetchfield('pm_count');
|
||||||
if (isset($_POST['sort']))
|
|
||||||
{
|
|
||||||
$start = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$pm_count = ($row = $db->sql_fetchrow($result)) ? $row['pm_count'] : 0;
|
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql_limit_time = "AND p.message_time >= $min_post_time";
|
$sql_limit_time = "AND p.message_time >= $min_post_time";
|
||||||
|
@ -432,9 +447,9 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
|
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
|
||||||
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
|
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
|
||||||
'TOTAL_MESSAGES'=> (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
|
'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
|
||||||
|
|
||||||
'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('btn_locked', 'PM_LOCKED') : $user->img('btn_post_pm', 'POST_PM'),
|
'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('btn_locked', 'PM_LOCKED') : $user->img('btn_post_pm', 'POST_PM'),
|
||||||
|
|
||||||
|
@ -483,7 +498,6 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||||
AND t.msg_id = p.msg_id
|
AND t.msg_id = p.msg_id
|
||||||
$sql_limit_time
|
$sql_limit_time
|
||||||
ORDER BY $sql_sort_order";
|
ORDER BY $sql_sort_order";
|
||||||
|
|
||||||
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
|
|
@ -38,10 +38,12 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||||
$icons = array();
|
$icons = array();
|
||||||
$cache->obtain_icons($icons);
|
$cache->obtain_icons($icons);
|
||||||
|
|
||||||
|
$bbcode = false;
|
||||||
|
|
||||||
// Instantiate BBCode if need be
|
// Instantiate BBCode if need be
|
||||||
if ($message_row['bbcode_bitfield'])
|
if ($message_row['bbcode_bitfield'])
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||||
$bbcode = new bbcode($message_row['bbcode_bitfield']);
|
$bbcode = new bbcode($message_row['bbcode_bitfield']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,9 +148,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||||
{
|
{
|
||||||
if ($user_info['user_sig_bbcode_bitfield'])
|
if ($user_info['user_sig_bbcode_bitfield'])
|
||||||
{
|
{
|
||||||
if (!isset($bbcode) || !$bbcode)
|
if ($bbcode === false)
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||||
$bbcode = new bbcode($user_info['user_sig_bbcode_bitfield']);
|
$bbcode = new bbcode($user_info['user_sig_bbcode_bitfield']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,41 +165,41 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'AUTHOR_NAME' => ($user_info['user_colour']) ? '<span style="color:#' . $user_info['user_colour'] . '">' . $user_info['username'] . '</span>' : $user_info['username'],
|
'AUTHOR_NAME' => ($user_info['user_colour']) ? '<span style="color:#' . $user_info['user_colour'] . '">' . $user_info['username'] . '</span>' : $user_info['username'],
|
||||||
'AUTHOR_RANK' => $user_info['rank_title'],
|
'AUTHOR_RANK' => $user_info['rank_title'],
|
||||||
'RANK_IMAGE' => $user_info['rank_image'],
|
'RANK_IMAGE' => $user_info['rank_image'],
|
||||||
'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
|
'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
|
||||||
'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']),
|
'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']),
|
||||||
'AUTHOR_POSTS' => (!empty($user_info['user_posts'])) ? $user_info['user_posts'] : '',
|
'AUTHOR_POSTS' => (!empty($user_info['user_posts'])) ? $user_info['user_posts'] : '',
|
||||||
'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '',
|
'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '',
|
||||||
|
|
||||||
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('btn_online', $user->lang['ONLINE']) : $user->img('btn_offline', $user->lang['OFFLINE'])),
|
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('btn_online', $user->lang['ONLINE']) : $user->img('btn_offline', $user->lang['OFFLINE'])),
|
||||||
'S_ONLINE' => (!$config['load_onlinetrack']) ? false : ((isset($user_info['online']) && $user_info['online']) ? true : false),
|
'S_ONLINE' => (!$config['load_onlinetrack']) ? false : ((isset($user_info['online']) && $user_info['online']) ? true : false),
|
||||||
'DELETE_IMG' => $user->img('btn_delete', $user->lang['DELETE_MESSAGE']),
|
'DELETE_IMG' => $user->img('btn_delete', $user->lang['DELETE_MESSAGE']),
|
||||||
'INFO_IMG' => $user->img('btn_info', $user->lang['VIEW_PM_INFO']),
|
'INFO_IMG' => $user->img('btn_info', $user->lang['VIEW_PM_INFO']),
|
||||||
'PROFILE_IMG' => $user->img('btn_profile', $user->lang['READ_PROFILE']),
|
'PROFILE_IMG' => $user->img('btn_profile', $user->lang['READ_PROFILE']),
|
||||||
'EMAIL_IMG' => $user->img('btn_email', $user->lang['SEND_EMAIL']),
|
'EMAIL_IMG' => $user->img('btn_email', $user->lang['SEND_EMAIL']),
|
||||||
'QUOTE_IMG' => $user->img('btn_quote', $user->lang['POST_QUOTE_PM']),
|
'QUOTE_IMG' => $user->img('btn_quote', $user->lang['POST_QUOTE_PM']),
|
||||||
'REPLY_IMG' => $user->img('btn_reply_pm', $user->lang['POST_REPLY_PM']),
|
'REPLY_IMG' => $user->img('btn_reply_pm', $user->lang['POST_REPLY_PM']),
|
||||||
'EDIT_IMG' => $user->img('btn_edit', $user->lang['POST_EDIT_PM']),
|
'EDIT_IMG' => $user->img('btn_edit', $user->lang['POST_EDIT_PM']),
|
||||||
'MINI_POST_IMG' => $user->img('icon_post', $user->lang['PM']),
|
'MINI_POST_IMG' => $user->img('icon_post', $user->lang['PM']),
|
||||||
|
|
||||||
'SENT_DATE' => $user->format_date($message_row['message_time']),
|
'SENT_DATE' => $user->format_date($message_row['message_time']),
|
||||||
'SUBJECT' => $message_row['message_subject'],
|
'SUBJECT' => $message_row['message_subject'],
|
||||||
'MESSAGE' => $message,
|
'MESSAGE' => $message,
|
||||||
'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '',
|
'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '',
|
||||||
'EDITED_MESSAGE' => $l_edited_by,
|
'EDITED_MESSAGE' => $l_edited_by,
|
||||||
|
|
||||||
'U_INFO' => ($auth->acl_get('m_info') && $message_row['forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&p=' . $message_row['msg_id'], true, $user->session_id) : '',
|
'U_INFO' => ($auth->acl_get('m_info') && $message_row['forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&p=' . $message_row['msg_id'], true, $user->session_id) : '',
|
||||||
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||||
'U_AUTHOR_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $author_id),
|
'U_AUTHOR_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $author_id),
|
||||||
'U_EMAIL' => $user_info['email'],
|
'U_EMAIL' => $user_info['email'],
|
||||||
'U_QUOTE' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
'U_QUOTE' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||||
'U_EDIT' => (($message_row['message_time'] > time() - $config['pm_edit_time'] || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
'U_EDIT' => (($message_row['message_time'] > time() - $config['pm_edit_time'] || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||||
'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||||
'U_PREVIOUS_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous",
|
'U_PREVIOUS_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous",
|
||||||
'U_NEXT_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next",
|
'U_NEXT_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next",
|
||||||
|
|
||||||
'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false,
|
'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false,
|
||||||
'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'],
|
'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'],
|
||||||
|
|
||||||
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',
|
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',
|
||||||
|
@ -253,9 +255,11 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||||
$sql .= ($sort_dir == 'd') ? 'ASC' : 'DESC';
|
$sql .= ($sort_dir == 'd') ? 'ASC' : 'DESC';
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
if (!$row)
|
||||||
{
|
{
|
||||||
|
$db->sql_freeresult($result);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,11 +295,11 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate BBCode class
|
// Instantiate BBCode class
|
||||||
if (!isset($bbcode) && $bbcode_bitfield)
|
if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield)
|
||||||
{
|
{
|
||||||
if (!class_exists('bbcode'))
|
if (!class_exists('bbcode'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||||
}
|
}
|
||||||
$bbcode = new bbcode($bbcode_bitfield);
|
$bbcode = new bbcode($bbcode_bitfield);
|
||||||
}
|
}
|
||||||
|
@ -332,10 +336,10 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('history_row', array(
|
$template->assign_block_vars('history_row', array(
|
||||||
'AUTHOR_NAME' => $author,
|
'AUTHOR_NAME' => $author,
|
||||||
'SUBJECT' => $subject,
|
'SUBJECT' => $subject,
|
||||||
'SENT_DATE' => $user->format_date($row['message_time']),
|
'SENT_DATE' => $user->format_date($row['message_time']),
|
||||||
'MESSAGE' => str_replace("\n", '<br />', $message),
|
'MESSAGE' => str_replace("\n", '<br />', $message),
|
||||||
'FOLDER' => implode(', ', $row['folder']),
|
'FOLDER' => implode(', ', $row['folder']),
|
||||||
|
|
||||||
'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id),
|
'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id),
|
||||||
|
@ -351,7 +355,7 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'QUOTE_IMG' => $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE']),
|
'QUOTE_IMG' => $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE']),
|
||||||
'TITLE' => $title,
|
'TITLE' => $title,
|
||||||
|
|
||||||
'U_VIEW_NEXT_HISTORY' => "$url&p=" . (($next_history_pm) ? $next_history_pm : $msg_id),
|
'U_VIEW_NEXT_HISTORY' => "$url&p=" . (($next_history_pm) ? $next_history_pm : $msg_id),
|
||||||
|
@ -396,9 +400,11 @@ function get_user_informations($user_id, $user_row)
|
||||||
WHERE session_user_id = $user_id
|
WHERE session_user_id = $user_id
|
||||||
GROUP BY session_user_id";
|
GROUP BY session_user_id";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$update_time = $config['load_online_time'] * 60;
|
$update_time = $config['load_online_time'] * 60;
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row)
|
||||||
{
|
{
|
||||||
$user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] && $user_row['user_allow_viewonline'])) ? true : false;
|
$user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] && $user_row['user_allow_viewonline'])) ? true : false;
|
||||||
}
|
}
|
||||||
|
@ -415,10 +421,11 @@ function get_user_informations($user_id, $user_row)
|
||||||
{
|
{
|
||||||
case AVATAR_UPLOAD:
|
case AVATAR_UPLOAD:
|
||||||
$avatar_img = $config['avatar_path'] . '/';
|
$avatar_img = $config['avatar_path'] . '/';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVATAR_GALLERY:
|
case AVATAR_GALLERY:
|
||||||
$avatar_img = $config['avatar_gallery_path'] . '/';
|
$avatar_img = $config['avatar_gallery_path'] . '/';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$avatar_img .= $user_row['user_avatar'];
|
$avatar_img .= $user_row['user_avatar'];
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,14 @@ class ucp_prefs
|
||||||
{
|
{
|
||||||
case 'personal':
|
case 'personal':
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'notifymethod' => $user->data['user_notify_type'],
|
||||||
|
'dateformat' => $user->data['user_dateformat'],
|
||||||
|
'lang' => $user->data['user_lang'],
|
||||||
|
'style' => $user->data['user_style'],
|
||||||
|
'tz' => $user->data['user_timezone'],
|
||||||
|
);
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
$var_ary = array(
|
$var_ary = array(
|
||||||
|
@ -58,27 +66,25 @@ class ucp_prefs
|
||||||
);
|
);
|
||||||
|
|
||||||
$error = validate_data($data, $var_ary);
|
$error = validate_data($data, $var_ary);
|
||||||
extract($data);
|
|
||||||
unset($data);
|
|
||||||
|
|
||||||
if (!sizeof($error))
|
if (!sizeof($error))
|
||||||
{
|
{
|
||||||
$user->optionset('popuppm', $popuppm);
|
$user->optionset('popuppm', $data['popuppm']);
|
||||||
|
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
'user_allow_pm' => $allowpm,
|
'user_allow_pm' => $data['allowpm'],
|
||||||
'user_allow_viewemail' => $viewemail,
|
'user_allow_viewemail' => $data['viewemail'],
|
||||||
'user_allow_massemail' => $massemail,
|
'user_allow_massemail' => $data['massemail'],
|
||||||
'user_allow_viewonline' => ($auth->acl_get('u_hideonline')) ? !$hideonline : $user->data['user_allow_viewonline'],
|
'user_allow_viewonline' => ($auth->acl_get('u_hideonline')) ? !$data['hideonline'] : $user->data['user_allow_viewonline'],
|
||||||
'user_notify_type' => $notifymethod,
|
'user_notify_type' => $data['notifymethod'],
|
||||||
'user_notify_pm' => $notifypm,
|
'user_notify_pm' => $data['notifypm'],
|
||||||
'user_options' => $user->data['user_options'],
|
'user_options' => $user->data['user_options'],
|
||||||
|
|
||||||
'user_dst' => $dst,
|
'user_dst' => $data['dst'],
|
||||||
'user_dateformat' => $dateformat,
|
'user_dateformat' => $data['dateformat'],
|
||||||
'user_lang' => $lang,
|
'user_lang' => $data['lang'],
|
||||||
'user_timezone' => $tz,
|
'user_timezone' => $data['tz'],
|
||||||
'user_style' => $style,
|
'user_style' => $data['style'],
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
|
@ -95,39 +101,11 @@ class ucp_prefs
|
||||||
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
||||||
}
|
}
|
||||||
|
|
||||||
$viewemail = (isset($viewemail)) ? $viewemail : $user->data['user_allow_viewemail'];
|
|
||||||
$view_email_yes = ($viewemail) ? ' checked="checked"' : '';
|
|
||||||
$view_email_no = (!$viewemail) ? ' checked="checked"' : '';
|
|
||||||
$massemail = (isset($massemail)) ? $massemail : $user->data['user_allow_massemail'];
|
|
||||||
$mass_email_yes = ($massemail) ? ' checked="checked"' : '';
|
|
||||||
$mass_email_no = (!$massemail) ? ' checked="checked"' : '';
|
|
||||||
$allowpm = (isset($allowpm)) ? $allowpm : $user->data['user_allow_pm'];
|
|
||||||
$allow_pm_yes = ($allowpm) ? ' checked="checked"' : '';
|
|
||||||
$allow_pm_no = (!$allowpm) ? ' checked="checked"' : '';
|
|
||||||
$hideonline = (isset($hideonline)) ? $hideonline : !$user->data['user_allow_viewonline'];
|
|
||||||
$hide_online_yes = ($hideonline) ? ' checked="checked"' : '';
|
|
||||||
$hide_online_no = (!$hideonline) ? ' checked="checked"' : '';
|
|
||||||
$notifypm = (isset($notifypm)) ? $notifypm : $user->data['user_notify_pm'];
|
|
||||||
$notify_pm_yes = ($notifypm) ? ' checked="checked"' : '';
|
|
||||||
$notify_pm_no = (!$notifypm) ? ' checked="checked"' : '';
|
|
||||||
$popuppm = (isset($popuppm)) ? $popuppm : $user->optionget('popuppm');
|
|
||||||
$popup_pm_yes = ($popuppm) ? ' checked="checked"' : '';
|
|
||||||
$popup_pm_no = (!$popuppm) ? ' checked="checked"' : '';
|
|
||||||
$dst = (isset($dst)) ? $dst : $user->data['user_dst'];
|
|
||||||
$dst_yes = ($dst) ? ' checked="checked"' : '';
|
|
||||||
$dst_no = (!$dst) ? ' checked="checked"' : '';
|
|
||||||
|
|
||||||
$notifymethod = (isset($notifymethod)) ? $notifymethod : $user->data['user_notify_type'];
|
|
||||||
$dateformat = (isset($dateformat)) ? $dateformat : $user->data['user_dateformat'];
|
|
||||||
$lang = (isset($lang)) ? $lang : $user->data['user_lang'];
|
|
||||||
$style = (isset($style)) ? $style : $user->data['user_style'];
|
|
||||||
$tz = (isset($tz)) ? $tz : $user->data['user_timezone'];
|
|
||||||
|
|
||||||
$dateformat_options = '';
|
$dateformat_options = '';
|
||||||
|
|
||||||
foreach ($user->lang['dateformats'] as $format => $null)
|
foreach ($user->lang['dateformats'] as $format => $null)
|
||||||
{
|
{
|
||||||
$dateformat_options .= '<option value="' . $format . '"' . (($format == $dateformat) ? ' selected="selected"' : '') . '>';
|
$dateformat_options .= '<option value="' . $format . '"' . (($format == $data['dateformat']) ? ' selected="selected"' : '') . '>';
|
||||||
$dateformat_options .= $user->format_date(time(), $format, true) . ((strpos($format, '|') !== false) ? ' [' . $user->lang['RELATIVE_DAYS'] . ']' : '');
|
$dateformat_options .= $user->format_date(time(), $format, true) . ((strpos($format, '|') !== false) ? ' [' . $user->lang['RELATIVE_DAYS'] . ']' : '');
|
||||||
$dateformat_options .= '</option>';
|
$dateformat_options .= '</option>';
|
||||||
}
|
}
|
||||||
|
@ -135,7 +113,7 @@ class ucp_prefs
|
||||||
$s_custom = false;
|
$s_custom = false;
|
||||||
|
|
||||||
$dateformat_options .= '<option value="custom"';
|
$dateformat_options .= '<option value="custom"';
|
||||||
if (!in_array($dateformat, array_keys($user->lang['dateformats'])))
|
if (!in_array($data['dateformat'], array_keys($user->lang['dateformats'])))
|
||||||
{
|
{
|
||||||
$dateformat_options .= ' selected="selected"';
|
$dateformat_options .= ' selected="selected"';
|
||||||
$s_custom = true;
|
$s_custom = true;
|
||||||
|
@ -145,58 +123,54 @@ class ucp_prefs
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||||
|
|
||||||
'VIEW_EMAIL_YES' => $view_email_yes,
|
'S_NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false,
|
||||||
'VIEW_EMAIL_NO' => $view_email_no,
|
'S_NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false,
|
||||||
'ADMIN_EMAIL_YES' => $mass_email_yes,
|
'S_NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false,
|
||||||
'ADMIN_EMAIL_NO' => $mass_email_no,
|
'S_VIEW_EMAIL' => (isset($data['viewemail'])) ? $data['viewemail'] : $user->data['user_allow_viewemail'],
|
||||||
'HIDE_ONLINE_YES' => $hide_online_yes,
|
'S_MASS_EMAIL' => (isset($data['massemail'])) ? $data['massemail'] : $user->data['user_allow_massemail'],
|
||||||
'HIDE_ONLINE_NO' => $hide_online_no,
|
'S_ALLOW_PM' => (isset($data['allowpm'])) ? $data['allowpm'] : $user->data['user_allow_pm'],
|
||||||
'ALLOW_PM_YES' => $allow_pm_yes,
|
'S_HIDE_ONLINE' => (isset($data['hideonline'])) ? $data['hideonline'] : !$user->data['user_allow_viewonline'],
|
||||||
'ALLOW_PM_NO' => $allow_pm_no,
|
'S_NOTIFY_PM' => (isset($data['notifypm'])) ? $data['notifypm'] : $user->data['user_notify_pm'],
|
||||||
'NOTIFY_PM_YES' => $notify_pm_yes,
|
'S_POPUP_PM' => (isset($data['popuppm'])) ? $data['popuppm'] : $user->optionget('popuppm'),
|
||||||
'NOTIFY_PM_NO' => $notify_pm_no,
|
'S_DST' => (isset($data['dst'])) ? $data['dst'] : $user->data['user_dst'],
|
||||||
'POPUP_PM_YES' => $popup_pm_yes,
|
|
||||||
'POPUP_PM_NO' => $popup_pm_no,
|
|
||||||
'DST_YES' => $dst_yes,
|
|
||||||
'DST_NO' => $dst_no,
|
|
||||||
'NOTIFY_EMAIL' => ($notifymethod == NOTIFY_EMAIL) ? 'checked="checked"' : '',
|
|
||||||
'NOTIFY_IM' => ($notifymethod == NOTIFY_IM) ? 'checked="checked"' : '',
|
|
||||||
'NOTIFY_BOTH' => ($notifymethod == NOTIFY_BOTH) ? 'checked="checked"' : '',
|
|
||||||
|
|
||||||
'DATE_FORMAT' => $dateformat,
|
'DATE_FORMAT' => $data['dateformat'],
|
||||||
'S_DATEFORMAT_OPTIONS' => $dateformat_options,
|
'S_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||||
'S_CUSTOM_DATEFORMAT' => $s_custom,
|
'S_CUSTOM_DATEFORMAT' => $s_custom,
|
||||||
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
|
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
|
||||||
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
|
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
|
||||||
|
|
||||||
'S_LANG_OPTIONS' => language_select($lang),
|
'S_LANG_OPTIONS' => language_select($data['lang']),
|
||||||
'S_STYLE_OPTIONS' => style_select($style),
|
'S_STYLE_OPTIONS' => style_select($data['style']),
|
||||||
'S_TZ_OPTIONS' => tz_select($tz),
|
'S_TZ_OPTIONS' => tz_select($data['tz']),
|
||||||
'S_CAN_HIDE_ONLINE' => true,
|
'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false,
|
||||||
'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
|
'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
|
break;
|
||||||
|
|
||||||
case 'view':
|
case 'view':
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'topic_sk' => (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't',
|
||||||
|
'topic_sd' => (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd',
|
||||||
|
'topic_st' => (!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0,
|
||||||
|
|
||||||
|
'post_sk' => (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't',
|
||||||
|
'post_sd' => (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a',
|
||||||
|
'post_st' => (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0,
|
||||||
|
);
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
$var_ary = array(
|
$var_ary = array_merge($data, array(
|
||||||
'topic_sk' => (string) 't',
|
|
||||||
'topic_sd' => (string) 'd',
|
|
||||||
'topic_st' => 0,
|
|
||||||
|
|
||||||
'post_sk' => (string) 't',
|
|
||||||
'post_sd' => (string) 'a',
|
|
||||||
'post_st' => 0,
|
|
||||||
|
|
||||||
'images' => true,
|
'images' => true,
|
||||||
'flash' => false,
|
'flash' => false,
|
||||||
'smilies' => true,
|
'smilies' => true,
|
||||||
'sigs' => true,
|
'sigs' => true,
|
||||||
'avatars' => true,
|
'avatars' => true,
|
||||||
'wordcensor'=> false,
|
'wordcensor'=> false,
|
||||||
);
|
));
|
||||||
|
|
||||||
foreach ($var_ary as $var => $default)
|
foreach ($var_ary as $var => $default)
|
||||||
{
|
{
|
||||||
|
@ -211,30 +185,29 @@ class ucp_prefs
|
||||||
);
|
);
|
||||||
|
|
||||||
$error = validate_data($data, $var_ary);
|
$error = validate_data($data, $var_ary);
|
||||||
extract($data);
|
|
||||||
unset($data);
|
|
||||||
|
|
||||||
if (!sizeof($error))
|
if (!sizeof($error))
|
||||||
{
|
{
|
||||||
$user->optionset('viewimg', $images);
|
$user->optionset('viewimg', $data['images']);
|
||||||
$user->optionset('viewflash', $flash);
|
$user->optionset('viewflash', $data['flash']);
|
||||||
$user->optionset('viewsmilies', $smilies);
|
$user->optionset('viewsmilies', $data['smilies']);
|
||||||
$user->optionset('viewsigs', $sigs);
|
$user->optionset('viewsigs', $data['sigs']);
|
||||||
$user->optionset('viewavatars', $avatars);
|
$user->optionset('viewavatars', $data['avatars']);
|
||||||
|
|
||||||
if ($auth->acl_get('u_chgcensors'))
|
if ($auth->acl_get('u_chgcensors'))
|
||||||
{
|
{
|
||||||
$user->optionset('viewcensors', $wordcensor);
|
$user->optionset('viewcensors', $data['wordcensor']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
'user_options' => $user->data['user_options'],
|
'user_options' => $user->data['user_options'],
|
||||||
'user_topic_sortby_type'=> $topic_sk,
|
'user_topic_sortby_type' => $data['topic_sk'],
|
||||||
'user_post_sortby_type' => $post_sk,
|
'user_post_sortby_type' => $data['post_sk'],
|
||||||
'user_topic_sortby_dir' => $topic_sd,
|
'user_topic_sortby_dir' => $data['topic_sd'],
|
||||||
'user_post_sortby_dir' => $post_sd,
|
'user_post_sortby_dir' => $data['post_sd'],
|
||||||
|
|
||||||
'user_topic_show_days' => $topic_st,
|
'user_topic_show_days' => $data['topic_st'],
|
||||||
'user_post_show_days' => $post_st,
|
'user_post_show_days' => $data['post_st'],
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
|
@ -251,15 +224,6 @@ class ucp_prefs
|
||||||
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_sk = (isset($topic_sk)) ? $topic_sk : ((!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't');
|
|
||||||
$post_sk = (isset($post_sk)) ? $post_sk : ((!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't');
|
|
||||||
|
|
||||||
$topic_sd = (isset($topic_sd)) ? $topic_sd : ((!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd');
|
|
||||||
$post_sd = (isset($post_sd)) ? $post_sd : ((!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'd');
|
|
||||||
|
|
||||||
$topic_st = (isset($topic_st)) ? $topic_st : ((!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0);
|
|
||||||
$post_st = (isset($post_st)) ? $post_st : ((!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0);
|
|
||||||
|
|
||||||
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
|
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
|
||||||
|
|
||||||
// Topic ordering options
|
// Topic ordering options
|
||||||
|
@ -280,7 +244,7 @@ class ucp_prefs
|
||||||
${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
|
${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
|
||||||
foreach (${'limit_' . $sort_option . '_days'} as $day => $text)
|
foreach (${'limit_' . $sort_option . '_days'} as $day => $text)
|
||||||
{
|
{
|
||||||
$selected = (${$sort_option . '_st'} == $day) ? ' selected="selected"' : '';
|
$selected = ($data[$sort_option . '_st'] == $day) ? ' selected="selected"' : '';
|
||||||
${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
|
${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
|
||||||
}
|
}
|
||||||
${'s_limit_' . $sort_option . '_days'} .= '</select>';
|
${'s_limit_' . $sort_option . '_days'} .= '</select>';
|
||||||
|
@ -288,7 +252,7 @@ class ucp_prefs
|
||||||
${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
|
${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
|
||||||
foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text)
|
foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text)
|
||||||
{
|
{
|
||||||
$selected = (${$sort_option . '_sk'} == $key) ? ' selected="selected"' : '';
|
$selected = ($data[$sort_option . '_sk'] == $key) ? ' selected="selected"' : '';
|
||||||
${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
||||||
}
|
}
|
||||||
${'s_sort_' . $sort_option . '_key'} .= '</select>';
|
${'s_sort_' . $sort_option . '_key'} .= '</select>';
|
||||||
|
@ -296,46 +260,21 @@ class ucp_prefs
|
||||||
${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">';
|
${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">';
|
||||||
foreach ($sort_dir_text as $key => $value)
|
foreach ($sort_dir_text as $key => $value)
|
||||||
{
|
{
|
||||||
$selected = (${$sort_option . '_sd'} == $key) ? ' selected="selected"' : '';
|
$selected = ($data[$sort_option . '_sd'] == $key) ? ' selected="selected"' : '';
|
||||||
${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||||
}
|
}
|
||||||
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
|
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$images = (isset($images)) ? $images : $user->optionget('viewimg');
|
|
||||||
$images_yes = ($images) ? ' checked="checked"' : '';
|
|
||||||
$images_no = (!$images) ? ' checked="checked"' : '';
|
|
||||||
$flash = (isset($flash)) ? $flash : $user->optionget('viewflash');
|
|
||||||
$flash_yes = ($flash) ? ' checked="checked"' : '';
|
|
||||||
$flash_no = (!$flash) ? ' checked="checked"' : '';
|
|
||||||
$smilies = (isset($smilies)) ? $smilies : $user->optionget('viewsmilies');
|
|
||||||
$smilies_yes = ($smilies) ? ' checked="checked"' : '';
|
|
||||||
$smilies_no = (!$smilies) ? ' checked="checked"' : '';
|
|
||||||
$sigs = (isset($sigs)) ? $sigs : $user->optionget('viewsigs');
|
|
||||||
$sigs_yes = ($sigs) ? ' checked="checked"' : '';
|
|
||||||
$sigs_no = (!$sigs) ? ' checked="checked"' : '';
|
|
||||||
$avatars = (isset($avatars)) ? $avatars : $user->optionget('viewavatars');
|
|
||||||
$avatars_yes = ($avatars) ? ' checked="checked"' : '';
|
|
||||||
$avatars_no = (!$avatars) ? ' checked="checked"' : '';
|
|
||||||
$wordcensor = (isset($wordcensor)) ? $wordcensor : $user->optionget('viewcensors');
|
|
||||||
$wordcensor_yes = ($wordcensor) ? ' checked="checked"' : '';
|
|
||||||
$wordcensor_no = (!$wordcensor) ? ' checked="checked"' : '';
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||||
|
|
||||||
'VIEW_IMAGES_YES' => $images_yes,
|
'S_IMAGES' => (isset($data['images'])) ? $data['images'] : $user->optionget('viewimg'),
|
||||||
'VIEW_IMAGES_NO' => $images_no,
|
'S_FLASH' => (isset($data['flash'])) ? $data['flash'] : $user->optionget('viewflash'),
|
||||||
'VIEW_FLASH_YES' => $flash_yes,
|
'S_SMILIES' => (isset($data['smilies'])) ? $data['smilies'] : $user->optionget('viewsmilies'),
|
||||||
'VIEW_FLASH_NO' => $flash_no,
|
'S_SIGS' => (isset($data['sigs'])) ? $data['sigs'] : $user->optionget('viewsigs'),
|
||||||
'VIEW_SMILIES_YES' => $smilies_yes,
|
'S_AVATARS' => (isset($data['avatars'])) ? $data['avatars'] : $user->optionget('viewavatars'),
|
||||||
'VIEW_SMILIES_NO' => $smilies_no,
|
'S_DISABLE_CENSORS' => (isset($data['wordcensor'])) ? $data['wordcensor'] : $user->optionget('viewcensors'),
|
||||||
'VIEW_SIGS_YES' => $sigs_yes,
|
|
||||||
'VIEW_SIGS_NO' => $sigs_no,
|
|
||||||
'VIEW_AVATARS_YES' => $avatars_yes,
|
|
||||||
'VIEW_AVATARS_NO' => $avatars_no,
|
|
||||||
'DISABLE_CENSORS_YES' => $wordcensor_yes,
|
|
||||||
'DISABLE_CENSORS_NO' => $wordcensor_no,
|
|
||||||
|
|
||||||
'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors')) ? true : false,
|
'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors')) ? true : false,
|
||||||
|
|
||||||
|
@ -347,75 +286,52 @@ class ucp_prefs
|
||||||
'S_POST_SORT_DIR' => $s_sort_post_dir)
|
'S_POST_SORT_DIR' => $s_sort_post_dir)
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'post':
|
case 'post':
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'bbcode' => $user->optionget('bbcode'),
|
||||||
|
'smilies' => $user->optionget('smilies'),
|
||||||
|
'sig' => $user->optionget('attachsig'),
|
||||||
|
'notify' => $user->data['user_notify'],
|
||||||
|
);
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
$var_ary = array(
|
$var_ary = $data;
|
||||||
'bbcode' => true,
|
|
||||||
'smilies' => true,
|
|
||||||
'sig' => true,
|
|
||||||
'notify' => false,
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($var_ary as $var => $default)
|
foreach ($var_ary as $var => $default)
|
||||||
{
|
{
|
||||||
$$var = request_var($var, $default);
|
$data[$var] = request_var($var, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->optionset('bbcode', $bbcode);
|
$user->optionset('bbcode', $data['bbcode']);
|
||||||
$user->optionset('smilies', $smilies);
|
$user->optionset('smilies', $data['smilies']);
|
||||||
$user->optionset('attachsig', $sig);
|
$user->optionset('attachsig', $data['sig']);
|
||||||
|
|
||||||
if (!sizeof($error))
|
$sql_ary = array(
|
||||||
{
|
'user_options' => $user->data['user_options'],
|
||||||
$sql_ary = array(
|
'user_notify' => $data['notify'],
|
||||||
'user_options' => $user->data['user_options'],
|
);
|
||||||
'user_notify' => $notify,
|
|
||||||
);
|
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||||
WHERE user_id = ' . $user->data['user_id'];
|
WHERE user_id = ' . $user->data['user_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
meta_refresh(3, $this->u_action);
|
meta_refresh(3, $this->u_action);
|
||||||
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
$message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
|
||||||
|
|
||||||
// Replace "error" strings with their real, localised form
|
|
||||||
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$bbcode = (isset($bbcode)) ? $bbcode : $user->optionget('bbcode');
|
|
||||||
$bbcode_yes = ($bbcode) ? ' checked="checked"' : '';
|
|
||||||
$bbcode_no = (!$bbcode) ? ' checked="checked"' : '';
|
|
||||||
$smilies = (isset($smilies)) ? $smilies : $user->optionget('smilies');
|
|
||||||
$smilies_yes = ($smilies) ? ' checked="checked"' : '';
|
|
||||||
$smilies_no = (!$smilies) ? ' checked="checked"' : '';
|
|
||||||
$sig = (isset($sig)) ? $sig : $user->optionget('attachsig');
|
|
||||||
$sig_yes = ($sig) ? ' checked="checked"' : '';
|
|
||||||
$sig_no = (!$sig) ? ' checked="checked"' : '';
|
|
||||||
$notify = (isset($notify)) ? $notify : $user->data['user_notify'];
|
|
||||||
$notify_yes = ($notify) ? ' checked="checked"' : '';
|
|
||||||
$notify_no = (!$notify) ? ' checked="checked"' : '';
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
'S_BBCODE' => $data['bbcode'],
|
||||||
|
'S_SMILIES' => $data['smilies'],
|
||||||
'DEFAULT_BBCODE_YES' => $bbcode_yes,
|
'S_SIG' => $data['sig'],
|
||||||
'DEFAULT_BBCODE_NO' => $bbcode_no,
|
'S_NOTIFY' => $data['notify'])
|
||||||
'DEFAULT_SMILIES_YES' => $smilies_yes,
|
|
||||||
'DEFAULT_SMILIES_NO' => $smilies_no,
|
|
||||||
'DEFAULT_SIG_YES' => $sig_yes,
|
|
||||||
'DEFAULT_SIG_NO' => $sig_no,
|
|
||||||
'DEFAULT_NOTIFY_YES' => $notify_yes,
|
|
||||||
'DEFAULT_NOTIFY_NO' => $notify_no,)
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|
|
@ -220,7 +220,7 @@ class ucp_profile
|
||||||
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
||||||
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
||||||
|
|
||||||
'S_FORCE_PASSWORD' => ($config['chg_passforce'] && $this->data['user_passchg'] < time() - $config['chg_passforce']) ? true : false,
|
'S_FORCE_PASSWORD' => ($config['chg_passforce'] && $user->data['user_passchg'] < time() - $config['chg_passforce']) ? true : false,
|
||||||
'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false,
|
'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false,
|
||||||
'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false,
|
'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false,
|
||||||
'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false)
|
'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false)
|
||||||
|
|
|
@ -24,16 +24,16 @@ class ucp_register
|
||||||
//
|
//
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
|
if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['UCP_REGISTER_DISABLE']);
|
trigger_error('UCP_REGISTER_DISABLE');
|
||||||
}
|
}
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
||||||
|
|
||||||
$confirm_id = request_var('confirm_id', '');
|
$confirm_id = request_var('confirm_id', '');
|
||||||
$coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
|
$coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
|
||||||
$agreed = (!empty($_POST['agreed'])) ? 1 : 0;
|
$agreed = (!empty($_POST['agreed'])) ? 1 : 0;
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
$change_lang = request_var('change_lang', '');
|
$change_lang = request_var('change_lang', '');
|
||||||
|
|
||||||
if ($change_lang)
|
if ($change_lang)
|
||||||
{
|
{
|
||||||
|
@ -155,8 +155,10 @@ class ucp_register
|
||||||
AND session_id = '" . $db->sql_escape($user->session_id) . "'
|
AND session_id = '" . $db->sql_escape($user->session_id) . "'
|
||||||
AND confirm_type = " . CONFIRM_REG;
|
AND confirm_type = " . CONFIRM_REG;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row)
|
||||||
{
|
{
|
||||||
if (strcasecmp($row['code'], $confirm_code) === 0)
|
if (strcasecmp($row['code'], $confirm_code) === 0)
|
||||||
{
|
{
|
||||||
|
@ -177,7 +179,6 @@ class ucp_register
|
||||||
$error[] = $user->lang['CONFIRM_CODE_WRONG'];
|
$error[] = $user->lang['CONFIRM_CODE_WRONG'];
|
||||||
$wrong_confirm = true;
|
$wrong_confirm = true;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,13 +209,14 @@ class ucp_register
|
||||||
WHERE group_name = '" . $db->sql_escape($group_name) . "'
|
WHERE group_name = '" . $db->sql_escape($group_name) . "'
|
||||||
AND group_type = " . GROUP_SPECIAL;
|
AND group_type = " . GROUP_SPECIAL;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
|
||||||
{
|
|
||||||
trigger_error($user->lang['NO_GROUP']);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if (!$row)
|
||||||
|
{
|
||||||
|
trigger_error('NO_GROUP');
|
||||||
|
}
|
||||||
|
|
||||||
$group_id = $row['group_id'];
|
$group_id = $row['group_id'];
|
||||||
|
|
||||||
if (($coppa ||
|
if (($coppa ||
|
||||||
|
@ -223,7 +225,7 @@ class ucp_register
|
||||||
{
|
{
|
||||||
$user_actkey = gen_rand_string(10);
|
$user_actkey = gen_rand_string(10);
|
||||||
$key_len = 54 - (strlen($server_url));
|
$key_len = 54 - (strlen($server_url));
|
||||||
$key_len = ($key_len > 6) ? $key_len : 6;
|
$key_len = ($key_len < 6) ? 6 : $key_len;
|
||||||
$user_actkey = substr($user_actkey, 0, $key_len);
|
$user_actkey = substr($user_actkey, 0, $key_len);
|
||||||
$user_type = USER_INACTIVE;
|
$user_type = USER_INACTIVE;
|
||||||
}
|
}
|
||||||
|
@ -233,80 +235,21 @@ class ucp_register
|
||||||
$user_actkey = '';
|
$user_actkey = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin transaction ... should this screw up we can rollback
|
$user_row = array(
|
||||||
$db->sql_transaction('begin');
|
'username' => $username,
|
||||||
|
'user_password' => md5($new_password),
|
||||||
$sql_ary = array(
|
'user_email' => $email,
|
||||||
'username' => $username,
|
|
||||||
'user_permissions' => '',
|
|
||||||
'user_password' => md5($new_password),
|
|
||||||
'user_email' => $email,
|
|
||||||
'user_email_hash' => (int) crc32(strtolower($email)) . strlen($email),
|
|
||||||
'group_id' => (int) $group_id,
|
|
||||||
'user_timezone' => (float) $tz,
|
|
||||||
'user_dateformat' => $config['default_dateformat'],
|
|
||||||
'user_lang' => $lang,
|
|
||||||
'user_style' => $config['default_style'],
|
|
||||||
'user_allow_pm' => 1,
|
|
||||||
'user_type' => $user_type,
|
|
||||||
'user_actkey' => $user_actkey,
|
|
||||||
'user_ip' => $user->ip,
|
|
||||||
'user_regdate' => time(),
|
|
||||||
|
|
||||||
'user_lastmark' => time(),
|
|
||||||
'user_lastvisit' => 0,
|
|
||||||
'user_lastpost_time' => 0,
|
|
||||||
'user_lastpage' => '',
|
|
||||||
'user_posts' => 0,
|
|
||||||
'user_dst' => 0,
|
|
||||||
'user_colour' => '',
|
|
||||||
'user_avatar' => '',
|
|
||||||
'user_avatar_type' => 0,
|
|
||||||
'user_avatar_width' => 0,
|
|
||||||
'user_avatar_height' => 0,
|
|
||||||
'user_new_privmsg' => 0,
|
|
||||||
'user_unread_privmsg' => 0,
|
|
||||||
'user_last_privmsg' => 0,
|
|
||||||
'user_message_rules' => 0,
|
|
||||||
'user_full_folder' => PRIVMSGS_NO_BOX,
|
|
||||||
'user_emailtime' => 0,
|
|
||||||
|
|
||||||
'user_notify' => 0,
|
|
||||||
'user_notify_pm' => 1,
|
|
||||||
'user_notify_type' => NOTIFY_EMAIL,
|
|
||||||
'user_allow_pm' => 1,
|
|
||||||
'user_allow_email' => 1,
|
|
||||||
'user_allow_viewonline' => 1,
|
|
||||||
'user_allow_viewemail' => 1,
|
|
||||||
'user_allow_massemail' => 1,
|
|
||||||
|
|
||||||
'user_sig' => '',
|
|
||||||
'user_sig_bbcode_uid' => '',
|
|
||||||
'user_sig_bbcode_bitfield' => 0,
|
|
||||||
);
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$user_id = $db->sql_nextid();
|
|
||||||
|
|
||||||
// Insert Custom Profile Fields
|
|
||||||
if (sizeof($cp_data))
|
|
||||||
{
|
|
||||||
$cp_data['user_id'] = (int) $user_id;
|
|
||||||
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
|
|
||||||
$db->sql_query($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Place into appropriate group, either REGISTERED(_COPPA) or INACTIVE(_COPPA) depending on config
|
|
||||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
|
||||||
'user_id' => (int) $user_id,
|
|
||||||
'group_id' => (int) $group_id,
|
'group_id' => (int) $group_id,
|
||||||
'user_pending' => 0)
|
'user_timezone' => (float) $tz,
|
||||||
|
'user_lang' => $lang,
|
||||||
|
'user_type' => $user_type,
|
||||||
|
'user_actkey' => $user_actkey,
|
||||||
|
'user_ip' => $user->ip,
|
||||||
|
'user_regdate' => time(),
|
||||||
);
|
);
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$db->sql_transaction('commit');
|
// Register user...
|
||||||
|
$user_id = user_add($user_row, $cp_data);
|
||||||
|
|
||||||
if ($coppa && $config['email_enable'])
|
if ($coppa && $config['email_enable'])
|
||||||
{
|
{
|
||||||
|
@ -331,7 +274,7 @@ class ucp_register
|
||||||
|
|
||||||
if ($config['email_enable'])
|
if ($config['email_enable'])
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||||
|
|
||||||
$messenger = new messenger(false);
|
$messenger = new messenger(false);
|
||||||
|
|
||||||
|
@ -360,7 +303,7 @@ class ucp_register
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'FAX_INFO' => $config['coppa_fax'],
|
'FAX_INFO' => $config['coppa_fax'],
|
||||||
'MAIL_INFO' => $config['coppa_mail'],
|
'MAIL_INFO' => $config['coppa_mail'],
|
||||||
'EMAIL_ADDRESS' => $email,
|
'EMAIL_ADDRESS' => $email,
|
||||||
'SITENAME' => $config['sitename'])
|
'SITENAME' => $config['sitename'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -369,8 +312,7 @@ class ucp_register
|
||||||
|
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
|
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
|
||||||
{
|
{
|
||||||
// Grab an array of user_id's with a_user permissions ... these users
|
// Grab an array of user_id's with a_user permissions ... these users can activate a user
|
||||||
// can activate a user
|
|
||||||
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
|
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
|
||||||
|
|
||||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
|
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
|
||||||
|
@ -412,12 +354,13 @@ class ucp_register
|
||||||
}
|
}
|
||||||
|
|
||||||
$s_hidden_fields = build_hidden_fields(array(
|
$s_hidden_fields = build_hidden_fields(array(
|
||||||
'agreed' => 'true',
|
'agreed' => 'true',
|
||||||
'coppa' => $coppa,
|
'coppa' => $coppa,
|
||||||
'change_lang' => 0)
|
'change_lang' => 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
$confirm_image = '';
|
$confirm_image = '';
|
||||||
|
|
||||||
// Visual Confirmation - Show images
|
// Visual Confirmation - Show images
|
||||||
if ($config['enable_confirm'])
|
if ($config['enable_confirm'])
|
||||||
{
|
{
|
||||||
|
@ -448,16 +391,14 @@ class ucp_register
|
||||||
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
|
WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
|
||||||
AND confirm_type = " . CONFIRM_REG;
|
AND confirm_type = " . CONFIRM_REG;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$attempts = (int) $db->sql_fetchfield('attempts');
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if ($config['max_reg_attempts'] && $row['attempts'] >= $config['max_reg_attempts'])
|
|
||||||
{
|
|
||||||
trigger_error($user->lang['TOO_MANY_REGISTERS']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts'])
|
||||||
|
{
|
||||||
|
trigger_error($user->lang['TOO_MANY_REGISTERS']);
|
||||||
|
}
|
||||||
|
|
||||||
$code = gen_rand_string(mt_rand(5, 8));
|
$code = gen_rand_string(mt_rand(5, 8));
|
||||||
$confirm_id = md5(unique_id($user->ip));
|
$confirm_id = md5(unique_id($user->ip));
|
||||||
|
|
||||||
|
@ -480,11 +421,11 @@ class ucp_register
|
||||||
{
|
{
|
||||||
case USER_ACTIVATION_SELF:
|
case USER_ACTIVATION_SELF:
|
||||||
$l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE'];
|
$l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case USER_ACTIVATION_ADMIN:
|
case USER_ACTIVATION_ADMIN:
|
||||||
$l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
|
$l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
|
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
|
||||||
|
@ -502,10 +443,10 @@ class ucp_register
|
||||||
'EMAIL_CONFIRM' => (isset($email_confirm)) ? $email_confirm : '',
|
'EMAIL_CONFIRM' => (isset($email_confirm)) ? $email_confirm : '',
|
||||||
'CONFIRM_IMG' => $confirm_image,
|
'CONFIRM_IMG' => $confirm_image,
|
||||||
|
|
||||||
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'),
|
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'),
|
||||||
'L_ITEMS_REQUIRED' => $l_reg_cond,
|
'L_ITEMS_REQUIRED' => $l_reg_cond,
|
||||||
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
||||||
'L_NEW_PASSWORD_EXPLAIN'=> sprintf($user->lang['NEW_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang['NEW_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
||||||
|
|
||||||
'S_LANG_OPTIONS' => language_select($lang),
|
'S_LANG_OPTIONS' => language_select($lang),
|
||||||
'S_TZ_OPTIONS' => tz_select($tz),
|
'S_TZ_OPTIONS' => tz_select($tz),
|
||||||
|
|
|
@ -19,82 +19,76 @@ class ucp_remind
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
global $config, $phpbb_root_path, $phpEx;
|
||||||
|
global $db, $user, $auth, $template;
|
||||||
|
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$username = request_var('username', '', true);
|
||||||
|
$email = request_var('email', '');
|
||||||
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
$username = request_var('username', '', true);
|
|
||||||
$email = request_var('email', '');
|
|
||||||
|
|
||||||
$sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_type, user_lang
|
$sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_type, user_lang
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . USERS_TABLE . "
|
||||||
WHERE user_email = '" . $db->sql_escape($email) . "'
|
WHERE user_email = '" . $db->sql_escape($email) . "'
|
||||||
AND username = '" . $db->sql_escape($username) . "'";
|
AND LOWER(username) = '" . $db->sql_escape(strtolower($username)) . "'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$user_row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
if (!$user_row)
|
||||||
{
|
{
|
||||||
trigger_error('NO_EMAIL_USER');
|
trigger_error('NO_EMAIL_USER');
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($row['user_type'] == USER_INACTIVE)
|
if ($user_row['user_type'] == USER_INACTIVE)
|
||||||
{
|
{
|
||||||
trigger_error('ACCOUNT_NOT_ACTIVATED');
|
trigger_error('ACCOUNT_NOT_ACTIVATED');
|
||||||
}
|
}
|
||||||
|
|
||||||
$server_url = generate_board_url();
|
$server_url = generate_board_url();
|
||||||
$username = $row['username'];
|
|
||||||
$user_id = $row['user_id'];
|
|
||||||
|
|
||||||
$key_len = 54 - strlen($server_url);
|
$key_len = 54 - strlen($server_url);
|
||||||
$key_len = ($key_len > 6) ? $key_len : 6;
|
$key_len = ($key_len < 6) ? 6 : $key_len;
|
||||||
$user_actkey = substr(gen_rand_string(10), 0, $key_len);
|
$user_actkey = substr(gen_rand_string(10), 0, $key_len);
|
||||||
$user_password = gen_rand_string(8);
|
$user_password = gen_rand_string(8);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||||
SET user_newpasswd = '" . $db->sql_escape(md5($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
|
SET user_newpasswd = '" . $db->sql_escape(md5($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
|
||||||
WHERE user_id = " . $row['user_id'];
|
WHERE user_id = " . $user_row['user_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||||
|
|
||||||
$messenger = new messenger();
|
$messenger = new messenger(false);
|
||||||
|
|
||||||
$messenger->template('user_activate_passwd', $row['user_lang']);
|
$messenger->template('user_activate_passwd', $row['user_lang']);
|
||||||
|
|
||||||
$messenger->replyto($user->data['user_email']);
|
$messenger->replyto($user->data['user_email']);
|
||||||
$messenger->to($row['user_email'], $row['username']);
|
$messenger->to($user_row['user_email'], $user_row['username']);
|
||||||
$messenger->im($row['user_jabber'], $row['username']);
|
$messenger->im($user_row['user_jabber'], $user_row['username']);
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'SITENAME' => $config['sitename'],
|
'SITENAME' => $config['sitename'],
|
||||||
'USERNAME' => html_entity_decode($username),
|
'USERNAME' => html_entity_decode($user_row['username']),
|
||||||
'PASSWORD' => html_entity_decode($user_password),
|
'PASSWORD' => html_entity_decode($user_password),
|
||||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||||
|
|
||||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
|
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
|
||||||
);
|
);
|
||||||
|
|
||||||
$messenger->send($row['user_notify_type']);
|
$messenger->send($user_row['user_notify_type']);
|
||||||
$messenger->save_queue();
|
|
||||||
|
|
||||||
|
|
||||||
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||||
|
|
||||||
$message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
$message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$username = $email = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'USERNAME' => $username,
|
'USERNAME' => $username,
|
||||||
'EMAIL' => $email)
|
'EMAIL' => $email,
|
||||||
|
'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword'))
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->tpl_name = 'ucp_remind';
|
$this->tpl_name = 'ucp_remind';
|
||||||
|
|
|
@ -19,61 +19,57 @@ class ucp_resend
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
global $config, $phpbb_root_path, $phpEx;
|
||||||
|
global $db, $user, $auth, $template;
|
||||||
|
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$username = request_var('username', '', true);
|
||||||
|
$email = request_var('email', '');
|
||||||
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
$username = request_var('username', '', true);
|
$sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey
|
||||||
$email = request_var('email', '');
|
|
||||||
|
|
||||||
$sql = 'SELECT user_id, username, user_email, user_type, user_lang, user_actkey
|
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . USERS_TABLE . "
|
||||||
WHERE user_email = '" . $db->sql_escape($email) . "'
|
WHERE user_email = '" . $db->sql_escape($email) . "'
|
||||||
AND username = '" . $db->sql_escape($username) . "'";
|
AND LOWER(username) = '" . $db->sql_escape(strtolower($username)) . "'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$user_row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
if (!$user_row)
|
||||||
{
|
{
|
||||||
trigger_error('NO_EMAIL_USER');
|
trigger_error('NO_EMAIL_USER');
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if (!$row['user_actkey'])
|
if (!$user_row['user_actkey'])
|
||||||
{
|
{
|
||||||
trigger_error('ACCOUNT_ALREADY_ACTIVATED');
|
trigger_error('ACCOUNT_ALREADY_ACTIVATED');
|
||||||
}
|
}
|
||||||
|
|
||||||
$server_url = generate_board_url();
|
// Determine coppa status on group (INACTIVE(_COPPA))
|
||||||
$username = $row['username'];
|
$sql = 'SELECT group_name, group_type
|
||||||
$user_id = $row['user_id'];
|
FROM ' . GROUPS_TABLE . '
|
||||||
|
WHERE group_id = ' . $user_row['group_id'];
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
/* if ($coppa)
|
if (!$row)
|
||||||
{
|
{
|
||||||
$email_template = 'coppa_welcome_inactive';
|
trigger_error('NO_GROUP');
|
||||||
}*/
|
|
||||||
/*
|
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
|
|
||||||
{
|
|
||||||
$email_template = 'admin_welcome_inactive';
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$email_template = 'user_welcome_inactive';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
$coppa = ($row['group_name'] == 'INACTIVE_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false;
|
||||||
|
|
||||||
|
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||||
$messenger = new messenger(false);
|
$messenger = new messenger(false);
|
||||||
|
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa)
|
if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa)
|
||||||
{
|
{
|
||||||
$messenger->template('user_resend_inactive', $row['user_lang']);
|
$messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']);
|
||||||
|
|
||||||
$messenger->replyto($config['board_contact']);
|
$messenger->replyto($config['board_contact']);
|
||||||
$messenger->to($row['user_email'], $row['username']);
|
$messenger->to($user_row['user_email'], $user_row['username']);
|
||||||
|
|
||||||
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
||||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||||
|
@ -83,10 +79,10 @@ class ucp_resend
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'SITENAME' => $config['sitename'],
|
'SITENAME' => $config['sitename'],
|
||||||
'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']),
|
'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']),
|
||||||
'USERNAME' => html_entity_decode($row['username']),
|
'USERNAME' => html_entity_decode($user_row['username']),
|
||||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||||
|
|
||||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$row['user_id']}&k={$row['user_actkey']}")
|
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($coppa)
|
if ($coppa)
|
||||||
|
@ -94,7 +90,7 @@ class ucp_resend
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'FAX_INFO' => $config['coppa_fax'],
|
'FAX_INFO' => $config['coppa_fax'],
|
||||||
'MAIL_INFO' => $config['coppa_mail'],
|
'MAIL_INFO' => $config['coppa_mail'],
|
||||||
'EMAIL_ADDRESS' => $row['user_email'],
|
'EMAIL_ADDRESS' => $user_row['user_email'],
|
||||||
'SITENAME' => $config['sitename'])
|
'SITENAME' => $config['sitename'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -104,8 +100,7 @@ class ucp_resend
|
||||||
|
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
|
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
|
||||||
{
|
{
|
||||||
// Grab an array of user_id's with a_user permissions ... these users
|
// Grab an array of user_id's with a_user permissions ... these users can activate a user
|
||||||
// can activate a user
|
|
||||||
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
|
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
|
||||||
|
|
||||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
|
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
|
||||||
|
@ -121,10 +116,10 @@ class ucp_resend
|
||||||
$messenger->im($row['user_jabber'], $row['username']);
|
$messenger->im($row['user_jabber'], $row['username']);
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'USERNAME' => html_entity_decode($row['username']),
|
'USERNAME' => html_entity_decode($user_row['username']),
|
||||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||||
|
|
||||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$row['user_id']}&k={$row['user_actkey']}")
|
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
|
||||||
);
|
);
|
||||||
|
|
||||||
$messenger->send($row['user_notify_type']);
|
$messenger->send($row['user_notify_type']);
|
||||||
|
@ -137,14 +132,11 @@ class ucp_resend
|
||||||
$message = $user->lang['ACTIVATION_EMAIL_SENT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
$message = $user->lang['ACTIVATION_EMAIL_SENT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$username = $email = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'USERNAME' => $username,
|
'USERNAME' => $username,
|
||||||
'EMAIL' => $email)
|
'EMAIL' => $email,
|
||||||
|
'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=resend_act'))
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->tpl_name = 'ucp_resend';
|
$this->tpl_name = 'ucp_resend';
|
||||||
|
|
|
@ -107,8 +107,8 @@ $lang = array_merge($lang, array(
|
||||||
'NO_FORUM_ACTION' => 'No action defined for what happens with the forum content',
|
'NO_FORUM_ACTION' => 'No action defined for what happens with the forum content',
|
||||||
'NO_PARENT' => 'No Parent',
|
'NO_PARENT' => 'No Parent',
|
||||||
'NO_PERMISSIONS' => 'Do not copy permissions',
|
'NO_PERMISSIONS' => 'Do not copy permissions',
|
||||||
'NO_PERMISSION_FORUM_ADD' => 'You do not have the neccessary permissions to delete forums',
|
'NO_PERMISSION_FORUM_ADD' => 'You do not have the neccessary permissions to add forums',
|
||||||
'NO_PERMISSION_FORUM_DELETE' => 'You do not have the neccessary permissions to add forums',
|
'NO_PERMISSION_FORUM_DELETE' => 'You do not have the neccessary permissions to delete forums',
|
||||||
|
|
||||||
'PARENT_NOT_EXIST' => 'Parent does not exist',
|
'PARENT_NOT_EXIST' => 'Parent does not exist',
|
||||||
'PRUNE_ANNOUNCEMENTS' => 'Prune Announcements',
|
'PRUNE_ANNOUNCEMENTS' => 'Prune Announcements',
|
||||||
|
|
|
@ -132,7 +132,9 @@ $lang = array_merge($lang, array(
|
||||||
'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.',
|
'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.',
|
||||||
'ENABLED' => 'Enabled',
|
'ENABLED' => 'Enabled',
|
||||||
'ENCLOSURE' => 'Enclosure',
|
'ENCLOSURE' => 'Enclosure',
|
||||||
|
'ERR_CHANGING_DIRECTORY' => 'Unable to change directory',
|
||||||
'ERR_CONNECTING_SERVER' => 'Error connecting to the server',
|
'ERR_CONNECTING_SERVER' => 'Error connecting to the server',
|
||||||
|
'ERR_UNABLE_TO_LOGIN' => 'Error on login. Supplied username or password wrong.',
|
||||||
'EXTENSION' => 'Extension',
|
'EXTENSION' => 'Extension',
|
||||||
'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed',
|
'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed',
|
||||||
|
|
||||||
|
|
43
phpBB/language/en/email/coppa_resend_inactive.txt
Normal file
43
phpBB/language/en/email/coppa_resend_inactive.txt
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
Subject: Welcome to {SITENAME} Forums
|
||||||
|
Charset: iso-8859-1
|
||||||
|
|
||||||
|
{WELCOME_MSG}
|
||||||
|
|
||||||
|
In compliance with the COPPA act your account is currently inactive.
|
||||||
|
|
||||||
|
Please print this message out and have your parent or guardian sign and date it. Then fax it to:
|
||||||
|
|
||||||
|
{FAX_INFO}
|
||||||
|
|
||||||
|
OR mail it to:
|
||||||
|
|
||||||
|
{MAIL_INFO}
|
||||||
|
|
||||||
|
------------------------------ CUT HERE ------------------------------
|
||||||
|
Permission to Participate at {SITENAME}
|
||||||
|
|
||||||
|
Username: {USERNAME}
|
||||||
|
Email: {EMAIL_ADDRESS}
|
||||||
|
|
||||||
|
I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO {SITENAME} TO STORE THIS INFORMATION.
|
||||||
|
I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD.
|
||||||
|
I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM {SITENAME} AT ANY TIME.
|
||||||
|
|
||||||
|
|
||||||
|
Parent or Guardian
|
||||||
|
(print your name here): _____________________
|
||||||
|
|
||||||
|
(sign here): __________________
|
||||||
|
|
||||||
|
Date: _______________
|
||||||
|
|
||||||
|
------------------------------ CUT HERE ------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
Once the administrator has recived the above form via fax or regular mail your account will be activated.
|
||||||
|
|
||||||
|
Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
|
||||||
|
|
||||||
|
Thank you for registering.
|
||||||
|
|
||||||
|
{EMAIL_SIG}
|
|
@ -20,15 +20,6 @@ Username: {USERNAME}
|
||||||
Password: {PASSWORD}
|
Password: {PASSWORD}
|
||||||
Email: {EMAIL_ADDRESS}
|
Email: {EMAIL_ADDRESS}
|
||||||
|
|
||||||
ICQ Number: {ICQ}
|
|
||||||
AIM Address: {AIM}
|
|
||||||
MSN Messenger: {MSN}
|
|
||||||
Yahoo Messenger: {YIM}
|
|
||||||
Web Site: {WEB_SITE}
|
|
||||||
From: {FROM}
|
|
||||||
Occupation: {OCC}
|
|
||||||
Interests: {INTERESTS}
|
|
||||||
|
|
||||||
I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO {SITENAME} TO STORE THIS INFORMATION.
|
I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO {SITENAME} TO STORE THIS INFORMATION.
|
||||||
I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD.
|
I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD.
|
||||||
I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM {SITENAME} AT ANY TIME.
|
I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM {SITENAME} AT ANY TIME.
|
||||||
|
|
|
@ -90,7 +90,7 @@ if ($id && $sid)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What happens if the theme_data value is older than the file?
|
* @todo What happens if the theme_data value is older than the file?
|
||||||
* It should be re-cached as is done with templates and the template cache
|
* It should be re-cached as is done with templates and the template cache
|
||||||
* if ($theme['theme_mtime'] < filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
|
* if ($theme['theme_mtime'] < filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<td>
|
<td>
|
||||||
<input class="post" type="password" name="password" size="25" maxlength="100" tabindex="2" />
|
<input class="post" type="password" name="password" size="25" maxlength="100" tabindex="2" />
|
||||||
<!-- IF U_SEND_PASSWORD --><br /><a class="gensmall" href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a><!-- ENDIF -->
|
<!-- IF U_SEND_PASSWORD --><br /><a class="gensmall" href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a><!-- ENDIF -->
|
||||||
<!-- IF U_RESEND_ACTIVATION --><br /><a class="gensmall" href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a><!-- ENDIF -->
|
<!-- IF U_RESEND_ACTIVATION and not S_ADMIN_AUTH --><br /><a class="gensmall" href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a><!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF S_DISPLAY_FULL_LOGIN -->
|
<!-- IF S_DISPLAY_FULL_LOGIN -->
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<!-- IF S_ATTACHMENT_ROWS -->
|
<!-- IF S_ATTACHMENT_ROWS -->
|
||||||
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th nowrap="nowrap">#</th>
|
<th nowrap="nowrap">#</th>
|
||||||
<th nowrap="nowrap" width="15%"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></th>
|
<th nowrap="nowrap" width="15%"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></th>
|
||||||
|
@ -12,20 +12,19 @@
|
||||||
<th width="2%" nowrap="nowrap">{L_DELETE}</th>
|
<th width="2%" nowrap="nowrap">{L_DELETE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF TOTAL_ATTACHMENTS -->
|
<!-- IF TOTAL_ATTACHMENTS -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row3" colspan="6">
|
<td class="row3" colspan="6">
|
||||||
<table width="100%" cellspacing="1">
|
<table width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td>
|
<td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td>
|
||||||
<td class="gensmall" nowrap="nowrap"> [ {TOTAL_ATTACHMENTS} ] </td>
|
<td class="gensmall" nowrap="nowrap"> [ {TOTAL_ATTACHMENTS} ] </td>
|
||||||
<td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td>
|
<td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- BEGIN attachrow -->
|
<!-- BEGIN attachrow -->
|
||||||
|
|
||||||
<!-- IF attachrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
|
<!-- IF attachrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
|
||||||
|
|
||||||
<td class="genmed" style="padding: 4px;" align="center" width="2%"> {attachrow.ROW_NUMBER} </td>
|
<td class="genmed" style="padding: 4px;" align="center" width="2%"> {attachrow.ROW_NUMBER} </td>
|
||||||
|
@ -39,20 +38,20 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="6"><div style="float:left"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> <input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float:right"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </div></td>
|
<td class="cat" colspan="6"><div style="float:left"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> <input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float:right"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div style="float:right"><b class="gensmall"><a href="javascript:marklist('ucp', 'attachment', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 'attachment', false);">{L_UNMARK_ALL}</a></b></div>
|
<div style="float:right"><b class="gensmall"><a href="javascript:marklist('ucp', 'attachment', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 'attachment', false);">{L_UNMARK_ALL}</a></b></div>
|
||||||
|
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th height="28">{L_TITLE}</th>
|
<th height="28">{L_TITLE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="row1">
|
<tr class="row1">
|
||||||
<td height="25" align="center"><b class="genmed">{L_UCP_NO_ATTACHMENTS}</b></td>
|
<td height="25" align="center"><b class="genmed">{L_UCP_NO_ATTACHMENTS}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
|
|
@ -1,58 +1,60 @@
|
||||||
<!-- INCLUDE ucp_header.html -->
|
<!-- INCLUDE ucp_header.html -->
|
||||||
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="5">{L_UCP}</th>
|
<th colspan="5">{L_UCP}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="5" align="center"><span class="genmed">{L_UCP_WELCOME}</span></td>
|
<td class="row1" colspan="5" align="center"><span class="genmed">{L_UCP_WELCOME}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="5">{L_BOOKMARKS}</th>
|
<th colspan="5">{L_BOOKMARKS}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- IF S_NO_DISPLAY_BOOKMARKS -->
|
<!-- IF S_NO_DISPLAY_BOOKMARKS -->
|
||||||
<tr class="row1">
|
<tr class="row1">
|
||||||
<td colspan="5" align="center"><b class="genmed">{L_BOOKMARKS_DISABLED}</b></td>
|
<td colspan="5" align="center"><b class="genmed">{L_BOOKMARKS_DISABLED}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
|
|
||||||
<!-- BEGIN topicrow -->
|
<!-- BEGIN topicrow -->
|
||||||
|
|
||||||
<!-- IF topicrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
|
<!-- IF topicrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
|
||||||
<td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td>
|
<td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td>
|
||||||
<!-- IF topicrow.S_DELETED_TOPIC -->
|
<!-- IF topicrow.S_DELETED_TOPIC -->
|
||||||
<td class="postdetails" style="padding: 4px" width="100%" colspan="2">{L_DELETED_TOPIC}</td>
|
<td class="postdetails" style="padding: 4px" width="100%" colspan="2">{L_DELETED_TOPIC}</td>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<td style="padding: 4px;" width="100%" valign="top">
|
<td style="padding: 4px;" width="100%" valign="top">
|
||||||
<p class="topictitle">{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p>
|
<p class="topictitle">{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p>
|
||||||
<!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
|
<!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
|
||||||
<!-- IF topicrow.PAGINATION -->
|
<!-- IF topicrow.PAGINATION -->
|
||||||
<p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
|
<p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
<td style="padding: 4px;" align="left" valign="top" nowrap="nowrap">
|
<td style="padding: 4px;" align="left" valign="top" nowrap="nowrap">
|
||||||
<p class="topicdetails">{topicrow.LAST_POST_TIME}</p>
|
<p class="topicdetails">{topicrow.LAST_POST_TIME}</p>
|
||||||
<p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF -->
|
<p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF -->
|
||||||
<a href="{topicrow.U_LAST_POST}">{topicrow.LAST_POST_IMG}</a>
|
<a href="{topicrow.U_LAST_POST}">{topicrow.LAST_POST_IMG}</a>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<td class="postdetails" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF topicrow.U_MOVE_UP --><a href="{topicrow.U_MOVE_UP}">{L_MOVE_UP}</a><!-- ENDIF --><!-- IF topicrow.U_MOVE_UP and topicrow.U_MOVE_DOWN --> | <!-- ENDIF --><!-- IF topicrow.U_MOVE_DOWN --><a href="{topicrow.U_MOVE_DOWN}">{L_MOVE_DOWN}</a><!-- ENDIF --></td>
|
<td class="postdetails" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"> <!-- IF topicrow.U_MOVE_UP --><a href="{topicrow.U_MOVE_UP}">{L_MOVE_UP}</a><!-- ENDIF --><!-- IF topicrow.U_MOVE_UP and topicrow.U_MOVE_DOWN --> | <!-- ENDIF --><!-- IF topicrow.U_MOVE_DOWN --><a href="{topicrow.U_MOVE_DOWN}">{L_MOVE_DOWN}</a><!-- ENDIF --> </td>
|
||||||
<td style="padding: 4px;"> <input type="checkbox" name="t[{topicrow.TOPIC_ID}]" /> </td>
|
<td style="padding: 4px;"> <input type="checkbox" name="t[{topicrow.TOPIC_ID}]" /> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGINELSE -->
|
<!-- BEGINELSE -->
|
||||||
<tr class="row1">
|
<tr class="row1">
|
||||||
<td colspan="5" align="center"><b class="genmed">{L_NO_BOOKMARKS}</b></td>
|
<td colspan="5" align="center"><b class="genmed">{L_NO_BOOKMARKS}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END topicrow -->
|
<!-- END topicrow -->
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="5" align="right"><input class="btnlite" type="submit" name="unbookmark" value="{L_REMOVE_BOOKMARK_MARKED}" /> </td>
|
<td class="cat" colspan="5" align="right"><input class="btnlite" type="submit" name="unbookmark" value="{L_REMOVE_BOOKMARK_MARKED}" /> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- IF not S_NO_DISPLAY_BOOKMARKS --><div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', 't', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 't', false);">{L_UNMARK_ALL}</a></b></div><!-- ENDIF -->
|
<!-- IF not S_NO_DISPLAY_BOOKMARKS -->
|
||||||
|
<div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', 't', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 't', false);">{L_UNMARK_ALL}</a></b></div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- INCLUDE ucp_footer.html -->
|
<!-- INCLUDE ucp_footer.html -->
|
|
@ -2,85 +2,91 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
// Set display of page element
|
/**
|
||||||
// s[-1,0,1] = hide,toggle display,show
|
* Set display of page element
|
||||||
function dE(n,s){
|
* s[-1,0,1] = hide,toggle display,show
|
||||||
var e = document.getElementById(n);
|
*/
|
||||||
if(!s) s = (e.style.display=='') ? -1:1;
|
function dE(n,s)
|
||||||
e.style.display = (s==1) ? 'block':'none';
|
{
|
||||||
}
|
var e = document.getElementById(n);
|
||||||
|
if (!s)
|
||||||
|
{
|
||||||
|
s = (e.style.display == '') ? -1 : 1;
|
||||||
|
}
|
||||||
|
e.style.display = (s == 1) ? 'block' : 'none';
|
||||||
|
}
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2" valign="middle">{L_TITLE}</th>
|
<th colspan="2" valign="middle">{L_TITLE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF ERROR -->
|
<!-- IF ERROR -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
|
<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="viewemail" value="1"{VIEW_EMAIL_YES} /><span class="genmed">{L_YES}</span> <input type="radio" name="viewemail" value="0"{VIEW_EMAIL_NO} /><span class="genmed">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="viewemail" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" name="viewemail" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="massemail" value="1"{ADMIN_EMAIL_YES} /><span class="genmed">{L_YES}</span> <input type="radio" name="massemail" value="0"{ADMIN_EMAIL_NO} /><span class="genmed">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="massemail" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" name="massemail" value="0"<!-- IF not S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}:</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td>
|
<td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}:</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td>
|
||||||
<td class="row2"><input type="radio" name="allowpm" value="1"{ALLOW_PM_YES} /><span class="genmed">{L_YES}</span> <input type="radio" name="allowpm" value="0"{ALLOW_PM_NO} /><span class="genmed">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="allowpm" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" name="allowpm" value="0"<!-- IF not S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF S_CAN_HIDE_ONLINE -->
|
<!-- IF S_CAN_HIDE_ONLINE -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="hideonline" value="1"{HIDE_ONLINE_YES} /><span class="genmed">{L_YES}</span> <input type="radio" name="hideonline" value="0"{HIDE_ONLINE_NO} /><span class="genmed">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="hideonline" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" name="hideonline" value="0"<!-- IF not S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF S_SELECT_NOTIFY -->
|
<!-- IF S_SELECT_NOTIFY -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}:</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td>
|
<td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}:</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td>
|
||||||
<td class="row2"><input type="radio" name="notifymethod" value="0"{NOTIFY_EMAIL} /><span class="genmed">{L_NOTIFY_METHOD_EMAIL}</span> <input type="radio" name="notifymethod" value="1"{NOTIFY_IM} /><span class="genmed">{L_NOTIFY_METHOD_IM}</span> <input type="radio" name="notifymethod" value="2"{NOTIFY_BOTH} /><span class="genmed">{L_NOTIFY_METHOD_BOTH}</span></td>
|
<td class="row2"><input type="radio" name="notifymethod" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_EMAIL}</span> <input type="radio" name="notifymethod" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_IM}</span> <input type="radio" name="notifymethod" value="2"<!-- IF S_NOTIFY_BOTH --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_BOTH}</span></td>
|
||||||
</tr>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_NOTIFY_ON_PM}:</b></td>
|
|
||||||
<td class="row2"><input type="radio" name="notifypm" value="1"{NOTIFY_PM_YES} /><span class="genmed">{L_YES}</span> <input type="radio" name="notifypm" value="0"{NOTIFY_PM_NO} /><span class="genmed">{L_NO}</span></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}:</b></td>
|
|
||||||
<td class="row2"><input type="radio" name="popuppm" value="1"{POPUP_PM_YES} /><span class="genmed">{L_YES}</span> <input type="radio" name="popuppm" value="0"{POPUP_PM_NO} /><span class="genmed">{L_NO}</span></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td>
|
|
||||||
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}:</b></td>
|
|
||||||
<td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}:</b></td>
|
|
||||||
<td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_BOARD_DST}:</b></td>
|
|
||||||
<td class="row2"><input type="radio" name="dst" value="1"{DST_YES} /> <span class="genmed">{L_YES}</span> <input type="radio" name="dst" value="0"{DST_NO} /> <span class="genmed">{L_NO}</span></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}:</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td>
|
|
||||||
<td class="row2">
|
|
||||||
<select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = '{A_DEFAULT_DATEFORMAT}'; } else { document.getElementById('dateformat').value = this.value; }">
|
|
||||||
{S_DATEFORMAT_OPTIONS}
|
|
||||||
</select>
|
|
||||||
<div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_NOTIFY_ON_PM}:</b></td>
|
||||||
|
<td class="row2"><input type="radio" name="notifypm" value="1"<!-- IF S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" name="notifypm" value="0"<!-- IF not S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}:</b></td>
|
||||||
|
<td class="row2"><input type="radio" name="popuppm" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" name="popuppm" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td>
|
||||||
|
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}:</b></td>
|
||||||
|
<td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}:</b></td>
|
||||||
|
<td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_BOARD_DST}:</b></td>
|
||||||
|
<td class="row2"><input type="radio" name="dst" value="1"<!-- IF S_DST --> checked="checked"<!-- ENDIF --> /> <span class="genmed">{L_YES}</span> <input type="radio" name="dst" value="0"<!-- IF not S_DST --> checked="checked"<!-- ENDIF --> /> <span class="genmed">{L_NO}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}:</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td>
|
||||||
|
<td class="row2">
|
||||||
|
<select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = '{A_DEFAULT_DATEFORMAT}'; } else { document.getElementById('dateformat').value = this.value; }">
|
||||||
|
{S_DATEFORMAT_OPTIONS}
|
||||||
|
</select>
|
||||||
|
<div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- INCLUDE ucp_footer.html -->
|
<!-- INCLUDE ucp_footer.html -->
|
|
@ -1,33 +1,33 @@
|
||||||
<!-- INCLUDE ucp_header.html -->
|
<!-- INCLUDE ucp_header.html -->
|
||||||
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2" valign="middle">{L_TITLE}</th>
|
<th colspan="2" valign="middle">{L_TITLE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF ERROR -->
|
<!-- IF ERROR -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
|
<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="bbcode" value="1"{DEFAULT_BBCODE_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="bbcode" value="0"{DEFAULT_BBCODE_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="bbcode" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="bbcode" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="smilies" value="1"{DEFAULT_SMILIES_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="smilies" value="0"{DEFAULT_SMILIES_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="sig" value="1"{DEFAULT_SIG_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="sig" value="0"{DEFAULT_SIG_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="sig" value="1"<!-- IF S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="sig" value="0"<!-- IF not S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="notify" value="1"{DEFAULT_NOTIFY_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="notify" value="0"{DEFAULT_NOTIFY_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
|
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- INCLUDE ucp_footer.html -->
|
<!-- INCLUDE ucp_footer.html -->
|
|
@ -1,73 +1,73 @@
|
||||||
<!-- INCLUDE ucp_header.html -->
|
<!-- INCLUDE ucp_header.html -->
|
||||||
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2" valign="middle">{L_TITLE}</th>
|
<th colspan="2" valign="middle">{L_TITLE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF ERROR -->
|
<!-- IF ERROR -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
|
<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="images" value="1"{VIEW_IMAGES_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="images" value="0"{VIEW_IMAGES_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="images" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="images" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="flash" value="1"{VIEW_FLASH_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="flash" value="0"{VIEW_FLASH_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="flash" value="1"<!-- IF S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="flash" value="0"<!-- IF not S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="smilies" value="1"{VIEW_SMILIES_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="smilies" value="0"{VIEW_SMILIES_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="sigs" value="1"{VIEW_SIGS_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="sigs" value="0"{VIEW_SIGS_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="sigs" value="1"<!-- IF S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="sigs" value="0"<!-- IF not S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="avatars" value="1"{VIEW_AVATARS_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="avatars" value="0"{VIEW_AVATARS_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="avatars" value="1"<!-- IF S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="avatars" value="0"<!-- IF not S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF S_CHANGE_CENSORS -->
|
<!-- IF S_CHANGE_CENSORS -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}:</b></td>
|
<td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}:</b></td>
|
||||||
<td class="row2"><input type="radio" name="wordcensor" value="1"{DISABLE_CENSORS_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="wordcensor" value="0"{DISABLE_CENSORS_NO} /><span class="gen">{L_NO}</span></td>
|
<td class="row2"><input type="radio" name="wordcensor" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" name="wordcensor" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
|
||||||
</tr>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" class="spacer"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}:</b></td>
|
|
||||||
<td class="row2">{S_TOPIC_SORT_DAYS}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}:</b></td>
|
|
||||||
<td class="row2">{S_TOPIC_SORT_KEY}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}:</b></td>
|
|
||||||
<td class="row2">{S_TOPIC_SORT_DIR}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" class="spacer"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}:</b></td>
|
|
||||||
<td class="row2">{S_POST_SORT_DAYS}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}:</b></td>
|
|
||||||
<td class="row2">{S_POST_SORT_KEY}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}:</b></td>
|
|
||||||
<td class="row2">{S_POST_SORT_DIR}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="spacer"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}:</b></td>
|
||||||
|
<td class="row2">{S_TOPIC_SORT_DAYS}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}:</b></td>
|
||||||
|
<td class="row2">{S_TOPIC_SORT_KEY}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}:</b></td>
|
||||||
|
<td class="row2">{S_TOPIC_SORT_DIR}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="spacer"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}:</b></td>
|
||||||
|
<td class="row2">{S_POST_SORT_DAYS}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}:</b></td>
|
||||||
|
<td class="row2">{S_POST_SORT_KEY}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}:</b></td>
|
||||||
|
<td class="row2">{S_POST_SORT_DIR}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- INCLUDE ucp_footer.html -->
|
<!-- INCLUDE ucp_footer.html -->
|
|
@ -1,22 +1,28 @@
|
||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
<form action="{S_PROFILE_ACTION}" method="post">
|
<form action="{S_PROFILE_ACTION}" method="post">
|
||||||
|
|
||||||
<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0" align="center">
|
<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">{L_SEND_PASSWORD}</th>
|
<th colspan="2">{L_SEND_PASSWORD}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
|
<td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
|
||||||
<td class="row2"><input type="text" class="post" name="username" size="25" maxlength="60" value="{USERNAME}" /></td>
|
<td class="row2"><input type="text" class="post" name="username" size="25" maxlength="60" value="{USERNAME}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
|
<td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
|
||||||
<td class="row2"><input type="text" class="post" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
|
<td class="row2"><input type="text" class="post" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
|
<td class="cat" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
<!-- INCLUDE overall_footer.html -->
|
|
@ -1,22 +1,28 @@
|
||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
<form action="{S_PROFILE_ACTION}" method="post">
|
<form action="{S_PROFILE_ACTION}" method="post">
|
||||||
|
|
||||||
<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0" align="center">
|
<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">{L_UCP_RESEND}</th>
|
<th colspan="2">{L_UCP_RESEND}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
|
<td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
|
||||||
<td class="row2"><input type="text" class="post" name="username" size="25" maxlength="60" value="{USERNAME}" /></td>
|
<td class="row2"><input type="text" class="post" name="username" size="25" maxlength="60" value="{USERNAME}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
|
<td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
|
||||||
<td class="row2"><input type="text" class="post" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
|
<td class="row2"><input type="text" class="post" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
|
<td class="cat" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
<!-- INCLUDE overall_footer.html -->
|
|
@ -518,7 +518,7 @@ $template->assign_vars(array(
|
||||||
'S_SELECT_SORT_DAYS' => $s_limit_days,
|
'S_SELECT_SORT_DAYS' => $s_limit_days,
|
||||||
'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"),
|
'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"),
|
||||||
'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action">' . $topic_mod . '</select>' : '',
|
'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action">' . $topic_mod . '</select>' : '',
|
||||||
'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "t=$topic_id&f=$forum_id&quickmod=1", true, $user->session_id),
|
'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "t=$topic_id&f=$forum_id&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),
|
||||||
|
|
||||||
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false,
|
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false,
|
||||||
'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 't=' . $topic_id),
|
'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 't=' . $topic_id),
|
||||||
|
|
Loading…
Add table
Reference in a new issue