1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add-on /me

Discussion in 'Resource and Add-on Requests' started by Chris D, Feb 13, 2012.

  1. Chris D

    Chris D XenForo Developer Staff Member

    This should be a relatively simple one, but I can't quite get there with it. I want to add a code so that it turns

    /me would like to learn XenForo addons


    *Yorick would like to learn XenForo addons

    Now obviously this could be done, and relatively easily, by using a [me] bbcode, but that's just not the same. So then it occurs to me that since the http://xenforo.com/community/threads/bd-tag-me.6762 Addon works by using @ in posts, that it should be possible to do a /me, and would in fact be a lot simpler since there's no need to query the database for users, no need for options or an alerts system. But I'm not 100% sure on how to go about it.
  2. avi

    avi Active Member

  3. avi

    avi Active Member

    actually what you are requesting is default in mybb :p
  4. Chris D

    Chris D XenForo Developer Staff Member

    It would presumably work but it's not exactly what I want. But I might be able to use it as a reference along with the [bd] Tag Me system in order to write my own.

    Hey it's default in mIRC too. As long as we're suggesting things that aren't what I want, maybe I'll just use that. :rolleyes:
  5. bambua

    bambua Well-Known Member

    The difficulty with this vs. say in mIRC, in mIRC you are entering a command...in a forum setting your using some mechanism to do a find and replace in the post. That's why bbcodes have the opening and closing tags, it makes it easy to find the beginning and end in a programmatic way. The reason the @ addon works is that in general names don't have spaces in them, it makes it a lot easier to match. A multiple word command with only the first character to find it becomes very costly to look for.
  6. Chris D

    Chris D XenForo Developer Staff Member

    That makes a lot of sense to me, except that aren't I only using trying to use a single word command with /me?

    Here's where I am with this now:
    I've gotten /me to work, but it only does it if there's a line of text before AND after it. Something to do with the regex query. I also think that I should be able to call the poster as the replacement text, but $message.username is coming up as undefined because it's, obviously, not global. So I need to figure out how to define that properly. And then this might eventually work.
  7. DRE

    DRE Well-Known Member

    Is this working in xenforo 1.2 yet.

Share This Page