The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

/me /you

View previous topic View next topic Go down

/me /you

Post by blindbat1457 on 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
Forumember

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

Back to top Go down

Re: /me /you

Post by blindbat1457 on 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
Forumember

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

Back to top Go down

Re: /me /you

Post by kirk on 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
Forumaster

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

Back to top Go down

Re: /me /you

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

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

blindbat1457
Forumember

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

Back to top Go down

View previous topic View next topic Back to top


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