PDA

View Full Version : /me - irc feature


Dean C
07-29-2005, 10:00 PM
[/me - irc feature]

Information
vBulletin Version: 3.5.x
Author: Dean Clatworthy (http://www.deanclatworthy.com)
Copyright: You may use this modification at your own risk. I cannot and will not be held responsible for any damage you may cause to your forums during installation or thereafter. You may not distribute this modification in whole or parts and anyone found doing so faces risk of prosecution. All my modifications are released at vBulletin.org and anyone found releasing them elsewhere also faces risk of prosecution. You may not translate this modification without my prior permission.
Donations: I release my modifications for free. If you wish to donate please contact me and I will give you my details. All donations are graciously appreciated.What does this modification do?
This modification simply duplicates the /me feature of irc. It will replace "/me does this action" with "* username does this action".

Installation

1/

Upload the me-hack.xml file via the plugin uploader in the AdminCP

Please Click Install!
If you installed this modifcation please click the install button. It'll help you keep up to date with future releases and important bugfixes, security updates.

Chris_D
07-29-2005, 10:28 PM
<3

:banana:

EDIT: Works great on vB3.5.0 RC1 as well. Only thing is that you can only have one line of /me code per line. Was this intentional or is it a bug?

* Chris_D is testing something
* Chris_D is testing something


EDIT 2: It works on this version of it.

Great work though, so simple as well. I've seen these often have a few template changes :) Well done.

EDIT 3: It also makes the rest of the post's text bold...

Corriewf
07-29-2005, 10:32 PM
Screen shot? I have no idea what this looks like and im afraid to install.

Chris_D
07-29-2005, 10:34 PM
Looks ok - needs a few fixes.

http://www.sinepisodes.net/forums/showpost.php?p=300&postcount=6

Dean C
07-29-2005, 10:38 PM
Looks ok - needs a few fixes.

http://www.sinepisodes.net/forums/showpost.php?p=300&postcount=6

K new version being uploaded as i type this post. Should fix it - delete old plugin and upload the new xml file :)

Chris_D
07-29-2005, 10:41 PM
K new version being uploaded as i type this post. Should fix it - delete old plugin and upload the new xml file :)
http://www.sinepisodes.net/forums/showpost.php?p=300&postcount=6

Perfect :)

Dean C
07-29-2005, 10:47 PM
http://www.sinepisodes.net/forums/showpost.php?p=300&postcount=6

Perfect :)

Excellent. Thanks for finding the bug. This is what happens when you could after midnight ;)

Chris_D
07-29-2005, 10:50 PM
Yeah, coulding is very hard after midnight. Coding isn't much better ;)

Go get some sleep Dean! :p

Boofo
07-29-2005, 10:53 PM
Do this worky in pms? ;)

Dean C
07-29-2005, 10:53 PM
Do this worky in pms? ;)

I think so yep. PMs use the postbit template :)

Chris M
07-30-2005, 12:22 AM
I think so yep. PMs use the postbit template :)

Indeed it does :)

Satan

ThePimp
07-30-2005, 12:29 AM
Any way to get this to support /you also?

Chris M
07-30-2005, 12:34 AM
Any way to get this to support /you also?

See Dean's [you] bbcode plugin...

Or, if you really want /you, upload this plugin again, and alter the /me references to /you and then see how the [you] bbcode obtains the necessary information:)

Satan

Chris M
07-30-2005, 12:57 AM
I have found a bug:

Quoting a post means that /me code quoted takes on the /me parameters of the person quoting, not the quotee, with or without using /me in their post :)

Satan

Dean C
07-30-2005, 07:14 AM
I have found a bug:

Quoting a post means that /me code quoted takes on the /me parameters of the person quoting, not the quotee, with or without using /me in their post :)

Satan

*just thought of a fix* Will fix it in a few hours, need to pop into town :)

Chris M
07-30-2005, 10:30 AM
*just thought of a fix* Will fix it in a few hours, need to pop into town :)

Not good enough :p

Fix it now >_< Lol :p

Satan

Christine
07-30-2005, 09:08 PM
Dean,

This is converting everything that starts with /me

It is showing up on links to ./member.php as (for example) .* Christinember.php

Is that something that can be fixed with a regex to look for the space after it?

Dean C
07-30-2005, 09:59 PM
Dean,

This is converting everything that starts with /me

