View Full Version : BB Code Enhancements - BBcode for Embedded Tweets
Bisha
10-17-2012, 10:00 PM
Overview
The Embedded Tweet feature allows websites to generate copy and paste-able HTML markup to render a Tweet on any third-party website. This markup presents a Tweet in an attractive (and display guidelines compliant) way, and automatically sets up Web Intents so that viewers of the Tweet may retweet, reply, favorite, and follow easily from the rendered view. read more (https://dev.twitter.com/docs/embedded-tweets)
https://vborg.vbsupport.ru/attachment.php?attachmentid=141806&stc=1&d=1350593885
How to Install:
Custom BB Codes->Add New BB Code
Title: Tweet
BB Code Tag Name: tweet (or whatever you want)
For Replacement paste this:
<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"/>
Confirm: Continue!
How to Use?
Copy the ID of the Tweet Status
https://vborg.vbsupport.ru/attachment.php?attachmentid=141805&stc=1&d=1350593769
and then paste on Tweet tag:
ID HERE
Enjoyed!
Drucifer
10-21-2012, 10:18 PM
I get this error message . . . .
The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes.
I copied & pasted. Have no idea where the two missing double quotes are supposed to be.
I'm running vB v4.2
===============================
Nevermind!
Got it to work even with the error message
dawges
10-22-2012, 04:11 AM
thank you. works great and very simple to use.
Bisha
10-22-2012, 06:06 AM
I get this error message . . . .
I copied & pasted. Have no idea where the two missing double quotes are supposed to be.
I'm running vB v4.2
Just ignore that message for now!
BozzaJos
10-25-2012, 05:05 PM
Brilliant mod! Thank You!
Bisha
10-26-2012, 06:27 AM
Brilliant mod! Thank You!
You'r welcome :)
mgurain
11-02-2012, 04:45 PM
I ignored the error message but it did not work in my 4.2 !
Bozza
11-04-2012, 07:38 AM
Installed on 4.2 and largely working well (despite the error message others mention when applying the BB code)
However edit post on a thread with an embedded tweet now doesn't work - the edit box is greyed out with no text to edit.
Other threads on the site are still OK, so I'm pretty confident it's related to this.
Drucifer
11-04-2012, 02:01 PM
Installed on 4.2 and largely working well (despite the error message others mention when applying the BB code)
However edit post on a thread with an embedded tweet now doesn't work - the edit box is greyed out with no text to edit.
Other threads on the site are still OK, so I'm pretty confident it's related to this.I have this issue too.
dawges
11-04-2012, 08:30 PM
I have this issue too.
Same issue here too. I had many reports that people were unable to edit posts. However it took me a while to track it to this, i never thought bbcode would cause such issues. Removed until bug fix.
Bisha
11-07-2012, 08:55 PM
Have you turned off autolinks for the TAG?
Bozza
11-07-2012, 09:26 PM
Have you turned off autolinks for the TAG?
I did have Disable Automatic Link Parsing Within This BB Code set to 'No', I've now set it to 'Yes'.
Same results with each - can't edit.
Drucifer
12-04-2012, 10:14 PM
It has stopped working.
And all previous embedded tweets posts are blank.
Bisha
12-08-2012, 07:20 PM
I'm working on an update!
Drucifer
12-09-2012, 01:52 AM
I think the problem was at the Twitter end.
deltahawk5
12-09-2012, 06:25 AM
Would be nice if it just took the whole URL. For now, having my users dissect it is nothing more than an inconvenience.
pete_brady
12-09-2012, 07:31 AM
Would be nice if it just took the whole URL. For now, having my users dissect it is nothing more than an inconvenience.
http://embedtweet.com/
just keep an eye on page load times
acast
01-13-2013, 01:14 AM
Nice. Thanks!!
TNERatedEdge
01-13-2013, 02:24 PM
doesn't work
Chase
01-17-2013, 09:36 PM
I am very interested in this.
Will this work on 3.8.7?
Chase
01-18-2013, 07:20 PM
bump
conchemimare
01-19-2013, 04:15 PM
Awesome, all set... good one.
Chase
01-19-2013, 07:22 PM
How can I get this to work on 3.8.7?
Digital Jedi
01-19-2013, 07:36 PM
How can I get this to work on 3.8.7?
BBCodes are, inherently, not modifications. They don't use anything vB version related, they only use Replacement code that should work in any webpage. So pretty much there's no reason why it shouldn't work on any version of vB.
Chase
01-19-2013, 11:16 PM
Thanks for the reply Jedi...
I followed the directions closely and when I went to add the 18 digit tweet ID in the tags, the result just came up blank.
Any idea why?
Digital Jedi
01-20-2013, 02:54 AM
Thanks for the reply Jedi...
I followed the directions closely and when I went to add the 18 digit tweet ID in the tags, the result just came up blank.
Any idea why?
Are you posting via AJAX [Quick Reply and Inline Editing]? JavaScripts, when used as BBCodes don't show up for the end user. That is, until you refresh or reload the page. For everyone else, they'll see it the first time. Also, is it working inside the BBCode editor? If it's working there, it's working on the forum. So always make sure it works in the example and test area as first.
Chase
01-20-2013, 04:23 AM
ahhhhhh thank you! It works great!
Chase
01-20-2013, 03:03 PM
The mod works great but it would be nice if all we had to do was copy and paste the URL and not have to go digging for the 18 digit code. It's not too difficult for me to do it but I feel it would be a real hassle for my visitors to have to dig around for that info.
Is there any way to do that?
Digital Jedi
01-20-2013, 06:13 PM
Not with the way the BBCode editor works. All it does is take whatever you put inside the [tags] and replaces it in the Replacement code wherever you see {param}. The replacement code doesn't use the full URL at all.
(NOTE: AME could probably do that. But it would require someone to make a definition.)
Chase
01-20-2013, 06:25 PM
I would have no idea how to do that. Think you could help me do that? I would donate some $$ to you for your help.
franzes80
01-20-2013, 08:03 PM
Don't work on vb 4.20 pl3
Digital Jedi
01-20-2013, 09:46 PM
Don't work on vb 4.20 pl3
It's not really version specific. Double check your code and do testing in the Admin CP. It should work on any vBulletin installation.
Chase
01-21-2013, 10:25 PM
Not with the way the BBCode editor works. All it does is take whatever you put inside the [tags] and replaces it in the Replacement code wherever you see {param}. The replacement code doesn't use the full URL at all.
(NOTE: AME could probably do that. But it would require someone to make a definition.)
I would have no idea how to do that. Think you could help me do that? I would donate some $$ to you for your help.
Just wanted to bump in case you missed this due to it being the last post on that page.
Digital Jedi
01-22-2013, 12:00 AM
It would be best if we discussed that in my AME definitions thread, rather than here. But I'll look into creating a definition in time.
Drucifer
01-24-2013, 03:39 AM
The simple LINK Tab is gone from Tweets, but the number is still there in Embed and works.
Digital Jedi
01-24-2013, 05:08 AM
The simple LINK Tab is gone from Tweets, but the number is still there in Embed and works.
If you mean the Direct Link to individual tweets, they're still there. You have to click the Tweet's time stamp.
Drucifer
01-29-2013, 06:44 PM
The reply box is back to being gray-out again when the post contains a tweet.
MattGarner
02-08-2013, 08:30 PM
I have something similar but only when you would need to go and edit the post that contains the tweet. Any chance that could be solved?
The reply box is back to being gray-out again when the post contains a tweet.
Digital Jedi
02-09-2013, 01:05 AM
Are you guys referring to when you edit a reply with a Tweet in it, and the tweet disappears? If so, that's a limitation of the AJAX used in vBulletin. JavaScript can't called within the JavaScript of the page, as it were. It also happens when using Quick Reply. Nothing simple can be done to fix it, but it really only does that for the person posting/editing. Everyone else can still see the post, and even the poster can when he reloads the page. If it's something different, than I'm not sure what you mean.
Drucifer
02-09-2013, 01:52 AM
No, the reply box is GRAY OUT. The only way to reply is via open in new tab.
I'm currently using FF v18.2
MattGarner
02-09-2013, 09:57 AM
Are you guys referring to when you edit a reply with a Tweet in it, and the tweet disappears? If so, that's a limitation of the AJAX used in vBulletin. JavaScript can't called within the JavaScript of the page, as it were. It also happens when using Quick Reply. Nothing simple can be done to fix it, but it really only does that for the person posting/editing. Everyone else can still see the post, and even the poster can when he reloads the page. If it's something different, than I'm not sure what you mean.
I hope I can explain this better. I post a tweet using the BBCode and that's fine it all works. But say I wanted to edit that specific post X amount of minutes later - I am unable to because it makes the text box all grey.
Digital Jedi
02-09-2013, 05:46 PM
I see now looking at Drucifer's forum. The editor is not being loaded inside the table cell. Likely the reason you can't edit it later is, actually, due to the JavaScript issue I mentioned, because when you post via AJAX, the JavaScript isn't loading, and in this case, not interfering until you come back to edit the post later. That might be tough to narrow down, but the first thing I would do, at least in Drucifer's case, is correct the validation errors on that page. Most of the time I've ever had a JavaScript conflict, it was because of validation errors. For instance:
<a href="search.php?do=getnew&contenttype=vBForum_Post">New Posts</a>
& should be &
If you're not familiar with Validation, there's an article in my profile that explains it in detail. Good idea to rule it out, at the very least. And it will help with any other problems you might encounter in the future.
sticky
03-09-2013, 05:53 AM
Can't get this to work.
Chase
03-23-2013, 02:08 PM
I have this mod installed on 3.8.7 and it works fine for the most part. We post that long digit code between the tweet tags and it shows up like it should... but some members of mine report back to me saying that from time to time their post doesn't show the tweet.... most of the posts only have the tweet in that post...
I understand the ajax issue when posting via quick reply... but they are saying if they navigate out and later come back to view a post... that tweet isn't showing.... the post it just empty.
However it will come back a little later.... reloading the page doesn't seem to help either.
Digital Jedi
03-23-2013, 07:40 PM
I have this mod installed on 3.8.7 and it works fine for the most part. We post that long digit code between the tweet tags and it shows up like it should... but some members of mine report back to me saying that from time to time their post doesn't show the tweet.... most of the posts only have the tweet in that post...
I understand the ajax issue when posting via quick reply... but they are saying if they navigate out and later come back to view a post... that tweet isn't showing.... the post it just empty.
However it will come back a little later.... reloading the page doesn't seem to help either.
Most likely that means Twitter is down for the time they are viewing it.
Chase
03-23-2013, 08:28 PM
Thanks for the reply Jedi....
Other tweet embeds are showing just fine though... and other tweets on the same page (but not same post, if you know what I mean)
I checked the ID of the tweet to make sure it is 18 digits and it is.
I can't figure out why a tweet wouldn't load but would load fine in other posts.
Chase
03-23-2013, 09:04 PM
They all post correctly but some end up vanishing..... then some time later (not sure how long) they come back again.
tomshawk
03-24-2013, 01:24 AM
I get this error message . . . .
I copied & pasted. Have no idea where the two missing double quotes are supposed to be.
I'm running vB v4.2
===============================
Nevermind!
Got it to work even with the error message
Same errror for me but not working, whether I use quick reply or advanced.
Argg, This will be kewl once I get it working
Digital Jedi
03-24-2013, 03:27 AM
They all post correctly but some end up vanishing..... then some time later (not sure how long) they come back again.
Keep in mind Twitter is a large site with more than one server. They don't always go down at once. That's most likely what's happening.
Drucifer
04-23-2013, 09:26 PM
Where the tweet number now?
deltahawk5
04-24-2013, 07:29 AM
is it possible to modify it so it just embeds with the whole link?
datoneer
04-24-2013, 11:00 PM
Works perfect on 4.2.1
Digital Jedi
04-25-2013, 03:15 AM
Where the tweet number now?
In the permalink. When you click the date.
is it possible to modify it so it just embeds with the whole link?
Not with BBCode. It doesn't use the full URL anywhere in the embed. And BBCode just extracts one element from the URL.
Working fine except when a reply is posted with the embedded tweet quoted, it left justifies the the signature of the person replying and the signature spans the entire length of the post. Is there something I can do to fix that?
Example:
https://vborg.vbsupport.ru/external/2013/06/17.jpg
Nevermind, had nothing to do with this, but for some reason only manifested when replying to tweet embedded posts. It was actually some modifications to additional.css and postbit.css that had been added to eliminate whitespace preceding signatures.
thenashy
07-25-2013, 05:15 AM
I don't see Twitter avatars. Just the Tweet.
Tony_FPM
08-27-2013, 07:57 AM
Facebook just released post embedding. Can you make a BBcode for that?
This is missing a closing div tag on the last line.
Should be:
<div class="twitter" onLoad="loadx().html"/></div>
Adam Wood
10-20-2013, 05:46 AM
Awesome! Works like a charm!
Thanks!
Digital Jedi
10-20-2013, 05:57 AM
This is missing a closing div tag on the last line.
Should be:
<div class="twitter" onLoad="loadx().html"/></div>
The div is self closed. You don't add a closing tag when a tag is self closed. Adding the closing tag will make the tag invalid.
What Are the Valid Closing Elements in XHTML (http://stackoverflow.com/questions/97522/what-are-all-the-valid-self-closing-elements-in-xhtml-as-implemented-by-the-maj)
ku-med
02-16-2014, 06:51 PM
Works great! Thanks :)
It's Damn Real!
02-25-2014, 07:44 PM
This works great using a standard browser, but it's not supported at all on Mobile, or through mobile forum apps like Tapatalk and ForumRunner. I've wanted to utilize something like this that responds to quoting (like this one does) for a while, but I can't seem to find a cure-all code anywhere that works across all platforms.
Andreasmax
07-31-2017, 10:14 AM
thanks for the code...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.