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)

El_Muerte 10-03-2005 03:14 PM

use:
Code:

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

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

Code:

$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

Quote:

Originally Posted by El_Muerte
You might also want to add the following plugin
Code:

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

Code:

$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

Quote:

Originally Posted by El_Muerte
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 [action=username]description[/action]

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

Quote:

Originally Posted by El_Muerte
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 [action=username]description[/action]

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. ;)


All times are GMT. The time now is 01:51 PM.

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.01247 seconds
  • Memory Usage 1,741KB
  • 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
  • (5)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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