Skip to content

Commit

Permalink
Merge pull request #224 from WildcardSearch/maintenance
Browse files Browse the repository at this point in the history
3.2.5 Release
  • Loading branch information
Mark Vincent authored Aug 4, 2018
2 parents bc2bfd4 + bb1f8e5 commit e13a566
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 180 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.4
## MentionMe 3.2.5

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

Expand Down
28 changes: 26 additions & 2 deletions Upload/inc/plugins/MentionMe/alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,19 @@ function mentionMeMyAlertsDatahandlerPostUpdate($thisPost)
$pid = (int) $thisPost->data['pid'];
$subject = $post['subject'];

$alertType = MybbStuff_MyAlerts_AlertTypeManager::getInstance()->getByCode('mention');
$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::getInstance();

if (is_null($alertTypeManager) ||
$alertTypeManager === false) {
global $cache;

$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::createInstance(
$db,
$cache
);
}

$alertType = $alertTypeManager->getByCode('mention');
$alertTypeId = $alertType->getId();
$mentionedAlready = $alerts = $matches = array();

Expand Down Expand Up @@ -115,7 +127,19 @@ function mentionMeMyAlertsDoNewReplyEnd()
{
global $mybb, $pid, $tid, $post, $thread, $fid, $db;

$alertType = MybbStuff_MyAlerts_AlertTypeManager::getInstance()->getByCode('mention');
$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::getInstance();

if (is_null($alertTypeManager) ||
$alertTypeManager === false) {
global $cache;

$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::createInstance(
$db,
$cache
);
}

$alertType = $alertTypeManager->getByCode('mention');
$alertTypeId = $alertType->getId();
$alerts = array();

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.4');
define('MENTIONME_VERSION', '3.2.5');

// register custom class autoloader
spl_autoload_register('mentionMeClassAutoLoad');
Expand Down
6 changes: 5 additions & 1 deletion Upload/jscripts/MentionMe/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,13 @@ var MentionMe = (function($, m) {
avatar = "";
if (options.showAvatars) {
avatarPath = data[user]["avatar"];
if (avatarPath.length == 0) {

if (typeof avatarPath == "undefined") {
avatarPath = options.defaultAvatar;
} else if (avatarPath.length == 0) {
avatarPath = options.defaultAvatar;
}

avatar = $("<img/>", {
"class": "mention_user_avatar",
src: avatarPath,
Expand Down
Loading

0 comments on commit e13a566

Please sign in to comment.