BBcode MediaSites Package [Deleted]

I'm really not sure where else to ask this, so I'm going to post it here. I've added the necessary php callback to get the bbcode tweet embed to work. However, I'm having a problem that apparently seems to be pretty common in that once the tweet is embedded in a post, it ends up several lines down for the top of the post. Has anyone figured out any sort of fix to this? I tried using CSS which was suggested in one of the closed bbcode threads, but that screwed up tweets that were embedded further down in articles and such so that they covered up text. So basically it seems that tweet embeds at the top of a post show up way down from the top of the post, but if you embedded several lines down from the top, they then align just fine. Of course the twitter devs have made all of the styling !important so I don't know what the heck to do. Anyone have any suggestions? Here's a link to what it looks like, posted in one of the closed threads by stewart1champ: http://xenforo.com/community/threads/add-more-video-sites-bb-code-media.7608/page-19
 
i have many workarounds for this, most of them are hackish and they rely on components that not all users of the web use with their browser of choice, since it is not cross browser compatible to a greater degree I elect not to post something that I would even ridicule myself for posting as a suggestion for others to follow...


I have a lot of updates to do to this addon, one of which includes removing the twitter embedder as I am 80% fragmentally done building a full twitter addon type of thing with a bunch of stuff (http://xenxero.com/twitter/alt/?tweeter=cern * use =AnyTwitterAccount to try out your favorite or your own * <-standalone demo for timeline bbcode and small scale basic version of another component for the twitter addon I am doing ) ,

the thing you are looking to do will be removed and be part of the twitter addon ... though I have fixed the problem and completely redid the thing in a way that does not make me rely on twitter for styling I am refraining from adding it as it is not optimal to keep and release my updates for it as is...


Is there a fix for this yet?
taHH4c.png

adhqSz.png

Yes but not something that is ready for release...that has to do with the way twitter widget js works.


What you see in the first place is something I made because I don't want people posting on twitter as a replacement to posting on the forum it is on...that was my logic in the first place at any rate...

Anyways...if I didn't do that which you see in the first image , it would look like crap until the twitter script ran which is something that is out of my control....

So back to my first sentence....yes there is a fix...i just need to attack one more thing on it and I can be confident that it will need no more changes (so long as the json/xml stuff remains the same @ twitter). When this change is applied it will remove this bbcode from this addon....and this bbcode will actually be it's own complete addon because of what I think should be done to make this bbcode worth keeping for a production environment.

I also need to update the addon...as someone asked about twitch and I am pretty sure I did it and like 5 or 6 others ones...but then again I also thought I already posted those lol.



Anyone interested in seeing this happen...hit me up on friday night to remind me about this for the weekend...otherwise i will forget and think I did it...again.
 
Looking forward to an update on this.

:D

Noticed that firebug tells me there is a SyntaxError: syntax error

bbms_twitter_XFormer

Code:
<script>$(".twitter-tweet").children("p").css("border-bottom", "3px double @primaryLighterStill"), ;</script>

Seemed to be the issue and since you plan on getting rid of the twitter part any ways....

I had to basically comment out

<xen:comment> </xen:comment>

Both

bbms_twitter_XFormer
bbms_twitter_css

Completely. Never did use the twitter part any ways.

This resolved it.
 
Looking forward to an update on this.

:D

Noticed that firebug tells me there is a SyntaxError: syntax error

bbms_twitter_XFormer

Code:
<script>$(".twitter-tweet").children("p").css("border-bottom", "3px double @primaryLighterStill"), ;</script>

Seemed to be the issue and since you plan on getting rid of the twitter part any ways....

I had to basically comment out

<xen:comment> </xen:comment>

Both

bbms_twitter_XFormer
bbms_twitter_css

Completely. Never did use the twitter part any ways.

This resolved it.

Adam, can you elaborate on this? The twitter bbcode is vital for me and I'd really like to fix this issue. I don't see any errors using google web tools. I'll happily use a hack workaround until I can figure something else out. The thing that seems really odd to me is that on Russ' mobile theme, there is no issue at all with the twitter bbcode. Thanks for the help.
 
Adam, can you elaborate on this? The twitter bbcode is vital for me and I'd really like to fix this issue. I don't see any errors using google web tools. I'll happily use a hack workaround until I can figure something else out. The thing that seems really odd to me is that on Russ' mobile theme, there is no issue at all with the twitter bbcode. Thanks for the help.
The root cause of Syntax Error's are like trying to find a golden needle in large pile of golden hey.

I'm not exactly sure what caused it really, but I use Firebug on Firefox and not any of the tools on Google Chrome. I also was using the default XenForo skin.

My quick fix was simply to turn off that Twitter code by commenting it out.
 
There already is a BBCode for IMDB that I made under my old persona and posted in this post: http://xenforo.com/community/threads/bb-code-manager-bb-code-xml-repository.8470/page-12#post-284910


Do you have it implemented at this point.....or does it still need to be worked into XF ?



either way if you or anyone else wants to hook up over the weekend and help me test all the bbcodes I will push an update including whatever is tested and working as well as any changes to existing codes. The more the merrier.
 
Today I want to release my bbcode of Twitch.TV. In your package I know that you had that, but it only supports live stream channel but not videos.

Admin CP -> Home -> BB Code Media Sites -> Add BB Code Media Site

Media Site ID: twitchtv

Site Title: Twitchtv

Site URL: http://www.twitch.tv

Match URLs:
HTML:
#http://www\.twitch\.tv/(?P<id>[\-a-z0-9_]+/[\-a-z0-9_]+/[\-a-z0-9_]+)(\?.*)?$#siU
#http://www\.twitch\.tv/(?P<id>[\-a-z0-9_]+)(\?.*)?$#siU

Embed HTML:

Code:
<see html callback>
Then under Advanced Options:

Tick Use 'Match URLs' as PCRE regular expressions

Embed HTML Callback: MediaSites_Twitchtv::buildEmbed

And you need to create the following directory/file (also attached to this post):

library/MediaSites/Twitchtv.php

PHP:
<?php

class MediaSites_Twitchtv

{

	public static function buildEmbed($mediaKey, array $site)

	{

		// CAPTURE WEB PAGE

		$pageHtml = file_get_contents('http://www.twitch.tv/' . $mediaKey );

		// ISOLATE THE TRAILER ID FROM THE META TAG

		if(preg_match('#<meta property="og:video" content="http://www\.twitch\.tv/widgets/archive_facebook_embed_player\.swf\?channel\=(?P<id1>[a-z0-9-_=+^%]+)&amp;archive_id\=(?P<id2>[a-z0-9-_=+^%]+)" />#si', $pageHtml, $match))

		{

			// DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLE __MEDIAKEY__

			$embedHtml = '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"> 
			<param name="allowscriptaccess" value="always">
			<param name="allowNetworking" value="all">
			<param name="allowScriptAccess" value="always">
			<param name="allowFullScreen" value="true">
			<param name="wmode" value="transparent">
			<param name="flashvars" value="archive_id=__MEDIAKEY2__&channel=__MEDIAKEY1__&hostname=www.twitch.tv">
			</object>';

			// MAKE THE REPLACEMENTS

			$finalHtml = str_replace(array('__MEDIAKEY1__', '__MEDIAKEY2__'), array($match['id1'], $match['id2']), $embedHtml);

			// RETURN THE FINISHED HTML

			return $finalHtml;

		}
		if(preg_match('#<meta property="og:video" content="http://www\.twitch\.tv/widgets/live_facebook_embed_player\.swf\?channel\=(?P<id>[a-z0-9-_=+^%]+)" />#si', $pageHtml, $match))

		{

			// DEFINE GENERIC EMBED HTML WITH REPLACEMENT VARIABLE __MEDIAKEY__

			$embedHtml = '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/live_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"> 
			<param name="allowscriptaccess" value="always">
			<param name="allowNetworking" value="all">
			<param name="allowScriptAccess" value="always">
			<param name="allowFullScreen" value="true">
			<param name="wmode" value="transparent">
			<param name="flashvars" value="channel=__MEDIAKEY__&hostname=www.twitch.tv">
			</object>';

			// MAKE THE REPLACEMENTS

			$finalHtml = str_replace(('__MEDIAKEY__'), ($match['id']), $embedHtml);
			// RETURN THE FINISHED HTML

			return $finalHtml;

		}

		// RETURN NOTHING IF NO MATCH

		return '123';

	}

}
 

Attachments

Hey duydangle, I tried your code and it correctly gets the video but it is wrapped in a link to the video on twitch tv so it opens a link every time I press play, pause, or full screen.

Also, you should change the match urls so it works with the various subdomains, en.twitch.tv, nl.twitch.tv.
 
I can't seem to expand the ZIP file for this add-on. I'm on a mac running the latest OS and I get an error that says Unable to expand... (Error 20 - Not a directory.). Other zips open fine.

I really only need the Flickr BB Code, is that code available on it's own?
 
does MLG TV still work from this? I am getting a javascript error... Thanks for the help!

Also, I couldnt get the above code "twitch tv" to work... Tried it but no dice. Whenever I embedded the file, it just placed the numbers "123" instead fo the stream. I have no idea what that means but yea, didn't work

Today I want to release my bbcode of Twitch.TV. In your package I know that you had that, but it only supports live stream channel but not videos.

Admin CP -> Home -> BB Code Media Sites -> Add BB Code Media Site

Media Site ID: twitchtv

Site Title: Twitchtv

...
 
Hi Gametrailers has changed their site. It looks totally different now and the embed codes no longer work.

Can you please update this?
 
I can do vh1 but it has a lot of unique embed structures to account for which takes research time so I can't do it at this minute...maybe when I take a break from fixing up a style or something.

On another note I have updated a lot of bbcodes and there is only a few left to check and fix so when I can spare the time I will update this addon.
 
I can do vh1 but it has a lot of unique embed structures to account for which takes research time so I can't do it at this minute...maybe when I take a break from fixing up a style or something.

On another note I have updated a lot of bbcodes and there is only a few left to check and fix so when I can spare the time I will update this addon.
I am using a very old version that I think was before the resource section... will it update to this file? Also I think my Amazon code was customized so that amazon embedded links are auto affiliated to use my Amazon associates code. Would you be able to help me make that happen again?
 
I can do vh1 but it has a lot of unique embed structures to account for which takes research time so I can't do it at this minute...maybe when I take a break from fixing up a style or something.

On another note I have updated a lot of bbcodes and there is only a few left to check and fix so when I can spare the time I will update this addon.

thanks so much
 
Top Bottom