Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
User avatar
HGN
Former Team Member
Posts: 4706
Joined: Wed Dec 03, 2008 1:53 pm
Location: The Netherlands
Name: Alfred
Contact:

Re: Custom BBCodes

Post by HGN » Thu Jul 19, 2012 10:09 am

You're right, I didn't read carefully enough.

Cery
Registered User
Posts: 3
Joined: Wed Jul 18, 2012 7:10 pm

Re: Custom BBCodes

Post by Cery » Thu Jul 19, 2012 2:27 pm

So there is no wayto do what I want?

Well actually thanks for trying it @all
And also thanks for cleaning up my messed Code :)

xCausxn
Registered User
Posts: 3
Joined: Sun Jul 15, 2012 1:04 pm

Re: Custom BBCodes

Post by xCausxn » Sat Jul 21, 2012 10:41 pm

Hi What would i need to do to use this code in posts

Code: Select all

<button type="button" onclick="CCPEVE.showContract(30003410, 14)">Show Contract</button>

User avatar
Lumpy Burgertushie
Registered User
Posts: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Sun Jul 22, 2012 1:23 am

xCausxn wrote:Hi What would i need to do to use this code in posts

Code: Select all

<button type="button" onclick="CCPEVE.showContract(30003410, 14)">Show Contract</button>
what does this do and why would you want everyone to be able to do it all the time?

that is what bbcodes are for mainly. creating something that everyone can use that might be useful for posting something often.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

xCausxn
Registered User
Posts: 3
Joined: Sun Jul 15, 2012 1:04 pm

Re: Custom BBCodes

Post by xCausxn » Sun Jul 22, 2012 5:25 pm

Ok Sorry if wrong forum but how would i use this code in a post anyway sorry??

User avatar
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: Custom BBCodes

Post by Pony99CA » Sun Jul 22, 2012 6:10 pm

xCausxn wrote:What would i need to do to use this code in posts

Code: Select all

<button type="button" onclick="CCPEVE.showContract(30003410, 14)">Show Contract</button>
Are those numbers ever going to change? If not, do the following:

BBCode usage

Code: Select all

[contract][/contract]
HTML replacement

Code: Select all

<button type="button" onclick="CCPEVE.showContract(30003410, 14)">Show Contract</button>
(The exact same code that you pasted.)

If the numbers will change, something like the following should work:

BBCode usage

Code: Select all

[contract]{NUMBER1},{NUMBER2}[/contract]
HTML replacement

Code: Select all

<button type="button" onclick="CCPEVE.showContract({NUMBER1}, {NUMBER2})">Show Contract</button>
It's really not rocket science. :) Before anybody asks for BBCode help, they should at least have tried it themselves (I don't know if you tried it, of course).

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
TiredChildren
Registered User
Posts: 37
Joined: Thu Sep 10, 2009 6:25 pm
Location: Oldsmar, FL
Name: James Likeness
Contact:

Re: Custom BBCodes

Post by TiredChildren » Mon Jul 23, 2012 4:56 pm

Here's a BBCode for inserting Instagram photos in posts:

BBCode Usage:

Code: Select all

[insta]{URL}[/insta]
HTML Replacement:

Code: Select all

<img src="{URL}media/?size=l">
Help Line:

Code: Select all

Instagram Photo: [insta]Instagram URL[/insta]

User avatar
Lumpy Burgertushie
Registered User
Posts: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Mon Jul 23, 2012 8:35 pm

TiredChildren wrote:Here's a BBCode for inserting Instagram photos in posts:


HTML Replacement:

Code: Select all

<img src="{URL}media/?size=l">
I wonder what happens if someone does not copy and paste the slash at the end of the URL.

for instance, if the url is like this:

http://whatever.com/whatever/media/?size=l

and they only copy and paste this part:
http://whatever.com/whatever

then it would wind up like this:
http://whatever.com/whatevermedia/?size=l

which would not work.

can you post a real url for whatever a instagram photo is?

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

User avatar
TiredChildren
Registered User
Posts: 37
Joined: Thu Sep 10, 2009 6:25 pm
Location: Oldsmar, FL
Name: James Likeness
Contact:

Re: Custom BBCodes

Post by TiredChildren » Tue Jul 24, 2012 1:06 pm

Instagram seems to add the slash to the url. Here's a link:

http://instagram.com/p/NcnZdUn1-Y/

I could change the BBCode to be {simpletext} and have the user input the code after the p/, if need be.

User avatar
Lumpy Burgertushie
Registered User
Posts: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Tue Jul 24, 2012 3:18 pm

TiredChildren wrote:Instagram seems to add the slash to the url. Here's a link:

http://instagram.com/p/NcnZdUn1-Y/

I could change the BBCode to be {simpletext} and have the user input the code after the p/, if need be.
if that is what the instagram url looks like then what is all of this for:
media/?size=l
shouldn't the code be: {INDENTIFIER}
and the replacement be:
http://instagram.com/p/{INDENTIFIER}

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

User avatar
TiredChildren
Registered User
Posts: 37
Joined: Thu Sep 10, 2009 6:25 pm
Location: Oldsmar, FL
Name: James Likeness
Contact:

Re: Custom BBCodes

Post by TiredChildren » Wed Jul 25, 2012 2:02 pm

Oh, I see what you're asking. I created a code for Instagram because they put their photos into the background via CSS, so you can't right-click on an image and get its URL. They have an API though, that if you take the URL of the photo's page and add media/ to the end, you'll get the photo file. The default size for the API is the smaller size though, and putting ?size=l on the end gives you the large version of the photo. So that's the reason for all the extra media/?size=l

All Instagram photo pages have a url of http://instagram.com/p/{identifier}/, so I could have the BBCode be [insta]{identifier}[/insta] and have the replacement be http://instagram.com/p/{identifier}/media/?size=l

User avatar
Lumpy Burgertushie
Registered User
Posts: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Wed Jul 25, 2012 8:49 pm

TiredChildren wrote:Oh, I see what you're asking. I created a code for Instagram because they put their photos into the background via CSS, so you can't right-click on an image and get its URL. They have an API though, that if you take the URL of the photo's page and add media/ to the end, you'll get the photo file. The default size for the API is the smaller size though, and putting ?size=l on the end gives you the large version of the photo. So that's the reason for all the extra media/?size=l

All Instagram photo pages have a url of http://instagram.com/p/{identifier}/, so I could have the BBCode be [insta]{identifier}[/insta] and have the replacement be http://instagram.com/p/{identifier}/media/?size=l
looks good to me. however be sure you make it {INDENTIFIER} in all caps.

test it and see if it works for you.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

User avatar
TiredChildren
Registered User
Posts: 37
Joined: Thu Sep 10, 2009 6:25 pm
Location: Oldsmar, FL
Name: James Likeness
Contact:

Re: Custom BBCodes

Post by TiredChildren » Thu Jul 26, 2012 8:35 pm

Yup, that works! Thanks for the suggestions! Here's the final BBCode if anyone's interested:

BBCode Usage:

Code: Select all

[insta]{IDENTIFIER}[/insta]
HTML Replacement:

Code: Select all

<img src="http://instagram.com/p/{IDENTIFIER}/media/?size=l">
Help Line:

Code: Select all

Instagram Photo: [insta]xxxxxxx[/insta] (For example: http://instagram.com/p/xxxxxxx/)

Jeremia
Registered User
Posts: 1
Joined: Sat Jul 28, 2012 8:58 pm

Re: Custom BBCodes

Post by Jeremia » Sat Jul 28, 2012 9:17 pm

Hey there... I realize that many people have come up with their own way of posting youtube videos, and I figured posting a new topic is a waste, so here's something I came up with.

this way requires you are able to make a new php file..
in this new php file, have this text..

Code: Select all

<?php
//Simple code for returning an "embed" link, for youtube.
//works mostly with the iframe method.
if(isset($_GET['url'])) {
$url = $_GET['url'];
//Strip out the url itself,
//
$url = str_replace("https://", "", $url);
$url = str_replace("http://", "", $url);
$url = str_replace("www.", "", $url);
//
$url = str_replace("youtube.com/watch?v=", "", $url);
$url = str_replace("youtube.com/v/", "", $url);
$url = str_replace("youtu.be/", "", $url);



//probably in effecient, but i'm too lazy to look up a better way.. so...
$params = split("&", $url);
$embed = $params[0];
//Basically, it'll split the remnants by the "&"s found in the string. We only need the first instance, as the rest
//are just arguements for the video, that aren't compatible in this form.


header("Location: http://www.youtube.com/embed/".$embed );
//and viola!
}; ?>
From there you can add the bbcode to your forum.

BBCode usage:

Code: Select all

[youtube]{SIMPLETEXT}[/youtube]
HTML Replacement:

Code: Select all

<iframe width="960" height="720" src="phpfile.php?url={SIMPLETEXT}" frameborder="0" allowfullscreen></iframe>
phpfile.php is the file that you're using. May be any file really.
If you're not able to create a php file, then you could use mine, http://theatrebox.net/Youtube
so basically the HTML Replacement would be

Code: Select all

<iframe width="960" height="720" src="http://theatrebox.net/Youtube?url={SIMPLETEXT}" frameborder="0" allowfullscreen></iframe>
This way works with either the identifier, or the entire URL... It's basically 100% user-friendly, for your users (probably not for who ever's installing it xD)

modify as you wish!

lunargamingnet
Registered User
Posts: 1
Joined: Sun Jul 29, 2012 11:04 pm

Re: Custom BBCodes

Post by lunargamingnet » Sun Jul 29, 2012 11:08 pm

Hey all,

Looking for a custom bbcode to embed twitch.tv livefeeds... I noticed there's every other livestream code in the thread except for twitch.tv! Anyone help?

Locked

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 5 guests