It is showing up on links to ./member.php as (for example) .* Christinember.php

Is that something that can be fixed with a regex to look for the space after it?

Time to change this to beta I think :) Thanks for the bug report, I need a few minutes to play around with the regex's, but a few minutes is something I don't have rigth now! :(

Marco van Herwaarden
07-31-2005, 09:27 AM
Just put a space after the 'me' in the regex.

Vizionz
07-31-2005, 09:39 AM
good job with this hack it works perfect

Boofo
07-31-2005, 10:06 AM
Just put a space after the 'me' in the regex.

Like this?

$mepattern = '/\/me ([^\r\n]+)/is';

Marco van Herwaarden
07-31-2005, 10:26 AM
Well try it and you'll know bob :D

Boofo
07-31-2005, 10:29 AM
I posted that for the benefit of the newbies, sir. ;)

Dean C
07-31-2005, 10:37 AM
$mepattern = '/\/me[\s]{1}([^\r\n]+)/is';


Should work

Boofo
07-31-2005, 10:41 AM
Is this official? ;)

Boofo
07-31-2005, 10:56 AM
It works, Dean. Great job! ;)

How do I get the whole line to be in red in this?

$this->post['message'] = preg_replace($mepattern, '<b><font color=red>* ' . $this->post['username'] . ' $1</font></b>', $this->post['message']);

Right now it makes everything from the /me part on in red but if you have something like:

The /me hack is working great now

The "The" at the beginning isn't bold or red.

Chris M
07-31-2005, 11:02 AM
It is now replacing all instances of "/me text" with "* Chris Mtext" -.-

The other version ignored /me commands that were not at the start of the line :)

Fix :p

Satan

FleaBag
07-31-2005, 11:06 AM
Nice to have this back in my vB. :)

Boofo
07-31-2005, 11:08 AM
It is now replacing all instances of "/me text" with "* Chris Mtext" -.-

The other version ignored /me commands that were not at the start of the line :)

Fix :p

Satan

I like it better this way myself. Sentences can make more sense now in some cases. ;)

Chris M
07-31-2005, 11:21 AM
I like it better this way myself. Sentences can make more sense now in some cases. ;)

It's no good if you are trying to explain to someone how to use it though ;)

"Just type /me then your message on a new line" becomes "Just type * Chris Mthen your message on a new line" -.-

How does that explain how to use the code, for example?

Satan

Boofo
07-31-2005, 11:32 AM
It's no good if you are trying to explain to someone how to use it though ;)

"Just type /me then your message on a new line" becomes "Just type * Chris Mthen your message on a new line" -.-

How does that explain how to use the code, for example?

Satan

Well, they should already know how to use it as much as it has been around, but I do see your point and think it should be the start of the line only. After experimenting with it, it just doesn't look right in the middle of a sentence.

Satan

Dean C
07-31-2005, 11:41 AM
Chris is right. It should only work at the start of a new line IMO. That's how I'll develop it when I get some time this week. The main problem is evil nested quotes :p

Boofo
07-31-2005, 11:41 AM
It is now replacing all instances of "/me text" with "* Chris Mtext" -.-

The other version ignored /me commands that were not at the start of the line :)

Fix :p

Satan

Here's what I came up with to work until Dean gets a chance to fix his:

$mepattern = '#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim';
if(preg_match($mepattern, $this->post['message']))
{
$this->post['message'] = preg_replace($mepattern, '<b><font color=red>* ' . $this->post['username'] . ' $3</font></b>', $this->post['message']);
}

I'm, sure his fix will be better than this, but this will get you through until then. ;)

Tested and working. ;)

Boofo
07-31-2005, 11:55 AM
The only thing I found wrong with it is when you quote a message with it, /me shows up instead of the name of the person who wrote the original post. How do we fix that?

Chris M
07-31-2005, 12:44 PM
Works perfectly Bob :)

Like you say, there is only the quote issue to work around now :)

Satan

