Skip to content

Commit

Permalink
Merge pull request #236 from WildcardSearch/maintenance
Browse files Browse the repository at this point in the history
3.2.8 Release
  • Loading branch information
Mark Vincent authored Nov 23, 2018
2 parents 16b2deb + e437eb6 commit 7aa79aa
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 208 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## MentionMe 3.2.7
## MentionMe 3.2.8

A plugin for MyBB 1.8.x that allows Twitter-style tagging and integration with [MyAlerts](https://github.com/euantorano/MyAlerts)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* plugin specific extension
*/

class MentionMeInstaller extends WildcardPluginInstaller010203
class MentionMeInstaller extends WildcardPluginInstaller010302
{
static public function getInstance()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
*
*/

class WildcardPluginInstaller010203 implements WildcardPluginInstallerInterface010000
class WildcardPluginInstaller010302 implements WildcardPluginInstallerInterface010000
{
/**
* @const version
*/
const VERSION = '1.2.3';
const VERSION = '1.3.2';

/**
* @var object a copy of the MyBB db object
Expand Down Expand Up @@ -145,8 +145,19 @@ public function __construct($path = '')
}
break;
case 'columns':
if ($db->engine == 'pgsql') {
$this->columns = $columns['pgsql'];
} else {
unset($this->columns['pgsql']);
}
case 'images':
break;
case 'tables':
if ($db->engine == 'pgsql') {
$this->tables = $tables['pgsql'];
} else {
unset($this->tables['pgsql']);
}
default:
$singular = substr($key, 0, strlen($key) - 1);
$property = "{$singular}Names";
Expand Down Expand Up @@ -216,8 +227,8 @@ protected function addTable($table, $columns)

// create the table if it doesn't already exist
if (!$this->tableExists($table)) {
$table = TABLE_PREFIX . $table;
$this->db->write_query("CREATE TABLE {$table} ({$columnList}) ENGINE={$this->db->table_type}{$collation};");
$queryExtra = ($this->db->engine == 'pgsql') ? '' : " ENGINE={$this->db->table_type}{$collation}";
$this->db->write_query("CREATE TABLE {$this->db->table_prefix}{$table} ({$columnList}){$queryExtra};");
}
}

Expand Down Expand Up @@ -256,8 +267,9 @@ protected function removeTables()
return;
}

$dropList = implode(', ' . TABLE_PREFIX, $this->tableNames);
$this->db->drop_table($dropList);
foreach ($this->tableNames as $table) {
$this->db->drop_table($table);
}
}

/**
Expand All @@ -274,17 +286,11 @@ protected function addColumns($columns = '')
}

foreach ($columns as $table => $allColumns) {
$sep = $addedColumns = '';
foreach ($allColumns as $title => $definition) {
if (!$this->fieldExists($table, $title)) {
$addedColumns .= "{$sep}{$title} {$definition}";
$sep = ', ADD ';
$this->db->add_column($table, $title, $definition);
}
}
if (strlen($addedColumns) > 0) {
// trickery, again
$this->db->add_column($table, $addedColumns, '');
}
}
}

Expand All @@ -302,17 +308,11 @@ protected function removeColumns()
}

foreach ($this->columns as $table => $columns) {
$sep = $droppedColumns = '';
foreach ($columns as $title => $definition) {
if ($this->fieldExists($table, $title)) {
$droppedColumns .= "{$sep}{$title}";
$sep = ', DROP ';
$this->db->drop_column($table, $title);
}
}
if (strlen($droppedColumns) > 0) {
// tricky, tricky xD
$result = $this->db->drop_column($table, $droppedColumns);
}
}
}

Expand Down Expand Up @@ -770,14 +770,23 @@ protected function buildTableList()
{
global $config;

$query = $this->db->write_query("
SHOW TABLES
FROM `{$config['database']['database']}`
");
// PostgreSQL requires a little more work to grab the table names
if ($this->db->engine == 'pgsql') {
$tableArray = $this->db->list_tables($config['database']['database'], $this->db->table_prefix);

$tableList = array();
while ($row = $this->db->fetch_array($query)) {
$tableList[array_pop($row)] = 1;
foreach ($tableArray as $table) {
$tableList[$table] = 1;
}
} else {
$query = $this->db->write_query("
SHOW TABLES
FROM `{$config['database']['database']}`
");

$tableList = array();
while ($row = $this->db->fetch_array($query)) {
$tableList[array_pop($row)] = 1;
}
}
return $tableList;
}
Expand Down
2 changes: 1 addition & 1 deletion Upload/inc/plugins/mention.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// checked by other plugin files
define('IN_MENTIONME', true);
define('MENTIONME_VERSION', '3.2.7');
define('MENTIONME_VERSION', '3.2.8');

// register custom class autoloader
spl_autoload_register('mentionMeClassAutoLoad');
Expand Down
4 changes: 2 additions & 2 deletions Upload/jscripts/MentionMe/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@ var MentionMe = (function($, m) {
this.editor = MyBBEditor;
this.rangeHelper = this.editor.getRangeHelper();

this.$iFrame = $("iframe");
this.$container = this.$iFrame.closest("td");
this.$iFrame = $("div.sceditor-toolbar").next("iframe");
this.$container = this.$iFrame.closest(".sceditor-container").parent();
this.$body = this.editor.getBody();

this.selection = {
Expand Down
Loading

0 comments on commit 7aa79aa

Please sign in to comment.