Topic: BBCODE to embed tweets

Is there a bbcode extension for embedding tweets in punbb?

Re: BBCODE to embed tweets

Is there a bbcode extension for embedding tweets in punbb?

Are you referring to Twitter from twitter.com?

Re: BBCODE to embed tweets

PanBB.Ru wrote:

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.

Re: BBCODE to embed tweets

Is not the script used in Twitter? Or links?

do you have an example? where I could see it?

5 (edited by paulcambull 2016-10-09 20:39)

Re: BBCODE to embed tweets

I have seen it in vbulletin forums but not in punbb.

I'll try to find an example for you.

Re: BBCODE to embed tweets

This is from a phpBB forum.

https://s22.postimg.org/7yjkug4jl/Screenshot_7.png

7 (edited by PanBB.Ru 2016-10-09 21:07)

Re: BBCODE to embed tweets

Understand you. Give me a link to this page. I need to look at the HTML source code of the objects.

Re: BBCODE to embed tweets

PanBB.Ru wrote:

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.

http://punyweakling.com/add-a-tweet-bbc … pbb-forum/

Re: BBCODE to embed tweets

Any luck with this one? I've tried to get something to work by altering another extension but I cannot get it right.

Re: BBCODE to embed tweets

Publication date  - 5 Jul, 2012
it is an old instruction. They are now all on another.

https://dev.twitter.com/web/embedded-tweets/cms

Re: BBCODE to embed tweets

PanBB.Ru wrote:

Publication date  - 5 Jul, 2012
it is an old instruction. They are now all on another.

https://dev.twitter.com/web/embedded-tweets/cms

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.

12 (edited by paulcambull 2016-10-27 17:48)

Re: BBCODE to embed tweets

I'm thinking this might be it, but a second opinion would be welcome. smile

<?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>

Re: BBCODE to embed tweets

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.

14 (edited by PanBB.Ru 2016-10-27 18:07)

Re: BBCODE to embed tweets

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.

Re: BBCODE to embed tweets

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.

16 (edited by PanBB.Ru 2016-11-06 19:25)

Re: BBCODE to embed tweets

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 ....

Re: BBCODE to embed tweets

PanBB.Ru wrote:

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. smile

Re: BBCODE to embed tweets

Must be inserted script or link?

[ twitter ] Here link [ /twitter ]

OR

[ twitter ] Here Script [ /twitter ]

Re: BBCODE to embed tweets

PanBB.Ru wrote:

Must be inserted script or link?

[ twitter ] Here link [ /twitter ]

OR

[ twitter ] Here Script [ /twitter ]

It would be [ tweet ] here link [ /twitter ]

20 (edited by PanBB.Ru 2016-11-12 14:22)

Re: BBCODE to embed tweets

See
http://panbb.ru/demo/viewtopic.php?pid=16#p16

Input as admin.

21 (edited by PanBB.Ru 2017-04-01 21:27)

Re: BBCODE to embed tweets

Расширение Pan Twitter позволяет вставлять твиты распространенного сервиса https://Twitter.com  прямо в посты
https://punbb.info/uploads/images/2016/11/12/screenshot.2016-11-12_17.17.56.png
https://punbb.info/uploads/images/2016/11/12/screenshot.2016-11-12_17.31.09.png

Re: BBCODE to embed tweets

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?

Re: BBCODE to embed tweets

so you just need to insert a link to it. where can I see it?

Re: BBCODE to embed tweets

PanBB.Ru wrote:

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!

Re: BBCODE to embed tweets

You are welcome. Always happy to help. Treat.