1 (edited by nhodges 2010-08-22 11:10)

Topic: [RELEASE] Usertagging for PunBB

Description:
Usertagging for PunBB enables 'user tagging' which is the tagging feature you see on a lot of social networking websites like Facebook or Twitter that allows you to directly address a user by putting an at symbol in front of their username, like @username.

Update:
When tagging a user, this extension will subscribe a user, send the subscription email, and then unsubscribe the user from the topic. (If the user was already subscribed, they won't be unsubscribed.)

Download: http://irunbackwards.com/files/pun_usertagging.zip

Planned Features:

  • User tag 'leaderboard' that shows the most tagged users

  • Dynamic extension logic (user settings for email notifications, etc)

    • Always/never notify me if a user tags me in a post

    • Only notify me if a user tags me in a post I've started/replied to.

Screenshot: http://imgur.com/qnAQx.jpg

2

Re: [RELEASE] Usertagging for PunBB

Wow, this will be really good when it can alert people they've been tagged.

You planning on doing it like how the private messaging alert does it at the top of the forums?
Because that would be pretty wicked.

And is it purposely made to just allow you to tag only one person in a post?

Re: [RELEASE] Usertagging for PunBB

Thanks!

nhodges wrote:

Email/message user when they are tagged

Something I'll want to install here.

Just wondering if that feature should be setable so that it only pms/emails if it's in a topic that isn't already subscribed by the user. Assuming someone is already setting subscribe you'd not want another alert.

One could also consider having the alerts in a box (maybe next to messages) like you see on facebook when you get a comment/message. That would be very uninvasive.

Also wonder if one should include link to post or whole post in the email. But might need safeguards against spammers abusing.

Best would be both as options in profile settings big_smile
Just some thoughts...

Re: [RELEASE] Usertagging for PunBB

@KeyDog yeah, I'll be adding dynamic workflow (user settings etc) to the extension, but for now I just want to fill it out, feature-wise.

@kiejr silly mistake on my part, uploading fix for that.

It also works now with emailing the user you tagged, sends a really simple email with a link to the post.

Re: [RELEASE] Usertagging for PunBB

PS: @nhodges: I saw the most popular way of numbering is <version>0.1.0</version> for beta and then <version>1.0.0</version> for full tested version - subsequent fixes would be  <version>1.0.1</version> and a feature enhanced version probably <version>1.1.0</version>.   Also quick bullet with what was fixed is interesting in initial post smile

Thanks.

Re: [RELEASE] Usertagging for PunBB

@KeyDog, thanks, yeah I don't like the x.x versioning system however I was in a quick hurry to get kiejr an update smile I have switched to x.x.x for future updates.

Re: [RELEASE] Usertagging for PunBB

I've just integrated it into the subscriptions system on my development platform; how I have it working now is it subscribes the tagged user to the post, sends an email with the fulltext of the post, and then unsubscribes the user (only starts this workflow if the user tagged is not already subscribed)

Just doing some more testing and I'll update with the updated extension!

Re: [RELEASE] Usertagging for PunBB

Updated ZIP to newest version, this one includes the subscribe/send/unsubscribe functionality.

Re: [RELEASE] Usertagging for PunBB

getting this;

An error was encountered

The error occurred on line 2483 in /.../include/functions.php

Database reported: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.id DESC LIMIT 1, 1' at line 1 (Errno: 1064).


when trying to post with @username

Re: [RELEASE] Usertagging for PunBB

Which PunBB are you using, and do you have the latest version of the extension?

11

Re: [RELEASE] Usertagging for PunBB

nhodges wrote:

Which PunBB are you using, and do you have the latest version of the extension?

Yes and yes (1.3.4 / 1.0.9)

But more important
MySQL Improved 5.1.42
PHP: 5.2.12

Which MySQL are you using?

12 (edited by nhodges 2010-08-22 19:59)

Re: [RELEASE] Usertagging for PunBB

PHP 5.3 (Not using any 5.3 only functions.)
MySQL Version: 5.1.41

Hmm, let me check if there is any disparities when using MySQLi vs MySQL

13

Re: [RELEASE] Usertagging for PunBB

$post_info is not isset when you are creating a new topic so you can't do this smile
[code=php]send_subscriptions($post_info, $new_pid);[/code]

BTW, just noticed - there's no link in Preview - could it be added there too? smile

Eraversum - scifi browser-based online webgame

14 (edited by nhodges 2010-08-22 20:31)

Re: [RELEASE] Usertagging for PunBB

Grez wrote:

$post_info is not isset when you are creating a new topic so you can't do this smile
[code=php]send_subscriptions($post_info, $new_pid);[/code]

BTW, just noticed - there's no link in Preview - could it be added there too? smile

Will add preview when I get rid of this error smile

What's this? Found in post.php

// If it's a new topic
else if ($fid)
{
    $post_info = array(
        'is_guest'        => $forum_user['is_guest'],
        'poster'        => $username,
        'poster_id'        => $forum_user['id'],    // Always 1 for guest posts
        'poster_email'    => ($forum_user['is_guest'] && $email != '') ? $email : null,    // Always null for non-guest posts
        'subject'        => $subject,
        'message'        => $message,
        'hide_smilies'    => $hide_smilies,
        'posted'        => $now,
        'subscribe'        => ($forum_config['o_subscriptions'] == '1' && (isset($_POST['subscribe']) && $_POST['subscribe'] == '1')),
        'forum_id'        => $fid,
        'update_user'    => true,
        'update_unread'    => true
    );

    ($hook = get_hook('po_pre_add_topic')) ? eval($hook) : null;
    add_topic($post_info, $new_tid, $new_pid);
}

Edit:

But yeah, I do this because there is no $post_info['topic_id'] on new topic:

$usertag_topicid = isset($post_info['topic_id']) ? $post_info['topic_id'] : $new_tid;

Re: [RELEASE] Usertagging for PunBB

No mail is sent when tagging a user.  hmm

Re: [RELEASE] Usertagging for PunBB

@noodles are you running a local installation or is this on a real installation? if you're running locally, remember, you need to have an SMTP server running!

Re: [RELEASE] Usertagging for PunBB

So, it can't use the PHP mail function?

Re: [RELEASE] Usertagging for PunBB

It actually is using forum_mail, which defaults to the PHP mail function if it doesn't have SMTP details provided; I however usually have problems with PHP's mail function on web servers running on my personal computers tongue

You should get the default subscription email:

noobsauce has replied to the topic 'Test post' to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.

The message reads as follows:
-----------------------------------------------------------------------

@nhodges i'll mess you up

-----------------------------------------------------------------------

The post is located at http://localhost/forums/viewtopic.php?pid=38#p38

You can unsubscribe by going to http://localhost/forums/misc.php?unsubscribe=1&amp;csrf_token=359c467590fa1e22f75badbde168f9b865c2f60a

19

Re: [RELEASE] Usertagging for PunBB

@nhodges Sorry, haven't looked the code carefully enough - the $post_info is isset, but $post_info['topic_id'] is not wink

Eraversum - scifi browser-based online webgame

20

Re: [RELEASE] Usertagging for PunBB

I'd say you should have the option for it to show an announcement link up the top, 'You've been tagged in topics'. Much like the Private Message Announcements extension (But a bit smaller of an announcement). That would be beast.

Re: [RELEASE] Usertagging for PunBB

Hehe Grez check out my edit. I found my problem, it's because in

function send_subscriptions

PunBB performs a check on the previous post, and of course there is no previous post on a new topic. Working out a proper resolution right now.

@kiejr noted, I will probably do something to that effect.

Re: [RELEASE] Usertagging for PunBB

Fixed the issue with the error when sending out notifications on new topics, please download the updated extension!

23

Re: [RELEASE] Usertagging for PunBB

The good news; it's now putting links to @user, however bad news, it's not sending any email. unless I missed the setting to turn that on?

Re: [RELEASE] Usertagging for PunBB

Won't work to yourself since it works off subscriptions, and you just "viewed" the thread, if you're trying to alert yourself.

25

Re: [RELEASE] Usertagging for PunBB

Tested and working my end! Love it! Thanks!!!

Edit: Just wondering now how to transition that extension into a board like this one.
Is it something that board users should be

  • informed about before, but set as default

  • only activated for users who have agreed (like with rules)

Any opinions?