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


All times are GMT. The time now is 01:54 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.02552 seconds
  • Memory Usage 1,747KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (2)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