• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

hacking media code to allow for 2nd id variable

caliman

Active member
#1
I would like to hack the media bbcode function to allow for a 2nd $id variable in order to support livestream. Any suggestions? Here is the function:

PHP:
    public function renderTagMedia(array $tag, array $rendererStates)
    {
        $mediaKey = trim($this->stringifyTree($tag['children']));
        if (preg_match('#[&?"\'<>\r\n]#', $mediaKey) || strpos($mediaKey, '..') !== false)
        {
            return '';
        }

        $mediaSiteId = strtolower($tag['option']);
        if ($mediaSiteId == 'youtube')
        {
            // youtube iframe embed bug workaround
            $mediaKey = str_replace('/', '', $mediaKey);
        }
        if (isset($this->_mediaSites[$mediaSiteId]))
        {
            $embedHtml = $this->_getMediaSiteHtmlFromCallback($mediaKey, $this->_mediaSites[$mediaSiteId]);

            if (!$embedHtml)
            {
                $embedHtml = strtr($this->_mediaSites[$mediaSiteId]['embed_html'], array(
                    '{$id}' => urlencode($mediaKey),
                    '{$id:digits}' => intval($mediaKey)
                ));
            }

            return $embedHtml;
        }
        else
        {
            return '';
        }
}
Here are livestream URL variations:

Code:
http://new.livestream.com/Mission31Main/events/3039691

http://new.livestream.com/account/8635998/events/3039691
Thanks in advance for any help here.

caliman