The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Automatically embedding Tweets
I already have the following plugin installed on my forum:
Code:
$embed_player = ' <table widht="300" align="center" class="tborder" > <tr><td class="alt1"> <iframe src="http://vine.co/v/\\4/card" frameborder="0" width="300" height="300"></iframe> </td> </tr> </table> '; $post['message'] = preg_replace('#(<a href="http://vine.co)?/(embed/([-|~_0-9A-Za-z]+)|v\/([-|~_0-9A-Za-z]+)&?.*?)">(http://vine.co)?/(embed/([-|~_0-9A-Za-z]+)|v\/([-|~_0-9A-Za-z]+)&?.*?)<\/a>#i', $embed_player, $post['message']); We have a Twitter BBCode which you do [Twitter]TWEET ID[/Twitter] but this is a painful process. For our users. But rather just would post their URL to tweet (e.g. https://twitter.com/name/status/tweet-ID ) and would auto embed. Only Tweet ID is needed for the bbcode below Code:
<div> <script type="text/javascript"> function loadx(data) { document.write(data.html); } </script> <script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id={param}&callback=loadx"></script> <div class="twitter" onLoad="loadx().html"/> </div> </div> <div style="clear:both;"></div> --------------- Added [DATE]1458246420[/DATE] at [TIME]1458246420[/TIME] --------------- tried something along the lines of Code:
$embed_player = ' <div> <script type="text/javascript"> function loadx(data) { document.write(data.html); } </script> <script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id=\4&callback=loadx"></script> <div class="twitter" onLoad="loadx().html"/> </div> </div> <div style="clear:both;"></div> '; $post['message'] = preg_replace('#(<a href="http://twitter.com)?/[\w-]+|+/status[es]*\/([\d]+)]+)&?.*?)">(http://twitter.com)?/[\w-]+|+/status[es]*\/([\d]+)]+)&?.*?)<\/a>#i', $embed_player, $post['message']); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|