Version 2.0.0-RC5
This commit is contained in:
23
.travis.yml
23
.travis.yml
@@ -4,10 +4,12 @@ language: php
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: 5.3.3
|
||||
env: DB=mysqli
|
||||
- php: 5.3
|
||||
env: DB=mysqli # MyISAM
|
||||
- php: 5.4
|
||||
env: DB=none;NOTESTS=1
|
||||
- php: 5.4
|
||||
env: DB=mysqli #myisam
|
||||
env: DB=mysqli
|
||||
- php: 5.4
|
||||
env: DB=mysql
|
||||
- php: 5.4
|
||||
@@ -16,16 +18,15 @@ matrix:
|
||||
env: DB=postgres
|
||||
- php: 5.4
|
||||
env: DB=sqlite3
|
||||
- php: 5.4
|
||||
env: DB=mysqli;SLOWTESTS=1
|
||||
- php: 5.5
|
||||
env: DB=mysqli
|
||||
- php: 5.6
|
||||
env: DB=mysqli
|
||||
- php: 7.0
|
||||
env: DB=mysqli
|
||||
- php: hhvm
|
||||
env: DB=mysqli
|
||||
allow_failures:
|
||||
- php: 7.0
|
||||
- php: hhvm
|
||||
fast_finish: true
|
||||
|
||||
@@ -51,7 +52,7 @@ before_install:
|
||||
- sudo rm -rf phpbb-ext-acme-demo
|
||||
|
||||
install:
|
||||
- composer install --dev --no-interaction --prefer-source
|
||||
- composer install --no-interaction --prefer-source
|
||||
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
|
||||
- cd ../../phpBB3
|
||||
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
|
||||
@@ -61,7 +62,7 @@ before_script:
|
||||
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
|
||||
|
||||
script:
|
||||
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi"
|
||||
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi"
|
||||
- sh -c "if [ '$NOTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php; fi"
|
||||
- sh -c "if [ '$EPV' != '0' ] && [ '$NOTESTS' = '1' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
|
||||
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"
|
||||
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi"
|
||||
- phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php
|
||||
- sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.3.3' ] && [ '$DB' = 'mysqli' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"type": "phpbb-extension",
|
||||
"description": "mChat Extension",
|
||||
"homepage": "http://www.dmzx-web.net",
|
||||
"version": "2.0.0-RC4",
|
||||
"time": "2016-03-31",
|
||||
"version": "2.0.0-RC5",
|
||||
"time": "2016-04-03",
|
||||
"keywords": ["phpbb", "extension", "mchat"],
|
||||
"license": "GPL-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -281,12 +281,16 @@ class functions
|
||||
}
|
||||
|
||||
$sql_array = array(
|
||||
'SELECT' => 'm.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm',
|
||||
'SELECT' => 'm.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm, p.post_visibility',
|
||||
'FROM' => array($this->mchat_table => 'm'),
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(USERS_TABLE => 'u'),
|
||||
'ON' => 'm.user_id = u.user_id',
|
||||
),
|
||||
array(
|
||||
'FROM' => array(POSTS_TABLE => 'p'),
|
||||
'ON' => 'm.post_id = p.post_id',
|
||||
)
|
||||
),
|
||||
'WHERE' => $sql_where,
|
||||
|
||||
@@ -678,6 +678,25 @@ class mchat
|
||||
*/
|
||||
protected function assign_messages($rows)
|
||||
{
|
||||
// Auth checks
|
||||
foreach ($rows as $i => $row)
|
||||
{
|
||||
if ($row['forum_id'])
|
||||
{
|
||||
// No permission to read forum
|
||||
if (!$this->auth->acl_get('f_read', $row['forum_id']))
|
||||
{
|
||||
unset($rows[$i]);
|
||||
}
|
||||
|
||||
// Post is not approved and no approval permission
|
||||
if ($row['post_visibility'] !== ITEM_APPROVED && !$this->auth->acl_get('m_approve', $row['forum_id']))
|
||||
{
|
||||
unset($rows[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$rows)
|
||||
{
|
||||
return;
|
||||
@@ -713,19 +732,8 @@ class mchat
|
||||
|
||||
foreach ($rows as $i => $row)
|
||||
{
|
||||
// Auth checks
|
||||
if ($row['forum_id'] && !$this->auth->acl_get('f_read', $row['forum_id']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$message_for_edit = generate_text_for_edit($row['message'], $row['bbcode_uid'], $row['bbcode_options']);
|
||||
|
||||
if (in_array($row['user_id'], $foes))
|
||||
{
|
||||
$row['message'] = $this->user->lang('MCHAT_FOE', get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')));
|
||||
}
|
||||
|
||||
$username_full = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST'));
|
||||
|
||||
// Fix profile link root path by replacing relative paths with absolute board URL
|
||||
@@ -734,6 +742,11 @@ class mchat
|
||||
$username_full = preg_replace('#(?<=href=")[\./]+?/(?=\w)#', $board_url, $username_full);
|
||||
}
|
||||
|
||||
if (in_array($row['user_id'], $foes))
|
||||
{
|
||||
$row['message'] = $this->user->lang('MCHAT_FOE', $username_full);
|
||||
}
|
||||
|
||||
$message_age = time() - $row['message_time'];
|
||||
$minutes_ago = $this->get_minutes_ago($message_age);
|
||||
$datetime = $this->user->format_date($row['message_time'], $this->settings->cfg('mchat_date'));
|
||||
|
||||
29
migrations/mchat_2_0_0_rc5.php
Normal file
29
migrations/mchat_2_0_0_rc5.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - mChat
|
||||
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
|
||||
* @copyright (c) 2016 kasimi
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_2_0_0_rc5 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\dmzx\mchat\migrations\mchat_2_0_0_rc4',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('mchat_version', '2.0.0-RC5')),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user