Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+12 votes
8.2k views
in Plugins by
edited by

So here it is. You can download the Portugues version or the English version from here:

mention-notifier-pt.rar

mention-notifier-en.rar

mention-notifier-pt.zip

mention-notifier-pt.zip

Question2Answer Minimum Version: 1.4

Installation

The installation is simple, just edit the file qa-mentions.sql and change the prefix of the table to match with your's database (default is qa_, so if your is the same you don't need to change), and then import it to your database.

The Plugin

The plugin has two widgets, one shows new mentions to the current logged on user, and the other is just available for question pages and shows the mentions in that question.

The plugin has alse one page which can be accessed by typing /mentions in the address bar. This shows all mention notifications for the current user. You can close the notifications.

The plugin also throws an event each time an user is mentioned, named "u_mentioned".

To mention someone, just type a @ before the username, like "@scorch"

Unfortunately, the plugins doesn't support usernames with spaces.

Look at the video.

 

Test it, enjoy it, and say if you liked it or dound any bugs. :)

by
This is the line:

$questionid = "SELECT parentid FROM ^posts WHERE postid = # LIMIT 1";

Delete it and the two lines above, and then paste the corrected code I posted.
by
Fatal error: Call to undefined function qa_get_userids_from_public() in /home/***/public_html/qa-plugin/mention-notifier/qa-mention-detect.php on line 63

qa_get_userids_from_public() is not implemented.
by
I still don't know if this plugin is fixed. I downloaded the  mention-notifier-en.rar  from your link above but received qa_get_userids_from_public() error again.
by
@scorch: Please update the post title to "Mention Notifier plugin". Otherwise it could be misunderstood as general notification plugin like this version here: http://www.question2answer.org/qa/33127/premium-notifications-facebook-stackoverflow-question2answer

7 Answers

0 votes
by

Question2Answer query failed:

SELECT value FROM qa_userlogs WHERE user_id = 1 and name = "mentions_last_update"

Error 1146: Table 'cookboo1_wanyuwang.qa_userlogs' doesn't exist

 

by
Thanks for reporting. I actually forgot to include the table userlogs in the sql file. If you import it again, it should work. I've also corrected one bug in the file qa-mentions.php, so you should update it too. The links are the same. :)
0 votes
by
when post a answer, the page is blank. answer is posted, but there is no mention. No data in qa_mentions database
0 votes
by
错误

SQL 查询:

CREATE TABLE IF NOT EXISTS `qa_mentions` (

`ID` int( 11 ) NOT NULL AUTO_INCREMENT ,
`to_id` int( 11 ) NOT NULL ,
`from_id` int( 11 ) NOT NULL ,
`question_id` int( 11 ) NOT NULL ,
`post_id` int( 11 ) NOT NULL ,
`post_type` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`eliminated` tinyint( 1 ) NOT NULL DEFAULT '0',
`closed` tinyint( 1 ) NOT NULL DEFAULT '0',
`date` int( 11 ) NOT NULL ,
PRIMARY KEY ( `ID` ) ,
UNIQUE KEY `ID` ( `ID` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8_unicode_ci

 

MySQL 返回:

#1115 - Unknown character set: 'utf8_unicode_ci'  

When install the database, error.  so I change it to:

CREATE TABLE IF NOT EXISTS `qa_mentions` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `to_id` int(11) NOT NULL,
  `from_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `post_id` int(11) NOT NULL,
  `post_type` text CHARACTER SET utf8  NOT NULL,
  `eliminated` tinyint(1) NOT NULL DEFAULT '0',
  `closed` tinyint(1) NOT NULL DEFAULT '0',
  `date` int(11) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`)
);

database was installed successfully, but the program not work.

by
just @username you can see here http://www.wanyuwang.com
by
Ok, I think I found the problem. That's because I use RegEx to get the posted usernames, and I'm not sure it works with other chars. You may fix this by probabily adding the chars you want in your usernames by editing the file qa-mentions-detect.php, and change the line 39. :)
by
I could see that It just works with external user db not bounded user db. Could use make an option so that it can work with both of db?
by
Unfortunately, I don't know how to do it now. I'm thinking in installing Q2A again, but with a embedded users database, so I can test the plugin and make it compatible.
0 votes
by

I would like to ask everyone who could test the plugin to test it, because it's hard to say if the plugin is compatible with many environments or there are incompatibilities.

Thanks,

Scorch

0 votes
by

Hi, I got this error message

Call to undefined function qa_get_userids_from_public() in /home/olimpiad/public_html/ask/qa-plugin/mention-notifier/qa-mention-detect.php

on line 63

by
nvm, I didn't read your instruction above. Let give me a try :).
by
It doesn't work!
The same case as abcute above
by
I got the same error


Fatal error: Call to undefined function qa_get_userids_from_public() in C:\webpub\qa4\qa-plugin\mention-notifier\qa-mention-detect.php on line 63
+2 votes
by

Thank to scorch for providing us an interesting plug-in. For the reason that the current version is not supported for bounded user database, I modified a bit to fix it.

Now it can work with BOUNDED user database. You can download here

If you find any bug, let me know.

by
Thanks for the contribution. I'll see your code, and then I will update the main post and give credits to you. :)
by
Thank you.

Now, I also run it on my site. However, as I asked in another question I got problem with notification mail sending. This feature is not included in here http://tenkana.vn/download/mention-notifier.internal_user_db.en.rar, just included in running version on my site for testing.

I'd like an option that send notification mail to mentioned users. If you see it is useful as well, please update to main code.
by
Hi, thank you :). It works now. I was hoping that it is also give a notification whenever some one reply to our question/answer/comment. But it seems it is not the case. Is it possible to modify it to also give a notification when some one reply to our post?
by
That is a feature already implemented by Q2A main code. You can do that by checking the box "Email me" below the input box.
by
Yes, I know that. What I want is onsite notification. The idea is that if you are already on the site and someone reply to your old question/answer you don't want to go to your email first to know about this. You want to immediately respond to that. It something like in facebook.
by
Suggest that to gidgreen. My plugin is only for mentions, but that may be a good feature for Q2A itself. :)
by
edited by
I also tried yours but get this fatal error after each @user comment:


A Question2Answer database query failed when generating this page.

A full description of the failure is available in the web server's error log file.

Server error details:
Column 'from_id' cannot be null ...etc

I think the error comes from unregistered users comments.
0 votes
by
edited by
hello friend, sorry, I'm using your plugin mentions in version 1.4 is excellent I congratulate you.

I have only one problem that maybe you can help, the system works fine, but i when mention more than one user, the system only detects  a one mention and not the others, it's like I just detect only one @ and ignore the others, there is some how to make multiple mentions detected?

greetings and thanks in advance

--------

thank you very much for answering and for the help with this wonderful mention-plugin

I can not wait you can find a solution, I am a beginner in php, I'm learning this beautiful community.

also please if you make a new version fixing this bug,

add numbers "preg_match_all" for users that have numbers in your username, I could easily fix this by adding "0-9" :

"

$return = preg_match_all("/@([0-9a-zA-Z_\-][0-9a-zA-Z_\-]*)/", $params["text"], $text, PREG_SET_ORDER);

"

but to mention multiple users on a single post I have no idea how to fix it, for example if a response i mention 3 users, only recognizes one of them:  @user1 @user2 @user3, only one of theme its recognizes:S

greetings, thank you very much and sorry for my English I am Spanish-speaking
...