Example #1
0
    }
} elseif (is_single()) {
    $huidesc = hui_excerpt(200);
    if ($post->post_excerpt) {
        $huidesc = $post->post_excerpt;
    }
} elseif (is_category() || is_tag()) {
    if (category_description()) {
        $huidesc = strip_tags(category_description());
    }
} elseif (is_page()) {
    if (the_content()) {
        $huidesc = hui_excerpt(200);
    }
}
$huidesc = DeleteHtml($huidesc);
if ($huidesc) {
    echo '<meta name="description" content="' . $huidesc . '" />';
}
?>

<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="<?php 
bloginfo('stylesheet_url');
?>
" type="text/css" media="screen" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
" />
Example #2
0
    $str = ereg_replace("\n", "", $str);
    return trim($str);
}
$ccurl = "http://www.dedecms.com/pl/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_URL, $ccurl);
// curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:8.8.8.8'));
// curl_setopt($ch, CURLOPT_REFERER, "http://sebug.net/appdir/");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$yuanma = curl_exec($ch);
curl_close($ch);
// echo $yuanma;
$canshustr = '<h4>[data]</p>';
//  截取  http:// 和 /之间的字符
$mubiaostr = '[data1]';
//  把上面找到的字符放到 http://之后进行组合 http://可以随意构造,
$jieguo = canshujiequ($yuanma, $canshustr, $mubiaostr);
foreach ($jieguo as $i => $r) {
    $r = preg_replace("'<a.*?a>'i", "", $r);
    $r = preg_replace("'<.*?>'i", "", $r);
    $r = DeleteHtml($r);
    echo $r . "\n";
}
// fclose($fp);
?>

Example #3
0
function getvideoid($url)
{
    $data['status'] = 0;
    if (strpos($url, 'youku.com')) {
        $data['type'] = 'youku';
        if (strpos($url, 'html')) {
            $data['id'] = inter($url, 'id_', '.html');
        } elseif (strpos($url, 'swf')) {
            $data['id'] = inter($url, '/sid/', '/');
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'tudou.com') || strpos($url, 'tudouui.com')) {
        $data['type'] = 'tudou';
        $data['id'] = '';
        if (strpos($url, 'swf')) {
            $wd = inter($url, 'iid=', '/');
            if (strpos($wd, 'swf')) {
                $wd = inter($url, 'iid=', '&');
            }
            if (!$wd) {
                $url1 = inter($url, 'v/', '/');
                $url = "http://www.tudou.com/programs/view/" . $url1 . "/";
            }
            $data['id'] = $wd;
        }
        if (!$data['id']) {
            $content = get_curl_contents($url);
            $wd = inter($content, 'vcode:"', '"');
            if (!$wd) {
                $wd = inter($content, 'vcode: \'', '\'');
            }
            if ($wd) {
                $data['type'] = 'youku';
                $data['id'] = $wd;
            } else {
                $data['id'] = DeleteHtml(inter($content, 'iid:', ','));
            }
        }
        if (!$data['id']) {
            urldebug($url);
        }
    } elseif (strpos($url, 'letv.com')) {
        $data['type'] = 'letv';
        if (strpos($url, 'swf')) {
            $wd = inter($url, 'swf?id=', '&');
            $data['id'] = $wd;
        } else {
            $content = get_curl_contents($url);
            $wd = inter($content, 'vid:', ',');
            if ($wd) {
                $data['id'] = $wd;
            } elseif ($wd == 0) {
                $data['id'] = inter($content, 'vid=', '&');
            } else {
                urldebug($url);
            }
        }
    } elseif (strpos($url, '56.com')) {
        $data['type'] = '56';
        if (strpos($url, 'v_')) {
            $wd = inter($url, 'v_', '.');
        } elseif (strpos($url, 'vid-')) {
            $wd = inter($url, 'vid-', '.');
        } elseif (strpos($url, 'open_')) {
            $wd = inter($url, 'open_', '.');
        } elseif (strpos($url, 'redian/')) {
            $wd = explode('redian/', $url);
            $wd2 = explode('/', $wd[1]);
            $wd = '';
            $wd = $wd2[0];
            if ($wd2[1]) {
                $wd = $wd2[1];
            }
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'pan.baidu')) {
        $data['type'] = 'baidu';
        $wd = explode('shareid=', $url);
        $arrr = array("&uk=" => "-");
        $wd = strtr($wd[1], $arrr);
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } elseif (strpos($url, 'ku6.com')) {
        $data['type'] = 'ku6';
        if (strpos($url, 'html')) {
            $arr = explode('/', $url);
            $wd = $arr[count($arr) - 1];
            $wd = str_replace('.html', '', $wd);
        } elseif (strpos($url, 'swf')) {
            $arr = explode('/', $url);
            $wd = $arr[count($arr) - 2];
        } else {
            urldebug($url);
        }
        if ($wd) {
            $data['id'] = $wd;
        } else {
            urldebug($url);
        }
    } else {
        $data['type'] = 'url';
        $data['id'] = $wd;
    }
    return $data;
}