vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   /me - irc feature (https://vborg.vbsupport.ru/showthread.php?t=93171)

Dean C 07-29-2005 10:00 PM

/me - irc feature
 
[/me - irc feature]

Information
  • [high]vBulletin Version:[/high] 3.5.x
  • [high]Author:[/high] Dean Clatworthy
  • [high]Copyright:[/high] 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.
  • [high]Donations:[/high] 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?

[high]* Chris_D is testing something
[/high]
[high]* Chris_D is testing something
[/high]


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/sh...00&postcount=6

Dean C 07-29-2005 10:38 PM

Quote:

Originally Posted by Chris_D

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

Quote:

Originally Posted by Dean C
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/sh...00&postcount=6

Perfect :)

Dean C 07-29-2005 10:47 PM

Quote:

Originally Posted by Chris_D

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

Quote:

Originally Posted by Boofo
Do this worky in pms? ;)

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

Chris M 07-30-2005 12:22 AM

Quote:

Originally Posted by Dean C
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

Quote:

Originally Posted by ThePimp
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

Quote:

Originally Posted by hellsatan
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

Quote:

Originally Posted by Dean C
*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

Quote:

Originally Posted by Christine
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

Quote:

Originally Posted by MarcoH64
Just put a space after the 'me' in the regex.

Like this?

HTML Code:

$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

Code:

$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?

HTML Code:

        $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:

Quote:

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

Quote:

Originally Posted by hellsatan
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

Quote:

Originally Posted by Boofo
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

Quote:

Originally Posted by hellsatan
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

Quote:

Originally Posted by hellsatan
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:

HTML Code:

$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 :(

PHP Code:

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.

HTML Code:

$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

Quote:

Originally Posted by Boofo
The problem almost has to be with this line. The old vb3 version used pagetext.

HTML Code:

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

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

PHP Code:

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

Quote:

Originally Posted by Dean C
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? ;)


All times are GMT. The time now is 07:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03515 seconds
  • Memory Usage 1,834KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (5)bbcode_html_printable
  • (2)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete