Пример #1
0
function embedNicovideo($input, $argv, $parser)
{
    $nvid = '';
    $width = $width_max = 640;
    $height = $height_max = 480;
    if (!empty($argv['nvid'])) {
        $nvid = embedYouTube_url2nvid($argv['nvid']);
    } elseif (!empty($input)) {
        $nvid = embedYouTube_url2nvid($input);
    }
    if (!empty($argv['width']) && settype($argv['width'], 'integer') && $width_max >= $argv['width']) {
        $width = $argv['width'];
    }
    if (!empty($argv['height']) && settype($argv['height'], 'integer') && $height_max >= $argv['height']) {
        $height = $argv['height'];
    }
    if (!empty($nvid)) {
        $url = "http://ext.nicovideo.jp/thumb_watch/{$nvid}?w={$width}&h={$height}";
        return "<script type=\"text/javascript\" src=\"{$url}\"></script>";
    }
}
Пример #2
0
function embedNicovideo($input, $argv, $parser)
{
    $nvid = '';
    if (!empty($argv['nvid'])) {
        $nvid = embedYouTube_url2nvid($argv['nvid']);
    } elseif (!empty($input)) {
        $nvid = embedYouTube_url2nvid($input);
    }
    if (!empty($nvid)) {
        $url = "http://ext.nicovideo.jp/thumb_watch/{$nvid}";
        return "<script type=\"text/javascript\" src=\"{$url}\"></script>";
    }
}