MyBB Community Forums

Full Version: Creating Custom MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
Need help with part this part of the code:

FlashVars="viewkey=8616c1559ab4221b3910"

the actual link leads to a hidden .flv file.

8616c1559ab4221b3910/127544.flv&viewkey=8616c1559ab4221b3910

how do I create the replacement to include the hidden stuff on a webpage?
(2008-07-06, 11:33 AM)lifeguard Wrote: [ -> ]Ok, thnx Lex!
Is there some MYcode, for google?

So when a user post [google]Mybb[/google], Mybb is a clickable link to googlesearch?

Here is the my Google Mycode. you can use it:

\[google\](.*?)\[/google\]

replacement:

<a href="http://www.google.com/search?q=$1&sourceid=ie7&rls=com.microsoft:en-US&ie=utf8&oe=utf8">$1</a>

Enjoy. Wink
(2008-08-09, 03:28 PM)primster7 Wrote: [ -> ]
(2008-08-09, 02:32 PM)imei Wrote: [ -> ]
(2008-08-08, 06:05 AM)primster7 Wrote: [ -> ]How can I get java script to work with mycode?

I heard that as a default mybb changed the script code to something else.

Is there a workaround that is still secure?

As a security prevention manner, it strongly recommended that any JS related things should not be made with user outputs unless it properly and accurately validated. So I also recommend you to leave this feature unless you knew that what are you doing.

I'm willing to take the chance. How do I get around this and get javascript to work in a post?
PTRN:\[script\](.*?)\[/script\]
RPLCMNT:<script>$1</script>
IT IS NOT SECURE AND STRONGLY RECOMMENDED NOT TO USE IT.

(2008-08-13, 08:54 PM)primster7 Wrote: [ -> ]Need help with part this part of the code:

FlashVars="viewkey=8616c1559ab4221b3910"

the actual link leads to a hidden .flv file.

8616c1559ab4221b3910/127544.flv&viewkey=8616c1559ab4221b3910

how do I create the replacement to include the hidden stuff on a webpage?
need more info please.
Imei - I sent you a PM.
This thread helps..
Can someone please, show any example of using an 'available' MyBB variable in custom MyCode?

Thank you

Edit: Can't be done / requires a plugin.
Quick question here's an example

\[codebox\](.*?)\[/codebox\]

that works fine but strange enough so does the following
on all internet browsers

\[codebox\](.*?)\[/codebox] <-- without the extra \]

Why is it necessary to have the extra \ on the end if
everything works across all browsers like the above?

test yourself full code

\[codebox\](.*?)\[/codebox]

In fact this also works perfectly

\[codebox\](.*)\[/codebox]

<p style="border: 1px solid black; width: 200px;">$1 </p>

can someone let me know what this extra \ does?
someone in the previous posts i think page 5 was asking how to use mycode as a table

\[table\](.*?)\[/table\]

<table class= or id= [your selector for table design]>
<tr>
<td>$1</td>
</tr>
</table>

if you like to do it the correct way then use thead tbody tfoot but i never have.
Is it possible to have some PHP code as replacement with the current form? and if not, how I can do this myself?

Basically what I want to do is this:

[sp8][/sp]

If there's and 8 there print Series 8, and if it's only [sp][/sp] don't print the Series bit, i've tried doing this with regex, but no luck, and it could easily be done with PHP.

Thanks.
Bump, but as this was referred to, and people may be using this, I would like to mention that the "(.*?)" regular expression can be rather dangerous if not used correctly.
I specifically made the following plugin to help people make "proper" expressions without compromising security:
http://mybbhacks.zingaburga.com/showthread.php?tid=269

Hopefully MyBB will have something similar in the future.
(2010-04-27, 10:30 AM)Yumi Wrote: [ -> ]Bump, but as this was referred to, and people may be using this, I would like to mention that the "(.*?)" regular expression can be rather dangerous if not used correctly.
I specifically made the following plugin to help people make "proper" expressions without compromising security:
http://mybbhacks.zingaburga.com/showthread.php?tid=269

Hopefully MyBB will have something similar in the future.

Awesome...thank you so much Yumi !
Sorry if this is too old a thread to post in, but it seemed the right nplace?

I've been using a custom bbcode in phpBB to wrap text around images in posts which works brilliantly!
I tried to rewrite the bbcode to suit MyCode but not having any luck.

Could someone help?

This is the working bbcode in phpBB..

Regular expression:
[imgwrap={TEXT1}]{TEXT2}[/imgwrap]
Replacement:
<div style="float:{TEXT1};margin: 2px 2px 6px 6px;"><img src="{TEXT2}"></div>

So in MyBB I have tried this..

Regular expression:
\[imgwrap=(.*?)\](.*?)\[/imgwrap\]
Replacement:
<div style="float:$1;margin: 2px 2px 6px 6px;"><img src="$2"></div>

But, no luck.
What have I missed?
Pages: 1 2 3 4 5 6 7 8 9