XF 1.2 Hide media sites from guests?

Janmaat

Active member
Is it possible to hide media sites (like amazon and/or youtube links) from guests so that only registered users can see them?
 
No. The parsing and display of the media tag doesn't utilize templates:
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 '';
        }
    }
 
Back
Top Bottom