Advertisement:

Embed BBCode

Aloittaja Antes, helmikuu 14, 2014, 10:22:13 AP

« edellinen - seuraava »

Antes

I like twitter and it has some basic features can empower your community, one of them is embed, you can embed it via tweet by tweet or you can do it with entering tweet ID. I created a little bbcode for it but not sure why its not working :/

            array(
                'tag' => 'tweet',
                'type' => 'unparsed_content',
                'content' => '',$tweet2['html'] ,'',
                'validate' => create_function('&$tag, &$data, $disabled', '
                if (isset($disabled[\'url\']))
                    $tag[\'content\'] = \'$1\';
               
                global $tweet, $tweet2;
                $tweet = file_get_contents(\'https://api.twitter.com/1/statuses/oembed.json?id=$1\');
                $tweet2 = json_decode($tweet, true);
                $tag[\'content\'] = $tweet2[\'html\'];
                '),
                'block_level' => true,
                'disabled_content' => '$1'
            ),


Errors;

Undefined variable: tweet2
Undefined index: html

Herman's Mixen

remove those damn slashes !!
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Antes

Lainaus käyttäjältä: Herman's Mixen - helmikuu 14, 2014, 10:49:07 AP
remove those damn slashes !!

Parse error: syntax error, unexpected 'url' (T_STRING) in **\Sources\Subs.php on line 991

Antes

I still get "Undefined index: html" error and not outputting what it needs to :(

Antes

It returns the values, i added a screenshot, upper part using this code;

   $tweet = file_get_contents("https://api.twitter.com/1/statuses/oembed.json?id=434084569902768129");
   $tweet2 = json_decode($tweet, true);
   echo $tweet2['html'];

Antes

Thank you - emanuele & Little Craw ^^

Advertisement: