Creating Custom MyCode
shrek Wrote:nope. that didn't work either

is this wrong too ?



coz this doesn't work either..
I tested on my board and it worked successfully.

And actually, you can just use
to center the words.
lol. i found out why that url code wont work. because regular expression is wrong.
the code should be ; \[url=(.*?)\](.*?)\[\/url\] .

thanks everyone. it works now
But there is already an url mycode Confused
CraKteR Wrote:But there is already an url mycode Confused
Apparently he wants support for [url=""] but MyBB doesn't support the quotes...
Guys. I find this topice just now.
Many of you,dont note to security in Custom Tags. When you'r creating a custom tag that have some variables INSIDE of html tags, for example <a href="XXXXX" title="YYYYY">blab blab</a> you should not that XX and YY have some conditions for security reasons. they sould not have " because if so they will exploit by XSS techniques by bad guys. Also if they have [ there is a chance that nested tags became a danger of XSS hacking for your board.
So a safe custom tage have such conditions :

we wana make a tag for tooltip, so we should use <span title="XXXX">blab blab</a>
<span title="$1">$2</span>
and works well and more secure.
WDZ Wrote:
CraKteR Wrote:But there is already an url mycode Confused
Apparently he wants support for [url=""] but MyBB doesn't support the quotes...
It supports, but bad support! in fact it is converted this way: <a href="""" >blabblab</a>
and you know, it is a bad html, it can be worse if you hit by an attacker.
a good Regexp for your purpose is:
<a href="$2">$3</a>

it will support:
[u rl="blab"]xx[/url]
[u rl='blab']xx[/url]
[u rl=blab]xx[/url]
but not support: {you may not do that by mybb standard.}

NOTE NOTE: it is not still completely safe against XSS:
but there is a chance that this code if have not a trick agains fixjavascript() function of mybb, became safe...
Quote:Ah, so in the next release, my javascript will work?
That change is in 1.2.1 for your information - so you should be able to use Javascript in your custom MyCode.
Is it possible to, say, insert PHP code into a MyCode so that, for example, I could use the PHP function rand() and have the output of that function be output. When I try to set this up how it ought to look just as a script I get weird answers.
<?php  $var = rand(1,20) ?> $var
I would think based on how it looks like this works that should just put the number that was gotten from the random, but what I get is just
Am I just not getting something about PHP and/or HTML or is this something more to do with how MyCode works?
Hey, how do you add the Custom MyCode links to the Posting Pages?

Like say, Underneath the Smilies. I just made one to insert YouTube videos.

I think I made a better way for flash files, this supports width and height and is less confusing. its like this.

[flash width=WIDTH height=HEIGHT]FLASH URL[/flash]

\[flash width\=(.*?) height\=(.*?)\](.*?)\[/flash\]

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,2,0" width="$1" height="$2">
    <param name="movie" value="$3">
    <param name="quality" value="high">
    <embed src="$3" quality="high" pluginspage="" type="application/x-shockwave-flash" width="$1" height="$2">

If that doesn't work then I don't know what will.

And for Youtube Videos.

[youtube]YouTube ID Tag eg: GHfasidfs-dfu[/youtube]

The Id tag is that little jumbled up piece of text that appears at the end of the youtube Url.


<object width="425" height="350"><param name="movie" value="$1"></param><param name="wmode" value="transparent"></param><embed src="$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
How would I add mycode that would find [!HA] and replace it with a picture, like



Forum Jump:

Users browsing this thread: 1 Guest(s)