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.

/you and /me code.

View previous topic View next topic Go down

Your opinion?

0% 0% 
[ 0 ]
100% 100% 
[ 1 ]
 
Total Votes : 1

/you and /me code.

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

So basically this replaces /me by the username of the poster and replaces /you by the username of the reader.
The provided php code is below so if this does get approved it is easy on the tech Smile

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);
                  }
[/quote]

blindbat1457
Forumember

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

Back to top Go down

Re: /you and /me code.

Post by Caihlem on August 11th 2010, 11:04 pm

If this is for posts, there's already regular php (censored on this forum).
If it's for the ChatBox, I'd rather not have my name randomly appear

Caihlem
Energetic

Male Posts : 8969
Reputation : 329
Language : English, French & Female
Location : You can't fly like the phenix

Back to top Go down

Re: /you and /me code.

Post by blindbat1457 on August 11th 2010, 11:08 pm

@Caihlem wrote:If this is for posts, there's already regular php (censored on this forum).
If it's for the ChatBox, I'd rather not have my name randomly appear

I am confused. Like you create a topic that says "/you read this" and you looked at it, it would say Caihlem read this but then if I looked at it, it would say Blindbat1457 read this.

Then if you type /me and I read it would say Blindbat1457 read this. I think you get the point.

blindbat1457
Forumember

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

Back to top Go down

Re: /you and /me code.

Post by LH Justin on August 12th 2010, 1:41 am

@blindbat1457 wrote:
@Caihlem wrote:If this is for posts, there's already regular php (censored on this forum).
If it's for the ChatBox, I'd rather not have my name randomly appear

I am confused. Like you create a topic that says "/you read this" and you looked at it, it would say Caihlem read this but then if I looked at it, it would say Blindbat1457 read this.

Then if you type /me and I read it would say Blindbat1457 read this. I think you get the point.
There is a variable for this.

Code:
{USERNAME}
Outcome: Using php in posts is called being a smart ass... Stop it

I just love the censor. Smile
If the code wasn't censored it would say your name.

Code:
{USERLINK}
Outcome: Guest

LH Justin
Hyperactive

Male Posts : 3686
Reputation : 121
Language : English, HTML, CSS, JavaScript
Location : United States

http://www.creative-nation.net

Back to top Go down

Re: /you and /me code.

Post by blindbat1457 on August 12th 2010, 4:31 am

@LH Justin wrote:
@blindbat1457 wrote:
@Caihlem wrote:If this is for posts, there's already regular php (censored on this forum).
If it's for the ChatBox, I'd rather not have my name randomly appear

I am confused. Like you create a topic that says "/you read this" and you looked at it, it would say Caihlem read this but then if I looked at it, it would say Blindbat1457 read this.

Then if you type /me and I read it would say Blindbat1457 read this. I think you get the point.
There is a variable for this.

Code:
{USERNAME}
Outcome: Using php in posts is called being a smart ass... Stop it

I just love the censor. Smile
If the code wasn't censored it would say your name.

Code:
{USERLINK}
Outcome: Guest

Okay Guest doesn't work for me, however Using php in posts is called being a smart ass... Stop it does. Also this doesn't work for the title topic. scratch

blindbat1457
Forumember

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

Back to top Go down

Re: /you and /me code.

Post by LH Justin on August 12th 2010, 4:44 am

@blindbat1457 wrote:
@LH Justin wrote:
@blindbat1457 wrote:
@Caihlem wrote:If this is for posts, there's already regular php (censored on this forum).
If it's for the ChatBox, I'd rather not have my name randomly appear

I am confused. Like you create a topic that says "/you read this" and you looked at it, it would say Caihlem read this but then if I looked at it, it would say Blindbat1457 read this.

Then if you type /me and I read it would say Blindbat1457 read this. I think you get the point.
There is a variable for this.

Code:
{USERNAME}
Outcome: Using php in posts is called being a smart ass... Stop it

I just love the censor. Smile
If the code wasn't censored it would say your name.

Code:
{USERLINK}
Outcome: Guest

Okay Guest doesn't work for me, however Using php in posts is called being a smart ass... Stop it does. Also this doesn't work for the title topic. scratch
Well, I don't think it's needed in topic titles, for various reasons.

LH Justin
Hyperactive

Male Posts : 3686
Reputation : 121
Language : English, HTML, CSS, JavaScript
Location : United States

http://www.creative-nation.net

Back to top Go down

Re: /you and /me code.

Post by blindbat1457 on August 12th 2010, 4:55 am

Well I wish it could but oh well. I fixed the problem. I guess we can move this topic to trash or something, didn't think about censoring.

blindbat1457
Forumember

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

Back to top Go down

Re: /you and /me code.

Post by Caihlem on August 12th 2010, 6:54 am

The problem was too many people were using the {USERNAME$} and many members where literally freaking out, hence the censor on the forum Razz

Caihlem
Energetic

Male Posts : 8969
Reputation : 329
Language : English, French & Female
Location : You can't fly like the phenix

Back to top Go down

Re: /you and /me code.

Post by Jophy on May 7th 2013, 6:33 am

Suggestion Clean up

-> Old suggestions(Please feel to create a new thread for the garbaged old suggestions)
-> Implemented suggestions
-> Suggestions which are currently suggested (Please use the SEARCH function)
-> Suggestions which are already possible
-> Unclear Suggestions

=> Please read the guidelines for the suggestion section: http://help.forumotion.com/t93899-suggestions-for-your-forums-how-to
=> Please take a look on the frequently suggested features for your forums:
http://help.forumotion.com/t79095-frequently-requested-suggestions-for-your-forums

Locked & Garbaged

Jophy

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

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