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

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

Boofo 10-05-2005 06:30 AM

Wouldn't this reg ex work just as well?

PHP Code:

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


Boofo 10-05-2005 10:52 AM

Quote:

Originally Posted by El_Muerte
ah... figures.. ok here's a fix. Replace the content of the "/me main" plugin with:
Code:

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

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

Also, how do we avoid this?

Quote:

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

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

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

Quote:

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

for example the replacement:
HTML Code:

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

$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

Quote:

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

for example the replacement:
HTML Code:

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

$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

Quote:

Originally Posted by GuaRRand
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:
PHP Code:

<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

Quote:

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

Quote:

Originally Posted by Jafo232
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" 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

[high]* makemedie just tested it out on 3.5.1! Works great thanks! :)[/high]

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:

Code:

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

Quote:

Originally Posted by Daniel
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"

[high]* Daniel is a confused duckling[/high]

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

Daniel 01-27-2006 02:43 AM

Quote:

Originally Posted by Chris-777
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

Quote:

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

Quote:

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

Quote:

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

PHP 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']);


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

Quote:

Originally Posted by Chris-777
It's in Product manager for me.

:scratches head:

That's El_Muerte's modification, posted earlier in the thread and released independently here. 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?


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.02042 seconds
  • Memory Usage 1,839KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_html_printable
  • (6)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