Nifty MyBB URL Tricks 08-17-2014, 02:43 PM
#1
So, today I figured out something relatively neat. I've used this trick in the Upgrade system so that people are sent to notify me of when they purchase an upgrade. I'll show you this trick, as it could be useful to people holding contests or selling things. I have found it very useful.
Just Text
Say I want you to reply to a thread following a particular format, asking for your username and post count.
I could have you visit a URL (https://www.sinister.ly/newreply.php?tid=29149) and provide you with the format. But, what if I want to include the format in the URL, so I don't have to send you it? Unless you know about URL encoding, you might ask "Well, how are you going to add the new line?" To accomplish this, I could have you visit the following URL:
(Click)
Spaces: %20 is a URL encoded space. If you put %20, there will be a space.
New lines: %0A is a URL encoded new line. If you put %0A, whatever comes afterward will be on a new line. Note: %0A is actually line feed.
Pretty simple, right?
More Than Just Text
However, I might want to add font colors, line breaks, and other stuff to the formatting. I might want something more complicated like this:
That's a bit more complicated, right? Thankfully, URL encoding allows us to do this without a huge hassle. I could have you go to this URL:
(Click)
Spaces: %20 is a URL encoded space. If you put %20, there will be a space.
New lines: %0A is a URL encoded new line. If you put %0A, whatever comes afterward will be on a new line. Note: %0A is actually line feed.
Brackets: %5B is a URL encoded left bracket ([). %5D is a URL encoded right bracket (]). If you put %5B or %5D, there will be brackets.
Number Signs: %23 is a URL encoded number sign. If you put a %23, there will be a number sign.
Equal Signs: %3D is a URL encoded equal sign. If you put a %3D, there will be an equal sign.
Spacing: %0A%0D is a URL encoded spacing. If you put a %0A%0D, there will be spacing. Note: %0A is actually line feed and %0D is actually carriage return.
Have other symbols that just aren't behaving in your URLs?
Check what the URL encoded version of the symbols are. w3schools.com has great information: http://www.w3schools.com/tags/ref_urlencode.asp
I hope this information has been useful to you guys.
If you have any questions or concerns, let me know.
Just Text
Say I want you to reply to a thread following a particular format, asking for your username and post count.
Quote:Username:
Post count:
Code:
Username:
Post count:I could have you visit a URL (https://www.sinister.ly/newreply.php?tid=29149) and provide you with the format. But, what if I want to include the format in the URL, so I don't have to send you it? Unless you know about URL encoding, you might ask "Well, how are you going to add the new line?" To accomplish this, I could have you visit the following URL:
(Click)
Code:
https://www.sinister.ly/newreply.php?tid=29149&message=Username:%0APost%20Count:New lines: %0A is a URL encoded new line. If you put %0A, whatever comes afterward will be on a new line. Note: %0A is actually line feed.
Pretty simple, right?
More Than Just Text
However, I might want to add font colors, line breaks, and other stuff to the formatting. I might want something more complicated like this:
Quote:Hi, you asked me for my username and post count.
Username:
Post Count:
Do you need anything else?
Code:
[color=#FF0000]Hi, you asked me for my [color=#32CD32][i]username[/i][/color] and [color=#32CD32][i]post count[/i][/color].
[color=#FF0000]Username:[/color]
[color=#FF0000]Post Count:[/color]
Do you need anything else?That's a bit more complicated, right? Thankfully, URL encoding allows us to do this without a huge hassle. I could have you go to this URL:
(Click)
Code:
https://www.sinister.ly/newreply.php?tid=29149&message=Hi,%20you%20asked%20me%20for%20my%20%5Bcolor%3D%2332CD32%5D%5Bi%5Dusername%5B/i%5D%5B/color%5D%20and%20%5Bcolor%3D%2332CD32%5D%5Bi%5Dpost
%20count%5B/i%5D%5B/color%5D.%0A%0D%5Bcolor%3D%23FF0000%5DUsername:%5B/color%5D%0A%5Bcolor%3D%23FF0000%5DPost%20Count:%5B/color%5D%0A%0DDo%20you%20need%20an
ything%20else?New lines: %0A is a URL encoded new line. If you put %0A, whatever comes afterward will be on a new line. Note: %0A is actually line feed.
Brackets: %5B is a URL encoded left bracket ([). %5D is a URL encoded right bracket (]). If you put %5B or %5D, there will be brackets.
Number Signs: %23 is a URL encoded number sign. If you put a %23, there will be a number sign.
Equal Signs: %3D is a URL encoded equal sign. If you put a %3D, there will be an equal sign.
Spacing: %0A%0D is a URL encoded spacing. If you put a %0A%0D, there will be spacing. Note: %0A is actually line feed and %0D is actually carriage return.
Have other symbols that just aren't behaving in your URLs?
Check what the URL encoded version of the symbols are. w3schools.com has great information: http://www.w3schools.com/tags/ref_urlencode.asp
I hope this information has been useful to you guys.
If you have any questions or concerns, let me know.











![[Image: 7ajmN5P.jpg]](https://i.imgur.com/7ajmN5P.jpg)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)