Chris M
07-31-2005, 12:53 PM
I believe there may be a way to solve it, but it will require a file edit to class_bbcode.php :(

function handle_bbcode_quote($message, $username = '')

I believe we could use the replacement code here, and set a variable, something like "isquotedme" to true, and then in the plugin check for if "isquotedme" is true...

Might work...

Satan

Boofo
07-31-2005, 01:04 PM
The problem almost has to be with this line. The old vb3 version used pagetext.

$this->post['message'] = preg_replace($mepattern, '<b><font color=red>* ' . $this->post['username'] . ' $3</font></b>', $this->post['message']);

Chris M
07-31-2005, 01:07 PM
The problem almost has to be with this line. The old vb3 version used pagetext.

$this->post['message'] = preg_replace($mepattern, '<b><font color=red>* ' . $this->post['username'] . ' $3</font></b>', $this->post['message']);

$this->post['message'] is a result of this function in class_postbit.php:

function parse_bbcode()
{
$this->post['message'] = $this->bbcode_parser->parse($this->post['pagetext'], $this->forum['forumid'], $this->post['allowsmilie']);
}

:)

Satan

Dean C
07-31-2005, 01:26 PM
I've got the quote thingy working, just need to play around with when a user has multiple /me's within their quote :)

Boofo
08-01-2005, 12:32 AM
I've got the quote thingy working, just need to play around with when a user has multiple /me's within their quote :)

Can we have what you have so far then? ;)

Dean C
08-01-2005, 10:38 AM
You can see how I'm testing it and see if you can get anywhere:


$msg =
'

adsfasd
* Dean C tesats
lala

* Dean C testss again

asdfadsf


* Dean C RAWRs
';
$mepattern = '#[\r\n\t]+(/me[\s]{1}([^\r\n]+))#i';
preg_match_all($mepattern, $msg, $matchess);
foreach($matchess[1] AS $mekey => $mematch)
{
$pattern = str_replace(' ', '[\s]{1}', $mematch);
$pattern = str_replace('/me', '\/me', $pattern);
if(preg_match('#\[quote=(.*?)\].*' . $pattern . '.*\[\/quote]#ims', $msg, $finalmatches))
{
$user = $finalmatches[1];
}
else
{
$user = 'User';
}
$msg = str_replace($mematch, '<b>* ' . $user . ' ' . $matchess[2]["$mekey"] . '</b>', $msg);
unset($pattern, $finalmatches);
}
echo nl2br($msg);

Christine
08-04-2005, 12:47 AM
Thanks for working on this one, Dean. Was a favorite for our members. :)

Am ready to test as soon as you have something you want us to try!

Roxie
08-06-2005, 01:30 AM
when my members post links that have http://me in it - such as http://members.com - it replaces with their name - http://usernamembers.com

ThePimp
08-09-2005, 05:15 AM
I'm not sure if this has been posted yet, but, I found an issue using this plugin... When posting a link to http://www.yoursite.com/member.php?u=123455

The /me in the URL gets parsed as BBCode.

It was breaking some links on my site. Just a note for you to maybe look into.

GrendelKhan{TSU
08-09-2005, 06:51 AM
installed RC 1 :D thx!

Boofo
08-09-2005, 09:16 AM
Dean, are you ever going to fix this, buddy? ;)

Gizmo5h1t3
08-09-2005, 09:29 PM
working fine on RC2 here

Boofo
08-09-2005, 09:38 PM
working fine on RC2 here

Try quoting it. ;)

Andreas
08-09-2005, 10:12 PM
An idea for the Quote Issue:
Hook: bbcode_create

$this->tag_list['option']['quote']['callback'] = 'handle_external';
$this->tag_list['option']['quote']['external_callback'] = 'me_quote_handler';
$this->tag_list['no_option']['quote']['callback'] = 'handle_external';
$this->tag_list['no_option']['quote']['external_callback'] = 'me_quote_handler';

if (!function_exists('me_quote_handler'))
{
function me_quote_handler(&$parser, $message, $username)
{
if ($username)
{
$message = preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim', '<b><font color=red>* ' . $username . ' $3</font></b>', $message);
}
else
{
$message = preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim', '& #47;me $3', $message);
}
return $parser->handle_bbcode_quote($message, $username);
}
}

Boofo
08-09-2005, 10:21 PM
Take the other code out or use this with it?

Andreas
08-09-2005, 10:23 PM
It's an addition to fix the Quote-Issue; the other Code is still required to handle /me outside Quotes

Boofo
08-09-2005, 10:28 PM
Ok, well, it doesn't work. It still shows /me in the quotes and well as editing. But I am using my code that I posted in this thread for hellsatan. Should I be using Dean's?

Andreas
08-09-2005, 10:31 PM
It shows /me if the Quote does not have a Username.
In Quotes that have a Username it should show this (at least this it was it does for me ;)).

In the Code I posted abobe, the space between & and #47; must be removed.
Seems like I can't post it this way it it will come up as / ;)

Boofo
08-09-2005, 10:35 PM
Here's what I get.

Andreas
08-09-2005, 10:37 PM
Hmm ... if you want /me substituted with the Posters Name in the Editor this would require other changes.

Boofo
08-09-2005, 10:53 PM
Hmm ... if you want /me substituted with the Posters Name in the Editor this would require other changes.

The second pic was a quote reply. ;)

Christine
08-09-2005, 10:56 PM
Is there any way of grabbing the quote already parsed?

Boofo
08-09-2005, 10:59 PM
It shows /me if the Quote does not have a Username.
In Quotes that have a Username it should show this (at least this it was it does for me ;)).

In the Code I posted abobe, the space between & and #47; must be removed.
Seems like I can't post it this way it it will come up as / ;)

Still doesn't work for some reason, and I took the space out.

Boofo
08-13-2005, 03:20 AM
An idea for the Quote Issue:
Hook: bbcode_create

$this->tag_list['option']['quote']['callback'] = 'handle_external';
$this->tag_list['option']['quote']['external_callback'] = 'me_quote_handler';
$this->tag_list['no_option']['quote']['callback'] = 'handle_external';
$this->tag_list['no_option']['quote']['external_callback'] = 'me_quote_handler';

if (!function_exists('me_quote_handler'))
{
function me_quote_handler(&$parser, $message, $username)
{
if ($username)
{
$message = preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim', '<b><font color=red>* ' . $username . ' $3</font></b>', $message);
}
else
{
$message = preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim', '& #47;me $3', $message);
}
return $parser->handle_bbcode_quote($message, $username);
}
}


No wonder this doesn't work! This is using code from your quote callback mod. ;)


$this->tag_list['option']['quote']['callback'] = 'handle_external';
$this->tag_list['option']['quote']['external_callback'] = 'me_quote_handler';
$this->tag_list['no_option']['quote']['callback'] = 'handle_external';
$this->tag_list['no_option']['quote']['external_callback'] = 'me_quote_handler';

utw-Mephisto
09-04-2005, 02:14 PM
I was trying to read through that post and haven't figured out how to install it on RC2 and IF this is working or now ...

Any suggestions / clues ?

yessir
09-20-2005, 10:05 PM
Bump for please update.

utw-Mephisto
09-23-2005, 03:29 AM
(OT)
@roscoe36:

Changes are being implemented to get this project going.
We will be back by 12:00 p.m. on September 20th, 2005


It is the 23rd already :D

GrendelKhan{TSU
09-23-2005, 06:48 PM
found a kinda "bug"

if someone types a URL link to something that coincendently has a "/ me " in it...
it messes up the link.

for example: someone on my board tried to post:

http://media.putfile.com/Bike-Stunt43

and it keep producing this when the link was clicked:

http://www.mysite.com/<b>*%20Liz?dKingdia.putfile.com/Bike-Stunt43

where "<b>*%20Liz?dKing" was his forum name


it is possible to fix this so that the /me function is disabled when inside a link/url?

Alien
09-29-2005, 09:26 AM
I was trying to read through that post and haven't figured out how to install it on RC2 and IF this is working or now ...

Any suggestions / clues ?

For me, everything with this hack works perfectly (including quoting) *except* attempting to post a message with URL's such as: http://media.putfile.com/Bike-Stunt43

The moment I do that, and try to submit a post (with or without wrapping it with (url) tags (yes i know they should be square ones lol) it renders the thread completely broken and I cannot read it again.. So I'm deactivating for now...

GrendelKhan{TSU
10-01-2005, 10:00 AM
installed and working on 3.5.0

url thing, Alien, is what I posted above....

solutoin:
---"/me" function is disabled when inside a link/url
---or just avoid url with "/me" in them. ;)

Mike Gaidin
10-01-2005, 12:13 PM
Works for me so far on 3.5.0 Gold. Nice work. :)

weaver
10-01-2005, 01:39 PM
$mepattern = '/\/me[\s]{1}([^\r\n]+)/is';


Should work

That didn't work for me. Now a space is missing between the username and the next word... and it's still mucking up the username on the quote to whoever is quoting instead of who's being quoted.

Alien
10-01-2005, 10:54 PM
installed and working on 3.5.0

url thing, Alien, is what I posted above....

solutoin:
---"/me" function is disabled when inside a link/url
---or just avoid url with "/me" in them. ;)

...and how would one disable the /me function inside links/urls? :)

utw-Mephisto
10-02-2005, 10:44 AM
Had to disabled / uninstall for now because of the URL problem :(

-mk-
10-03-2005, 01:49 AM
Had to disabled / uninstall for now because of the URL problem :(
^Same :( i have lots of members with links like http://members.site.com/whatever.html

El_Muerte
10-03-2005, 03:14 PM
use:
$mepattern = '/(^|\s)\/me([^\r\n]+)/is';
if(preg_match($mepattern, $this->post['message']))
{
$this->post['message'] = preg_replace($mepattern, '$1<b>* ' . $this->post['username'] . '$2</b>', $this->post['message']);
}

this requires either nothing (begin of the post) or a whitespace character before the /me

also note the changed preg_replace

utw-Mephisto
10-03-2005, 03:50 PM
You are A HERO :D :D Works !!!

-mk-
10-04-2005, 02:45 AM
YAY that worked great!
Thank you very much :D

El_Muerte
10-04-2005, 10:18 AM
You might also want to add the following plugin
global $vbulletin;
$mepattern = '/(^|\s)\/me([^\r\n]+)/is';
if(preg_match($mepattern, $previewmessage))
{
$previewmessage = preg_replace($mepattern, '$1<b>* ' . $vbulletin->userinfo['username'] . '$2</b>', $previewmessage);
}
under the hook: newpost_preview

and

$mepattern = '/(^|\s)\/me([^\r\n]+)/is';
if(preg_match($mepattern, $reviewmessage))
{
$reviewmessage = preg_replace($mepattern, '$1<b>* ' . $username . '$2</b>', $reviewmessage);
}
under the hook: newreply_form_reviewbit

with this the preview of a post will also get the right update

or simply download the attached xml file (note: I made it a product because of the 3 linked hooks)

Boofo
10-04-2005, 10:41 AM
You might also want to add the following plugin
global $vbulletin;
$mepattern = '/(^|\s)\/me([^\r\n]+)/is';
if(preg_match($mepattern, $previewmessage))
{
$previewmessage = preg_replace($mepattern, '$1<b>* ' . $vbulletin->userinfo['username'] . '$2</b>', $previewmessage);
}
under the hook: newpost_preview

and

$mepattern = '/(^|\s)\/me([^\r\n]+)/is';
if(preg_match($mepattern, $reviewmessage))
{
$reviewmessage = preg_replace($mepattern, '$1<b>* ' . $username . '$2</b>', $reviewmessage);
}
under the hook: newreply_form_reviewbit

with this the preview of a post will also get the right update

or simply download the attached xml file (note: I made it a product because of the 3 linked hooks)

Where is the attachment, sir? ;)

El_Muerte
10-04-2005, 10:55 AM
doh, forgot to save the post.
it's there now.

Boofo
10-04-2005, 10:58 AM
doh, forgot to save the post.
it's there now.

How about when editing a post?

And thank you. ;)

Moparx
10-04-2005, 03:09 PM
thanks El_Muerte :)

Now all we need is a fix so that when quoting a post with /me in it, the quoted /me uses the quoted persons name instead of taking on the name of the person replying

El_Muerte
10-04-2005, 06:43 PM
I've been working to revamp this plugin, so far so good except for the quoting issue.
The problem with quoting is that it's not use who posted it, so I've been going through a couple of ideas:

1) rewrite the /me in the quote to reflect the original user
2) use the username from the quote param to replace the /me

the problem with 1) is that it needs to be rewritten to a vbcode, so I could change the rewriting to use something like description

with 2) you have the issue that not always a username is provided in the quote

I think I'm going for the rewriting as a whole base, just like with the automatic URL detection. Ofcourse this has the issue that current /me's won't be replaced correctly.

Boofo
10-04-2005, 06:52 PM
I've been working to revamp this plugin, so far so good except for the quoting issue.
The problem with quoting is that it's not use who posted it, so I've been going through a couple of ideas:

1) rewrite the /me in the quote to reflect the original user
2) use the username from the quote param to replace the /me

the problem with 1) is that it needs to be rewritten to a vbcode, so I could change the rewriting to use something like description

with 2) you have the issue that not always a username is provided in the quote

I think I'm going for the rewriting as a whole base, just like with the automatic URL detection. Ofcourse this has the issue that current /me's won't be replaced correctly.

Maybe Kirby has an idea of how to handle the quote part. ;)

El_Muerte
10-04-2005, 08:11 PM
Ok here's a major overhaul of the /me command, this version rewrite the /me line to [action=username]text[/username]. This solution provides better cusomization and easier usage. Plus it also work in other plugins that parse bb code.

By default it forces a definition for [action] but you can simply override is by specifing it in the custom bbcode.
The default replacement is: <span style="font-weight: bold;">* {option} {param}</span>

This product also contains a few plugins postfixed with "(legacy support)" (disabled by default). This adds backwards compatibility for posts that only have the old "/me ..." stuff. However, the legacy code has a minor bug where "/me" is used inside a quote.

Also an entry for "/me" is added to the vbCode overview page.

Moparx
10-04-2005, 09:04 PM
with legacy mode active im seeing stuff like this:

has a return after it:
* Moparx waves<br />

has a smilie next to it:
* Moparx starts up a fire pit. <img src="images/smilies/evil.gif" border="0" alt="" title="Evil" class="inlineimg" />

El_Muerte
10-05-2005, 06:15 AM
ah... figures.. ok here's a fix. Replace the content of the "/me main" plugin with:
if (!function_exists("bbcode_irc_me"))
{
$bbcode_irc_me_parser = null;

function bbcode_irc_me($username, $text)
{
global $bbcode_irc_me_parser, $vbulletin;
if ($bbcode_irc_me_parser == null)
$bbcode_irc_me_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$mask = $bbcode_irc_me_parser->tag_list["option"]["action"]["html"];
$res = str_replace(array("%2\$s", "%1\$s"), array($username, $text), $mask);
return $res;
}
}

$ircme_pattern = "/(^|\s)\/me ([^\r\n]+)/is";

the produced HTML however isn't validator valid, but shouldn't produce rendering issues.

or install the newer product .xml (https://vborg.vbsupport.ru/attachment.php?attachmentid=35252)

Boofo
10-05-2005, 06:30 AM
Wouldn't this reg ex work just as well?

#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim

Boofo
10-05-2005, 10:52 AM
ah... figures.. ok here's a fix. Replace the content of the "/me main" plugin with:
if (!function_exists("bbcode_irc_me"))
{
$bbcode_irc_me_parser = null;

function bbcode_irc_me($username, $text)
{
global $bbcode_irc_me_parser, $vbulletin;
if ($bbcode_irc_me_parser == null)
$bbcode_irc_me_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$mask = $bbcode_irc_me_parser->tag_list["option"]["action"]["html"];
$res = str_replace(array("%2\$s", "%1\$s"), array($username, $text), $mask);
return $res;
}
}

$ircme_pattern = "/(^|\s)\/me ([^\r\n]+)/is";

the produced HTML however isn't validator valid, but shouldn't produce rendering issues.

or install the newer product .xml (https://vborg.vbsupport.ru/attachment.php?attachmentid=35252)

How do we get it to show up in highlight or a certain color? ;)

Also, how do we avoid this?

The * Boofo hack is working now.

If /me comes after the first word, it shouldn't be parsed. ;)

El_Muerte
10-05-2005, 11:48 AM
to change the way the /me is displayed simply add the [action] vbcode tag.

for example the replacement:
<span style="font-weight: bold; color: red;">* {option} {param}</span>
will make "/me does this" be displayed as:
* El_Muerte does this

in order for /me to only be replaced at the beginning of a line edit the "/me main" plugin to use the regex:
$ircme_pattern = "/(^|\n|\r)\/me ([^\r\n]+)/is";

or you could simply add to something like "the [noprase]/me[/noparse] doesn't work now"

wth, why does [ color=red]text[/color] make the text green?!

Moparx
10-05-2005, 09:01 PM
thanks again El_Muerte.
Your product is working perfectly :)

Salazar
10-10-2005, 10:07 PM
doesn't work for me in 3.5.0

I uploaded the plugin but it doesn't do anything me text is still displayed as "/ me does something" (without space of course)

Any ideas? And yes, I activated the plugin.

EDIT: Nevermind, it works now :rolleyes:

Christine
10-10-2005, 10:10 PM
@Salazar -- You need to upload this as a product. Use the link from El_Muerte's post. I can confirm this is working on 3.5 Gold.

@ El_Muerte -- thanks, working like a charm in big, bold red. :D Question -- what are the disabled legacy support plugins for? Can those just be deleted?

Moparx
10-11-2005, 12:29 AM
if you used previous /me hacks (say on 3.0.x) the legacy mode will allow them to be shown correctly

Christine
10-11-2005, 12:48 AM
Ah -- gotcha. Thanks Moparx. :)

KimmiKat
10-26-2005, 06:28 PM
Where would I add the "action" tag at?

Edit: My co-admin helped me figure it out. Need coffee.

to change the way the /me is displayed simply add the [action] vbcode tag.

for example the replacement:
<span style="font-weight: bold; color: red;">* {option} {param}</span>
will make "/me does this" be displayed as:
* El_Muerte does this

in order for /me to only be replaced at the beginning of a line edit the "/me main" plugin to use the regex:
$ircme_pattern = "/(^|\n|\r)\/me ([^\r\n]+)/is";

or you could simply add to something like "the [noprase]/me[/noparse] doesn't work now"

wth, why does [ color=red]text[/color] make the text green?!

BANDiT600
10-26-2005, 06:37 PM
/me very usefull I think!

GuaRRand
10-26-2005, 07:54 PM
to change the way the /me is displayed simply add the [action] vbcode tag.

for example the replacement:
<span style="font-weight: bold; color: red;">* {option} {param}</span>
will make "/me does this" be displayed as:
* El_Muerte does this

in order for /me to only be replaced at the beginning of a line edit the "/me main" plugin to use the regex:
$ircme_pattern = "/(^|\n|\r)\/me ([^\r\n]+)/is";

or you could simply add to something like "the [noprase]/me[/noparse] doesn't work now"

wth, why does [ color=red]text[/color] make the text green?!

So if i want the "/me does this and that" to be displayed in red...how and WHERE would i have to edit the XML file?

El_Muerte
10-28-2005, 10:19 AM
So if i want the "/me does this and that" to be displayed in red...how and WHERE would i have to edit the XML file?

You simply add the [action] vbCode tag to your custom vbcode list like you quoted. You don't have to edit the plugin's code.
The [action] tag isn't added by default (but it is forced in the background).

mfizzel
10-30-2005, 02:07 AM
I still don't know what you mean, lol

Christine
10-30-2005, 01:33 PM
In El_Muerte's plugin called enforce default [action] bbcode hooked to bbcode_create , replace the <span></span> tag with:
<span style=\"font-weight: bold; color: red;\">* %2\$s %1\$s</span>

Jafo232
11-02-2005, 06:31 PM
Problem with this hack. Consider this:

http://Members.aol.com.. Took me forever to figure out what was mucking my links..

For now, uninstall clicked..

JohnBee
11-03-2005, 04:36 AM
Same here, it was affecting many links on my forum, I was also forced to uninstall it :(

Jafo232
11-03-2005, 05:02 AM
Same here, it was affecting many links on my forum, I was also forced to uninstall it :(

It is too bad.. I haven't looked over the code, I am sure it is an easy fix, I just do not have the time.

Good idea anyway..

Boofo
11-03-2005, 07:07 AM
It is too bad.. I haven't looked over the code, I am sure it is an easy fix, I just do not have the time.

Good idea anyway..

It probably took you longer to post this message than it would take to fix it, if it is an easy fix. ;)

StarBuG
11-05-2005, 04:11 PM
Thank you

/me clicks install

Erox
11-22-2005, 11:39 PM
No offense, but I have to uninstall as well. "/me" was a good idea but something more unique like [me] would work better on a board, so I simply edited and uploaded a modified version of the "[you] hack (https://vborg.vbsupport.ru/showthread.php?t=93500)" instead (given my EXTEMELY limited coding skills).

Appreciate all the hard work you guys all did though.

-=e=-

Edited Later: One second thought, I re-installed this after changing "/me" to "[me]", and it works like a charm! I take back my "uninstall"! :)

makemedie
11-23-2005, 03:50 AM
* makemedie just tested it out on 3.5.1! Works great thanks! :)

Teslasparker
11-29-2005, 10:13 AM
Nice one. Only one thing that is a bit of a problem: the string searched for seems to be "/me" and not "/me ", causing certain URL's to be changed too! I.e:

