The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

/me /you

2 posters

Go down

/me /you Empty /me /you

Post by blindbat1457 August 10th 2010, 9:53 am

Is there a way to add /me and /you to the forums.
This hack replaces /me by the username of the poster and replaces /you by the username of the reader.

Code is below. I am on phpbb2 not sure where to put it.. although the txt file says

Put this in the "bbcode-section" of your viewtopic.php
(maybe not the best place to set it, but it works!)
/note/ it will only be seen in the submitted message, not in the preview /note/
Code:
{
$message = str_replace("/me ","<font color="orange"> " .$poster. "</font> ",$message);
}
{
$message = str_replace("/you ","<font color="violet"> " .$userdata['username']. "</font> ",$message);
}
 


Then, to prevent the wrong names show up in eventually quotes, put this in your posting.php

FIND
Code:

if ( !empty($orig_word) )
        {
            $subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : '';
            $message = ( !empty($message) ) ? preg_replace($orig_word, $replace_word, $message) : '';
        }
 


and place above this the following code:
Code:

{
$message = str_replace("/me "," $quote_username ",$message);
                  }
blindbat1457
blindbat1457
Forumember

Male Posts : 667
Reputation : 6
Language : English
Location : Santa Clarita, CA

Back to top Go down

/me /you Empty Re: /me /you

Post by blindbat1457 August 11th 2010, 10:19 pm

Is there a way I can do this via template editing and if so wanna help me out on where I put it and such? Please?
blindbat1457
blindbat1457
Forumember

Male Posts : 667
Reputation : 6
Language : English
Location : Santa Clarita, CA

Back to top Go down

/me /you Empty Re: /me /you

Post by kirk August 11th 2010, 10:41 pm

it's php so i dont think you can add that.
you can go to the view topic body in your templates and fine the area where the user name is .remove that and add the code but i am not sure if it will work correctly or not.
if it dont just go back and delete the template and it will automatically go back to the default.
kirk
kirk
Forumaster

Male Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

/me /you Empty Re: /me /you

Post by blindbat1457 August 11th 2010, 10:46 pm

So this is something to throw in the suggestions category I guess.
blindbat1457
blindbat1457
Forumember

Male Posts : 667
Reputation : 6
Language : English
Location : Santa Clarita, CA

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum