Topic: BBCODE to embed tweets
Is there a bbcode extension for embedding tweets in punbb?
You are not logged in. Please login or register.
PunBB Forums → Feature requests → BBCODE to embed tweets
Is there a bbcode extension for embedding tweets in punbb?
Is there a bbcode extension for embedding tweets in punbb?
Are you referring to Twitter from twitter.com?
Is there a bbcode extension for embedding tweets in punbb?
Are you referring to Twitter from twitter.com?
Yes. I would like for my users to be able to embed a tweet in a post.
Is not the script used in Twitter? Or links?
do you have an example? where I could see it?
I have seen it in vbulletin forums but not in punbb.
I'll try to find an example for you.
This is from a phpBB forum.
Understand you. Give me a link to this page. I need to look at the HTML source code of the objects.
Understand you. Give me a link to this page. I need to look at the HTML source code of the objects.
This is the page I got the image from.
Any luck with this one? I've tried to get something to work by altering another extension but I cannot get it right.
Publication date - 5 Jul, 2012
it is an old instruction. They are now all on another.
Publication date - 5 Jul, 2012
it is an old instruction. They are now all on another.
I'm not sure that I can put that information to work.
Basically, I'm trying to do this - http://punbb.informer.com/forums/topic/ … extension/
This way my users could copy the tweet url and wrap it with the BBCode tags to render the tweet in their posts. It would be really helpful for sports and news updates.
I'm going to try and monkey with it some tonight.
I'm thinking this might be it, but a second opinion would be welcome.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">
<!--
/**
*BBCODE Tweet
*/
-->
<extension engine="1.0">
<id>bbcode_tweet</id>
<title>BBCODE TWEET)</title>
<version>0.1.0</version>
<description>BBCODE to insert tweet in post</description>
<minversion>1.4.1</minversion>
<maxtestedon>1.4.2</maxtestedon>
<hooks>
<hook id="ps_start"><![CDATA[
// tag handling function
function handle_table_tag($inputText) {
<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={IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>
}
]]></hook>
<hook id="ps_preparse_tags_start"><![CDATA[
// add our tag to the list
$tags[0] = 'tweet';
$tags_opened[0] = 'tweet';
$tags_closed[0] = 'tweet';
$tags_inline[0] = 'tweet';
$tags_trim[0] = 'tweet';
]]></hook>
<hook id="ps_do_bbcode_replace"><![CDATA[
$pattern[] = '#\[tweet\](.*?)\[/tweet\]#se';
$replace[] = 'handle_tweet_tag(\'$1\')';
]]></hook>
<hook id="pun_bbcode_pre_buttons_output">
<![CDATA[
$this->add_button(array('name' => 'TW', 'weight' => 60, 'image' => false));
]]></hook>
</hooks>
</extension>
Shit, doesn't work. I get this error in the extensions -
Loading of extension "bbcode_tweet" failed.
Element extension/hooks/hook has content which does not end in PHP mode.
take as a basis for expansion is not bb code, such as: fancy youtube.
?>
// tag handling function
function handle_table_tag($inputText) {
<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={IDENTIFIER}&callback=loadx"></script>
<?php
BUT, This script will not work.
I wrote to you the date of publication. It's all out of date. See the link that I threw you.
This is a useful thing, but I'm busy.
I'm still digging into this trying to make it work.
I'm trying to utilize this - https://codex.wordpress.org/Shortcode_API
So far I'm shooting blanks... but I am learning this on the fly.
OK! My friend, let me work twitter script to be inserted into a message and I'll write an extension for you. I like it a piece of cake, but I do not even want to go into Twitter ideology and understand how it all works. Help me and I will help you ....
OK! My friend, let me work twitter script to be inserted into a message and I'll write an extension for you. I like it a piece of cake, but I do not even want to go into Twitter ideology and understand how it all works. Help me and I will help you ....
I'll help however I can.
Must be inserted script or link?
[ twitter ] Here link [ /twitter ]
OR
[ twitter ] Here Script [ /twitter ]
Must be inserted script or link?
[ twitter ] Here link [ /twitter ]
OR
[ twitter ] Here Script [ /twitter ]
It would be [ tweet ] here link [ /twitter ]
See
http://panbb.ru/demo/viewtopic.php?pid=16#p16
Input as admin.
Расширение Pan Twitter позволяет вставлять твиты распространенного сервиса https://Twitter.com прямо в посты
I gave this a try and it did not function for me.
It showed the twitter icon (blue bird) and nothing else. When I clicked on the twitter icon it took me to twitter to view the tweet.
Is there anything else I need to add to my forum in order to make the extension function properly?
so you just need to insert a link to it. where can I see it?
so you just need to insert a link to it. where can I see it?
I just needed to refresh my browser.
This looks really good Pan, thanks a lot!
I got the language switched up to English and I can tell you know, for anyone that is running a forum that includes a lot of breaking news this will be an extremely useful extension.
Thanks again!
You are welcome. Always happy to help. Treat.
PunBB Forums → Feature requests → BBCODE to embed tweets
Powered by PunBB, supported by Informer Technologies, Inc.