REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MyBB MyCode - Thread Closed [RELEASE]
#1
Hello everyone, this is my first MyCode that I've made myself from nothing and It brings me great pleasure to release it here, now you've seen a moderator warning but I've never seen a closed thread one. Now hey I'm not the best MyCode maker but it's quite a nice idea from my point of view.

Preview: http://pspcheats.us/showthread.php?tid=16&pid=19#pid19

Title:
Topic Closed

Short Description:
This is a MyCode to act like a warning when you close threads.

Regular Expression:
\[close\](.*?)\[/close\]
Replacement:
Code:
<style> .code{font-family: Lucida Console; color: #00FFFF; background-color: #E42217; padding: 2px; width:70%; margin: 0px auto 0px auto; /*overflow: auto; height: 200px;*/} </style> <table width="55%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr> <td><span class="smallfont"><strong><font color="#00FFFF"></font></span></td> </tr> <tr> <td class="code"><centre></centre><font color="#00FFFF">Sorry this topic has been closed, the topic could of been closed for a various of reasons, please consult a member of the team if you think this is a mistake.</font></td> <tr> </table>

Enabled:
Yes

I hope this helps you.
Reply
#2
I guess this is a nice tutorial but you have writen the regular expression incorrectly.

The (.*?) is to signify that the user who uses the code can add custom text to the end result. Example when you use the code tabs.
Ive tested your mycode and due to the fact that your replacement code doesnt have an custom varibles ($1) in it, the text put between the [close] tags will not display and it therefore you do not need it and the closing tag.

I advise that you remove the (.*?) and the final close tag so you just have to type [close] to show the message and not have to bother with anything else which doesnt change the end result
The new Regular Expression should be: \[close\]

Now when you type [close] you will get exactly the same, just without having to type the rest.

My Closed Visual:
   

-

Adding a reason to the message

To add more customizability, you could change your replacement code to:
Code:
<style> .code{font-family: Lucida Console; color: #00FFFF; background-color: #E42217; padding: 2px; width:70%; margin: 0px auto 0px auto; /*overflow: auto; height: 200px;*/} </style> <table width="55%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr> <td><span class="smallfont"><strong><font color="#00FFFF"></font></span></td> </tr> <tr> <td class="code"><centre></centre><font color="#00FFFF">Sorry this topic has been closed because $1, please consult a member of the team if you think this is a mistake.</font></td> <tr> </table>

Notice the $1.

Now if you use your old expression: \[close\](.*?)\[/close\]
you will need to type: [close]the problem has been resolved[/close]

This will then display the message:
Sorry this topic has been closed because the problem has been resolved, please consult a member of the team if you think this is a mistake.

-

The power of MyCode is endless ... almost.

Reply
#3
Thanks! I don't fancy going round all the sites and changing it, it works pretty fine without removing anything. You've just told me a very interesting fact, thank's very much!
Reply
#4
ok, it will just reduce the amount of typing you and your moderators will have to do.
Reply
#5
That's the whole idea of the MyCode, but that's a lot more helpful for more MyCodes I'm going to create! Very nice guy +rep Smile
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Redtube MyCode Kaleb 5 3,417 Oct 19, 2017, 08:27 AM
Last Post: wtf11
  [Release] RepFuck Button Oliver Evans 140 62,942 Jun 29, 2017, 06:08 PM
Last Post: juv3
Exclamation [RELEASE] Hide Section v1.0 Oliver Evans 31 20,031 Jan 27, 2015, 09:58 AM
Last Post: L34XXOR
  [RELEASE] [BETA] - MyBB Multiforums Mod for MyBB 1.6.6 BMR777 3 4,414 Apr 12, 2014, 10:33 AM
Last Post: Ace700
  "Your Thread" Plug-in? Oliver Evans 10 5,160 Oct 13, 2013, 05:08 PM
Last Post: Persona

Forum Jump:


Users browsing this thread: 1 Guest(s)