http://server.contry/me_hack.jpg results in: http://server.contry* ~_hack.jpg

(where "~" is the user (me) in question that has been replaced).

Could you please fix this in future versions?

Bernd Glasstett
12-03-2005, 09:39 AM
I would rather recommend, to look if in the string there is a "http://". If so: Don't apply the hack. Just for the case, someone has been using a blind space in his URL ;)

Club3G
01-11-2006, 07:28 PM
Nice, but nested quotes kills .. /me.. (har har)

Daniel
01-22-2006, 11:20 PM
I know this will sound stupid but... how would I uninstall this via admincp? It's not showing up in my plugin manager, but it's showing up when I click "Upload/download plugins"

/me is a confused duckling

wolfyman
01-25-2006, 06:31 PM
sounds like there are a few things missing before this hack is safe to use... will watch the thread, though :)

Guest210212002
01-25-2006, 11:10 PM
Working on 3.5.3 with the above mentioned issues, but they're minor in light of this being such a fun add-on in general.

/me clicks install.

I've attached my product XML, edited just to make the font 10px non-bold green if anyone would like it.

Guest210212002
01-25-2006, 11:12 PM
I know this will sound stupid but... how would I uninstall this via admincp? It's not showing up in my plugin manager, but it's showing up when I click "Upload/download plugins"

* Daniel is a confused duckling

Uninstall in the Product Manager, not the plugin manager. ;)

Daniel
01-27-2006, 02:43 AM
Uninstall in the Product Manager, not the plugin manager. ;)
I believe this is a plugin... anyway, doesn't appear in either of them. :(

Guest210212002
01-27-2006, 01:07 PM
I believe this is a plugin... anyway, doesn't appear in either of them. :(

It's in Product manager for me.

:scratches head:

Perhaps reinstall it, allow overwrite, then see if it shows up?

pokesph
01-29-2006, 05:06 PM
Problem with this hack. Consider this:

http://Members.aol.com.. Took me forever to figure out what was mucking my links..

For now, uninstall clicked..
4 days of pulling out hair because of mucked links and image links.. and finially figured out it was the hack.. had to disable it and may remove it soon unless the url issuse are fixed.

well, it was fun while it lasted..

Guest210212002
01-29-2006, 09:08 PM
4 days of pulling out hair because of mucked links and image links.. and finially figured out it was the hack.. had to disable it and may remove it soon unless the url issuse are fixed.

well, it was fun while it lasted..

Hmm. I don't have an issue with that at all, see screenshot:

Erwin
02-20-2006, 05:24 AM
Use this code instead:


$mepattern = '/(^|\s)\/me ([^\r\n]+)/is';
if(preg_match($mepattern, $this->post['message']))
{
$this->post['message'] = preg_replace($mepattern, '$1<b>* ' . $this->post['username'] . ' $2</b>', $this->post['message']);
}


Should fix the URL and other unintentional change problems.

Desihunk
03-13-2006, 01:46 AM
Thanks Erwin.

I had to disable the hack due to the same reason!!

This might help :)

Thanks

theArchitect
04-28-2006, 07:02 AM
Many thanks Erwin. Worked like a charm on 3.5.4. :)

zetetic
11-01-2006, 02:15 PM
It's in Product manager for me.

:scratches head:
That's El_Muerte's modification, posted earlier in the thread and released independently here (https://vborg.vbsupport.ru/showthread.php?t=102899). The mod in the OP of this thread is a plugin, not a product.

shaynehammy
06-14-2007, 04:41 AM
Does this work on 3.6.4?

brvheart
10-15-2007, 12:42 PM
will this work on 3.6.8??

brvheart
10-31-2007, 04:04 PM
bump please

MTGDarkness
03-24-2009, 04:49 AM
This keeps breaking links to certain forums with url rewrite (www.site.com/forums/metaboard-f86) and member.php, and I'm not sure of a fix.

EDIT: Fix made.

$mepattern2 = '/\/me ([^\r\n]+)/';
if(preg_match($mepattern2, $this->post['message']))
{
$this->post['message'] = preg_replace($mepattern2, '<b><font color="DarkOrchid">* ' . $this->post['username'] . ' $1 </font></b>', $this->post['message']);
}

Notice: space before the parentheses. Not after (I'm quite stupid with Regex)