Bower, NMP (+ Gulp) dependency for frontend and some fixes

This commit is contained in:
Yuriy Pikhtarev 2016-08-25 23:41:20 +03:00
commit 701c7de604
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
10 changed files with 101 additions and 72 deletions

6
.gitignore vendored
View file

@ -1,5 +1,6 @@
### TorrentPier ### ### TorrentPier ###
.idea/ .idea
bower_components
composer.phar composer.phar
composer.lock composer.lock
configs/local.php configs/local.php
@ -12,6 +13,7 @@ internal_data/log
internal_data/sitemap internal_data/sitemap
internal_data/triggers internal_data/triggers
library/config.local.php library/config.local.php
node_modules
vendor vendor
### Archives ### ### Archives ###
@ -36,4 +38,4 @@ $RECYCLE.BIN/
.Spotlight-V100 .Spotlight-V100
.Trashes .Trashes
*.orig *.orig
*.rej *.rej

View file

@ -7,17 +7,12 @@ $view = $di->view;
/** @var \TorrentPier\Db\Adapter $db */ /** @var \TorrentPier\Db\Adapter $db */
$db = $di->db; $db = $di->db;
$view->addGlobal('title', 'Title Page Simple'); $view->addGlobal('title', 'Title Page Simple');
$categories = $db->select('bb_categories', function (\Zend\Db\Sql\Select $query) { $categories = $db->select('bb_categories', function (\Zend\Db\Sql\Select $query) {
$query->join('bb_forums', 'bb_categories.cat_id = bb_forums.cat_id'); $query->join('bb_forums', 'bb_categories.cat_id = bb_forums.cat_id');
})->all(); })->all();
echo $view->make('app', [ echo $view->make('app', [
'data' => 'Hello world', 'data' => 'Hello world',
'categories' => $categories 'categories' => $categories

View file

@ -2,8 +2,8 @@
require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . '/vendor/autoload.php';
use TorrentPier\Di, use TorrentPier\Di;
TorrentPier\ServiceProviders; use TorrentPier\ServiceProviders;
$di = new Di(); $di = new Di();

24
bower.json Normal file
View file

@ -0,0 +1,24 @@
{
"name": "torrentpier",
"description": "TorrentPier. Bittorrent-tracker engine",
"main": "build/index.js",
"authors": [
"Exile <admin@torrentpier.me>"
],
"license": "GPL-3.0",
"homepage": "https://torrentpier.me/",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": "^3.3.7",
"jquery": "^3.1.0",
"moment": "^2.14.1",
"font-awesome": "fontawesome#^4.6.3",
"jquery.quicksearch": "quicksearch#^2.3.0"
}
}

View file

@ -15,14 +15,12 @@
"support": { "support": {
"email": "support@torrentpier.me", "email": "support@torrentpier.me",
"issues" : "https://github.com/torrentpier/torrentpier/issues", "issues" : "https://github.com/torrentpier/torrentpier/issues",
"forum": "https://torrentpier.me/", "forum": "https://torrentpier.me/forum/",
"get": "http://get.torrentpier.me/", "get": "https://get.torrentpier.me/",
"docs": "http://faq.torrentpier.me/" "docs": "https://faq.torrentpier.me/"
}, },
"require": { "require": {
"php": "^5.5 || ^7.0", "php": "^5.5 || ^7.0",
"ext-curl": "*",
"ext-mbstring": "*",
"google/recaptcha": "^1.0", "google/recaptcha": "^1.0",
"monolog/monolog": "^1.18", "monolog/monolog": "^1.18",
"pimple/pimple": "^3.0", "pimple/pimple": "^3.0",

View file

@ -123,7 +123,6 @@ function generate_smilies($mode)
if ($num_smilies) if ($num_smilies)
{ {
$smilies_count = ($mode == 'inline') ? min(19, $num_smilies) : $num_smilies;
$smilies_split_row = ($mode == 'inline') ? $inline_columns - 1 : $window_columns - 1; $smilies_split_row = ($mode == 'inline') ? $inline_columns - 1 : $window_columns - 1;
$s_colspan = 0; $s_colspan = 0;
@ -658,8 +657,6 @@ class bbcode
$found_spam = array(); $found_spam = array();
$tm_start = utime();
$msg_decoded = $text; $msg_decoded = $text;
$msg_decoded = html_entity_decode($msg_decoded); $msg_decoded = html_entity_decode($msg_decoded);
$msg_decoded = urldecode($msg_decoded); $msg_decoded = urldecode($msg_decoded);
@ -689,7 +686,6 @@ class bbcode
$text = preg_replace("/($spam_exp)(\S*)/i", $spam_replace, $msg_decoded); $text = preg_replace("/($spam_exp)(\S*)/i", $spam_replace, $msg_decoded);
$text = htmlCHR($text, false, ENT_NOQUOTES); $text = htmlCHR($text, false, ENT_NOQUOTES);
# bb_log(date("H:i:s") ." | ". sprintf('%.4f', (utime() - $tm_start)) ." | ". sprintf('%-6s', strlen($text)) ." | ". join(' ** ', $found_spam) ."\n", 'spam_filter');
} }
return $text; return $text;
@ -1015,4 +1011,4 @@ function get_parsed_post ($postrow, $mode = 'full', $return_chars = 600)
function update_post_html ($postrow) function update_post_html ($postrow)
{ {
DB()->query("DELETE FROM ". BB_POSTS_HTML ." WHERE post_id = ". (int) $postrow['post_id'] ." LIMIT 1"); DB()->query("DELETE FROM ". BB_POSTS_HTML ." WHERE post_id = ". (int) $postrow['post_id'] ." LIMIT 1");
} }

View file

@ -2,67 +2,57 @@
if (!defined('BB_ROOT')) die(basename(__FILE__)); if (!defined('BB_ROOT')) die(basename(__FILE__));
//
// Languages // Languages
// function language_select($default_lang, $select_name = 'language')
function language_select ($default_lang, $select_name = 'language')
{ {
/** @var \TorrentPier\Di $di */ /** @var \TorrentPier\Di $di */
$di = \TorrentPier\Di::getInstance(); $di = \TorrentPier\Di::getInstance();
$lang_select = '<select name="'. $select_name .'">'; $lang_select = '<select name="' . $select_name . '">';
$x = 0; $x = 0;
foreach ($di->config->get('lang') as $key => $data) foreach ($di->config->get('lang') as $key => $data) {
{ $selected = '';
$selected = ''; if ($key == $default_lang) $selected = ' selected="selected"';
if ($key == $default_lang) $selected = ' selected="selected"'; $lang_select .= '<option value="' . $key . '"' . $selected . '>' . $data['name'] . '</option>';
$lang_select .= '<option value="'. $key .'"'. $selected .'>'. $data['name'] .'</option>'; $x++;
$x++; }
} $lang_select .= '</select>';
$lang_select .= '</select>'; return ($x > 1) ? $lang_select : $di->config->get('lang')->ru;
return ($x > 1) ? $lang_select : reset($di->config->get('lang'))['name'];
} }
//
// Pick a timezone // Pick a timezone
// function tz_select($default, $select_name = 'timezone')
function tz_select ($default, $select_name = 'timezone')
{ {
global $sys_timezone, $lang; global $sys_timezone, $lang;
if (!isset($default)) if (!isset($default)) {
{ $default = $sys_timezone;
$default = $sys_timezone; }
} $tz_select = '<select name="' . $select_name . '">';
$tz_select = '<select name="' . $select_name . '">';
while( list($offset, $zone) = each($lang['TZ']) ) while (list($offset, $zone) = each($lang['TZ'])) {
{ $selected = ($offset == $default) ? ' selected="selected"' : '';
$selected = ( $offset == $default ) ? ' selected="selected"' : ''; $tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>';
$tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>'; }
} $tz_select .= '</select>';
$tz_select .= '</select>';
return $tz_select; return $tz_select;
} }
//
// Templates // Templates
// function templates_select($default_style, $select_name = 'tpl_name')
function templates_select ($default_style, $select_name = 'tpl_name')
{ {
/** @var \TorrentPier\Di $di */ /** @var \TorrentPier\Di $di */
$di = \TorrentPier\Di::getInstance(); $di = \TorrentPier\Di::getInstance();
$templates_select = '<select name="'. $select_name .'">'; $templates_select = '<select name="' . $select_name . '">';
$x = 0; $x = 0;
foreach ($di->config->get('templates') as $folder => $name) foreach ($di->config->get('templates') as $folder => $name) {
{ $selected = '';
$selected = ''; if ($folder == $default_style) $selected = ' selected="selected"';
if ($folder == $default_style) $selected = ' selected="selected"'; $templates_select .= '<option value="' . $folder . '"' . $selected . '>' . $name . '</option>';
$templates_select .= '<option value="'. $folder .'"'. $selected .'>'. $name .'</option>'; $x++;
$x++; }
} $templates_select .= '</select>';
$templates_select .= '</select>'; return ($x > 1) ? $templates_select : $di->config->get('templates')->default;
return ($x > 1) ? $templates_select : reset($di->config->get('templates')); }
}

25
package.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "torrentpier",
"version": "2.1.0",
"description": "TorrentPier. Bittorrent-tracker engine",
"main": "build/index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/torrentpier/torrentpier.git"
},
"author": "",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/torrentpier/torrentpier/issues"
},
"homepage": "https://torrentpier.me/",
"devDependencies": {
"gulp": "^3.9.1"
}
}

View file

@ -17,7 +17,6 @@ table>tbody {
} }
thead tr { thead tr {
position: relative; position: relative;
top: expression($p("tScrollCont").scrollTop); /* IE5+ only */
} }
.tPerm { .tPerm {
background-color: #B4BBC8; margin-top: -2px; background-color: #B4BBC8; margin-top: -2px;
@ -322,4 +321,4 @@ function mark_changed (f_id, acl_id)
<br /><br /><br /><br /> <br /><br /><br /><br />
<!--========================================================================--> <!--========================================================================-->
<!-- ENDIF / TPL_SELECT_GROUP --> <!-- ENDIF / TPL_SELECT_GROUP -->

View file

@ -177,7 +177,7 @@ ajax.callback.gen_passkey = function(data){
<style type="text/css"> <style type="text/css">
#traf-stats-tbl { width: 468px; background: #F9F9F9; border: 1px solid #A5AFB4; border-collapse: separate; } #traf-stats-tbl { width: 468px; background: #F9F9F9; border: 1px solid #A5AFB4; border-collapse: separate; }
#traf-stats-tbl th, #traf-stats-tbl td { padding: 2px 10px 3px; text-align: center; white-space: nowrap; font-size: 11px; } #traf-stats-tbl th, #traf-stats-tbl td { padding: 2px 10px 3px; text-align: center; white-space: nowrap; font-size: 11px; }
#traf-stats-tbl th { padding: 2px <!-- IF $di->config->get('seed_bonus_enabled') -->11<!-- ELSE -->22<!-- ENDIF -->px 3px; } #traf-stats-tbl th { padding: 2px 11px 3px; }
<!-- IF TRAF_STATS --> <!-- IF TRAF_STATS -->
#traf-stats-tbl th { padding: 2px 30px 3px; } #traf-stats-tbl th { padding: 2px 30px 3px; }
<!-- ENDIF --> <!-- ENDIF -->
@ -578,4 +578,4 @@ $(function(){
<a class="gen" href="{U_SEARCH}?dlu={PROFILE_USER_ID}&dlw=1">{L_SEARCH_DL_WILL_DOWNLOADS}</a> :: <a class="gen" href="{U_SEARCH}?dlu={PROFILE_USER_ID}&dlw=1">{L_SEARCH_DL_WILL_DOWNLOADS}</a> ::
<a class="gen" href="{U_SEARCH}?dlu={PROFILE_USER_ID}&dlc=1">{L_SEARCH_DL_COMPLETE_DOWNLOADS}</a> <a class="gen" href="{U_SEARCH}?dlu={PROFILE_USER_ID}&dlc=1">{L_SEARCH_DL_COMPLETE_DOWNLOADS}</a>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->