Фикс прав на удаление постов аяксом (спасибо Phoenix); фикс ошибок из-за пустых системных заголовков; пара мелочей, вроде нового логотипа. Движок переводится в стадию RC - начинается подготовка к релизу, в частности отлов всех багов, которые на данный момент в статусе критичных + исправление мелких недочетов. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@581 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08@gmail.com 2014-02-03 21:54:36 +00:00
commit a111c66e94
11 changed files with 74 additions and 60 deletions

View file

@ -50,7 +50,7 @@ if (!defined('WORD_LIST_OBTAINED'))
switch($this->request['type']) switch($this->request['type'])
{ {
case 'delete'; case 'delete';
if ($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW))) if ($post['post_id'] != $post['topic_first_post_id'] && $is_auth['auth_delete'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW)))
{ {
if (empty($this->request['confirmed'])) if (empty($this->request['confirmed']))
{ {
@ -62,14 +62,14 @@ switch($this->request['type'])
} }
else else
{ {
$this->ajax_die(sprintf($lang['DELETE_OWN_POSTS'], strip_tags($is_auth['auth_delete_type']))); $this->ajax_die(sprintf($lang['SORRY_AUTH_DELETE'], strip_tags($is_auth['auth_delete_type'])));
} }
break; break;
case 'reply'; case 'reply';
if(bf($userdata['user_opt'], 'user_opt', 'allow_post')) if (bf($userdata['user_opt'], 'user_opt', 'allow_post'))
{ {
$this->ajax_die($lang['RULES_REPLY_CANNOT']); $this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT']));
} }
elseif(!$is_auth['auth_reply']) elseif(!$is_auth['auth_reply'])
{ {
@ -113,6 +113,10 @@ switch($this->request['type'])
case 'edit': case 'edit':
case 'editor': case 'editor':
if (bf($userdata['user_opt'], 'user_opt', 'allow_post_edit'))
{
$this->ajax_die($lang['POST_EDIT_CANNOT']);
}
if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod'])
{ {
$this->ajax_die($lang['EDIT_OWN_POSTS']); $this->ajax_die($lang['EDIT_OWN_POSTS']);
@ -224,7 +228,7 @@ switch($this->request['type'])
if (bf($userdata['user_opt'], 'user_opt', 'allow_post')) if (bf($userdata['user_opt'], 'user_opt', 'allow_post'))
{ {
$this->ajax_die($lang['RULES_REPLY_CANNOT']); $this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT']));
} }
elseif (!$is_auth['auth_reply']) elseif (!$is_auth['auth_reply'])
{ {

View file

@ -104,7 +104,7 @@ class torrent
} }
array_deep($f['path'], 'clean_tor_dirname'); array_deep($f['path'], 'clean_tor_dirname');
$length = isset($f['length']) ? $f['length'] : 0; $length = isset($f['length']) ? (int) $f['length'] : 0;
$subdir_count = count($f['path']) - 1; $subdir_count = count($f['path']) - 1;
if ($subdir_count > 0) if ($subdir_count > 0)
@ -145,7 +145,7 @@ class torrent
{ {
$this->multiple = false; $this->multiple = false;
$name = isset($info['name']) ? clean_tor_dirname($info['name']) : ''; $name = isset($info['name']) ? clean_tor_dirname($info['name']) : '';
$length = isset($info['length']) ? $info['length'] : 0; $length = isset($info['length']) ? (int) $info['length'] : 0;
$this->files_ary['/'][] = $this->build_file_item($name, $length); $this->files_ary['/'][] = $this->build_file_item($name, $length);
natsort($this->files_ary['/']); natsort($this->files_ary['/']);

View file

@ -1,10 +1,15 @@
<?php <?php
if (isset($_REQUEST['GLOBALS'])) die();
ignore_user_abort(true); ignore_user_abort(true);
define('TIMESTART', utime()); define('TIMESTART', utime());
define('TIMENOW', time()); define('TIMENOW', time());
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) die(); if (empty($_SERVER['REMOTE_ADDR'])) $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
if (empty($_SERVER['HTTP_USER_AGENT'])) $_SERVER['HTTP_USER_AGENT'] = '';
if (empty($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = '';
if (empty($_SERVER['SERVER_NAME'])) $_SERVER['SERVER_NAME'] = '';
if (!defined('BB_ROOT')) define('BB_ROOT', './'); if (!defined('BB_ROOT')) define('BB_ROOT', './');
if (!defined('IN_FORUM') && !defined('IN_TRACKER')) define('IN_FORUM', true); if (!defined('IN_FORUM') && !defined('IN_TRACKER')) define('IN_FORUM', true);

View file

@ -54,9 +54,9 @@ $domain_name = 'torrentpier.me'; // Enter here your primary d
$domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name; $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name;
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.6 (unstable)'; $bb_cfg['tp_version'] = '2.6 (RC)';
$bb_cfg['tp_release_date'] = '02-02-2014'; $bb_cfg['tp_release_date'] = '02-02-2014';
$bb_cfg['tp_release_state'] = 'R580'; $bb_cfg['tp_release_state'] = 'R581';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';
@ -245,7 +245,10 @@ $bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php"
// Language // Language
setlocale(LC_ALL, 'ru_RU.UTF-8'); setlocale(LC_ALL, 'ru_RU.UTF-8');
setlocale(LC_NUMERIC, 'C'); setlocale(LC_NUMERIC, 'C');
$bb_cfg['charset'] = 'utf8';
$bb_cfg['auto_language'] = true; $bb_cfg['auto_language'] = true;
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $bb_cfg['auto_language']) if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $bb_cfg['auto_language'])
{ {
if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) == 'ru') if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) == 'ru')

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -177,7 +177,6 @@ define('TOPIC_WATCH_UN_NOTIFIED', 0);
define('POST_NORMAL', 0); define('POST_NORMAL', 0);
define('POST_STICKY', 1); define('POST_STICKY', 1);
define('POST_ANNOUNCE', 2); define('POST_ANNOUNCE', 2);
define('POST_GLOBAL_ANNOUNCE', 3);
// Search types // Search types
define('SEARCH_TYPE_POST', 0); define('SEARCH_TYPE_POST', 0);

View file

@ -3193,3 +3193,5 @@ $lang['ACCOUNT_STATUS'] = 'Account Status';
$lang['SORT_OPTIONS'] = 'Sort options:'; $lang['SORT_OPTIONS'] = 'Sort options:';
$lang['LAST_VISIT'] = 'Last Visit'; $lang['LAST_VISIT'] = 'Last Visit';
$lang['DAY'] = 'Day'; $lang['DAY'] = 'Day';
$lang['POST_EDIT_CANNOT'] = 'Sorry, but you cannot edit posts';

View file

@ -1827,8 +1827,8 @@ $lang['USER_LEVELS_UPDATED'] = 'Уровни и права пользовате
// Synchronize // Synchronize
$lang['SYNCHRONIZE'] = 'Синхронизировать'; $lang['SYNCHRONIZE'] = 'Синхронизировать';
$lang['TOPICS_DATA_SYNCHRONIZED'] = 'Темы синхронизированы'; $lang['TOPICS_DATA_SYNCHRONIZED'] = 'Темы синхронизированы';
$lang['USER_POSTS_COUNT'] = 'Количество сообщений пользователей.'; $lang['USER_POSTS_COUNT'] = 'Количество сообщений пользователей';
$lang['USER POSTS COUNT SYNCHRONIZED'] = 'Количество сообщений пользователей синхронизированы.'; $lang['USER POSTS COUNT SYNCHRONIZED'] = 'Количество сообщений пользователей синхронизированы';
// Online Userlist // Online Userlist
$lang['SHOW_ONLINE_USERLIST'] = 'Показать список пользователей онлайн'; $lang['SHOW_ONLINE_USERLIST'] = 'Показать список пользователей онлайн';
@ -3219,3 +3219,5 @@ $lang['ACCOUNT_STATUS'] = 'Статус учётной записи';
$lang['SORT_OPTIONS'] = 'Поля сортировки:'; $lang['SORT_OPTIONS'] = 'Поля сортировки:';
$lang['LAST_VISIT'] = 'Последнее посещение'; $lang['LAST_VISIT'] = 'Последнее посещение';
$lang['DAY'] = 'День'; $lang['DAY'] = 'День';
$lang['POST_EDIT_CANNOT'] = 'Извините, вы не можете редактировать сообщения';

View file

@ -1117,7 +1117,7 @@ else if ( $submit || $refresh || $mode != '' )
'NAME_FROM' => $userdata['username'], 'NAME_FROM' => $userdata['username'],
'MSG_SUBJECT' => html_entity_decode($privmsg_subject), 'MSG_SUBJECT' => html_entity_decode($privmsg_subject),
'SITENAME' => $bb_cfg['sitename'], 'SITENAME' => $bb_cfg['sitename'],
'U_INBOX' => make_url(PM_URL ."?folder=inbox$pm&mode=read&p=". $privmsg_sent_id), 'U_INBOX' => make_url(PM_URL . "?folder=inbox&mode=read&p=". $privmsg_sent_id),
)); ));
$emailer->send(); $emailer->send();

View file

@ -84,21 +84,21 @@ ajax.callback.manage_user = function(data) {
<td> <td>
<a href="#" id="datastore" onclick="ajax.manage_user('clear_datastore'); return false;">{L_DATASTORE}</a>,&nbsp; <a href="#" id="datastore" onclick="ajax.manage_user('clear_datastore'); return false;">{L_DATASTORE}</a>,&nbsp;
<a href="#" id="cache" onclick="ajax.manage_user('clear_cache'); return false;">{L_ALL_CACHE}</a>,&nbsp; <a href="#" id="cache" onclick="ajax.manage_user('clear_cache'); return false;">{L_ALL_CACHE}</a>,&nbsp;
<a href="#" id="template_cache" onclick="ajax.manage_user('clear_template_cache'); return false;">{L_TEMPLATES}</a>&nbsp; <a href="#" id="template_cache" onclick="ajax.manage_user('clear_template_cache'); return false;">{L_TEMPLATES}</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><b>{L_UPDATE}:</b></td> <td><b>{L_UPDATE}:</b></td>
<td> <td>
<a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>,&nbsp; <a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>
<!-- IF $bb_cfg['search_engine_type'] == "sphinx" --><a href="#" id="indexer" onclick="ajax.manage_user('indexer'); return false;">{L_INDEXER}</a><!-- ENDIF --> <!-- IF $bb_cfg['search_engine_type'] == "sphinx" -->,&nbsp;<a href="#" id="indexer" onclick="ajax.manage_user('indexer'); return false;">{L_INDEXER}</a><!-- ENDIF -->
</td> </td>
</tr> </tr>
<tr> <tr>
<td><b>{L_SYNCHRONIZE}:</b></td> <td><b>{L_SYNCHRONIZE}:</b></td>
<td> <td>
<a href="{U_SYNC_TOPICS}">{L_TOPICS}</a>,&nbsp; <a href="{U_SYNC_TOPICS}">{L_TOPICS}</a>,&nbsp;
<a href="{U_SYNC_USER_POSTS}">{L_USER_POSTS_COUNT}</a>&nbsp; <a href="{U_SYNC_USER_POSTS}">{L_USER_POSTS_COUNT}</a>
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -126,13 +126,12 @@ function initSpoilers(context)
} }
function initExternalLinks(context) function initExternalLinks(context)
{ {
var context = context || 'body'; var context = context || 'body';
if (ExternalLinks_InNewWindow) { if (ExternalLinks_InNewWindow) {
$("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' }); $("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' });
//$("a.postLink:not([@href*='"+ window.location.hostname +"/'])", context).replaceWith('<span style="color: red;">{L_LINKS_ARE_FORBIDDEN}</span>'); }
}
} }
function fixPostImage ($img) function fixPostImage($img)
{ {
var banned_image_hosts = /imagebanana|hidebehind/i; // imageshack var banned_image_hosts = /imagebanana|hidebehind/i; // imageshack
var src = $img[0].src; var src = $img[0].src;
@ -171,7 +170,7 @@ function initMedia(context)
} }
} }
$(document).ready(function(){ $(document).ready(function(){
$('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) }); $('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) });
}); });
</script> </script>
<!-- ENDIF / INCLUDE_BBCODE_JS --> <!-- ENDIF / INCLUDE_BBCODE_JS -->
@ -185,32 +184,32 @@ var LOGGED_IN = {LOGGED_IN};
var InfoWinParams = 'HEIGHT=510,resizable=yes,WIDTH=780'; var InfoWinParams = 'HEIGHT=510,resizable=yes,WIDTH=780';
var user = { var user = {
opt_js: {USER_OPTIONS_JS}, opt_js: {USER_OPTIONS_JS},
set: function(opt, val, days, reload) { set: function(opt, val, days, reload) {
this.opt_js[opt] = val; this.opt_js[opt] = val;
setCookie('opt_js', $.toJSON(this.opt_js), days); setCookie('opt_js', $.toJSON(this.opt_js), days);
if (reload) { if (reload) {
window.location.reload(); window.location.reload();
} }
} }
} }
<!-- IF SHOW_JUMPBOX --> <!-- IF SHOW_JUMPBOX -->
$(document).ready(function(){ $(document).ready(function(){
$("div.jumpbox").html('\ $("div.jumpbox").html('\
<span id="jumpbox-container"> \ <span id="jumpbox-container"> \
<select id="jumpbox"> \ <select id="jumpbox"> \
<option id="jumpbox-title" value="-1">&nbsp;&raquo;&raquo; {L_JUMPBOX_TITLE} &nbsp;</option> \ <option id="jumpbox-title" value="-1">&nbsp;&raquo;&raquo; {L_JUMPBOX_TITLE} &nbsp;</option> \
</select> \ </select> \
</span> \ </span> \
<input id="jumpbox-submit" type="button" class="lite" value="{L_GO}" /> \ <input id="jumpbox-submit" type="button" class="lite" value="{L_GO}" /> \
'); ');
$('#jumpbox-container').one('click', function(){ $('#jumpbox-container').one('click', function(){
$('#jumpbox-title').html('&nbsp;&nbsp; {L_LOADING} ... &nbsp;'); $('#jumpbox-title').html('&nbsp;&nbsp; {L_LOADING} ... &nbsp;');
var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? 'jumpbox_user.html' : 'jumpbox_guest.html'); var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? 'jumpbox_user.html' : 'jumpbox_guest.html');
$(this).load(jumpbox_src); $(this).load(jumpbox_src);
$('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); }); $('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); });
}); });
}); });
<!-- ENDIF --> <!-- ENDIF -->
@ -218,17 +217,17 @@ var ajax = new Ajax('{SITE_URL}{$bb_cfg['ajax_url']}', 'POST', 'json');
function getElText (e) function getElText (e)
{ {
var t = ''; var t = '';
if (e.textContent !== undefined) { t = e.textContent; } else if (e.innerText !== undefined) { t = e.innerText; } else { t = jQuery(e).text(); } if (e.textContent !== undefined) { t = e.textContent; } else if (e.innerText !== undefined) { t = e.innerText; } else { t = jQuery(e).text(); }
return t; return t;
} }
function escHTML (txt) function escHTML (txt)
{ {
return txt.replace(/</g, '&lt;'); return txt.replace(/</g, '&lt;');
} }
<!-- IF USE_TABLESORTER --> <!-- IF USE_TABLESORTER -->
$(document).ready(function(){ $(document).ready(function() {
$('.tablesorter').tablesorter(); // {debug: true} $('.tablesorter').tablesorter();
}); });
<!-- ENDIF --> <!-- ENDIF -->
@ -284,13 +283,13 @@ input[type="checkbox"] { margin-bottom: -1px; }
var dev = true; var dev = true;
function OpenInEditor ($file, $line) function OpenInEditor ($file, $line)
{ {
$editor_path = '{EDITOR_PATH}'; $editor_path = '{EDITOR_PATH}';
$editor_args = '{EDITOR_ARGS}'; $editor_args = '{EDITOR_ARGS}';
$url = BB_ROOT +'develop/open_editor.php'; $url = BB_ROOT +'develop/open_editor.php';
$url += '?prog='+ $editor_path +'&args='+ $editor_args.sprintf($file, $line); $url += '?prog='+ $editor_path +'&args='+ $editor_args.sprintf($file, $line);
window.open($url,'','height=1,width=1,left=1,top=1,resizable=yes,scrollbars=no,toolbar=no'); window.open($url,'','height=1,width=1,left=1,top=1,resizable=yes,scrollbars=no,toolbar=no');
} }
</script> </script>
<!-- ENDIF / INCLUDE_DEVELOP_JS --> <!-- ENDIF / INCLUDE_DEVELOP_JS -->
@ -431,7 +430,7 @@ if (top != self) {
<div id="logo"> <div id="logo">
<!--<h1>{SITENAME}</h1> <!--<h1>{SITENAME}</h1>
<h6>{SITE_DESCRIPTION}</h6> --> <h6>{SITE_DESCRIPTION}</h6> -->
<a href="{U_INDEX}"><img src="images/logo/logo.png" alt="{SITENAME}" /></a> <a href="{U_INDEX}"><img src="images/logo/logo_me.png" alt="{SITENAME}" /></a>
</div> </div>
<!--/logo--> <!--/logo-->