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 08-01-2005 10:38 AM

You can see how I'm testing it and see if you can get anywhere:

PHP Code:

    $msg 
    
'
    [quote=DeanC]
    adsfasd
[high]    * Dean C tesats [/high]
    lala
    [quote=Bob]
[high]    * Dean C testss again [/high]
    [/quote]
    asdfadsf
    [/quote]
    
[high]    * Dean C RAWRs [/high]
    '
;
    
$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

Quote:

Originally Posted by Gizmo5h1t3
working fine on RC2 here

Try quoting it. ;)

Andreas 08-09-2005 10:12 PM

An idea for the Quote Issue:
Hook: bbcode_create
PHP Code:

$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

Quote:

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

Quote:

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

Quote:

Originally Posted by KirbyDE
An idea for the Quote Issue:
Hook: bbcode_create
PHP Code:

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

PHP Code:

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

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:

Quote:

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

Quote:

Originally Posted by utw-Mephisto
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

Quote:

Originally Posted by Dean C
Code:

$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

Quote:

Originally Posted by GrendelKhan{TSU
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

Quote:

Originally Posted by utw-Mephisto
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:
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 11:57 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.01325 seconds
  • Memory Usage 1,863KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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