Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
/me code Version 3 Details »»
/me code Version 3
Version: 3.00, by Erwin Erwin is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 01-04-2004 Last Update: Never Installs: 200
 
No support by the author.

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!

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #82  
Old 03-11-2004, 10:06 AM
Edgewize Edgewize is offline
 
Join Date: Jan 2004
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack; I customized it pretty heavily to add support for private messages, message preview, and to respect bbcode-disabled flags. I also think that this will work no matter what font is currently in use, and it will never generate non-XHTML-compliant output (even when tags are badly overlapped).

[high]* Edgewize clicks install because without Erwin, I'd never have started!
[/high]


I put the following a file called hack_me.php:

(NOTE: had to mangle the color tags to get it to post right. replace Xcolor with color in six places!)

Code:
<?php
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', '[Xcolor=#008811]$1* '.$GLOBALS['post']['username'].' $3[/Xcolor]', $bbcode);
elseif (isset($bbcode) && $dobbcode && $GLOBALS['previewpost'])
        $bbcode = preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim', '[Xcolor=#008811]$1* '.$GLOBALS['bbuserinfo']['username'].' $3[/Xcolor]', $bbcode);
elseif (isset($bbcode) && $dobbcode && isset($GLOBALS['fromuserinfo']))
        $bbcode = preg_replace('#^(([ \t]|\[[a-z]+[^\]]*\])*)/me[ \t](.*)$#Uim', '[Xcolor=#008811]$1* '.$GLOBALS['fromuserinfo']['username'].' $3[/Xcolor]', $bbcode);
?>
Then added the line
Code:
@include('hack_me.php');
in the following places:

Code:
includes/functions_bbcodeparse.php  around line 323, immediately after:
        global $DB_site, $vboptions, $bbuserinfo, $templatecache, $smiliecache;
        global $html_allowed;

newreply.php  around line 96, immediately after
        $pagetext = trim(strip_quotes($pagetext));

private.php  around line 1156, immediately after
        $pagetext = trim($pagetext);

(Note: to change the color, change the three color tags in hack_me.php)

First post, baby! And hello Erwin, I totally forgot that you post here as well as at EV1servers
Reply With Quote
  #83  
Old 03-11-2004, 11:01 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm still have problems with the different fonts (as you can see in the thread link below). Any idaes how to fix this?

http://www.bearfacts2.com/forums/showthread.php?t=437
Reply With Quote
  #84  
Old 03-11-2004, 07:39 PM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DestinyIslands
[high]* DestinyIslands will click install as soon as he installs it! Should be tonight or tommorw!
[/high]

/you ... what does this do?
the you tag sounds more interesting though..

think of users using.
Example i post a message like:

[you] is a nice member

When rest of members of board read that message it. it appears to them as
[Member Reasing the post name] is a nice member


what do u think ??
Reply With Quote
  #85  
Old 03-11-2004, 09:31 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by san-deep
the you tag sounds more interesting though..

think of users using.
Example i post a message like:

[you] is a nice member

When rest of members of board read that message it. it appears to them as
[Member Reasing the post name] is a nice member


what do u think ??
I'm putting the install file together for it now. I did this a while back for my site for vB3 but I needed to get the archive code set right so the [you] code wouldn't show up there. I have it up and working now at my site if you would like to check it out. I need someone to make sure I got all the places it can show up at (in case I missed any).
Reply With Quote
  #86  
Old 03-12-2004, 05:44 AM
ChuanSE's Avatar
ChuanSE ChuanSE is offline
 
Join Date: Feb 2003
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i didn't manage to get a answer for you boofo :/
I guess it doesn't work in my private forum...

But hey, you made some real cool mods on your board
Reply With Quote
  #87  
Old 03-12-2004, 06:47 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ChuanSE
i didn't manage to get a answer for you boofo :/
I guess it doesn't work in my private forum...

But hey, you made some real cool mods on your board
That's because on my site I don't use [you]. I use a different word so I don't get it overused and abused on the board too soon.

Thank you for the kind words. Glad to have you aboard.
Reply With Quote
  #88  
Old 03-12-2004, 01:14 PM
BBQ BBQ is offline
 
Join Date: Nov 2003
Location: The Netherlands
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on RC4, works like a charm

Well that is, it works fine in a new thread and new reply.
Works fine in quoting a post with a /me in it.

Doesn't work when you edit the orig /me post, you loose the username then. But you can always add /me befor eit again. Plus editting is not done often.

[high]* BBQ is happy but he already installed this on beta 7 and pressed install a few pages in this thread back [/high]
Reply With Quote
  #89  
Old 03-12-2004, 06:41 PM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
I'm putting the install file together for it now. I did this a while back for my site for vB3 but I needed to get the archive code set right so the [you] code wouldn't show up there. I have it up and working now at my site if you would like to check it out. I need someone to make sure I got all the places it can show up at (in case I missed any).
can u please pm me the links to ur board ??
i had installed the YOU tag on ipb

i administrate my forums, and i know what are default places where that thing should be visible

Sandy...
Reply With Quote
  #90  
Old 03-12-2004, 06:46 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's in my profile, but here it is again.

http://www.bearfacts2.com
Reply With Quote
  #91  
Old 03-14-2004, 06:33 AM
ChuanSE's Avatar
ChuanSE ChuanSE is offline
 
Join Date: Feb 2003
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
That's because on my site I don't use [you]. I use a different word so I don't get it overused and abused on the board too soon.

Thank you for the kind words. Glad to have you aboard.
aha, what would be the secret word then? j/k

But hey, i'm glad to have guyz like you aboard
Keep up the good work
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:51 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05861 seconds
  • Memory Usage 2,342KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (5)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete