1

I'm just getting Embedly working on my site and for a few articles I embedded, clicking on the picture thumbnails resulted in an error Undefined index: html. Looking at the code, it apparently thinks that the article I'm embedding is a video:

switch($oembed['type']) {
        case 'photo':
            print '<div class="embed-content"><div class="embed-wrapper">';
            if (!array_key_exists('title', $oembed)) {
              ?><img src="<?php echo $oembed['url'] ?>"></img><?php
            }
            else {
                ?><img src="<?php echo $oembed['url'] ?>" alt="<?php echo $oembed['title'] ?>"></img><?php
            }
            print '</div></div>';
            break;
        case 'link':
        case 'rich':
        case 'video':
            print '<div class="embed-content"><div class="embed-wrapper">';
            print $oembed['html'];
            print '</div></div>';
            break;
        case 'error':
        default:
        }

I'm clearly missing some code for several cases as I just took this from Embedly's PHP github.

I do pay for Embedly pro but I don't have the code for the full use here, where can I find it?? I figured if I sign into Embedly with the account I pay for they might have it, but cant seem to find anything new there.

tnw
  • 13,521
  • 15
  • 70
  • 111

0 Answers0