mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 05:13:54 -07:00
r586
Добавление файла с никами пользователей, оказавшими помощь проекту. Исправления ошибок по запросам тестеров. Перенос js-кода в bbcode.js; исправление ошибки с проверкой на установленность модуля tidy на сервере; изменения на сервисе для проверки ip пользователей. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@586 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
649b393989
commit
a54e7bcc65
8 changed files with 536 additions and 479 deletions
41
contributors.txt
Normal file
41
contributors.txt
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
Уважаемые пользователи TorrentPier II!
|
||||||
|
|
||||||
|
За помощь, оказанную в развитии нашего движка, выражаем особую благодарность нижеперечисленным участникам форума:
|
||||||
|
|
||||||
|
********************************
|
||||||
|
** Сборы марта 2013 года **
|
||||||
|
********************************
|
||||||
|
|
||||||
|
emilio13
|
||||||
|
UralSOFT
|
||||||
|
aik
|
||||||
|
Sarymian
|
||||||
|
eve
|
||||||
|
Алексей Письменский
|
||||||
|
qaqra
|
||||||
|
rserg99
|
||||||
|
leszav
|
||||||
|
Dr_Brown
|
||||||
|
Bullit
|
||||||
|
Triceratop (http://goldenshara.com/)
|
||||||
|
Ramzess
|
||||||
|
|
||||||
|
********************************
|
||||||
|
** Сборы июня 2014 года **
|
||||||
|
********************************
|
||||||
|
|
||||||
|
SamSeGo
|
||||||
|
alesel (http://sporttracker.kz/)
|
||||||
|
Bullit
|
||||||
|
igorsaevets
|
||||||
|
vasilich619
|
||||||
|
wint1000 (http://asmlocator.ru/)
|
||||||
|
|
||||||
|
********************************
|
||||||
|
** Прочая информация **
|
||||||
|
********************************
|
||||||
|
|
||||||
|
Большое вам всем спасибо за помощь.
|
||||||
|
|
||||||
|
Если в данных списках кто-то не указан, либо если вы хотите указать дополнительно адрес своего трекера, отправьте письмо по адресу admin@torrentpier.me,
|
||||||
|
с указанием вашего ника на форуме и адреса вашего трекера, дабы мы могли вас добавить в этот список.
|
|
@ -590,7 +590,7 @@ INSERT INTO `bb_config` VALUES ('show_network_news', '1');
|
||||||
INSERT INTO `bb_config` VALUES ('max_net_title', '50');
|
INSERT INTO `bb_config` VALUES ('max_net_title', '50');
|
||||||
INSERT INTO `bb_config` VALUES ('network_news_count', '5');
|
INSERT INTO `bb_config` VALUES ('network_news_count', '5');
|
||||||
INSERT INTO `bb_config` VALUES ('network_news_forum_id', '2');
|
INSERT INTO `bb_config` VALUES ('network_news_forum_id', '2');
|
||||||
INSERT INTO `bb_config` VALUES ('whois_info', 'http://ip-whois.net/ip_geo.php?ip=');
|
INSERT INTO `bb_config` VALUES ('whois_info', 'http://ip-whois.net/ip_geos.php?ip=');
|
||||||
INSERT INTO `bb_config` VALUES ('show_mod_index', '0');
|
INSERT INTO `bb_config` VALUES ('show_mod_index', '0');
|
||||||
INSERT INTO `bb_config` VALUES ('premod', '0');
|
INSERT INTO `bb_config` VALUES ('premod', '0');
|
||||||
INSERT INTO `bb_config` VALUES ('new_tpls', '1');
|
INSERT INTO `bb_config` VALUES ('new_tpls', '1');
|
||||||
|
|
|
@ -29,10 +29,7 @@ function attach_build_auth_levels($is_auth, &$s_auth_can)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line
|
// If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line
|
||||||
// $rules_link = '(<a href="' . BB_ROOT . 'attach_rules.php?f=' . $forum_id . '" target="_blank">Rules</a>)';
|
|
||||||
// $s_auth_can .= ( ( $is_auth['auth_attachments'] ) ? $rules_link . ' ' . $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'] ) . '<br />';
|
|
||||||
$s_auth_can .= (($is_auth['auth_attachments']) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'] ) . '<br />';
|
$s_auth_can .= (($is_auth['auth_attachments']) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'] ) . '<br />';
|
||||||
|
|
||||||
$s_auth_can .= (($is_auth['auth_download']) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'] ) . '<br />';
|
$s_auth_can .= (($is_auth['auth_download']) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'] ) . '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
|
||||||
|
|
||||||
// Increase number of revision after update
|
// Increase number of revision after update
|
||||||
$bb_cfg['tp_version'] = '2.6 (RC)';
|
$bb_cfg['tp_version'] = '2.6 (RC)';
|
||||||
$bb_cfg['tp_release_date'] = '15-05-2014';
|
$bb_cfg['tp_release_date'] = '13-06-2014';
|
||||||
$bb_cfg['tp_release_state'] = 'R585';
|
$bb_cfg['tp_release_state'] = 'R586';
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
$charset = 'utf8';
|
$charset = 'utf8';
|
||||||
|
@ -419,8 +419,6 @@ ini_set('error_log', LOG_DIR .'php_err.log');
|
||||||
if (get_magic_quotes_gpc()) die('Set magic_quotes off');
|
if (get_magic_quotes_gpc()) die('Set magic_quotes off');
|
||||||
// JSON
|
// JSON
|
||||||
if (!function_exists('json_encode')) die('Json_encode not installed');
|
if (!function_exists('json_encode')) die('Json_encode not installed');
|
||||||
// Tidy
|
|
||||||
if (!function_exists('tidy_repair_string')) die('Set $bb_cfg[\'tidy_post\'] = false in config.php');
|
|
||||||
|
|
||||||
// Triggers
|
// Triggers
|
||||||
define('BB_ENABLED', TRIGGERS_DIR .'$on');
|
define('BB_ENABLED', TRIGGERS_DIR .'$on');
|
||||||
|
@ -500,6 +498,9 @@ $bb_cfg['user_not_active_days_keep'] = 180; // inactive users but only wi
|
||||||
// GroupCP
|
// GroupCP
|
||||||
$bb_cfg['groupcp_members_per_page'] = 300;
|
$bb_cfg['groupcp_members_per_page'] = 300;
|
||||||
|
|
||||||
|
// Tidy
|
||||||
|
if ($bb_cfg['tidy_post'] && !function_exists('tidy_repair_string') or !extension_loaded('tidy')) die('Set $bb_cfg[\'tidy_post\'] = false in config.php');
|
||||||
|
|
||||||
// Ads
|
// Ads
|
||||||
$bb_cfg['show_ads'] = false;
|
$bb_cfg['show_ads'] = false;
|
||||||
$bb_cfg['show_ads_users'] = array(
|
$bb_cfg['show_ads_users'] = array(
|
||||||
|
|
|
@ -8,8 +8,6 @@ if (defined('PAGE_HEADER_SENT')) return;
|
||||||
global $page_cfg, $userdata, $user, $ads, $bb_cfg, $template, $lang, $images;
|
global $page_cfg, $userdata, $user, $ads, $bb_cfg, $template, $lang, $images;
|
||||||
|
|
||||||
$logged_in = (int) !empty($userdata['session_logged_in']);
|
$logged_in = (int) !empty($userdata['session_logged_in']);
|
||||||
$is_admin = ($logged_in && IS_ADMIN);
|
|
||||||
$is_mod = ($logged_in && IS_MOD);
|
|
||||||
|
|
||||||
// Generate logged in/logged out status
|
// Generate logged in/logged out status
|
||||||
if ($logged_in)
|
if ($logged_in)
|
||||||
|
@ -169,7 +167,7 @@ $template->assign_vars(array(
|
||||||
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
||||||
|
|
||||||
'IN_ADMIN' => defined('IN_ADMIN'),
|
'IN_ADMIN' => defined('IN_ADMIN'),
|
||||||
'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!($is_admin || $is_mod) && $user->show_ads)),
|
'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!IS_AM && $user->show_ads)),
|
||||||
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
|
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
|
||||||
|
|
||||||
'USER_RUS' => ($userdata['user_lang'] != 'english') ? true : false,
|
'USER_RUS' => ($userdata['user_lang'] != 'english') ? true : false,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// BBCode control. (based on bbcode.js from http://forum.dklab.ru)
|
// BBCode control
|
||||||
function BBCode(obj)
|
function BBCode(obj)
|
||||||
{
|
{
|
||||||
textarea = document.getElementById(obj);
|
textarea = document.getElementById(obj);
|
||||||
|
@ -17,11 +17,11 @@ BBCode.prototype = {
|
||||||
collapseAfterInsert: false,
|
collapseAfterInsert: false,
|
||||||
replaceOnInsert: false,
|
replaceOnInsert: false,
|
||||||
|
|
||||||
// Create new BBCode control.
|
// Create new BBCode control
|
||||||
construct: function(textarea) {
|
construct: function(textarea) {
|
||||||
this.textarea = textarea
|
this.textarea = textarea
|
||||||
this.tags = new Object();
|
this.tags = new Object();
|
||||||
// Tag for quoting.
|
// Tag for quoting
|
||||||
this.addTag(
|
this.addTag(
|
||||||
'_quoter',
|
'_quoter',
|
||||||
function() { return '[quote="'+th.quoter+'"][qpost='+th.qouted_pid+']' },
|
function() { return '[quote="'+th.quoter+'"][qpost='+th.qouted_pid+']' },
|
||||||
|
@ -31,13 +31,13 @@ BBCode.prototype = {
|
||||||
function() { th.collapseAfterInsert=true; return th._prepareMultiline(th.quoterText) }
|
function() { th.collapseAfterInsert=true; return th._prepareMultiline(th.quoterText) }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init events.
|
// Init events
|
||||||
var th = this;
|
var th = this;
|
||||||
addEvent(textarea, 'keydown', function(e) { return th.onKeyPress(e, window.HTMLElement? 'down' : 'press') });
|
addEvent(textarea, 'keydown', function(e) { return th.onKeyPress(e, window.HTMLElement? 'down' : 'press') });
|
||||||
addEvent(textarea, 'keypress', function(e) { return th.onKeyPress(e, 'press') });
|
addEvent(textarea, 'keypress', function(e) { return th.onKeyPress(e, 'press') });
|
||||||
},
|
},
|
||||||
|
|
||||||
// Insert poster name or poster quotes to the text.
|
// Insert poster name or poster quotes to the text
|
||||||
onclickPoster: function(name, post_id) {
|
onclickPoster: function(name, post_id) {
|
||||||
var sel = this.getSelection()[0];
|
var sel = this.getSelection()[0];
|
||||||
if (sel) {
|
if (sel) {
|
||||||
|
@ -74,7 +74,7 @@ BBCode.prototype = {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// For stupid Opera - save selection before mouseover the button.
|
// For stupid Opera - save selection before mouseover the button
|
||||||
refreshSelection: function(get) {
|
refreshSelection: function(get) {
|
||||||
if (get) this.stext = this.getSelection()[0];
|
if (get) this.stext = this.getSelection()[0];
|
||||||
else this.stext = '';
|
else this.stext = '';
|
||||||
|
@ -213,14 +213,14 @@ BBCode.prototype = {
|
||||||
return this._cancelEvent(e);
|
return this._cancelEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tab.
|
// Tab
|
||||||
if (type == 'press' && e.keyCode == this.VK_TAB && !e.shiftKey && !e.ctrlKey && !e.altKey) {
|
if (type == 'press' && e.keyCode == this.VK_TAB && !e.shiftKey && !e.ctrlKey && !e.altKey) {
|
||||||
//this.surround("\t", "");
|
//this.surround("\t", "");
|
||||||
this.insertAtCursor('[tab]');
|
this.insertAtCursor('[tab]');
|
||||||
return this._cancelEvent(e);
|
return this._cancelEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl+Tab.
|
// Ctrl+Tab
|
||||||
if (e.keyCode == this.VK_TAB && !e.shiftKey && e.ctrlKey && !e.altKey) {
|
if (e.keyCode == this.VK_TAB && !e.shiftKey && e.ctrlKey && !e.altKey) {
|
||||||
this.textarea.form.post.focus();
|
this.textarea.form.post.focus();
|
||||||
return this._cancelEvent(e);
|
return this._cancelEvent(e);
|
||||||
|
@ -243,7 +243,7 @@ BBCode.prototype = {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Adds a BB tag to the list.
|
// Adds a BB tag to the list
|
||||||
addTag: function(id, open, close, key, ctrlKey, multiline) {
|
addTag: function(id, open, close, key, ctrlKey, multiline) {
|
||||||
if (!ctrlKey) ctrlKey = "ctrl";
|
if (!ctrlKey) ctrlKey = "ctrl";
|
||||||
var tag = new Object();
|
var tag = new Object();
|
||||||
|
@ -270,9 +270,9 @@ BBCode.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Inserts the tag with specified ID.
|
// Inserts the tag with specified ID
|
||||||
insertTag: function(id) {
|
insertTag: function(id) {
|
||||||
// Find tag.
|
// Find tag
|
||||||
var tag = this.tags[id];
|
var tag = this.tags[id];
|
||||||
if (!tag) return alert("Unknown tag ID: "+id);
|
if (!tag) return alert("Unknown tag ID: "+id);
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ BBCode.prototype = {
|
||||||
if (typeof(tag.open) == "function") op = tag.open(tag.elt);
|
if (typeof(tag.open) == "function") op = tag.open(tag.elt);
|
||||||
var cl = tag.close!=null? tag.close : "/"+op;
|
var cl = tag.close!=null? tag.close : "/"+op;
|
||||||
|
|
||||||
// Use "[" if needed.
|
// Use "[" if needed
|
||||||
if (op.charAt(0) != this.BRK_OP) op = this.BRK_OP+op+this.BRK_CL;
|
if (op.charAt(0) != this.BRK_OP) op = this.BRK_OP+op+this.BRK_CL;
|
||||||
if (cl && cl.charAt(0) != this.BRK_OP) cl = this.BRK_OP+cl+this.BRK_CL;
|
if (cl && cl.charAt(0) != this.BRK_OP) cl = this.BRK_OP+cl+this.BRK_CL;
|
||||||
|
|
||||||
|
@ -323,7 +323,164 @@ function storeCaret(textEl) {
|
||||||
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
|
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translit START
|
function initPostBBCode(context)
|
||||||
|
{
|
||||||
|
$('span.post-hr', context).html('<hr align="left" />');
|
||||||
|
initCodes(context);
|
||||||
|
initQuotes(context);
|
||||||
|
initExternalLinks(context);
|
||||||
|
initPostImages(context);
|
||||||
|
initSpoilers(context);
|
||||||
|
initMedia(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initCodes(context)
|
||||||
|
{
|
||||||
|
$('div.c-body', context).each(function(){
|
||||||
|
var $c = $(this);
|
||||||
|
$c.before('<div class="c-head"><b>'+bbl['code']+':</b></div>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initQuotes(context)
|
||||||
|
{
|
||||||
|
$('div.q', context).each(function(){
|
||||||
|
var $q = $(this);
|
||||||
|
var name = $(this).attr('head');
|
||||||
|
var q_title = (name ? '<b>'+name+'</b> '+bbl['wrote']+':' : '<b>'+bbl['quote']+'</b>');
|
||||||
|
if ( quoted_pid = $q.children('u.q-post:first').text() ) {
|
||||||
|
var on_this_page = $('#post_'+quoted_pid).length;
|
||||||
|
var href = (on_this_page) ? '#'+ quoted_pid : './viewtopic.php?p='+ quoted_pid +'#'+ quoted_pid;
|
||||||
|
q_title += ' <a href="'+ href +'" title="'+bbl['quoted_post']+'"><img src="'+bb_url+'templates/default/images/icon_latest_reply.gif" class="icon2" alt="" /></a>';
|
||||||
|
}
|
||||||
|
$q.before('<div class="q-head">'+ q_title +'</div>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initPostImages(context)
|
||||||
|
{
|
||||||
|
if (hidePostImg) return;
|
||||||
|
var $in_spoilers = $('div.sp-body var.postImg', context);
|
||||||
|
$('var.postImg', context).not($in_spoilers).each(function(){
|
||||||
|
var $v = $(this);
|
||||||
|
var src = $v.attr('title');
|
||||||
|
var $img = $('<img src="'+ src +'" class="'+ $v.attr('class') +'" alt="pic" />');
|
||||||
|
$img = fixPostImage($img);
|
||||||
|
var maxW = ($v.hasClass('postImgAligned')) ? postImgAligned_MaxWidth : postImg_MaxWidth;
|
||||||
|
$img.bind('click', function(){ return imgFit(this, maxW); });
|
||||||
|
if (user.opt_js.i_aft_l) {
|
||||||
|
$('#preload').append($img);
|
||||||
|
var loading_icon = '<a href="'+ src +'" target="_blank"><img src="'+bb_url+'images/pic_loading.gif" alt="" /></a>';
|
||||||
|
$v.html(loading_icon);
|
||||||
|
if ($.browser.msie) {
|
||||||
|
$v.after('<wbr>');
|
||||||
|
}
|
||||||
|
$img.one('load', function(){
|
||||||
|
imgFit(this, maxW);
|
||||||
|
$v.empty().append(this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$img.one('load', function(){ imgFit(this, maxW) });
|
||||||
|
$v.empty().append($img);
|
||||||
|
if ($.browser.msie) {
|
||||||
|
$v.after('<wbr>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('var.posterImg', context).each(function(){
|
||||||
|
var $v = $(this);
|
||||||
|
var src = $v.attr('title');
|
||||||
|
var $img = $('<img src="'+ src +'" class="'+ $v.attr('class') +'" width="260px;" alt="'+bbl['loading']+'" border="0" />');
|
||||||
|
$img = fixPostImage($img);
|
||||||
|
$v.empty().append($img);
|
||||||
|
if ($.browser.msie) {
|
||||||
|
$v.after('<wbr>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initSpoilers(context)
|
||||||
|
{
|
||||||
|
$('div.sp-body', context).each(function(){
|
||||||
|
var $sp_body = $(this);
|
||||||
|
var name = $.trim(this.title) || ''+bbl['spoiler_head']+'';
|
||||||
|
this.title = '';
|
||||||
|
var $sp_head = $('<div class="sp-head folded clickable">'+ name +'</div>');
|
||||||
|
$sp_head.insertBefore($sp_body).click(function(e){
|
||||||
|
if (!$sp_body.hasClass('inited')) {
|
||||||
|
initPostImages($sp_body);
|
||||||
|
var $sp_fold_btn = $('<div class="sp-fold clickable">['+bbl['spoiler_close']+']</div>').click(function(){
|
||||||
|
$.scrollTo($sp_head, { duration:200, axis:'y', offset:-200 });
|
||||||
|
$sp_head.click().animate({opacity: 0.1}, 500).animate({opacity: 1}, 700);
|
||||||
|
});
|
||||||
|
$sp_body.prepend('<div class="clear"></div>').append('<div class="clear"></div>').append($sp_fold_btn).addClass('inited');
|
||||||
|
}
|
||||||
|
if (e.shiftKey) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.shiftKey = false;
|
||||||
|
var fold = $(this).hasClass('unfolded');
|
||||||
|
$('div.sp-head', $($sp_body.parents('td')[0])).filter( function(){ return $(this).hasClass('unfolded') ? fold : !fold } ).click();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(this).toggleClass('unfolded');
|
||||||
|
$sp_body.slideToggle('fast');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initExternalLinks(context)
|
||||||
|
{
|
||||||
|
var context = context || 'body';
|
||||||
|
if (ExternalLinks_InNewWindow) {
|
||||||
|
$("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fixPostImage ($img)
|
||||||
|
{
|
||||||
|
var banned_image_hosts = /imagebanana|hidebehind/i;
|
||||||
|
var src = $img[0].src;
|
||||||
|
if (src.match(banned_image_hosts)) {
|
||||||
|
$img.wrap('<a href="'+ this.src +'" target="_blank"></a>').attr({ src: ""+bb_url+"images/tr_oops.gif", title: ""+bbl['scr_rules']+"" });
|
||||||
|
}
|
||||||
|
return $img;
|
||||||
|
}
|
||||||
|
|
||||||
|
function initMedia(context)
|
||||||
|
{
|
||||||
|
var apostLink = $('a.postLink', context);
|
||||||
|
for (var i = 0; i < apostLink.length; i++) {
|
||||||
|
var link = apostLink[i];
|
||||||
|
if (typeof link.href != 'string') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\/.+/i.test(link.href)) {
|
||||||
|
var a = document.createElement('span');
|
||||||
|
a.className = 'YTLink';
|
||||||
|
a.innerHTML = '<span title="'+bbl['play_on']+'" class="YTLinkButton">►</span>';
|
||||||
|
window.addEvent(a, 'click', function (e) {
|
||||||
|
var vhref = e.target.nextSibling.href.replace(/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\//ig, "http://www.youtube.com/embed/$3");
|
||||||
|
var text = e.target.nextSibling.innerText != "" ? e.target.nextSibling.innerText : e.target.nextSibling.href;
|
||||||
|
$('#Panel_youtube').remove();
|
||||||
|
ypanel('youtube', {
|
||||||
|
title: '<b>' + text + '</b>',
|
||||||
|
resizing: 0,
|
||||||
|
width: 862,
|
||||||
|
height: 550,
|
||||||
|
content: '<iframe width="853" height="493" frameborder="0" allowfullscreen="" src="' + vhref + '?wmode=opaque"></iframe>'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
link.parentNode.insertBefore(a, link);
|
||||||
|
a.appendChild(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) });
|
||||||
|
});
|
||||||
|
|
||||||
// One character letters
|
// One character letters
|
||||||
var t_table1 = "ABVGDEZIJKLMNOPRSTUFXHCYWabvgdezijklmnoprstufxhcyw'#";
|
var t_table1 = "ABVGDEZIJKLMNOPRSTUFXHCYWabvgdezijklmnoprstufxhcyw'#";
|
||||||
|
@ -426,7 +583,6 @@ function translit2win (str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// document.REPLIER.Post.focus();
|
|
||||||
return new_str;
|
return new_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,4 +596,3 @@ function transliterate (msg, e)
|
||||||
if (e) e.disabled = false;
|
if (e) e.disabled = false;
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
// Translit END
|
|
|
@ -21,6 +21,9 @@
|
||||||
window.encURL = encodeURIComponent;
|
window.encURL = encodeURIComponent;
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var bb_url = '{SITE_URL}';
|
||||||
|
var bbl = { "code": "{L_CODE}", "wrote": "{L_WROTE}", "quote": "{L_QUOTE}", "quoted_post": "{L_GOTO_QUOTED_POST}", "loading": "{L_LOADING}", "spoiler_head": "{L_SPOILER_HEAD}", "spoiler_close": "{L_SPOILER_CLOSE}", "links_are": "{L_LINKS_ARE_FORBIDDEN}", "scr_rules": "{L_SCREENSHOTS_RULES}", "play_on": "{L_PLAY_ON_CURPAGE}" }
|
||||||
|
|
||||||
var postImg_MaxWidth = screen.width - {POST_IMG_WIDTH_DECR_JS};
|
var postImg_MaxWidth = screen.width - {POST_IMG_WIDTH_DECR_JS};
|
||||||
var postImgAligned_MaxWidth = Math.round(screen.width/3);
|
var postImgAligned_MaxWidth = Math.round(screen.width/3);
|
||||||
var attachImg_MaxWidth = screen.width - {ATTACH_IMG_WIDTH_DECR_JS};
|
var attachImg_MaxWidth = screen.width - {ATTACH_IMG_WIDTH_DECR_JS};
|
||||||
|
@ -32,148 +35,9 @@ function copyText_writeLink(node)
|
||||||
if (!is_ie) return;
|
if (!is_ie) return;
|
||||||
document.write('<p style="float: right;"><a class="txtb" onclick="if (ie_copyTextToClipboard('+node+')) alert(\'{L_CODE_COPIED}\'); return false;" href="#">{L_CODE_COPY}</a></p>');
|
document.write('<p style="float: right;"><a class="txtb" onclick="if (ie_copyTextToClipboard('+node+')) alert(\'{L_CODE_COPIED}\'); return false;" href="#">{L_CODE_COPY}</a></p>');
|
||||||
}
|
}
|
||||||
function initPostBBCode(context)
|
|
||||||
{
|
|
||||||
$('span.post-hr', context).html('<hr align="left" />');
|
|
||||||
initCodes(context);
|
|
||||||
initQuotes(context);
|
|
||||||
initExternalLinks(context);
|
|
||||||
initPostImages(context);
|
|
||||||
initSpoilers(context);
|
|
||||||
initMedia(context);
|
|
||||||
}
|
|
||||||
function initCodes(context)
|
|
||||||
{
|
|
||||||
$('div.c-body', context).each(function(){
|
|
||||||
var $c = $(this);
|
|
||||||
$c.before('<div class="c-head"><b>{L_CODE}:</b></div>');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function initQuotes(context)
|
|
||||||
{
|
|
||||||
$('div.q', context).each(function(){
|
|
||||||
var $q = $(this);
|
|
||||||
var name = $(this).attr('head');
|
|
||||||
var q_title = (name ? '<b>'+name+'</b> {L_WROTE}:' : '<b>{L_QUOTE}</b>');
|
|
||||||
if ( quoted_pid = $q.children('u.q-post:first').text() ) {
|
|
||||||
var on_this_page = $('#post_'+quoted_pid).length;
|
|
||||||
var href = (on_this_page) ? '#'+ quoted_pid : './viewtopic.php?p='+ quoted_pid +'#'+ quoted_pid;
|
|
||||||
q_title += ' <a href="'+ href +'" title="{L_GOTO_QUOTED_POST}"><img src="{SITE_URL}templates/default/images/icon_latest_reply.gif" class="icon2" alt="" /></a>';
|
|
||||||
}
|
|
||||||
$q.before('<div class="q-head">'+ q_title +'</div>');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function initPostImages(context)
|
|
||||||
{
|
|
||||||
if (hidePostImg) return;
|
|
||||||
var $in_spoilers = $('div.sp-body var.postImg', context);
|
|
||||||
$('var.postImg', context).not($in_spoilers).each(function(){
|
|
||||||
var $v = $(this);
|
|
||||||
var src = $v.attr('title');
|
|
||||||
var $img = $('<img src="'+ src +'" class="'+ $v.attr('class') +'" alt="pic" />');
|
|
||||||
$img = fixPostImage($img);
|
|
||||||
var maxW = ($v.hasClass('postImgAligned')) ? postImgAligned_MaxWidth : postImg_MaxWidth;
|
|
||||||
$img.bind('click', function(){ return imgFit(this, maxW); });
|
|
||||||
if (user.opt_js.i_aft_l) {
|
|
||||||
$('#preload').append($img);
|
|
||||||
var loading_icon = '<a href="'+ src +'" target="_blank"><img src="{SITE_URL}images/pic_loading.gif" alt="" /></a>';
|
|
||||||
$v.html(loading_icon);
|
|
||||||
if ($.browser.msie) {
|
|
||||||
$v.after('<wbr>');
|
|
||||||
}
|
|
||||||
$img.one('load', function(){
|
|
||||||
imgFit(this, maxW);
|
|
||||||
$v.empty().append(this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$img.one('load', function(){ imgFit(this, maxW) });
|
|
||||||
$v.empty().append($img);
|
|
||||||
if ($.browser.msie) {
|
|
||||||
$v.after('<wbr>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function initSpoilers(context)
|
|
||||||
{
|
|
||||||
$('div.sp-body', context).each(function(){
|
|
||||||
var $sp_body = $(this);
|
|
||||||
var name = $.trim(this.title) || '{L_SPOILER_HEAD}';
|
|
||||||
this.title = '';
|
|
||||||
var $sp_head = $('<div class="sp-head folded clickable">'+ name +'</div>');
|
|
||||||
$sp_head.insertBefore($sp_body).click(function(e){
|
|
||||||
if (!$sp_body.hasClass('inited')) {
|
|
||||||
initPostImages($sp_body);
|
|
||||||
var $sp_fold_btn = $('<div class="sp-fold clickable">[{L_SPOILER_CLOSE}]</div>').click(function(){
|
|
||||||
$.scrollTo($sp_head, { duration:200, axis:'y', offset:-200 });
|
|
||||||
$sp_head.click().animate({opacity: 0.1}, 500).animate({opacity: 1}, 700);
|
|
||||||
});
|
|
||||||
$sp_body.prepend('<div class="clear"></div>').append('<div class="clear"></div>').append($sp_fold_btn).addClass('inited');
|
|
||||||
}
|
|
||||||
if (e.shiftKey) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.shiftKey = false;
|
|
||||||
var fold = $(this).hasClass('unfolded');
|
|
||||||
$('div.sp-head', $($sp_body.parents('td')[0])).filter( function(){ return $(this).hasClass('unfolded') ? fold : !fold } ).click();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$(this).toggleClass('unfolded');
|
|
||||||
$sp_body.slideToggle('fast');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function initExternalLinks(context)
|
|
||||||
{
|
|
||||||
var context = context || 'body';
|
|
||||||
if (ExternalLinks_InNewWindow) {
|
|
||||||
$("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function fixPostImage($img)
|
|
||||||
{
|
|
||||||
var banned_image_hosts = /imagebanana|hidebehind/i; // imageshack
|
|
||||||
var src = $img[0].src;
|
|
||||||
if (src.match(banned_image_hosts)) {
|
|
||||||
$img.wrap('<a href="'+ this.src +'" target="_blank"></a>').attr({ src: "{SITE_URL}images/tr_oops.gif", title: "{L_SCREENSHOTS_RULES}" });
|
|
||||||
}
|
|
||||||
return $img;
|
|
||||||
}
|
|
||||||
function initMedia(context)
|
|
||||||
{
|
|
||||||
var apostLink = $('a.postLink', context);
|
|
||||||
for (var i = 0; i < apostLink.length; i++) {
|
|
||||||
var link = apostLink[i];
|
|
||||||
if (typeof link.href != 'string') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\/.+/i.test(link.href)) {
|
|
||||||
var a = document.createElement('span');
|
|
||||||
a.className = 'YTLink';
|
|
||||||
a.innerHTML = '<span title="{L_PLAY_ON_CURPAGE}" class="YTLinkButton">►</span>';
|
|
||||||
window.addEvent(a, 'click', function (e) {
|
|
||||||
var vhref = e.target.nextSibling.href.replace(/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\//ig, "http://www.youtube.com/embed/$3");
|
|
||||||
var text = e.target.nextSibling.innerText != "" ? e.target.nextSibling.innerText : e.target.nextSibling.href;
|
|
||||||
$('#Panel_youtube').remove();
|
|
||||||
ypanel('youtube', {
|
|
||||||
title: '<b>' + text + '</b>',
|
|
||||||
resizing: 0,
|
|
||||||
width: 862,
|
|
||||||
height: 550,
|
|
||||||
content: '<iframe width="853" height="510" frameborder="0" allowfullscreen="" src="' + vhref + '?wmode=opaque"></iframe>'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
link.parentNode.insertBefore(a, link);
|
|
||||||
a.appendChild(link);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).ready(function(){
|
|
||||||
$('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) });
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<!-- ENDIF / INCLUDE_BBCODE_JS -->
|
<!-- ENDIF / INCLUDE_BBCODE_JS -->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var BB_ROOT = "{#BB_ROOT}";
|
var BB_ROOT = "{#BB_ROOT}";
|
||||||
var cookieDomain = "{$bb_cfg['cookie_domain']}";
|
var cookieDomain = "{$bb_cfg['cookie_domain']}";
|
||||||
|
@ -194,6 +58,7 @@ var user = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<!-- IF SHOW_JUMPBOX -->
|
<!-- IF SHOW_JUMPBOX -->
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("div.jumpbox").html('\
|
$("div.jumpbox").html('\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue