<?php
define('HDOM_TYPE_ELEMENT', 1);
define('HDOM_TYPE_COMMENT', 2);
define('HDOM_TYPE_TEXT', 3);
define('HDOM_TYPE_ENDTAG', 4);
define('HDOM_TYPE_ROOT', 5);
define('HDOM_TYPE_UNKNOWN', 6);
define('HDOM_QUOTE_DOUBLE', 0);
define('HDOM_QUOTE_SINGLE', 1);
define('HDOM_QUOTE_NO', 3);
define('HDOM_INFO_BEGIN', 0);
define('HDOM_INFO_END', 1);
define('HDOM_INFO_QUOTE', 2);
define('HDOM_INFO_SPACE', 3);
define('HDOM_INFO_TEXT', 4);
define('HDOM_INFO_INNER', 5);
define('HDOM_INFO_OUTER', 6);
define('HDOM_INFO_ENDSPACE',7);
define('DEFAULT_TARGET_CHARSET', 'UTF-8');
define('DEFAULT_BR_TEXT', "\r\n");
define('DEFAULT_SPAN_TEXT', " ");
if (!defined('MAX_FILE_SIZE')) {
define('MAX_FILE_SIZE', 600000);
}
// helper functions
// -----------------------------------------------------------------------------
// get html dom from file
// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
{
// We DO force the tags to be terminated.
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
do {
$repeat = false;
if ($context!==NULL)
{
// Test if "Accept-Encoding: gzip" has been set in $context
$params = stream_context_get_params($context);
if (isset($params['options']['http']['header']) && preg_match('/gzip/', $params['options']['http']['header']) !== false)
{
$contents = curl_file_get_contents('compress.zlib://'.$url, $use_include_path, $context, $offset);
}
else
{
$contents = curl_file_get_contents($url, $use_include_path, $context, $offset);
}
}
else
{
$contents = curl_file_get_contents($url, $use_include_path, NULL, $offset);
}
// test if the URL doesn't return a 200 status
if (isset($http_response_header) && strpos($http_response_header[0], '200') === false) {
// has a 301 redirect header been sent?
$pattern = "/^Location:\s*(.*)$/i";
$location_headers = preg_grep($pattern, $http_response_header);
if (!empty($location_headers) && preg_match($pattern, array_values($location_headers)[0], $matches)) {
// set the URL to that returned via the redirect header and repeat this loop
$url = $matches[1];
$repeat = true;
}
}
} while ($repeat);
// stop processing if the header isn't a good responce
if (isset($http_response_header) && strpos($http_response_header[0], '200') === false)
{
return false;
}
// stop processing if the contents are too big
if (empty($contents) || strlen($contents) > MAX_FILE_SIZE)
{
return false;
}
// The second parameter can force the selectors to all be lowercase.
$dom->load($contents, $lowercase, $stripRN);
return $dom;
}
// get html dom from string
function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
{
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
if (empty($str) || strlen($str) > MAX_FILE_SIZE)
{
$dom->clear();
return false;
}
$dom->load($str, $lowercase, $stripRN);
return $dom;
}
// dump html dom tree
function dump_html_tree($node, $show_attr=true, $deep=0)
{
$node->dump($node);
}
/**
* simple html dom node
* PaperG - added ability for "find" routine to lowercase the value of the selector.
* PaperG - added $tag_start to track the start position of the tag in the total byte index
*
* @package PlaceLocalInclude
*/
class simple_html_dom_node
{
public $nodetype = HDOM_TYPE_TEXT;
public $tag = 'text';
public $attr = array();
public $children = array();
public $nodes = array();
public $parent = null;
// The "info" array - see HDOM_INFO_... for what each element contains.
public $_ = array();
public $tag_start = 0;
private $dom = null;
function __construct($dom)
{
$this->dom = $dom;
$dom->nodes[] = $this;
}
function __destruct()
{
$this->clear();
}
function __toString()
{
return $this->outertext();
}
// clean up memory due to php5 circular references memory leak...
function clear()
{
$this->dom = null;
$this->nodes = null;
$this->parent = null;
$this->children = null;
}
// dump node's tree
function dump($show_attr=true, $deep=0)
{
$lead = str_repeat(' ', $deep);
echo $lead.$this->tag;
if ($show_attr && count($this->attr)>0)
{
echo '(';
foreach ($this->attr as $k=>$v)
echo "[$k]=>\"".$this->$k.'", ';
echo ')';
}
echo "\n";
if ($this->nodes)
{
foreach ($this->nodes as $c)
{
$c->dump($show_attr, $deep+1);
}
}
}
// Debugging function to dump a single dom node with a bunch of information about it.
function dump_node($echo=true)
{
$string = $this->tag;
if (count($this->attr)>0)
{
$string .= '(';
foreach ($this->attr as $k=>$v)
{
$string .= "[$k]=>\"".$this->$k.'", ';
}
$string .= ')';
}
if (count($this->_)>0)
{
$string .= ' $_ (';
foreach ($this->_ as $k=>$v)
{
if (is_array($v))
{
$string .= "[$k]=>(";
foreach ($v as $k2=>$v2)
{
$string .= "[$k2]=>\"".$v2.'", ';
}
$string .= ")";
} else {
$string .= "[$k]=>\"".$v.'", ';
}
}
$string .= ")";
}
if (isset($this->text))
{
$string .= " text: (" . $this->text . ")";
}
$string .= " HDOM_INNER_INFO: '";
if (isset($node->_[HDOM_INFO_INNER]))
{
$string .= $node->_[HDOM_INFO_INNER] . "'";
}
else
{
$string .= ' NULL ';
}
$string .= " children: " . count($this->children);
$string .= " nodes: " . count($this->nodes);
$string .= " tag_start: " . $this->tag_start;
$string .= "\n";
if ($echo)
{
echo $string;
return;
}
else
{
return $string;
}
}
// returns the parent of node
// If a node is passed in, it will reset the parent of the current node to that one.
function parent($parent=null)
{
// I am SURE that this doesn't work properly.
// It fails to unset the current node from it's current parents nodes or children list first.
if ($parent !== null)
{
$this->parent = $parent;
$this->parent->nodes[] = $this;
$this->parent->children[] = $this;
}
return $this->parent;
}
// verify that node has children
function has_child()
{
return !empty($this->children);
}
// returns children of node
function children($idx=-1)
{
if ($idx===-1)
{
return $this->children;
}
if (isset($this->children[$idx])) r
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP的新版米酷影视电影网站源码(修复幻灯片 分类网址错误).zip
共902个文件
php:207个
png:183个
js:165个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 199 浏览量
2023-08-29
00:18:11
上传
评论
收藏 12.39MB ZIP 举报
温馨提示
基于PHP的新版米酷影视电影网站源码(修复幻灯片 分类网址错误).zip
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的新版米酷影视电影网站源码(修复幻灯片 分类网址错误).zip (902个子文件)
07f5e662fa5d90289c74f3e7f4237f3e 12KB
0cb3c5bd57114ce41b7e1f9d971a0b88 15KB
1006168bd346d1506a12eb21887a7921 12KB
11699b26af4a04d6b01ec209aa17f0d1 11KB
19baee3d206a9bbe69dfca648f22e379 475B
1b25fcc6585ce6c4662f0b260d2afb03 12KB
21f203f2e21c9159dd06d8b4855df035 12KB
2aa8591266d2981ba446ea5db36a17d8 12KB
41300cb79d37e632004de63b10b77331 12KB
490bf65d456a7480186d9c1e5c230155 12KB
53b8f06adada98926e41a66e23e3d513 12KB
62b1337040fcdd9bc90039de3aa6e224 534B
7d5572f1bc872f8d224eb5bca614774a 12KB
84e584fbd7ed9dc9ba3a59559ad9c4a7 12KB
8c5d1a0543bc139c9e1befbab561c090 12KB
8c96b80ecf9d7525f8765b4075896cb3 7KB
8f7faf656e5b8fdce4cc3ab9e5abd7e7 16KB
9067849c515457f70b445831dfd7c4fd 15KB
b82551a7844711cfd776e559e63351cf 12KB
cc71fe763b6a54cd8d13f1878fde1d38 12KB
cf0da978deadb172d34a60171c6b982e 12KB
web.config 16KB
oneui.css 305KB
main.css 238KB
summernote-bs3.css 149KB
bootstrap.min.css 135KB
style.css 112KB
bootstrap.min.css 111KB
bootstrap.css 106KB
yzmplayer.css 63KB
add-ons.min.css 52KB
aui-hall.css 48KB
style.min.css 46KB
jquery.mCustomScrollbar.min.css 42KB
news.css 35KB
stui_block.css 34KB
datepicker3.css 34KB
font-awesome.min.css 30KB
bootkit.css 29KB
jquery-ui-1.10.4.min.css 27KB
theme.css 25KB
jquery-ui-1.10.4.custom.css 24KB
default.css 21KB
bootstrap-editable.css 21KB
font-awesome.min.css 20KB
swiper.min.css 17KB
player.css 16KB
stui_default.css 15KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
mCustomScrollbar.css 14KB
fullcalendar.css 12KB
dropzone.css 12KB
iconfont.css 10KB
jquery.mmenu.css 8KB
summernote.css 8KB
skycons.css 8KB
magnific-popup.css 8KB
default.css 7KB
blackcolor.css 6KB
whitecolor.css 5KB
layer.css 5KB
stui_custom.css 5KB
index.css 4KB
xcharts.min.css 4KB
iconfont.css 4KB
bootstrap-colorpicker.css 4KB
install.css 4KB
zhibo.css 4KB
tv.css 4KB
small.css 4KB
bootstrap-timepicker.css 4KB
datepicker-theme.css 3KB
down.css 3KB
qq.css 3KB
iconfont.css 3KB
simple.css 2KB
aui.css 2KB
phone_style.css 1KB
bootstrap-tagsinput.css 1KB
prettify.css 973B
bootstrap-markdown.min.css 844B
morris.css 445B
e31bacd6f3e7b8e7dc18624744dc6db9 41KB
eb9061ee38df4fcf1215f3b88959ed43 8KB
fontawesome-webfont.eot 162KB
fontawesome-webfont.eot 71KB
fontawesome-webfont.eot 71KB
weathericons-regular-webfont.eot 34KB
weathericons-regular-webfont.eot 34KB
iconfont.eot 24KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
climacons-webfont.eot 18KB
iconfont.eot 9KB
f2b7634f5c05c76f3441e61884cca13e 12KB
fa71c12dd362ffeabe17d58d1bb78ca7 12KB
fbdc3077fa5b7cd38d610a4e3c601f44 521B
共 902 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
助力毕业
- 粉丝: 2177
- 资源: 5130
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功