vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   /me code Version 3 (https://vborg.vbsupport.ru/showthread.php?t=59698)

Erwin 01-04-2004 10:00 PM

/me code Version 3
 
Updated version 2.00 thanks to buro9!

Updated version 3.00 thanks to Edgewize!

New in version 3.00:
Correct parsing in quotes, private messages etc.

Okay, this is the famous /me code first created by Chen. All credits go to him. I'm just putting up instructions on how to do this in vB3. It's very easy.

Typing "/me is great!" gives you this:

* Erwin is great!


You make changes to THREE php files only.

1. Copy this piece of code:

Change "red" to whatever color you want.

PHP Code:

// /me hack
if (THIS_SCRIPT == 'newreply' && !isset($bbcode) && isset($pagetext))
        
$pagetext preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim''$1* '.$postinfo['username'].' $3'$pagetext);
elseif (
THIS_SCRIPT == 'private' && !isset($bbcode) && isset($pagetext))
        
$pagetext preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim''$1* '.$pm['fromusername'].' $3'$pagetext);
elseif (isset(
$bbcode) && $dobbcode && is_array($GLOBALS['post']))
        
$bbcode preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim''$1* '.$GLOBALS['post']['username'].' $3'$bbcode);
elseif (isset(
$bbcode) && $dobbcode && $GLOBALS['previewpost'])
        
$bbcode preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim''$1* '.$GLOBALS['bbuserinfo']['username'].' $3'$bbcode);
elseif (isset(
$bbcode) && $dobbcode && isset($GLOBALS['fromuserinfo']))
        
$bbcode preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim''$1* '.$GLOBALS['fromuserinfo']['username'].' $3'$bbcode);
// /me hack 

2. Open functions_bbcodeparse.php:

Find:

PHP Code:

// end smilies 

PASTE code copied BELOW.

3. Open newreply.php

Find:

In 3.0.6 or less:
PHP Code:

$pagetext trim(strip_quotes($pagetext)); 

In 3.0.7:
PHP Code:

$pagetext trim(htmlspecialchars_uni($pagetext)); 

PASTE code copied BELOW.

4. Lastly, open private.php

Find:

PHP Code:

$pagetext trim($pagetext); 

PASTE code copied BELOW.

Done! ;)

DestinyIslands 01-05-2004 01:31 AM

/me will click install as soon as he installs it! Should be tonight or tommorw!

/you ... what does this do?

MGM 01-05-2004 01:41 AM

absolutely nothing :p

sweet! thanks for porting it over Erwin!

[high]* MGM clicks install
[/high]

MGM out

SnowBot 01-05-2004 02:21 AM

nice little mod, thanks fella :)

Koutaru 01-05-2004 02:35 AM

[high]* Koutaru clicks install.
[/high]

I'll definately be using this one :) thanks for releasing

Boofo 01-05-2004 03:14 AM

Been waiting for this one, my friend. ;) Good job!

Exero 01-05-2004 06:13 AM

[high]* Exero clicks install
[/high]
www.exero.net/forum/ installed, thanks alot man its wiked..

Hoffi 01-05-2004 09:08 AM

/me clicks install too....

neocorteqz 01-05-2004 09:09 AM

Simple, easy. Just the way i like it. Thanks.

xxskullxx 01-05-2004 01:46 PM

Nice and easy. Thanks, Erwin.

Boofo 01-05-2004 01:50 PM

I've heard of Erwin being nice but I know for sure he ain't easy! ;)

neocorteqz 01-05-2004 07:04 PM

Quote:

Originally Posted by Boofo
I've heard of Erwin being nice but I know for sure he ain't easy! ;)

LMAO.
One question, is this supposed to work with quoted post?


http://www.neocorteqz.com/images/metest.png

Erwin 01-05-2004 07:09 PM

Yes it should. Did you do step 2? This hack only has problems when you try to edit a post with /me in it - then it stuffs up.

TheAnt 01-05-2004 07:16 PM

/me bows to Erwin in reverence

*install

neocorteqz 01-05-2004 07:17 PM

Quote:

Originally Posted by Erwin
Yes it should. Did you do step 2? This hack only has problems when you try to edit a post with /me in it - then it stuffs up.


Yep, unless there is more than one spot that code is in..

Code:

$pagetext = trim(strip_quotes($pagetext));
                // /me Hack
        $pagetext = preg_replace('#^/me(.*)$#im', "[color=\"red\"]* $originalposter\\1[/color]", $pagetext);
                // /me Hack
                eval('$newpost[\'message\'] = "' . fetch_template('newpost_quote', 1, 0) . '";');

                // fetch the quoted post title



edit: It works when the "/me" code is placed before the quote tags.

And to clarify, this is the only hack i am using. :)

FleaBag 01-05-2004 07:47 PM

A classic in my opinion - even though I seem to be the only person using it on my site. Thanks for the effort Erwin.

xxskullxx 01-05-2004 07:56 PM

Quote:

Originally Posted by Boofo
I've heard of Erwin being nice but I know for sure he ain't easy! ;)

LOL

[high]* xxskullxx thinks Boofo read too much into that comment[/high]

BillaBongUSA 01-05-2004 08:50 PM

Quote:

Originally Posted by User_001
Yep, unless there is more than one spot that code is in..

Code:

$pagetext = trim(strip_quotes($pagetext));
                // /me Hack
        $pagetext = preg_replace('#^/me(.*)$#im', "[color=\"red\"]* $originalposter\\1[/color]", $pagetext);
                // /me Hack
                eval('$newpost[\'message\'] = "' . fetch_template('newpost_quote', 1, 0) . '";');

                // fetch the quoted post title



edit: It works when the "/me" code is placed before the quote tags.

And to clarify, this is the only hack i am using. :)


Yeah, it only seems to work for me when /me is on the first line of my post.

Cassidy 01-05-2004 10:10 PM

/me clicked install to!

Great hack XD my members are all IRC addicts so they'll love this!

Xanthine 01-06-2004 07:46 PM

Yep works fine, just isnt quotable

Koutaru 01-06-2004 07:49 PM

[high]* Koutaru testing before quote
[/high]

[high]
Quote:

Originally Posted by Koutaru
* Koutaru testing if hack works in quotes

[/high]
Just testing ;) ... :p I guess not!

[high]* Koutaru testing after quote
[/high]

never mind then! Actually, if you put /me in quotes when it hasn't already been said (already been converted in the original post) then it doesn't work. Then again.. I guess it's not supposed to anyway :p

Erwin 01-06-2004 07:52 PM

Quote:

Originally Posted by TheAnt
[high]* TheAnt bows to Erwin in reverence
[/high]

*install

Testing...

shorty 01-06-2004 09:44 PM

Did you fix it Erwin :D

Boofo 01-06-2004 09:58 PM

Erwin, will this work in pms now, too, sir?

Link14716 01-06-2004 10:30 PM

It works anywhere BBCode is used by the looks of it.

Boofo 01-06-2004 10:34 PM

Quote:

Originally Posted by Link14716
It works anywhere BBCode is used by the looks of it.

The vB2 version didn't unless you put it in the private.php file, too. ;)

Erwin 01-06-2004 10:37 PM

Quote:

Originally Posted by Boofo
Erwin, will this work in pms now, too, sir?

Yes, but when you reply with a quote, it does not work properly. :) This has been an issue since vB2.

Repec 01-07-2004 11:26 AM

[high]* Repec clicks install
[/high]

I just love this irc addition :D

Boofo 01-07-2004 11:31 AM

Quote:

Originally Posted by Erwin
Yes, but when you reply with a quote, it does not work properly. :) This has been an issue since vB2.

They did come out with a fix for that in vB2. I have it here if it would help at all. And they also had to do some code in the private.php to get it to work in pms. ;)

Convergys 01-07-2004 03:57 PM

Quote:

Originally Posted by BillaBongUSA
Yeah, it only seems to work for me when /me is on the first line of my post.

I am having the same problem....

BBQ 01-07-2004 05:13 PM

[high]* BBQ clicks install :D
[/high]
i don't care if it works in quotes, peepz quote too much anyway, mostly useless

and it's supposed to be used when you start a new line! it's the goold old IRC action command simulated in vbb.

Erwin 01-07-2004 11:00 PM

The /me has to be at the start of a separate line. Is this what you mean?

/me tests...

gmarik 01-08-2004 06:04 PM

simple, yet good.
any changes from vb2?

eXtremeTim 01-09-2004 01:07 AM

Quote:

Originally Posted by gmarik
simple, yet good.
any changes from vb2?

This hack does not work when you edit a post you lose the username when using the wysiwyg message editor. You end up with * your text here.

BillaBongUSA 01-09-2004 05:39 AM

Let's see...

/me enjoys Pinnacle, whatever the hell that is

BillaBongUSA 01-09-2004 05:41 AM

Ah, I think it only doesn't work when using the WYSIWYG editor unless it's on the very first line of your post. It works fine when used on the standard editors, though.

Erwin 01-09-2004 06:27 AM

Let me try...

/me testing...

Erwin 01-09-2004 06:27 AM

Weird...

eXtremeTim 01-09-2004 02:25 PM

No edit a post with the wysiwyg message mode and it will lose the username

watch.

Hmm it works here. :-/

But on my site is i edit a post thats using /me text here you end up with * text here on the edit page not * eXtremeTim text here or * Username text here

* eXtremeTim is testing the editing on vb.org of /me

Convergys 01-09-2004 04:00 PM

Lets see if this does the same thing here as test forum...

/me is cool


All times are GMT. The time now is 04:50 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.01653 seconds
  • Memory Usage 1,833KB
  • 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
  • (5)bbcode_php_printable
  • (11)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