Version Description
[16/07/15] =
- Add HTML5 validation by applying a property="stylesheet" attribute to meta slider CSS tags
- Remove unused "Resource Manager" code
- Chinese language pack updated (thanks to mamsds!)
Download this release
Release Info
Developer | matchalabs |
Plugin | MetaSlider |
Version | 3.3.4 |
Comparing to | |
See all releases |
Code changes from version 3.3.3 to 3.3.4
- inc/simple_html_dom.php +0 -1707
- languages/metaslider-zh_CN.mo +0 -0
- languages/metaslider-zh_CN.po +720 -631
- ml-slider.php +14 -54
- readme.txt +8 -2
inc/simple_html_dom.php
DELETED
@@ -1,1707 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Website: http://sourceforge.net/projects/simplehtmldom/
|
4 |
-
* Additional projects that may be used: http://sourceforge.net/projects/debugobject/
|
5 |
-
* Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/)
|
6 |
-
* Contributions by:
|
7 |
-
* Yousuke Kumakura (Attribute filters)
|
8 |
-
* Vadim Voituk (Negative indexes supports of "find" method)
|
9 |
-
* Antcs (Constructor with automatically load contents either text or file/url)
|
10 |
-
*
|
11 |
-
* all affected sections have comments starting with "PaperG"
|
12 |
-
*
|
13 |
-
* Paperg - Added case insensitive testing of the value of the selector.
|
14 |
-
* Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately.
|
15 |
-
* This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source,
|
16 |
-
* it will almost always be smaller by some amount.
|
17 |
-
* We use this to determine how far into the file the tag in question is. This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from.
|
18 |
-
* but for most purposes, it's a really good estimation.
|
19 |
-
* Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors.
|
20 |
-
* Allow the user to tell us how much they trust the html.
|
21 |
-
* Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node.
|
22 |
-
* This allows for us to find tags based on the text they contain.
|
23 |
-
* Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag.
|
24 |
-
* Paperg: added parse_charset so that we know about the character set of the source document.
|
25 |
-
* NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the
|
26 |
-
* last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection.
|
27 |
-
*
|
28 |
-
* Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that.
|
29 |
-
* PaperG (John Schlick) Added get_display_size for "IMG" tags.
|
30 |
-
*
|
31 |
-
* Licensed under The MIT License
|
32 |
-
* Redistributions of files must retain the above copyright notice.
|
33 |
-
*
|
34 |
-
* @author S.C. Chen <me578022@gmail.com>
|
35 |
-
* @author John Schlick
|
36 |
-
* @author Rus Carroll
|
37 |
-
* @version 1.5 ($Rev: 208 $)
|
38 |
-
* @package PlaceLocalInclude
|
39 |
-
* @subpackage simple_html_dom
|
40 |
-
*/
|
41 |
-
|
42 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
43 |
-
exit; // disable direct access
|
44 |
-
}
|
45 |
-
|
46 |
-
if ( ! class_exists('simple_html_dom_node') ) :
|
47 |
-
/**
|
48 |
-
* All of the Defines for the classes below.
|
49 |
-
* @author S.C. Chen <me578022@gmail.com>
|
50 |
-
*/
|
51 |
-
define('HDOM_TYPE_ELEMENT', 1);
|
52 |
-
define('HDOM_TYPE_COMMENT', 2);
|
53 |
-
define('HDOM_TYPE_TEXT', 3);
|
54 |
-
define('HDOM_TYPE_ENDTAG', 4);
|
55 |
-
define('HDOM_TYPE_ROOT', 5);
|
56 |
-
define('HDOM_TYPE_UNKNOWN', 6);
|
57 |
-
define('HDOM_QUOTE_DOUBLE', 0);
|
58 |
-
define('HDOM_QUOTE_SINGLE', 1);
|
59 |
-
define('HDOM_QUOTE_NO', 3);
|
60 |
-
define('HDOM_INFO_BEGIN', 0);
|
61 |
-
define('HDOM_INFO_END', 1);
|
62 |
-
define('HDOM_INFO_QUOTE', 2);
|
63 |
-
define('HDOM_INFO_SPACE', 3);
|
64 |
-
define('HDOM_INFO_TEXT', 4);
|
65 |
-
define('HDOM_INFO_INNER', 5);
|
66 |
-
define('HDOM_INFO_OUTER', 6);
|
67 |
-
define('HDOM_INFO_ENDSPACE',7);
|
68 |
-
define('DEFAULT_TARGET_CHARSET', 'UTF-8');
|
69 |
-
define('DEFAULT_BR_TEXT', "\r\n");
|
70 |
-
define('DEFAULT_SPAN_TEXT', " ");
|
71 |
-
define('MAX_FILE_SIZE', 600000);
|
72 |
-
|
73 |
-
/**
|
74 |
-
* simple html dom node
|
75 |
-
* PaperG - added ability for "find" routine to lowercase the value of the selector.
|
76 |
-
* PaperG - added $tag_start to track the start position of the tag in the total byte index
|
77 |
-
*
|
78 |
-
* @package PlaceLocalInclude
|
79 |
-
*/
|
80 |
-
class simple_html_dom_node
|
81 |
-
{
|
82 |
-
public $nodetype = HDOM_TYPE_TEXT;
|
83 |
-
public $tag = 'text';
|
84 |
-
public $attr = array();
|
85 |
-
public $children = array();
|
86 |
-
public $nodes = array();
|
87 |
-
public $parent = null;
|
88 |
-
// The "info" array - see HDOM_INFO_... for what each element contains.
|
89 |
-
public $_ = array();
|
90 |
-
public $tag_start = 0;
|
91 |
-
private $dom = null;
|
92 |
-
|
93 |
-
function __construct($dom)
|
94 |
-
{
|
95 |
-
$this->dom = $dom;
|
96 |
-
$dom->nodes[] = $this;
|
97 |
-
}
|
98 |
-
|
99 |
-
function __destruct()
|
100 |
-
{
|
101 |
-
$this->clear();
|
102 |
-
}
|
103 |
-
|
104 |
-
function __toString()
|
105 |
-
{
|
106 |
-
return $this->outertext();
|
107 |
-
}
|
108 |
-
|
109 |
-
// clean up memory due to php5 circular references memory leak...
|
110 |
-
function clear()
|
111 |
-
{
|
112 |
-
$this->dom = null;
|
113 |
-
$this->nodes = null;
|
114 |
-
$this->parent = null;
|
115 |
-
$this->children = null;
|
116 |
-
}
|
117 |
-
|
118 |
-
// dump node's tree
|
119 |
-
function dump($show_attr=true, $deep=0)
|
120 |
-
{
|
121 |
-
$lead = str_repeat(' ', $deep);
|
122 |
-
|
123 |
-
echo $lead.$this->tag;
|
124 |
-
if ($show_attr && count($this->attr)>0)
|
125 |
-
{
|
126 |
-
echo '(';
|
127 |
-
foreach ($this->attr as $k=>$v)
|
128 |
-
echo "[$k]=>\"".$this->$k.'", ';
|
129 |
-
echo ')';
|
130 |
-
}
|
131 |
-
echo "\n";
|
132 |
-
|
133 |
-
if ($this->nodes)
|
134 |
-
{
|
135 |
-
foreach ($this->nodes as $c)
|
136 |
-
{
|
137 |
-
$c->dump($show_attr, $deep+1);
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
|
143 |
-
// Debugging function to dump a single dom node with a bunch of information about it.
|
144 |
-
function dump_node($echo=true)
|
145 |
-
{
|
146 |
-
|
147 |
-
$string = $this->tag;
|
148 |
-
if (count($this->attr)>0)
|
149 |
-
{
|
150 |
-
$string .= '(';
|
151 |
-
foreach ($this->attr as $k=>$v)
|
152 |
-
{
|
153 |
-
$string .= "[$k]=>\"".$this->$k.'", ';
|
154 |
-
}
|
155 |
-
$string .= ')';
|
156 |
-
}
|
157 |
-
if (count($this->_)>0)
|
158 |
-
{
|
159 |
-
$string .= ' $_ (';
|
160 |
-
foreach ($this->_ as $k=>$v)
|
161 |
-
{
|
162 |
-
if (is_array($v))
|
163 |
-
{
|
164 |
-
$string .= "[$k]=>(";
|
165 |
-
foreach ($v as $k2=>$v2)
|
166 |
-
{
|
167 |
-
$string .= "[$k2]=>\"".$v2.'", ';
|
168 |
-
}
|
169 |
-
$string .= ")";
|
170 |
-
} else {
|
171 |
-
$string .= "[$k]=>\"".$v.'", ';
|
172 |
-
}
|
173 |
-
}
|
174 |
-
$string .= ")";
|
175 |
-
}
|
176 |
-
|
177 |
-
if (isset($this->text))
|
178 |
-
{
|
179 |
-
$string .= " text: (" . $this->text . ")";
|
180 |
-
}
|
181 |
-
|
182 |
-
$string .= " HDOM_INNER_INFO: '";
|
183 |
-
if (isset($node->_[HDOM_INFO_INNER]))
|
184 |
-
{
|
185 |
-
$string .= $node->_[HDOM_INFO_INNER] . "'";
|
186 |
-
}
|
187 |
-
else
|
188 |
-
{
|
189 |
-
$string .= ' NULL ';
|
190 |
-
}
|
191 |
-
|
192 |
-
$string .= " children: " . count($this->children);
|
193 |
-
$string .= " nodes: " . count($this->nodes);
|
194 |
-
$string .= " tag_start: " . $this->tag_start;
|
195 |
-
$string .= "\n";
|
196 |
-
|
197 |
-
if ($echo)
|
198 |
-
{
|
199 |
-
echo $string;
|
200 |
-
return;
|
201 |
-
}
|
202 |
-
else
|
203 |
-
{
|
204 |
-
return $string;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
// returns the parent of node
|
209 |
-
// If a node is passed in, it will reset the parent of the current node to that one.
|
210 |
-
function parent($parent=null)
|
211 |
-
{
|
212 |
-
// I am SURE that this doesn't work properly.
|
213 |
-
// It fails to unset the current node from it's current parents nodes or children list first.
|
214 |
-
if ($parent !== null)
|
215 |
-
{
|
216 |
-
$this->parent = $parent;
|
217 |
-
$this->parent->nodes[] = $this;
|
218 |
-
$this->parent->children[] = $this;
|
219 |
-
}
|
220 |
-
|
221 |
-
return $this->parent;
|
222 |
-
}
|
223 |
-
|
224 |
-
// verify that node has children
|
225 |
-
function has_child()
|
226 |
-
{
|
227 |
-
return !empty($this->children);
|
228 |
-
}
|
229 |
-
|
230 |
-
// returns children of node
|
231 |
-
function children($idx=-1)
|
232 |
-
{
|
233 |
-
if ($idx===-1)
|
234 |
-
{
|
235 |
-
return $this->children;
|
236 |
-
}
|
237 |
-
if (isset($this->children[$idx]))
|
238 |
-
{
|
239 |
-
return $this->children[$idx];
|
240 |
-
}
|
241 |
-
return null;
|
242 |
-
}
|
243 |
-
|
244 |
-
// returns the first child of node
|
245 |
-
function first_child()
|
246 |
-
{
|
247 |
-
if (count($this->children)>0)
|
248 |
-
{
|
249 |
-
return $this->children[0];
|
250 |
-
}
|
251 |
-
return null;
|
252 |
-
}
|
253 |
-
|
254 |
-
// returns the last child of node
|
255 |
-
function last_child()
|
256 |
-
{
|
257 |
-
if (($count=count($this->children))>0)
|
258 |
-
{
|
259 |
-
return $this->children[$count-1];
|
260 |
-
}
|
261 |
-
return null;
|
262 |
-
}
|
263 |
-
|
264 |
-
// returns the next sibling of node
|
265 |
-
function next_sibling()
|
266 |
-
{
|
267 |
-
if ($this->parent===null)
|
268 |
-
{
|
269 |
-
return null;
|
270 |
-
}
|
271 |
-
|
272 |
-
$idx = 0;
|
273 |
-
$count = count($this->parent->children);
|
274 |
-
while ($idx<$count && $this!==$this->parent->children[$idx])
|
275 |
-
{
|
276 |
-
++$idx;
|
277 |
-
}
|
278 |
-
if (++$idx>=$count)
|
279 |
-
{
|
280 |
-
return null;
|
281 |
-
}
|
282 |
-
return $this->parent->children[$idx];
|
283 |
-
}
|
284 |
-
|
285 |
-
// returns the previous sibling of node
|
286 |
-
function prev_sibling()
|
287 |
-
{
|
288 |
-
if ($this->parent===null) return null;
|
289 |
-
$idx = 0;
|
290 |
-
$count = count($this->parent->children);
|
291 |
-
while ($idx<$count && $this!==$this->parent->children[$idx])
|
292 |
-
++$idx;
|
293 |
-
if (--$idx<0) return null;
|
294 |
-
return $this->parent->children[$idx];
|
295 |
-
}
|
296 |
-
|
297 |
-
// function to locate a specific ancestor tag in the path to the root.
|
298 |
-
function find_ancestor_tag($tag)
|
299 |
-
{
|
300 |
-
global $debug_object;
|
301 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
302 |
-
|
303 |
-
// Start by including ourselves in the comparison.
|
304 |
-
$returnDom = $this;
|
305 |
-
|
306 |
-
while (!is_null($returnDom))
|
307 |
-
{
|
308 |
-
if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); }
|
309 |
-
|
310 |
-
if ($returnDom->tag == $tag)
|
311 |
-
{
|
312 |
-
break;
|
313 |
-
}
|
314 |
-
$returnDom = $returnDom->parent;
|
315 |
-
}
|
316 |
-
return $returnDom;
|
317 |
-
}
|
318 |
-
|
319 |
-
// get dom node's inner html
|
320 |
-
function innertext()
|
321 |
-
{
|
322 |
-
if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
|
323 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
324 |
-
|
325 |
-
$ret = '';
|
326 |
-
foreach ($this->nodes as $n)
|
327 |
-
$ret .= $n->outertext();
|
328 |
-
return $ret;
|
329 |
-
}
|
330 |
-
|
331 |
-
// get dom node's outer text (with tag)
|
332 |
-
function outertext()
|
333 |
-
{
|
334 |
-
global $debug_object;
|
335 |
-
if (is_object($debug_object))
|
336 |
-
{
|
337 |
-
$text = '';
|
338 |
-
if ($this->tag == 'text')
|
339 |
-
{
|
340 |
-
if (!empty($this->text))
|
341 |
-
{
|
342 |
-
$text = " with text: " . $this->text;
|
343 |
-
}
|
344 |
-
}
|
345 |
-
$debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text);
|
346 |
-
}
|
347 |
-
|
348 |
-
if ($this->tag==='root') return $this->innertext();
|
349 |
-
|
350 |
-
// trigger callback
|
351 |
-
if ($this->dom && $this->dom->callback!==null)
|
352 |
-
{
|
353 |
-
call_user_func_array($this->dom->callback, array($this));
|
354 |
-
}
|
355 |
-
|
356 |
-
if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER];
|
357 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
358 |
-
|
359 |
-
// render begin tag
|
360 |
-
if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]])
|
361 |
-
{
|
362 |
-
$ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup();
|
363 |
-
} else {
|
364 |
-
$ret = "";
|
365 |
-
}
|
366 |
-
|
367 |
-
// render inner text
|
368 |
-
if (isset($this->_[HDOM_INFO_INNER]))
|
369 |
-
{
|
370 |
-
// If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added.
|
371 |
-
if ($this->tag != "br")
|
372 |
-
{
|
373 |
-
$ret .= $this->_[HDOM_INFO_INNER];
|
374 |
-
}
|
375 |
-
} else {
|
376 |
-
if ($this->nodes)
|
377 |
-
{
|
378 |
-
foreach ($this->nodes as $n)
|
379 |
-
{
|
380 |
-
$ret .= $this->convert_text($n->outertext());
|
381 |
-
}
|
382 |
-
}
|
383 |
-
}
|
384 |
-
|
385 |
-
// render end tag
|
386 |
-
if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0)
|
387 |
-
$ret .= '</'.$this->tag.'>';
|
388 |
-
return $ret;
|
389 |
-
}
|
390 |
-
|
391 |
-
// get dom node's plain text
|
392 |
-
function text()
|
393 |
-
{
|
394 |
-
if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
|
395 |
-
switch ($this->nodetype)
|
396 |
-
{
|
397 |
-
case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
398 |
-
case HDOM_TYPE_COMMENT: return '';
|
399 |
-
case HDOM_TYPE_UNKNOWN: return '';
|
400 |
-
}
|
401 |
-
if (strcasecmp($this->tag, 'script')===0) return '';
|
402 |
-
if (strcasecmp($this->tag, 'style')===0) return '';
|
403 |
-
|
404 |
-
$ret = '';
|
405 |
-
// In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
|
406 |
-
// NOTE: This indicates that there is a problem where it's set to NULL without a clear happening.
|
407 |
-
// WHY is this happening?
|
408 |
-
if (!is_null($this->nodes))
|
409 |
-
{
|
410 |
-
foreach ($this->nodes as $n)
|
411 |
-
{
|
412 |
-
$ret .= $this->convert_text($n->text());
|
413 |
-
}
|
414 |
-
|
415 |
-
// If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all.
|
416 |
-
if ($this->tag == "span")
|
417 |
-
{
|
418 |
-
$ret .= $this->dom->default_span_text;
|
419 |
-
}
|
420 |
-
|
421 |
-
|
422 |
-
}
|
423 |
-
return $ret;
|
424 |
-
}
|
425 |
-
|
426 |
-
function xmltext()
|
427 |
-
{
|
428 |
-
$ret = $this->innertext();
|
429 |
-
$ret = str_ireplace('<![CDATA[', '', $ret);
|
430 |
-
$ret = str_replace(']]>', '', $ret);
|
431 |
-
return $ret;
|
432 |
-
}
|
433 |
-
|
434 |
-
// build node's text with tag
|
435 |
-
function makeup()
|
436 |
-
{
|
437 |
-
// text, comment, unknown
|
438 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
439 |
-
|
440 |
-
$ret = '<'.$this->tag;
|
441 |
-
$i = -1;
|
442 |
-
|
443 |
-
foreach ($this->attr as $key=>$val)
|
444 |
-
{
|
445 |
-
++$i;
|
446 |
-
|
447 |
-
// skip removed attribute
|
448 |
-
if ($val===null || $val===false)
|
449 |
-
continue;
|
450 |
-
|
451 |
-
$ret .= $this->_[HDOM_INFO_SPACE][$i][0];
|
452 |
-
//no value attr: nowrap, checked selected...
|
453 |
-
if ($val===true)
|
454 |
-
$ret .= $key;
|
455 |
-
else {
|
456 |
-
switch ($this->_[HDOM_INFO_QUOTE][$i])
|
457 |
-
{
|
458 |
-
case HDOM_QUOTE_DOUBLE: $quote = '"'; break;
|
459 |
-
case HDOM_QUOTE_SINGLE: $quote = '\''; break;
|
460 |
-
default: $quote = '';
|
461 |
-
}
|
462 |
-
$ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote;
|
463 |
-
}
|
464 |
-
}
|
465 |
-
$ret = $this->dom->restore_noise($ret);
|
466 |
-
return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
|
467 |
-
}
|
468 |
-
|
469 |
-
// find elements by css selector
|
470 |
-
//PaperG - added ability for find to lowercase the value of the selector.
|
471 |
-
function find($selector, $idx=null, $lowercase=false)
|
472 |
-
{
|
473 |
-
$selectors = $this->parse_selector($selector);
|
474 |
-
if (($count=count($selectors))===0) return array();
|
475 |
-
$found_keys = array();
|
476 |
-
|
477 |
-
// find each selector
|
478 |
-
for ($c=0; $c<$count; ++$c)
|
479 |
-
{
|
480 |
-
// The change on the below line was documented on the sourceforge code tracker id 2788009
|
481 |
-
// used to be: if (($levle=count($selectors[0]))===0) return array();
|
482 |
-
if (($levle=count($selectors[$c]))===0) return array();
|
483 |
-
if (!isset($this->_[HDOM_INFO_BEGIN])) return array();
|
484 |
-
|
485 |
-
$head = array($this->_[HDOM_INFO_BEGIN]=>1);
|
486 |
-
|
487 |
-
// handle descendant selectors, no recursive!
|
488 |
-
for ($l=0; $l<$levle; ++$l)
|
489 |
-
{
|
490 |
-
$ret = array();
|
491 |
-
foreach ($head as $k=>$v)
|
492 |
-
{
|
493 |
-
$n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
|
494 |
-
//PaperG - Pass this optional parameter on to the seek function.
|
495 |
-
$n->seek($selectors[$c][$l], $ret, $lowercase);
|
496 |
-
}
|
497 |
-
$head = $ret;
|
498 |
-
}
|
499 |
-
|
500 |
-
foreach ($head as $k=>$v)
|
501 |
-
{
|
502 |
-
if (!isset($found_keys[$k]))
|
503 |
-
{
|
504 |
-
$found_keys[$k] = 1;
|
505 |
-
}
|
506 |
-
}
|
507 |
-
}
|
508 |
-
|
509 |
-
// sort keys
|
510 |
-
ksort($found_keys);
|
511 |
-
|
512 |
-
$found = array();
|
513 |
-
foreach ($found_keys as $k=>$v)
|
514 |
-
$found[] = $this->dom->nodes[$k];
|
515 |
-
|
516 |
-
// return nth-element or array
|
517 |
-
if (is_null($idx)) return $found;
|
518 |
-
else if ($idx<0) $idx = count($found) + $idx;
|
519 |
-
return (isset($found[$idx])) ? $found[$idx] : null;
|
520 |
-
}
|
521 |
-
|
522 |
-
// seek for given conditions
|
523 |
-
// PaperG - added parameter to allow for case insensitive testing of the value of a selector.
|
524 |
-
protected function seek($selector, &$ret, $lowercase=false)
|
525 |
-
{
|
526 |
-
global $debug_object;
|
527 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
528 |
-
|
529 |
-
list($tag, $key, $val, $exp, $no_key) = $selector;
|
530 |
-
|
531 |
-
// xpath index
|
532 |
-
if ($tag && $key && is_numeric($key))
|
533 |
-
{
|
534 |
-
$count = 0;
|
535 |
-
foreach ($this->children as $c)
|
536 |
-
{
|
537 |
-
if ($tag==='*' || $tag===$c->tag) {
|
538 |
-
if (++$count==$key) {
|
539 |
-
$ret[$c->_[HDOM_INFO_BEGIN]] = 1;
|
540 |
-
return;
|
541 |
-
}
|
542 |
-
}
|
543 |
-
}
|
544 |
-
return;
|
545 |
-
}
|
546 |
-
|
547 |
-
$end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0;
|
548 |
-
if ($end==0) {
|
549 |
-
$parent = $this->parent;
|
550 |
-
while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) {
|
551 |
-
$end -= 1;
|
552 |
-
$parent = $parent->parent;
|
553 |
-
}
|
554 |
-
$end += $parent->_[HDOM_INFO_END];
|
555 |
-
}
|
556 |
-
|
557 |
-
for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
|
558 |
-
$node = $this->dom->nodes[$i];
|
559 |
-
|
560 |
-
$pass = true;
|
561 |
-
|
562 |
-
if ($tag==='*' && !$key) {
|
563 |
-
if (in_array($node, $this->children, true))
|
564 |
-
$ret[$i] = 1;
|
565 |
-
continue;
|
566 |
-
}
|
567 |
-
|
568 |
-
// compare tag
|
569 |
-
if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;}
|
570 |
-
// compare key
|
571 |
-
if ($pass && $key) {
|
572 |
-
if ($no_key) {
|
573 |
-
if (isset($node->attr[$key])) $pass=false;
|
574 |
-
} else {
|
575 |
-
if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false;
|
576 |
-
}
|
577 |
-
}
|
578 |
-
// compare value
|
579 |
-
if ($pass && $key && $val && $val!=='*') {
|
580 |
-
// If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
|
581 |
-
if ($key == "plaintext") {
|
582 |
-
// $node->plaintext actually returns $node->text();
|
583 |
-
$nodeKeyValue = $node->text();
|
584 |
-
} else {
|
585 |
-
// this is a normal search, we want the value of that attribute of the tag.
|
586 |
-
$nodeKeyValue = $node->attr[$key];
|
587 |
-
}
|
588 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);}
|
589 |
-
|
590 |
-
//PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
|
591 |
-
if ($lowercase) {
|
592 |
-
$check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue));
|
593 |
-
} else {
|
594 |
-
$check = $this->match($exp, $val, $nodeKeyValue);
|
595 |
-
}
|
596 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));}
|
597 |
-
|
598 |
-
// handle multiple class
|
599 |
-
if (!$check && strcasecmp($key, 'class')===0) {
|
600 |
-
foreach (explode(' ',$node->attr[$key]) as $k) {
|
601 |
-
// Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
|
602 |
-
if (!empty($k)) {
|
603 |
-
if ($lowercase) {
|
604 |
-
$check = $this->match($exp, strtolower($val), strtolower($k));
|
605 |
-
} else {
|
606 |
-
$check = $this->match($exp, $val, $k);
|
607 |
-
}
|
608 |
-
if ($check) break;
|
609 |
-
}
|
610 |
-
}
|
611 |
-
}
|
612 |
-
if (!$check) $pass = false;
|
613 |
-
}
|
614 |
-
if ($pass) $ret[$i] = 1;
|
615 |
-
unset($node);
|
616 |
-
}
|
617 |
-
// It's passed by reference so this is actually what this function returns.
|
618 |
-
if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);}
|
619 |
-
}
|
620 |
-
|
621 |
-
protected function match($exp, $pattern, $value) {
|
622 |
-
global $debug_object;
|
623 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
624 |
-
|
625 |
-
switch ($exp) {
|
626 |
-
case '=':
|
627 |
-
return ($value===$pattern);
|
628 |
-
case '!=':
|
629 |
-
return ($value!==$pattern);
|
630 |
-
case '^=':
|
631 |
-
return preg_match("/^".preg_quote($pattern,'/')."/", $value);
|
632 |
-
case '$=':
|
633 |
-
return preg_match("/".preg_quote($pattern,'/')."$/", $value);
|
634 |
-
case '*=':
|
635 |
-
if ($pattern[0]=='/') {
|
636 |
-
return preg_match($pattern, $value);
|
637 |
-
}
|
638 |
-
return preg_match("/".$pattern."/i", $value);
|
639 |
-
}
|
640 |
-
return false;
|
641 |
-
}
|
642 |
-
|
643 |
-
protected function parse_selector($selector_string) {
|
644 |
-
global $debug_object;
|
645 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
646 |
-
|
647 |
-
// pattern of CSS selectors, modified from mootools
|
648 |
-
// Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
|
649 |
-
// Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
|
650 |
-
// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured.
|
651 |
-
// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
|
652 |
-
// farther study is required to determine of this should be documented or removed.
|
653 |
-
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
|
654 |
-
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
|
655 |
-
preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
|
656 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);}
|
657 |
-
|
658 |
-
$selectors = array();
|
659 |
-
$result = array();
|
660 |
-
//print_r($matches);
|
661 |
-
|
662 |
-
foreach ($matches as $m) {
|
663 |
-
$m[0] = trim($m[0]);
|
664 |
-
if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue;
|
665 |
-
// for browser generated xpath
|
666 |
-
if ($m[1]==='tbody') continue;
|
667 |
-
|
668 |
-
list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
|
669 |
-
if (!empty($m[2])) {$key='id'; $val=$m[2];}
|
670 |
-
if (!empty($m[3])) {$key='class'; $val=$m[3];}
|
671 |
-
if (!empty($m[4])) {$key=$m[4];}
|
672 |
-
if (!empty($m[5])) {$exp=$m[5];}
|
673 |
-
if (!empty($m[6])) {$val=$m[6];}
|
674 |
-
|
675 |
-
// convert to lowercase
|
676 |
-
if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);}
|
677 |
-
//elements that do NOT have the specified attribute
|
678 |
-
if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;}
|
679 |
-
|
680 |
-
$result[] = array($tag, $key, $val, $exp, $no_key);
|
681 |
-
if (trim($m[7])===',') {
|
682 |
-
$selectors[] = $result;
|
683 |
-
$result = array();
|
684 |
-
}
|
685 |
-
}
|
686 |
-
if (count($result)>0)
|
687 |
-
$selectors[] = $result;
|
688 |
-
return $selectors;
|
689 |
-
}
|
690 |
-
|
691 |
-
function __get($name)
|
692 |
-
{
|
693 |
-
if (isset($this->attr[$name]))
|
694 |
-
{
|
695 |
-
return $this->convert_text($this->attr[$name]);
|
696 |
-
}
|
697 |
-
switch ($name)
|
698 |
-
{
|
699 |
-
case 'outertext': return $this->outertext();
|
700 |
-
case 'innertext': return $this->innertext();
|
701 |
-
case 'plaintext': return $this->text();
|
702 |
-
case 'xmltext': return $this->xmltext();
|
703 |
-
default: return array_key_exists($name, $this->attr);
|
704 |
-
}
|
705 |
-
}
|
706 |
-
|
707 |
-
function __set($name, $value)
|
708 |
-
{
|
709 |
-
global $debug_object;
|
710 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
711 |
-
|
712 |
-
switch ($name)
|
713 |
-
{
|
714 |
-
case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value;
|
715 |
-
case 'innertext':
|
716 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value;
|
717 |
-
return $this->_[HDOM_INFO_INNER] = $value;
|
718 |
-
}
|
719 |
-
if (!isset($this->attr[$name]))
|
720 |
-
{
|
721 |
-
$this->_[HDOM_INFO_SPACE][] = array(' ', '', '');
|
722 |
-
$this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
|
723 |
-
}
|
724 |
-
$this->attr[$name] = $value;
|
725 |
-
}
|
726 |
-
|
727 |
-
function __isset($name)
|
728 |
-
{
|
729 |
-
switch ($name)
|
730 |
-
{
|
731 |
-
case 'outertext': return true;
|
732 |
-
case 'innertext': return true;
|
733 |
-
case 'plaintext': return true;
|
734 |
-
}
|
735 |
-
//no value attr: nowrap, checked selected...
|
736 |
-
return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]);
|
737 |
-
}
|
738 |
-
|
739 |
-
function __unset($name) {
|
740 |
-
if (isset($this->attr[$name]))
|
741 |
-
unset($this->attr[$name]);
|
742 |
-
}
|
743 |
-
|
744 |
-
// PaperG - Function to convert the text from one character set to another if the two sets are not the same.
|
745 |
-
function convert_text($text)
|
746 |
-
{
|
747 |
-
global $debug_object;
|
748 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
749 |
-
|
750 |
-
$converted_text = $text;
|
751 |
-
|
752 |
-
$sourceCharset = "";
|
753 |
-
$targetCharset = "";
|
754 |
-
|
755 |
-
if ($this->dom)
|
756 |
-
{
|
757 |
-
$sourceCharset = strtoupper($this->dom->_charset);
|
758 |
-
$targetCharset = strtoupper($this->dom->_target_charset);
|
759 |
-
}
|
760 |
-
if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);}
|
761 |
-
|
762 |
-
if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0))
|
763 |
-
{
|
764 |
-
// Check if the reported encoding could have been incorrect and the text is actually already UTF-8
|
765 |
-
if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text)))
|
766 |
-
{
|
767 |
-
$converted_text = $text;
|
768 |
-
}
|
769 |
-
else
|
770 |
-
{
|
771 |
-
$converted_text = iconv($sourceCharset, $targetCharset, $text);
|
772 |
-
}
|
773 |
-
}
|
774 |
-
|
775 |
-
// Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
|
776 |
-
if ($targetCharset == 'UTF-8')
|
777 |
-
{
|
778 |
-
if (substr($converted_text, 0, 3) == "\xef\xbb\xbf")
|
779 |
-
{
|
780 |
-
$converted_text = substr($converted_text, 3);
|
781 |
-
}
|
782 |
-
if (substr($converted_text, -3) == "\xef\xbb\xbf")
|
783 |
-
{
|
784 |
-
$converted_text = substr($converted_text, 0, -3);
|
785 |
-
}
|
786 |
-
}
|
787 |
-
|
788 |
-
return $converted_text;
|
789 |
-
}
|
790 |
-
|
791 |
-
/**
|
792 |
-
* Returns true if $string is valid UTF-8 and false otherwise.
|
793 |
-
*
|
794 |
-
* @param mixed $str String to be tested
|
795 |
-
* @return boolean
|
796 |
-
*/
|
797 |
-
static function is_utf8($str)
|
798 |
-
{
|
799 |
-
$c=0; $b=0;
|
800 |
-
$bits=0;
|
801 |
-
$len=strlen($str);
|
802 |
-
for($i=0; $i<$len; $i++)
|
803 |
-
{
|
804 |
-
$c=ord($str[$i]);
|
805 |
-
if($c > 128)
|
806 |
-
{
|
807 |
-
if(($c >= 254)) return false;
|
808 |
-
elseif($c >= 252) $bits=6;
|
809 |
-
elseif($c >= 248) $bits=5;
|
810 |
-
elseif($c >= 240) $bits=4;
|
811 |
-
elseif($c >= 224) $bits=3;
|
812 |
-
elseif($c >= 192) $bits=2;
|
813 |
-
else return false;
|
814 |
-
if(($i+$bits) > $len) return false;
|
815 |
-
while($bits > 1)
|
816 |
-
{
|
817 |
-
$i++;
|
818 |
-
$b=ord($str[$i]);
|
819 |
-
if($b < 128 || $b > 191) return false;
|
820 |
-
$bits--;
|
821 |
-
}
|
822 |
-
}
|
823 |
-
}
|
824 |
-
return true;
|
825 |
-
}
|
826 |
-
/*
|
827 |
-
function is_utf8($string)
|
828 |
-
{
|
829 |
-
//this is buggy
|
830 |
-
return (utf8_encode(utf8_decode($string)) == $string);
|
831 |
-
}
|
832 |
-
*/
|
833 |
-
|
834 |
-
/**
|
835 |
-
* Function to try a few tricks to determine the displayed size of an img on the page.
|
836 |
-
* NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types.
|
837 |
-
*
|
838 |
-
* @author John Schlick
|
839 |
-
* @version April 19 2012
|
840 |
-
* @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
|
841 |
-
*/
|
842 |
-
function get_display_size()
|
843 |
-
{
|
844 |
-
global $debug_object;
|
845 |
-
|
846 |
-
$width = -1;
|
847 |
-
$height = -1;
|
848 |
-
|
849 |
-
if ($this->tag !== 'img')
|
850 |
-
{
|
851 |
-
return false;
|
852 |
-
}
|
853 |
-
|
854 |
-
// See if there is aheight or width attribute in the tag itself.
|
855 |
-
if (isset($this->attr['width']))
|
856 |
-
{
|
857 |
-
$width = $this->attr['width'];
|
858 |
-
}
|
859 |
-
|
860 |
-
if (isset($this->attr['height']))
|
861 |
-
{
|
862 |
-
$height = $this->attr['height'];
|
863 |
-
}
|
864 |
-
|
865 |
-
// Now look for an inline style.
|
866 |
-
if (isset($this->attr['style']))
|
867 |
-
{
|
868 |
-
// Thanks to user gnarf from stackoverflow for this regular expression.
|
869 |
-
$attributes = array();
|
870 |
-
preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER);
|
871 |
-
foreach ($matches as $match) {
|
872 |
-
$attributes[$match[1]] = $match[2];
|
873 |
-
}
|
874 |
-
|
875 |
-
// If there is a width in the style attributes:
|
876 |
-
if (isset($attributes['width']) && $width == -1)
|
877 |
-
{
|
878 |
-
// check that the last two characters are px (pixels)
|
879 |
-
if (strtolower(substr($attributes['width'], -2)) == 'px')
|
880 |
-
{
|
881 |
-
$proposed_width = substr($attributes['width'], 0, -2);
|
882 |
-
// Now make sure that it's an integer and not something stupid.
|
883 |
-
if (filter_var($proposed_width, FILTER_VALIDATE_INT))
|
884 |
-
{
|
885 |
-
$width = $proposed_width;
|
886 |
-
}
|
887 |
-
}
|
888 |
-
}
|
889 |
-
|
890 |
-
// If there is a width in the style attributes:
|
891 |
-
if (isset($attributes['height']) && $height == -1)
|
892 |
-
{
|
893 |
-
// check that the last two characters are px (pixels)
|
894 |
-
if (strtolower(substr($attributes['height'], -2)) == 'px')
|
895 |
-
{
|
896 |
-
$proposed_height = substr($attributes['height'], 0, -2);
|
897 |
-
// Now make sure that it's an integer and not something stupid.
|
898 |
-
if (filter_var($proposed_height, FILTER_VALIDATE_INT))
|
899 |
-
{
|
900 |
-
$height = $proposed_height;
|
901 |
-
}
|
902 |
-
}
|
903 |
-
}
|
904 |
-
|
905 |
-
}
|
906 |
-
|
907 |
-
// Future enhancement:
|
908 |
-
// Look in the tag to see if there is a class or id specified that has a height or width attribute to it.
|
909 |
-
|
910 |
-
// Far future enhancement
|
911 |
-
// Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width
|
912 |
-
// Note that in this case, the class or id will have the img subselector for it to apply to the image.
|
913 |
-
|
914 |
-
// ridiculously far future development
|
915 |
-
// If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page.
|
916 |
-
|
917 |
-
$result = array('height' => $height,
|
918 |
-
'width' => $width);
|
919 |
-
return $result;
|
920 |
-
}
|
921 |
-
|
922 |
-
// camel naming conventions
|
923 |
-
function getAllAttributes() {return $this->attr;}
|
924 |
-
function getAttribute($name) {return $this->__get($name);}
|
925 |
-
function setAttribute($name, $value) {$this->__set($name, $value);}
|
926 |
-
function hasAttribute($name) {return $this->__isset($name);}
|
927 |
-
function removeAttribute($name) {$this->__set($name, null);}
|
928 |
-
function getElementById($id) {return $this->find("#$id", 0);}
|
929 |
-
function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
|
930 |
-
function getElementByTagName($name) {return $this->find($name, 0);}
|
931 |
-
function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);}
|
932 |
-
function parentNode() {return $this->parent();}
|
933 |
-
function childNodes($idx=-1) {return $this->children($idx);}
|
934 |
-
function firstChild() {return $this->first_child();}
|
935 |
-
function lastChild() {return $this->last_child();}
|
936 |
-
function nextSibling() {return $this->next_sibling();}
|
937 |
-
function previousSibling() {return $this->prev_sibling();}
|
938 |
-
function hasChildNodes() {return $this->has_child();}
|
939 |
-
function nodeName() {return $this->tag;}
|
940 |
-
function appendChild($node) {$node->parent($this); return $node;}
|
941 |
-
|
942 |
-
}
|
943 |
-
|
944 |
-
/**
|
945 |
-
* simple html dom parser
|
946 |
-
* Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector.
|
947 |
-
* Paperg - change $size from protected to public so we can easily access it
|
948 |
-
* Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it.
|
949 |
-
*
|
950 |
-
* @package PlaceLocalInclude
|
951 |
-
*/
|
952 |
-
class simple_html_dom
|
953 |
-
{
|
954 |
-
public $root = null;
|
955 |
-
public $nodes = array();
|
956 |
-
public $callback = null;
|
957 |
-
public $lowercase = false;
|
958 |
-
// Used to keep track of how large the text was when we started.
|
959 |
-
public $original_size;
|
960 |
-
public $size;
|
961 |
-
protected $pos;
|
962 |
-
protected $doc;
|
963 |
-
protected $char;
|
964 |
-
protected $cursor;
|
965 |
-
protected $parent;
|
966 |
-
protected $noise = array();
|
967 |
-
protected $token_blank = " \t\r\n";
|
968 |
-
protected $token_equal = ' =/>';
|
969 |
-
protected $token_slash = " />\r\n\t";
|
970 |
-
protected $token_attr = ' >';
|
971 |
-
// Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
|
972 |
-
public $_charset = '';
|
973 |
-
public $_target_charset = '';
|
974 |
-
protected $default_br_text = "";
|
975 |
-
public $default_span_text = "";
|
976 |
-
|
977 |
-
// use isset instead of in_array, performance boost about 30%...
|
978 |
-
protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1);
|
979 |
-
protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1);
|
980 |
-
// Known sourceforge issue #2977341
|
981 |
-
// B tags that are not closed cause us to return everything to the end of the document.
|
982 |
-
protected $optional_closing_tags = array(
|
983 |
-
'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1),
|
984 |
-
'th'=>array('th'=>1),
|
985 |
-
'td'=>array('td'=>1),
|
986 |
-
'li'=>array('li'=>1),
|
987 |
-
'dt'=>array('dt'=>1, 'dd'=>1),
|
988 |
-
'dd'=>array('dd'=>1, 'dt'=>1),
|
989 |
-
'dl'=>array('dd'=>1, 'dt'=>1),
|
990 |
-
'p'=>array('p'=>1),
|
991 |
-
'nobr'=>array('nobr'=>1),
|
992 |
-
'b'=>array('b'=>1),
|
993 |
-
'option'=>array('option'=>1),
|
994 |
-
);
|
995 |
-
|
996 |
-
function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
997 |
-
{
|
998 |
-
if ($str)
|
999 |
-
{
|
1000 |
-
if (preg_match("/^http:\/\//i",$str) || is_file($str))
|
1001 |
-
{
|
1002 |
-
$this->load_file($str);
|
1003 |
-
}
|
1004 |
-
else
|
1005 |
-
{
|
1006 |
-
$this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
|
1007 |
-
}
|
1008 |
-
}
|
1009 |
-
// Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
|
1010 |
-
if (!$forceTagsClosed) {
|
1011 |
-
$this->optional_closing_array=array();
|
1012 |
-
}
|
1013 |
-
$this->_target_charset = $target_charset;
|
1014 |
-
}
|
1015 |
-
|
1016 |
-
function __destruct()
|
1017 |
-
{
|
1018 |
-
$this->clear();
|
1019 |
-
}
|
1020 |
-
|
1021 |
-
// load html from string
|
1022 |
-
function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
1023 |
-
{
|
1024 |
-
global $debug_object;
|
1025 |
-
|
1026 |
-
// prepare
|
1027 |
-
$this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
|
1028 |
-
// strip out cdata
|
1029 |
-
$this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true);
|
1030 |
-
// strip out comments
|
1031 |
-
$this->remove_noise("'<!--(.*?)-->'is");
|
1032 |
-
// Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
|
1033 |
-
// Script tags removal now preceeds style tag removal.
|
1034 |
-
// strip out <script> tags
|
1035 |
-
$this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is");
|
1036 |
-
$this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is");
|
1037 |
-
// strip out <style> tags
|
1038 |
-
$this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is");
|
1039 |
-
$this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is");
|
1040 |
-
// strip out preformatted tags
|
1041 |
-
$this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is");
|
1042 |
-
// strip out server side scripts
|
1043 |
-
$this->remove_noise("'(<\?)(.*?)(\?>)'s", true);
|
1044 |
-
// strip smarty scripts
|
1045 |
-
$this->remove_noise("'(\{\w)(.*?)(\})'s", true);
|
1046 |
-
|
1047 |
-
// parsing
|
1048 |
-
while ($this->parse());
|
1049 |
-
// end
|
1050 |
-
$this->root->_[HDOM_INFO_END] = $this->cursor;
|
1051 |
-
$this->parse_charset();
|
1052 |
-
|
1053 |
-
// make load function chainable
|
1054 |
-
return $this;
|
1055 |
-
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
// load html from file
|
1059 |
-
function load_file()
|
1060 |
-
{
|
1061 |
-
$args = func_get_args();
|
1062 |
-
$this->load(call_user_func_array('file_get_contents', $args), true);
|
1063 |
-
// Throw an error if we can't properly load the dom.
|
1064 |
-
if (($error=error_get_last())!==null) {
|
1065 |
-
$this->clear();
|
1066 |
-
return false;
|
1067 |
-
}
|
1068 |
-
}
|
1069 |
-
|
1070 |
-
// set callback function
|
1071 |
-
function set_callback($function_name)
|
1072 |
-
{
|
1073 |
-
$this->callback = $function_name;
|
1074 |
-
}
|
1075 |
-
|
1076 |
-
// remove callback function
|
1077 |
-
function remove_callback()
|
1078 |
-
{
|
1079 |
-
$this->callback = null;
|
1080 |
-
}
|
1081 |
-
|
1082 |
-
// save dom as string
|
1083 |
-
function save($filepath='')
|
1084 |
-
{
|
1085 |
-
$ret = $this->root->innertext();
|
1086 |
-
if ($filepath!=='') file_put_contents($filepath, $ret, LOCK_EX);
|
1087 |
-
return $ret;
|
1088 |
-
}
|
1089 |
-
|
1090 |
-
// find dom node by css selector
|
1091 |
-
// Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
|
1092 |
-
function find($selector, $idx=null, $lowercase=false)
|
1093 |
-
{
|
1094 |
-
return $this->root->find($selector, $idx, $lowercase);
|
1095 |
-
}
|
1096 |
-
|
1097 |
-
// clean up memory due to php5 circular references memory leak...
|
1098 |
-
function clear()
|
1099 |
-
{
|
1100 |
-
foreach ($this->nodes as $n) {$n->clear(); $n = null;}
|
1101 |
-
// This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear.
|
1102 |
-
if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null;}
|
1103 |
-
if (isset($this->parent)) {$this->parent->clear(); unset($this->parent);}
|
1104 |
-
if (isset($this->root)) {$this->root->clear(); unset($this->root);}
|
1105 |
-
unset($this->doc);
|
1106 |
-
unset($this->noise);
|
1107 |
-
}
|
1108 |
-
|
1109 |
-
function dump($show_attr=true)
|
1110 |
-
{
|
1111 |
-
$this->root->dump($show_attr);
|
1112 |
-
}
|
1113 |
-
|
1114 |
-
// prepare HTML data and init everything
|
1115 |
-
protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
1116 |
-
{
|
1117 |
-
$this->clear();
|
1118 |
-
|
1119 |
-
// set the length of content before we do anything to it.
|
1120 |
-
$this->size = strlen($str);
|
1121 |
-
// Save the original size of the html that we got in. It might be useful to someone.
|
1122 |
-
$this->original_size = $this->size;
|
1123 |
-
|
1124 |
-
//before we save the string as the doc... strip out the \r \n's if we are told to.
|
1125 |
-
if ($stripRN) {
|
1126 |
-
$str = str_replace("\r", " ", $str);
|
1127 |
-
$str = str_replace("\n", " ", $str);
|
1128 |
-
|
1129 |
-
// set the length of content since we have changed it.
|
1130 |
-
$this->size = strlen($str);
|
1131 |
-
}
|
1132 |
-
|
1133 |
-
$this->doc = $str;
|
1134 |
-
$this->pos = 0;
|
1135 |
-
$this->cursor = 1;
|
1136 |
-
$this->noise = array();
|
1137 |
-
$this->nodes = array();
|
1138 |
-
$this->lowercase = $lowercase;
|
1139 |
-
$this->default_br_text = $defaultBRText;
|
1140 |
-
$this->default_span_text = $defaultSpanText;
|
1141 |
-
$this->root = new simple_html_dom_node($this);
|
1142 |
-
$this->root->tag = 'root';
|
1143 |
-
$this->root->_[HDOM_INFO_BEGIN] = -1;
|
1144 |
-
$this->root->nodetype = HDOM_TYPE_ROOT;
|
1145 |
-
$this->parent = $this->root;
|
1146 |
-
if ($this->size>0) $this->char = $this->doc[0];
|
1147 |
-
}
|
1148 |
-
|
1149 |
-
// parse html content
|
1150 |
-
protected function parse()
|
1151 |
-
{
|
1152 |
-
if (($s = $this->copy_until_char('<'))==='')
|
1153 |
-
{
|
1154 |
-
return $this->read_tag();
|
1155 |
-
}
|
1156 |
-
|
1157 |
-
// text
|
1158 |
-
$node = new simple_html_dom_node($this);
|
1159 |
-
++$this->cursor;
|
1160 |
-
$node->_[HDOM_INFO_TEXT] = $s;
|
1161 |
-
$this->link_nodes($node, false);
|
1162 |
-
return true;
|
1163 |
-
}
|
1164 |
-
|
1165 |
-
// PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later.
|
1166 |
-
// NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec
|
1167 |
-
// (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
|
1168 |
-
protected function parse_charset()
|
1169 |
-
{
|
1170 |
-
global $debug_object;
|
1171 |
-
|
1172 |
-
$charset = null;
|
1173 |
-
|
1174 |
-
if (function_exists('get_last_retrieve_url_contents_content_type'))
|
1175 |
-
{
|
1176 |
-
$contentTypeHeader = get_last_retrieve_url_contents_content_type();
|
1177 |
-
$success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches);
|
1178 |
-
if ($success)
|
1179 |
-
{
|
1180 |
-
$charset = $matches[1];
|
1181 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: ' . $charset);}
|
1182 |
-
}
|
1183 |
-
|
1184 |
-
}
|
1185 |
-
|
1186 |
-
if (empty($charset))
|
1187 |
-
{
|
1188 |
-
$el = $this->root->find('meta[http-equiv=Content-Type]',0);
|
1189 |
-
if (!empty($el))
|
1190 |
-
{
|
1191 |
-
$fullvalue = $el->content;
|
1192 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found' . $fullvalue);}
|
1193 |
-
|
1194 |
-
if (!empty($fullvalue))
|
1195 |
-
{
|
1196 |
-
$success = preg_match('/charset=(.+)/', $fullvalue, $matches);
|
1197 |
-
if ($success)
|
1198 |
-
{
|
1199 |
-
$charset = $matches[1];
|
1200 |
-
}
|
1201 |
-
else
|
1202 |
-
{
|
1203 |
-
// If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1
|
1204 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');}
|
1205 |
-
$charset = 'ISO-8859-1';
|
1206 |
-
}
|
1207 |
-
}
|
1208 |
-
}
|
1209 |
-
}
|
1210 |
-
|
1211 |
-
// If we couldn't find a charset above, then lets try to detect one based on the text we got...
|
1212 |
-
if (empty($charset))
|
1213 |
-
{
|
1214 |
-
// Use this in case mb_detect_charset isn't installed/loaded on this machine.
|
1215 |
-
$charset = false;
|
1216 |
-
if (function_exists('mb_detect_encoding'))
|
1217 |
-
{
|
1218 |
-
// Have php try to detect the encoding from the text given to us.
|
1219 |
-
$charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) );
|
1220 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);}
|
1221 |
-
}
|
1222 |
-
|
1223 |
-
// and if this doesn't work... then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need...
|
1224 |
-
if ($charset === false)
|
1225 |
-
{
|
1226 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8');}
|
1227 |
-
$charset = 'UTF-8';
|
1228 |
-
}
|
1229 |
-
}
|
1230 |
-
|
1231 |
-
// Since CP1252 is a superset, if we get one of it's subsets, we want it instead.
|
1232 |
-
if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1')))
|
1233 |
-
{
|
1234 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing ' . $charset . ' with CP1252 as its a superset');}
|
1235 |
-
$charset = 'CP1252';
|
1236 |
-
}
|
1237 |
-
|
1238 |
-
if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - ' . $charset);}
|
1239 |
-
|
1240 |
-
return $this->_charset = $charset;
|
1241 |
-
}
|
1242 |
-
|
1243 |
-
// read tag info
|
1244 |
-
protected function read_tag()
|
1245 |
-
{
|
1246 |
-
if ($this->char!=='<')
|
1247 |
-
{
|
1248 |
-
$this->root->_[HDOM_INFO_END] = $this->cursor;
|
1249 |
-
return false;
|
1250 |
-
}
|
1251 |
-
$begin_tag_pos = $this->pos;
|
1252 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1253 |
-
|
1254 |
-
// end tag
|
1255 |
-
if ($this->char==='/')
|
1256 |
-
{
|
1257 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1258 |
-
// This represents the change in the simple_html_dom trunk from revision 180 to 181.
|
1259 |
-
// $this->skip($this->token_blank_t);
|
1260 |
-
$this->skip($this->token_blank);
|
1261 |
-
$tag = $this->copy_until_char('>');
|
1262 |
-
|
1263 |
-
// skip attributes in end tag
|
1264 |
-
if (($pos = strpos($tag, ' '))!==false)
|
1265 |
-
$tag = substr($tag, 0, $pos);
|
1266 |
-
|
1267 |
-
$parent_lower = strtolower($this->parent->tag);
|
1268 |
-
$tag_lower = strtolower($tag);
|
1269 |
-
|
1270 |
-
if ($parent_lower!==$tag_lower)
|
1271 |
-
{
|
1272 |
-
if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower]))
|
1273 |
-
{
|
1274 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1275 |
-
$org_parent = $this->parent;
|
1276 |
-
|
1277 |
-
while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
|
1278 |
-
$this->parent = $this->parent->parent;
|
1279 |
-
|
1280 |
-
if (strtolower($this->parent->tag)!==$tag_lower) {
|
1281 |
-
$this->parent = $org_parent; // restore origonal parent
|
1282 |
-
if ($this->parent->parent) $this->parent = $this->parent->parent;
|
1283 |
-
$this->parent->_[HDOM_INFO_END] = $this->cursor;
|
1284 |
-
return $this->as_text_node($tag);
|
1285 |
-
}
|
1286 |
-
}
|
1287 |
-
else if (($this->parent->parent) && isset($this->block_tags[$tag_lower]))
|
1288 |
-
{
|
1289 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1290 |
-
$org_parent = $this->parent;
|
1291 |
-
|
1292 |
-
while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
|
1293 |
-
$this->parent = $this->parent->parent;
|
1294 |
-
|
1295 |
-
if (strtolower($this->parent->tag)!==$tag_lower)
|
1296 |
-
{
|
1297 |
-
$this->parent = $org_parent; // restore origonal parent
|
1298 |
-
$this->parent->_[HDOM_INFO_END] = $this->cursor;
|
1299 |
-
return $this->as_text_node($tag);
|
1300 |
-
}
|
1301 |
-
}
|
1302 |
-
else if (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower)
|
1303 |
-
{
|
1304 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1305 |
-
$this->parent = $this->parent->parent;
|
1306 |
-
}
|
1307 |
-
else
|
1308 |
-
return $this->as_text_node($tag);
|
1309 |
-
}
|
1310 |
-
|
1311 |
-
$this->parent->_[HDOM_INFO_END] = $this->cursor;
|
1312 |
-
if ($this->parent->parent) $this->parent = $this->parent->parent;
|
1313 |
-
|
1314 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1315 |
-
return true;
|
1316 |
-
}
|
1317 |
-
|
1318 |
-
$node = new simple_html_dom_node($this);
|
1319 |
-
$node->_[HDOM_INFO_BEGIN] = $this->cursor;
|
1320 |
-
++$this->cursor;
|
1321 |
-
$tag = $this->copy_until($this->token_slash);
|
1322 |
-
$node->tag_start = $begin_tag_pos;
|
1323 |
-
|
1324 |
-
// doctype, cdata & comments...
|
1325 |
-
if (isset($tag[0]) && $tag[0]==='!') {
|
1326 |
-
$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>');
|
1327 |
-
|
1328 |
-
if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') {
|
1329 |
-
$node->nodetype = HDOM_TYPE_COMMENT;
|
1330 |
-
$node->tag = 'comment';
|
1331 |
-
} else {
|
1332 |
-
$node->nodetype = HDOM_TYPE_UNKNOWN;
|
1333 |
-
$node->tag = 'unknown';
|
1334 |
-
}
|
1335 |
-
if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
|
1336 |
-
$this->link_nodes($node, true);
|
1337 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1338 |
-
return true;
|
1339 |
-
}
|
1340 |
-
|
1341 |
-
// text
|
1342 |
-
if ($pos=strpos($tag, '<')!==false) {
|
1343 |
-
$tag = '<' . substr($tag, 0, -1);
|
1344 |
-
$node->_[HDOM_INFO_TEXT] = $tag;
|
1345 |
-
$this->link_nodes($node, false);
|
1346 |
-
$this->char = $this->doc[--$this->pos]; // prev
|
1347 |
-
return true;
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
if (!preg_match("/^[\w-:]+$/", $tag)) {
|
1351 |
-
$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
|
1352 |
-
if ($this->char==='<') {
|
1353 |
-
$this->link_nodes($node, false);
|
1354 |
-
return true;
|
1355 |
-
}
|
1356 |
-
|
1357 |
-
if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
|
1358 |
-
$this->link_nodes($node, false);
|
1359 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1360 |
-
return true;
|
1361 |
-
}
|
1362 |
-
|
1363 |
-
// begin tag
|
1364 |
-
$node->nodetype = HDOM_TYPE_ELEMENT;
|
1365 |
-
$tag_lower = strtolower($tag);
|
1366 |
-
$node->tag = ($this->lowercase) ? $tag_lower : $tag;
|
1367 |
-
|
1368 |
-
// handle optional closing tags
|
1369 |
-
if (isset($this->optional_closing_tags[$tag_lower]) )
|
1370 |
-
{
|
1371 |
-
while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)]))
|
1372 |
-
{
|
1373 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1374 |
-
$this->parent = $this->parent->parent;
|
1375 |
-
}
|
1376 |
-
$node->parent = $this->parent;
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
$guard = 0; // prevent infinity loop
|
1380 |
-
$space = array($this->copy_skip($this->token_blank), '', '');
|
1381 |
-
|
1382 |
-
// attributes
|
1383 |
-
do
|
1384 |
-
{
|
1385 |
-
if ($this->char!==null && $space[0]==='')
|
1386 |
-
{
|
1387 |
-
break;
|
1388 |
-
}
|
1389 |
-
$name = $this->copy_until($this->token_equal);
|
1390 |
-
if ($guard===$this->pos)
|
1391 |
-
{
|
1392 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1393 |
-
continue;
|
1394 |
-
}
|
1395 |
-
$guard = $this->pos;
|
1396 |
-
|
1397 |
-
// handle endless '<'
|
1398 |
-
if ($this->pos>=$this->size-1 && $this->char!=='>') {
|
1399 |
-
$node->nodetype = HDOM_TYPE_TEXT;
|
1400 |
-
$node->_[HDOM_INFO_END] = 0;
|
1401 |
-
$node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name;
|
1402 |
-
$node->tag = 'text';
|
1403 |
-
$this->link_nodes($node, false);
|
1404 |
-
return true;
|
1405 |
-
}
|
1406 |
-
|
1407 |
-
// handle mismatch '<'
|
1408 |
-
if ($this->doc[$this->pos-1]=='<') {
|
1409 |
-
$node->nodetype = HDOM_TYPE_TEXT;
|
1410 |
-
$node->tag = 'text';
|
1411 |
-
$node->attr = array();
|
1412 |
-
$node->_[HDOM_INFO_END] = 0;
|
1413 |
-
$node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1);
|
1414 |
-
$this->pos -= 2;
|
1415 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1416 |
-
$this->link_nodes($node, false);
|
1417 |
-
return true;
|
1418 |
-
}
|
1419 |
-
|
1420 |
-
if ($name!=='/' && $name!=='') {
|
1421 |
-
$space[1] = $this->copy_skip($this->token_blank);
|
1422 |
-
$name = $this->restore_noise($name);
|
1423 |
-
if ($this->lowercase) $name = strtolower($name);
|
1424 |
-
if ($this->char==='=') {
|
1425 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1426 |
-
$this->parse_attr($node, $name, $space);
|
1427 |
-
}
|
1428 |
-
else {
|
1429 |
-
//no value attr: nowrap, checked selected...
|
1430 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
|
1431 |
-
$node->attr[$name] = true;
|
1432 |
-
if ($this->char!='>') $this->char = $this->doc[--$this->pos]; // prev
|
1433 |
-
}
|
1434 |
-
$node->_[HDOM_INFO_SPACE][] = $space;
|
1435 |
-
$space = array($this->copy_skip($this->token_blank), '', '');
|
1436 |
-
}
|
1437 |
-
else
|
1438 |
-
break;
|
1439 |
-
} while ($this->char!=='>' && $this->char!=='/');
|
1440 |
-
|
1441 |
-
$this->link_nodes($node, true);
|
1442 |
-
$node->_[HDOM_INFO_ENDSPACE] = $space[0];
|
1443 |
-
|
1444 |
-
// check self closing
|
1445 |
-
if ($this->copy_until_char_escape('>')==='/')
|
1446 |
-
{
|
1447 |
-
$node->_[HDOM_INFO_ENDSPACE] .= '/';
|
1448 |
-
$node->_[HDOM_INFO_END] = 0;
|
1449 |
-
}
|
1450 |
-
else
|
1451 |
-
{
|
1452 |
-
// reset parent
|
1453 |
-
if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node;
|
1454 |
-
}
|
1455 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1456 |
-
|
1457 |
-
// If it's a BR tag, we need to set it's text to the default text.
|
1458 |
-
// This way when we see it in plaintext, we can generate formatting that the user wants.
|
1459 |
-
// since a br tag never has sub nodes, this works well.
|
1460 |
-
if ($node->tag == "br")
|
1461 |
-
{
|
1462 |
-
$node->_[HDOM_INFO_INNER] = $this->default_br_text;
|
1463 |
-
}
|
1464 |
-
|
1465 |
-
return true;
|
1466 |
-
}
|
1467 |
-
|
1468 |
-
// parse attributes
|
1469 |
-
protected function parse_attr($node, $name, &$space)
|
1470 |
-
{
|
1471 |
-
// Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037
|
1472 |
-
// If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one.
|
1473 |
-
if (isset($node->attr[$name]))
|
1474 |
-
{
|
1475 |
-
return;
|
1476 |
-
}
|
1477 |
-
|
1478 |
-
$space[2] = $this->copy_skip($this->token_blank);
|
1479 |
-
switch ($this->char) {
|
1480 |
-
case '"':
|
1481 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
|
1482 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1483 |
-
$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
|
1484 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1485 |
-
break;
|
1486 |
-
case '\'':
|
1487 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE;
|
1488 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1489 |
-
$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
|
1490 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1491 |
-
break;
|
1492 |
-
default:
|
1493 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
|
1494 |
-
$node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr));
|
1495 |
-
}
|
1496 |
-
// PaperG: Attributes should not have \r or \n in them, that counts as html whitespace.
|
1497 |
-
$node->attr[$name] = str_replace("\r", "", $node->attr[$name]);
|
1498 |
-
$node->attr[$name] = str_replace("\n", "", $node->attr[$name]);
|
1499 |
-
// PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case.
|
1500 |
-
if ($name == "class") {
|
1501 |
-
$node->attr[$name] = trim($node->attr[$name]);
|
1502 |
-
}
|
1503 |
-
}
|
1504 |
-
|
1505 |
-
// link node's parent
|
1506 |
-
protected function link_nodes(&$node, $is_child)
|
1507 |
-
{
|
1508 |
-
$node->parent = $this->parent;
|
1509 |
-
$this->parent->nodes[] = $node;
|
1510 |
-
if ($is_child)
|
1511 |
-
{
|
1512 |
-
$this->parent->children[] = $node;
|
1513 |
-
}
|
1514 |
-
}
|
1515 |
-
|
1516 |
-
// as a text node
|
1517 |
-
protected function as_text_node($tag)
|
1518 |
-
{
|
1519 |
-
$node = new simple_html_dom_node($this);
|
1520 |
-
++$this->cursor;
|
1521 |
-
$node->_[HDOM_INFO_TEXT] = '</' . $tag . '>';
|
1522 |
-
$this->link_nodes($node, false);
|
1523 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1524 |
-
return true;
|
1525 |
-
}
|
1526 |
-
|
1527 |
-
protected function skip($chars)
|
1528 |
-
{
|
1529 |
-
$this->pos += strspn($this->doc, $chars, $this->pos);
|
1530 |
-
$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1531 |
-
}
|
1532 |
-
|
1533 |
-
protected function copy_skip($chars)
|
1534 |
-
{
|
1535 |
-
$pos = $this->pos;
|
1536 |
-
$len = strspn($this->doc, $chars, $pos);
|
1537 |
-
$this->pos += $len;
|
1538 |
-
$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1539 |
-
if ($len===0) return '';
|
1540 |
-
return substr($this->doc, $pos, $len);
|
1541 |
-
}
|
1542 |
-
|
1543 |
-
protected function copy_until($chars)
|
1544 |
-
{
|
1545 |
-
$pos = $this->pos;
|
1546 |
-
$len = strcspn($this->doc, $chars, $pos);
|
1547 |
-
$this->pos += $len;
|
1548 |
-
$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1549 |
-
return substr($this->doc, $pos, $len);
|
1550 |
-
}
|
1551 |
-
|
1552 |
-
protected function copy_until_char($char)
|
1553 |
-
{
|
1554 |
-
if ($this->char===null) return '';
|
1555 |
-
|
1556 |
-
if (($pos = strpos($this->doc, $char, $this->pos))===false) {
|
1557 |
-
$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
|
1558 |
-
$this->char = null;
|
1559 |
-
$this->pos = $this->size;
|
1560 |
-
return $ret;
|
1561 |
-
}
|
1562 |
-
|
1563 |
-
if ($pos===$this->pos) return '';
|
1564 |
-
$pos_old = $this->pos;
|
1565 |
-
$this->char = $this->doc[$pos];
|
1566 |
-
$this->pos = $pos;
|
1567 |
-
return substr($this->doc, $pos_old, $pos-$pos_old);
|
1568 |
-
}
|
1569 |
-
|
1570 |
-
protected function copy_until_char_escape($char)
|
1571 |
-
{
|
1572 |
-
if ($this->char===null) return '';
|
1573 |
-
|
1574 |
-
$start = $this->pos;
|
1575 |
-
while (1)
|
1576 |
-
{
|
1577 |
-
if (($pos = strpos($this->doc, $char, $start))===false)
|
1578 |
-
{
|
1579 |
-
$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
|
1580 |
-
$this->char = null;
|
1581 |
-
$this->pos = $this->size;
|
1582 |
-
return $ret;
|
1583 |
-
}
|
1584 |
-
|
1585 |
-
if ($pos===$this->pos) return '';
|
1586 |
-
|
1587 |
-
if ($this->doc[$pos-1]==='\\') {
|
1588 |
-
$start = $pos+1;
|
1589 |
-
continue;
|
1590 |
-
}
|
1591 |
-
|
1592 |
-
$pos_old = $this->pos;
|
1593 |
-
$this->char = $this->doc[$pos];
|
1594 |
-
$this->pos = $pos;
|
1595 |
-
return substr($this->doc, $pos_old, $pos-$pos_old);
|
1596 |
-
}
|
1597 |
-
}
|
1598 |
-
|
1599 |
-
// remove noise from html content
|
1600 |
-
// save the noise in the $this->noise array.
|
1601 |
-
protected function remove_noise($pattern, $remove_tag=false)
|
1602 |
-
{
|
1603 |
-
global $debug_object;
|
1604 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
1605 |
-
|
1606 |
-
$count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
|
1607 |
-
|
1608 |
-
for ($i=$count-1; $i>-1; --$i)
|
1609 |
-
{
|
1610 |
-
$key = '___noise___'.sprintf('% 5d', count($this->noise)+1000);
|
1611 |
-
if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: ' . $key); }
|
1612 |
-
$idx = ($remove_tag) ? 0 : 1;
|
1613 |
-
$this->noise[$key] = $matches[$i][$idx][0];
|
1614 |
-
$this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0]));
|
1615 |
-
}
|
1616 |
-
|
1617 |
-
// reset the length of content
|
1618 |
-
$this->size = strlen($this->doc);
|
1619 |
-
if ($this->size>0)
|
1620 |
-
{
|
1621 |
-
$this->char = $this->doc[0];
|
1622 |
-
}
|
1623 |
-
}
|
1624 |
-
|
1625 |
-
// restore noise to html content
|
1626 |
-
function restore_noise($text)
|
1627 |
-
{
|
1628 |
-
global $debug_object;
|
1629 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
1630 |
-
|
1631 |
-
while (($pos=strpos($text, '___noise___'))!==false)
|
1632 |
-
{
|
1633 |
-
// Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
|
1634 |
-
if (strlen($text) > $pos+15)
|
1635 |
-
{
|
1636 |
-
$key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15];
|
1637 |
-
if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: ' . $key); }
|
1638 |
-
|
1639 |
-
if (isset($this->noise[$key]))
|
1640 |
-
{
|
1641 |
-
$text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16);
|
1642 |
-
}
|
1643 |
-
else
|
1644 |
-
{
|
1645 |
-
// do this to prevent an infinite loop.
|
1646 |
-
$text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16);
|
1647 |
-
}
|
1648 |
-
}
|
1649 |
-
else
|
1650 |
-
{
|
1651 |
-
// There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem.
|
1652 |
-
$text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11);
|
1653 |
-
}
|
1654 |
-
}
|
1655 |
-
return $text;
|
1656 |
-
}
|
1657 |
-
|
1658 |
-
// Sometimes we NEED one of the noise elements.
|
1659 |
-
function search_noise($text)
|
1660 |
-
{
|
1661 |
-
global $debug_object;
|
1662 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
1663 |
-
|
1664 |
-
foreach($this->noise as $noiseElement)
|
1665 |
-
{
|
1666 |
-
if (strpos($noiseElement, $text)!==false)
|
1667 |
-
{
|
1668 |
-
return $noiseElement;
|
1669 |
-
}
|
1670 |
-
}
|
1671 |
-
}
|
1672 |
-
function __toString()
|
1673 |
-
{
|
1674 |
-
return $this->root->innertext();
|
1675 |
-
}
|
1676 |
-
|
1677 |
-
function __get($name)
|
1678 |
-
{
|
1679 |
-
switch ($name)
|
1680 |
-
{
|
1681 |
-
case 'outertext':
|
1682 |
-
return $this->root->innertext();
|
1683 |
-
case 'innertext':
|
1684 |
-
return $this->root->innertext();
|
1685 |
-
case 'plaintext':
|
1686 |
-
return $this->root->text();
|
1687 |
-
case 'charset':
|
1688 |
-
return $this->_charset;
|
1689 |
-
case 'target_charset':
|
1690 |
-
return $this->_target_charset;
|
1691 |
-
}
|
1692 |
-
}
|
1693 |
-
|
1694 |
-
// camel naming conventions
|
1695 |
-
function childNodes($idx=-1) {return $this->root->childNodes($idx);}
|
1696 |
-
function firstChild() {return $this->root->first_child();}
|
1697 |
-
function lastChild() {return $this->root->last_child();}
|
1698 |
-
function createElement($name, $value=null) {return @str_get_html("<$name>$value</$name>")->first_child();}
|
1699 |
-
function createTextNode($value) {return @end(str_get_html($value)->nodes);}
|
1700 |
-
function getElementById($id) {return $this->find("#$id", 0);}
|
1701 |
-
function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
|
1702 |
-
function getElementByTagName($name) {return $this->find($name, 0);}
|
1703 |
-
function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
|
1704 |
-
function loadFile() {$args = func_get_args();$this->load_file($args);}
|
1705 |
-
}
|
1706 |
-
|
1707 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/metaslider-zh_CN.mo
CHANGED
Binary file
|
languages/metaslider-zh_CN.po
CHANGED
@@ -1,631 +1,720 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: metaslider-zh_CN\n"
|
4 |
-
"POT-Creation-Date:
|
5 |
-
"PO-Revision-Date:
|
6 |
-
"Last-Translator: 断青丝 <181138991@qq.com>\n"
|
7 |
-
"Language-Team:
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"Content-
|
11 |
-
"
|
12 |
-
"X-Generator: Poedit 1.
|
13 |
-
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
14 |
-
"X-Poedit-Basepath: .\n"
|
15 |
-
"X-Poedit-SearchPath-0: .\n"
|
16 |
-
"X-Poedit-SearchPath-1: ..\n"
|
17 |
-
|
18 |
-
#: ../ml-slider.php:
|
19 |
-
msgid "Go Pro"
|
20 |
-
msgstr "
|
21 |
-
|
22 |
-
#: ../ml-slider.php:
|
23 |
-
msgid "
|
24 |
-
msgstr "
|
25 |
-
|
26 |
-
#: ../ml-slider.php:
|
27 |
-
msgid "
|
28 |
-
msgstr "
|
29 |
-
|
30 |
-
#: ../ml-slider.php:
|
31 |
-
msgid "
|
32 |
-
msgstr "
|
33 |
-
|
34 |
-
#: ../ml-slider.php:
|
35 |
-
msgid "
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: ../ml-slider.php:
|
39 |
-
msgid "
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#: ../ml-slider.php:
|
43 |
-
msgid "
|
44 |
-
msgstr "
|
45 |
-
|
46 |
-
#: ../ml-slider.php:
|
47 |
-
msgid "
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
"
|
66 |
-
msgstr "
|
67 |
-
|
68 |
-
#: ../ml-slider.php:
|
69 |
-
msgid "
|
70 |
-
msgstr "
|
71 |
-
|
72 |
-
#: ../ml-slider.php:
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
-
|
76 |
-
#: ../ml-slider.php:
|
77 |
-
msgid "
|
78 |
-
msgstr "
|
79 |
-
|
80 |
-
#: ../ml-slider.php:
|
81 |
-
msgid "
|
82 |
-
msgstr "
|
83 |
-
|
84 |
-
#: ../ml-slider.php:
|
85 |
-
msgid "
|
86 |
-
msgstr "
|
87 |
-
|
88 |
-
#: ../ml-slider.php:
|
89 |
-
msgid "
|
90 |
-
msgstr "
|
91 |
-
|
92 |
-
#: ../ml-slider.php:
|
93 |
-
msgid "
|
94 |
-
msgstr "
|
95 |
-
|
96 |
-
#: ../ml-slider.php:
|
97 |
-
msgid "
|
98 |
-
msgstr "
|
99 |
-
|
100 |
-
#: ../ml-slider.php:
|
101 |
-
msgid "
|
102 |
-
msgstr "
|
103 |
-
|
104 |
-
#: ../ml-slider.php:
|
105 |
-
msgid "
|
106 |
-
msgstr "
|
107 |
-
|
108 |
-
#: ../ml-slider.php:
|
109 |
-
msgid "
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#: ../ml-slider.php:
|
113 |
-
msgid "
|
114 |
-
msgstr "
|
115 |
-
|
116 |
-
#: ../ml-slider.php:
|
117 |
-
msgid "
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#: ../ml-slider.php:
|
121 |
-
msgid "
|
122 |
-
msgstr ""
|
123 |
-
|
124 |
-
#: ../ml-slider.php:
|
125 |
-
msgid "
|
126 |
-
msgstr "
|
127 |
-
|
128 |
-
#: ../ml-slider.php:
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
msgid "Show the
|
266 |
-
msgstr "
|
267 |
-
|
268 |
-
#: ../ml-slider.php:
|
269 |
-
msgid "
|
270 |
-
msgstr "
|
271 |
-
|
272 |
-
#: ../ml-slider.php:
|
273 |
-
msgid "
|
274 |
-
msgstr "
|
275 |
-
|
276 |
-
#: ../ml-slider.php:
|
277 |
-
msgid "
|
278 |
-
msgstr "
|
279 |
-
|
280 |
-
#: ../ml-slider.php:
|
281 |
-
msgid "
|
282 |
-
msgstr "
|
283 |
-
|
284 |
-
#: ../ml-slider.php:
|
285 |
-
msgid "
|
286 |
-
msgstr "
|
287 |
-
|
288 |
-
#: ../ml-slider.php:
|
289 |
-
msgid "
|
290 |
-
msgstr "
|
291 |
-
|
292 |
-
#: ../ml-slider.php:
|
293 |
-
msgid "
|
294 |
-
msgstr ""
|
295 |
-
|
296 |
-
#: ../ml-slider.php:
|
297 |
-
msgid "
|
298 |
-
msgstr ""
|
299 |
-
|
300 |
-
#: ../ml-slider.php:
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
"
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
"
|
354 |
-
msgstr "
|
355 |
-
|
356 |
-
#: ../ml-slider.php:
|
357 |
-
msgid "
|
358 |
-
msgstr "
|
359 |
-
|
360 |
-
#: ../ml-slider.php:
|
361 |
-
msgid "
|
362 |
-
msgstr "
|
363 |
-
|
364 |
-
#: ../ml-slider.php:
|
365 |
-
msgid "
|
366 |
-
msgstr "
|
367 |
-
|
368 |
-
#: ../ml-slider.php:
|
369 |
-
msgid "
|
370 |
-
msgstr "
|
371 |
-
|
372 |
-
#: ../ml-slider.php:
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
#: ../ml-slider.php:
|
391 |
-
msgid "
|
392 |
-
msgstr "
|
393 |
-
|
394 |
-
#: ../ml-slider.php:
|
395 |
-
msgid "
|
396 |
-
msgstr "
|
397 |
-
|
398 |
-
#: ../ml-slider.php:
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
msgid "
|
462 |
-
msgstr "
|
463 |
-
|
464 |
-
#: ../ml-slider.php:
|
465 |
-
msgid "
|
466 |
-
msgstr "
|
467 |
-
|
468 |
-
#: ../ml-slider.php:
|
469 |
-
msgid ""
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
msgid "
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
msgid "
|
582 |
-
msgstr "
|
583 |
-
|
584 |
-
#: ../inc/
|
585 |
-
msgid "
|
586 |
-
msgstr ""
|
587 |
-
|
588 |
-
#: ../inc/
|
589 |
-
msgid "
|
590 |
-
msgstr ""
|
591 |
-
|
592 |
-
#: ../inc/slide/metaslide.
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: metaslider-zh_CN\n"
|
4 |
+
"POT-Creation-Date: 2015-02-17 14:47-0000\n"
|
5 |
+
"PO-Revision-Date: 2015-07-02 20:20+0800\n"
|
6 |
+
"Last-Translator: 断青丝 <181138991@qq.com>\n"
|
7 |
+
"Language-Team: mamsds <mamsds@live.com>\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"Language: zh_CN\n"
|
12 |
+
"X-Generator: Poedit 1.8.2\n"
|
13 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SearchPath-0: .\n"
|
16 |
+
"X-Poedit-SearchPath-1: ..\n"
|
17 |
+
|
18 |
+
#: ../ml-slider.php:283 ../ml-slider.php:284
|
19 |
+
msgid "Go Pro!"
|
20 |
+
msgstr "升级到专业版!"
|
21 |
+
|
22 |
+
#: ../ml-slider.php:412
|
23 |
+
msgid "Documentation"
|
24 |
+
msgstr "文档"
|
25 |
+
|
26 |
+
#: ../ml-slider.php:465 ../inc/slide/metaslide.image.class.php:147
|
27 |
+
msgid "URL"
|
28 |
+
msgstr "URL"
|
29 |
+
|
30 |
+
#: ../ml-slider.php:466 ../inc/slide/metaslide.image.class.php:146
|
31 |
+
msgid "Caption"
|
32 |
+
msgstr "标题"
|
33 |
+
|
34 |
+
#: ../ml-slider.php:467 ../inc/slide/metaslide.image.class.php:149
|
35 |
+
msgid "New Window"
|
36 |
+
msgstr "新窗口"
|
37 |
+
|
38 |
+
#: ../ml-slider.php:468
|
39 |
+
msgid "Are you sure?"
|
40 |
+
msgstr "你确定吗?"
|
41 |
+
|
42 |
+
#: ../ml-slider.php:470
|
43 |
+
msgid "Select replacement image"
|
44 |
+
msgstr "选择替代图像"
|
45 |
+
|
46 |
+
#: ../ml-slider.php:475
|
47 |
+
msgid ""
|
48 |
+
"Caution: This setting is for advanced developers only. If you're unsure, "
|
49 |
+
"leave it checked."
|
50 |
+
msgstr "注意:此设置仅适用于高级开发者。如果你不确定,请将他保持在未勾选的状态"
|
51 |
+
|
52 |
+
#: ../ml-slider.php:538
|
53 |
+
msgid "Image"
|
54 |
+
msgstr "图像"
|
55 |
+
|
56 |
+
#: ../ml-slider.php:539
|
57 |
+
msgid "Add to slider"
|
58 |
+
msgstr "添加到幻灯片"
|
59 |
+
|
60 |
+
#: ../ml-slider.php:703
|
61 |
+
msgid "New Slider"
|
62 |
+
msgstr "新幻灯片"
|
63 |
+
|
64 |
+
#: ../ml-slider.php:1015
|
65 |
+
msgid "Switch to Dropdown view"
|
66 |
+
msgstr "切换到下拉菜单视图"
|
67 |
+
|
68 |
+
#: ../ml-slider.php:1015
|
69 |
+
msgid "Dropdown"
|
70 |
+
msgstr "下拉菜单"
|
71 |
+
|
72 |
+
#: ../ml-slider.php:1036
|
73 |
+
msgid "New slideshow created. Click 'Add Slide' to get started!"
|
74 |
+
msgstr "创建新的幻灯片。点击“添加幻灯片”以开始!"
|
75 |
+
|
76 |
+
#: ../ml-slider.php:1040
|
77 |
+
msgid "Switch to Tab view"
|
78 |
+
msgstr "切换到标签页视图"
|
79 |
+
|
80 |
+
#: ../ml-slider.php:1040
|
81 |
+
msgid "Tabs"
|
82 |
+
msgstr "标签页"
|
83 |
+
|
84 |
+
#: ../ml-slider.php:1042
|
85 |
+
msgid "Select Slider"
|
86 |
+
msgstr "选择幻灯片"
|
87 |
+
|
88 |
+
#: ../ml-slider.php:1061
|
89 |
+
msgid "or"
|
90 |
+
msgstr "或"
|
91 |
+
|
92 |
+
#: ../ml-slider.php:1062
|
93 |
+
msgid "Add New Slideshow"
|
94 |
+
msgstr "添加新的幻灯片"
|
95 |
+
|
96 |
+
#: ../ml-slider.php:1068
|
97 |
+
msgid "Create your first slideshow"
|
98 |
+
msgstr "创建第一份幻灯片"
|
99 |
+
|
100 |
+
#: ../ml-slider.php:1130
|
101 |
+
msgid "Slides"
|
102 |
+
msgstr "幻灯片"
|
103 |
+
|
104 |
+
#: ../ml-slider.php:1134 ../ml-slider.php:1135
|
105 |
+
msgid "Add Slide"
|
106 |
+
msgstr "添加幻灯片"
|
107 |
+
|
108 |
+
#: ../ml-slider.php:1158
|
109 |
+
msgid "Settings"
|
110 |
+
msgstr "设置"
|
111 |
+
|
112 |
+
#: ../ml-slider.php:1159
|
113 |
+
msgid "Save"
|
114 |
+
msgstr "保存"
|
115 |
+
|
116 |
+
#: ../ml-slider.php:1160
|
117 |
+
msgid "Save & Preview"
|
118 |
+
msgstr "保存并预览"
|
119 |
+
|
120 |
+
#: ../ml-slider.php:1173
|
121 |
+
msgid "Flex Slider"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: ../ml-slider.php:1174
|
125 |
+
msgid "R. Slides"
|
126 |
+
msgstr "R. Slides"
|
127 |
+
|
128 |
+
#: ../ml-slider.php:1175
|
129 |
+
msgid "Nivo Slider"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: ../ml-slider.php:1176
|
133 |
+
msgid "Coin Slider"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: ../ml-slider.php:1187 ../ml-slider.php:1426
|
137 |
+
msgid "Width"
|
138 |
+
msgstr "宽度"
|
139 |
+
|
140 |
+
#: ../ml-slider.php:1189
|
141 |
+
msgid "Slideshow width"
|
142 |
+
msgstr "幻灯片宽度"
|
143 |
+
|
144 |
+
#: ../ml-slider.php:1190 ../ml-slider.php:1203 ../ml-slider.php:1353
|
145 |
+
msgid "px"
|
146 |
+
msgstr "像素"
|
147 |
+
|
148 |
+
#: ../ml-slider.php:1200 ../ml-slider.php:1439
|
149 |
+
msgid "Height"
|
150 |
+
msgstr "高度"
|
151 |
+
|
152 |
+
#: ../ml-slider.php:1202
|
153 |
+
msgid "Slideshow height"
|
154 |
+
msgstr "幻灯片标高度"
|
155 |
+
|
156 |
+
#: ../ml-slider.php:1209
|
157 |
+
msgid "Effect"
|
158 |
+
msgstr "效果"
|
159 |
+
|
160 |
+
#: ../ml-slider.php:1211
|
161 |
+
msgid "Slide transition effect"
|
162 |
+
msgstr "幻灯片过渡效果"
|
163 |
+
|
164 |
+
#: ../ml-slider.php:1213 ../ml-slider.php:1358
|
165 |
+
msgid "Random"
|
166 |
+
msgstr "随机"
|
167 |
+
|
168 |
+
#: ../ml-slider.php:1214
|
169 |
+
msgid "Swirl"
|
170 |
+
msgstr "漩涡"
|
171 |
+
|
172 |
+
#: ../ml-slider.php:1215
|
173 |
+
msgid "Rain"
|
174 |
+
msgstr "雨"
|
175 |
+
|
176 |
+
#: ../ml-slider.php:1216
|
177 |
+
msgid "Straight"
|
178 |
+
msgstr "直"
|
179 |
+
|
180 |
+
#: ../ml-slider.php:1217
|
181 |
+
msgid "Slide Down"
|
182 |
+
msgstr "向下滑动"
|
183 |
+
|
184 |
+
#: ../ml-slider.php:1218
|
185 |
+
msgid "Slice Up"
|
186 |
+
msgstr "切片"
|
187 |
+
|
188 |
+
#: ../ml-slider.php:1219
|
189 |
+
msgid "Slide Up Left"
|
190 |
+
msgstr "向左滑动"
|
191 |
+
|
192 |
+
#: ../ml-slider.php:1220
|
193 |
+
msgid "Slice Up Down"
|
194 |
+
msgstr "切片向下"
|
195 |
+
|
196 |
+
#: ../ml-slider.php:1221
|
197 |
+
msgid "Slide Up Down Left"
|
198 |
+
msgstr "向上滑动"
|
199 |
+
|
200 |
+
#: ../ml-slider.php:1222
|
201 |
+
msgid "Fold"
|
202 |
+
msgstr "折叠"
|
203 |
+
|
204 |
+
#: ../ml-slider.php:1223
|
205 |
+
msgid "Fade"
|
206 |
+
msgstr "渐隐"
|
207 |
+
|
208 |
+
#: ../ml-slider.php:1224
|
209 |
+
msgid "Slide In Right"
|
210 |
+
msgstr "向右滑动"
|
211 |
+
|
212 |
+
#: ../ml-slider.php:1225
|
213 |
+
msgid "Slide In Left"
|
214 |
+
msgstr "向左滑动"
|
215 |
+
|
216 |
+
#: ../ml-slider.php:1226
|
217 |
+
msgid "Box Random"
|
218 |
+
msgstr "随机"
|
219 |
+
|
220 |
+
#: ../ml-slider.php:1227
|
221 |
+
msgid "Box Rain"
|
222 |
+
msgstr "箱式"
|
223 |
+
|
224 |
+
#: ../ml-slider.php:1228
|
225 |
+
msgid "Box Rain Reverse"
|
226 |
+
msgstr "箱式"
|
227 |
+
|
228 |
+
#: ../ml-slider.php:1229
|
229 |
+
msgid "Box Rain Grow Reverse"
|
230 |
+
msgstr ""
|
231 |
+
|
232 |
+
#: ../ml-slider.php:1230
|
233 |
+
msgid "Slide"
|
234 |
+
msgstr "滑动"
|
235 |
+
|
236 |
+
#: ../ml-slider.php:1237
|
237 |
+
msgid "Theme"
|
238 |
+
msgstr "主题"
|
239 |
+
|
240 |
+
#: ../ml-slider.php:1239
|
241 |
+
msgid "Slideshow theme"
|
242 |
+
msgstr "幻灯片主题"
|
243 |
+
|
244 |
+
#: ../ml-slider.php:1241
|
245 |
+
msgid "Default"
|
246 |
+
msgstr "默认"
|
247 |
+
|
248 |
+
#: ../ml-slider.php:1242
|
249 |
+
msgid "Dark (Nivo)"
|
250 |
+
msgstr "暗 (Nivo)"
|
251 |
+
|
252 |
+
#: ../ml-slider.php:1243
|
253 |
+
msgid "Light (Nivo)"
|
254 |
+
msgstr "亮 (Nivo)"
|
255 |
+
|
256 |
+
#: ../ml-slider.php:1244
|
257 |
+
msgid "Bar (Nivo)"
|
258 |
+
msgstr ""
|
259 |
+
|
260 |
+
#: ../ml-slider.php:1250
|
261 |
+
msgid "Arrows"
|
262 |
+
msgstr "箭头"
|
263 |
+
|
264 |
+
#: ../ml-slider.php:1253
|
265 |
+
msgid "Show the previous/next arrows"
|
266 |
+
msgstr "显示 向后/向前 箭头"
|
267 |
+
|
268 |
+
#: ../ml-slider.php:1258
|
269 |
+
msgid "Navigation"
|
270 |
+
msgstr "导航"
|
271 |
+
|
272 |
+
#: ../ml-slider.php:1261
|
273 |
+
msgid "Show the slide navigation bullets"
|
274 |
+
msgstr "显示幻灯片导航的小圆点"
|
275 |
+
|
276 |
+
#: ../ml-slider.php:1263
|
277 |
+
msgid "Hidden"
|
278 |
+
msgstr "隐藏"
|
279 |
+
|
280 |
+
#: ../ml-slider.php:1264
|
281 |
+
msgid "Dots"
|
282 |
+
msgstr "点"
|
283 |
+
|
284 |
+
#: ../ml-slider.php:1275
|
285 |
+
msgid "Title"
|
286 |
+
msgstr "标题"
|
287 |
+
|
288 |
+
#: ../ml-slider.php:1276
|
289 |
+
msgid "Slideshow title"
|
290 |
+
msgstr "幻灯片标题"
|
291 |
+
|
292 |
+
#: ../ml-slider.php:1290
|
293 |
+
msgid "Advanced Settings"
|
294 |
+
msgstr "高级设置"
|
295 |
+
|
296 |
+
#: ../ml-slider.php:1299
|
297 |
+
msgid "Stretch"
|
298 |
+
msgstr "拉伸"
|
299 |
+
|
300 |
+
#: ../ml-slider.php:1301
|
301 |
+
msgid "100% wide output"
|
302 |
+
msgstr "100%宽度输出"
|
303 |
+
|
304 |
+
#: ../ml-slider.php:1303
|
305 |
+
msgid "Stretch the slideshow output to fill it's parent container"
|
306 |
+
msgstr "拉伸幻灯片以填充其父容器"
|
307 |
+
|
308 |
+
#: ../ml-slider.php:1308
|
309 |
+
msgid "Center align"
|
310 |
+
msgstr "居中对齐"
|
311 |
+
|
312 |
+
#: ../ml-slider.php:1311
|
313 |
+
msgid "Center align the slideshow"
|
314 |
+
msgstr "居中对齐幻灯片"
|
315 |
+
|
316 |
+
#: ../ml-slider.php:1316
|
317 |
+
msgid "Auto play"
|
318 |
+
msgstr "自动播放"
|
319 |
+
|
320 |
+
#: ../ml-slider.php:1319
|
321 |
+
msgid "Transition between slides automatically"
|
322 |
+
msgstr "幻灯片间自动过渡"
|
323 |
+
|
324 |
+
#: ../ml-slider.php:1324
|
325 |
+
msgid "Image Crop"
|
326 |
+
msgstr "图像裁剪"
|
327 |
+
|
328 |
+
#: ../ml-slider.php:1328
|
329 |
+
msgid "Smart Crop"
|
330 |
+
msgstr "智能裁剪"
|
331 |
+
|
332 |
+
#: ../ml-slider.php:1329
|
333 |
+
msgid "Standard"
|
334 |
+
msgstr "标准"
|
335 |
+
|
336 |
+
#: ../ml-slider.php:1330
|
337 |
+
msgid "Disabled"
|
338 |
+
msgstr "禁用"
|
339 |
+
|
340 |
+
#: ../ml-slider.php:1331
|
341 |
+
msgid "Disabled (Smart Pad)"
|
342 |
+
msgstr "禁用 (Smart Pad)"
|
343 |
+
|
344 |
+
#: ../ml-slider.php:1333
|
345 |
+
msgid ""
|
346 |
+
"Smart Crop ensures your responsive slides are cropped to a ratio that "
|
347 |
+
"results in a consistent slideshow size"
|
348 |
+
msgstr ""
|
349 |
+
"智能裁剪确保您的多张响应式幻灯片被剪裁到一个相同的比例,使他们能在幻灯片中保"
|
350 |
+
"持同样的尺寸。"
|
351 |
+
|
352 |
+
#: ../ml-slider.php:1338
|
353 |
+
msgid "Carousel mode"
|
354 |
+
msgstr "传送带模式"
|
355 |
+
|
356 |
+
#: ../ml-slider.php:1341
|
357 |
+
msgid "Display multiple slides at once. Slideshow output will be 100% wide."
|
358 |
+
msgstr "立即显示多张幻灯片. 幻灯片放映会以100%的宽度输出"
|
359 |
+
|
360 |
+
#: ../ml-slider.php:1349
|
361 |
+
msgid "Carousel margin"
|
362 |
+
msgstr "传送带模式边距"
|
363 |
+
|
364 |
+
#: ../ml-slider.php:1352
|
365 |
+
msgid "Pixel margin between slides in carousel."
|
366 |
+
msgstr "传送带模式下幻灯片间间距"
|
367 |
+
|
368 |
+
#: ../ml-slider.php:1361
|
369 |
+
msgid "Randomise the order of the slides"
|
370 |
+
msgstr "打乱幻灯片放映的顺序"
|
371 |
+
|
372 |
+
#: ../ml-slider.php:1366
|
373 |
+
msgid "Hover pause"
|
374 |
+
msgstr "悬停时暂停"
|
375 |
+
|
376 |
+
#: ../ml-slider.php:1369
|
377 |
+
msgid ""
|
378 |
+
"Pause the slideshow when hovering over slider, then resume when no longer "
|
379 |
+
"hovering."
|
380 |
+
msgstr "当鼠标悬停在图片上时暂停幻灯片放映(鼠标移开后恢复)"
|
381 |
+
|
382 |
+
#: ../ml-slider.php:1374
|
383 |
+
msgid "Reverse"
|
384 |
+
msgstr "反向"
|
385 |
+
|
386 |
+
#: ../ml-slider.php:1377
|
387 |
+
msgid "Reverse the animation direction"
|
388 |
+
msgstr "反转过渡效果的方向"
|
389 |
+
|
390 |
+
#: ../ml-slider.php:1387
|
391 |
+
msgid "Slide delay"
|
392 |
+
msgstr "幻灯片播放间隔"
|
393 |
+
|
394 |
+
#: ../ml-slider.php:1389
|
395 |
+
msgid "How long to display each slide, in milliseconds"
|
396 |
+
msgstr "幻灯片的播放间隔,单位是毫秒"
|
397 |
+
|
398 |
+
#: ../ml-slider.php:1390 ../ml-slider.php:1403 ../ml-slider.php:1416
|
399 |
+
#: ../ml-slider.php:1492 ../ml-slider.php:1518
|
400 |
+
msgid "ms"
|
401 |
+
msgstr "毫秒"
|
402 |
+
|
403 |
+
#: ../ml-slider.php:1400
|
404 |
+
msgid "Animation speed"
|
405 |
+
msgstr "动画速度"
|
406 |
+
|
407 |
+
#: ../ml-slider.php:1402
|
408 |
+
msgid "Set the speed of animations, in milliseconds"
|
409 |
+
msgstr "设置动画的速度,单位是毫秒"
|
410 |
+
|
411 |
+
#: ../ml-slider.php:1413 ../ml-slider.php:1415
|
412 |
+
msgid "Number of slices"
|
413 |
+
msgstr "切片数"
|
414 |
+
|
415 |
+
#: ../ml-slider.php:1426 ../ml-slider.php:1428 ../ml-slider.php:1439
|
416 |
+
#: ../ml-slider.php:1441
|
417 |
+
msgid "Number of squares"
|
418 |
+
msgstr "方格数"
|
419 |
+
|
420 |
+
#: ../ml-slider.php:1447
|
421 |
+
msgid "Slide direction"
|
422 |
+
msgstr "滑动方向"
|
423 |
+
|
424 |
+
#: ../ml-slider.php:1449
|
425 |
+
msgid "Select the sliding direction"
|
426 |
+
msgstr "选择的滑动方向"
|
427 |
+
|
428 |
+
#: ../ml-slider.php:1452
|
429 |
+
msgid "Horizontal"
|
430 |
+
msgstr "横向"
|
431 |
+
|
432 |
+
#: ../ml-slider.php:1453
|
433 |
+
msgid "Vertical"
|
434 |
+
msgstr "垂直"
|
435 |
+
|
436 |
+
#: ../ml-slider.php:1459
|
437 |
+
msgid "Easing"
|
438 |
+
msgstr "松"
|
439 |
+
|
440 |
+
#: ../ml-slider.php:1461
|
441 |
+
msgid "Animation easing effect"
|
442 |
+
msgstr "动画宽松效果"
|
443 |
+
|
444 |
+
#: ../ml-slider.php:1468
|
445 |
+
msgid "Previous text"
|
446 |
+
msgstr "表示“上一张”的文本"
|
447 |
+
|
448 |
+
#: ../ml-slider.php:1470
|
449 |
+
msgid "Set the text for the 'previous' direction item"
|
450 |
+
msgstr "为幻灯片放映中的“上一张”按钮设置文本内容"
|
451 |
+
|
452 |
+
#: ../ml-slider.php:1476
|
453 |
+
msgid "Next text"
|
454 |
+
msgstr "表示“下一张”的文本"
|
455 |
+
|
456 |
+
#: ../ml-slider.php:1478
|
457 |
+
msgid "Set the text for the 'next' direction item"
|
458 |
+
msgstr "为幻灯片放映中的“下一张”按钮设置文本内容"
|
459 |
+
|
460 |
+
#: ../ml-slider.php:1489
|
461 |
+
msgid "Square delay"
|
462 |
+
msgstr "延迟"
|
463 |
+
|
464 |
+
#: ../ml-slider.php:1491
|
465 |
+
msgid "Delay between squares in ms"
|
466 |
+
msgstr "以毫秒为单位"
|
467 |
+
|
468 |
+
#: ../ml-slider.php:1502
|
469 |
+
msgid "Opacity"
|
470 |
+
msgstr "透明度"
|
471 |
+
|
472 |
+
#: ../ml-slider.php:1504
|
473 |
+
msgid "Opacity of title and navigation"
|
474 |
+
msgstr "标题和导航的透明度"
|
475 |
+
|
476 |
+
#: ../ml-slider.php:1515
|
477 |
+
msgid "Caption speed"
|
478 |
+
msgstr "速度"
|
479 |
+
|
480 |
+
#: ../ml-slider.php:1517
|
481 |
+
msgid "Set the fade in speed of the caption"
|
482 |
+
msgstr "设置字幕渐隐的速度"
|
483 |
+
|
484 |
+
#: ../ml-slider.php:1524
|
485 |
+
msgid "Developer options"
|
486 |
+
msgstr "开发人员选项"
|
487 |
+
|
488 |
+
#: ../ml-slider.php:1529
|
489 |
+
msgid "CSS classes"
|
490 |
+
msgstr "CSS 类"
|
491 |
+
|
492 |
+
#: ../ml-slider.php:1531
|
493 |
+
msgid ""
|
494 |
+
"Specify any custom CSS Classes you would like to be added to the slider "
|
495 |
+
"wrapper"
|
496 |
+
msgstr "指定的任何自定义CSS类"
|
497 |
+
|
498 |
+
#: ../ml-slider.php:1537
|
499 |
+
msgid "Print CSS"
|
500 |
+
msgstr "打印CSS"
|
501 |
+
|
502 |
+
#: ../ml-slider.php:1540
|
503 |
+
msgid "Uncheck this is you would like to include your own CSS"
|
504 |
+
msgstr "取消选中,则使用自己的CSS"
|
505 |
+
|
506 |
+
#: ../ml-slider.php:1545
|
507 |
+
msgid "Print JS"
|
508 |
+
msgstr "打印JavaScript"
|
509 |
+
|
510 |
+
#: ../ml-slider.php:1548
|
511 |
+
msgid "Uncheck this is you would like to include your own Javascript"
|
512 |
+
msgstr "取消选中,则使用自己的Javascript"
|
513 |
+
|
514 |
+
#: ../ml-slider.php:1553
|
515 |
+
msgid "No conflict mode"
|
516 |
+
msgstr "无冲突模式"
|
517 |
+
|
518 |
+
#: ../ml-slider.php:1556
|
519 |
+
msgid "Delay adding the flexslider class to the slideshow"
|
520 |
+
msgstr ""
|
521 |
+
|
522 |
+
#: ../ml-slider.php:1570
|
523 |
+
msgid "Usage"
|
524 |
+
msgstr "使用方法"
|
525 |
+
|
526 |
+
#: ../ml-slider.php:1573
|
527 |
+
msgid "Shortcode"
|
528 |
+
msgstr "短代码"
|
529 |
+
|
530 |
+
#: ../ml-slider.php:1574
|
531 |
+
msgid "Template Include"
|
532 |
+
msgstr "使用在主题代码中的代码"
|
533 |
+
|
534 |
+
#: ../ml-slider.php:1578
|
535 |
+
msgid "Copy & paste the shortcode directly into any WordPress post or page."
|
536 |
+
msgstr "复制并粘贴这段短代码进任何WordPress博文或页面"
|
537 |
+
|
538 |
+
#: ../ml-slider.php:1581
|
539 |
+
msgid ""
|
540 |
+
"Copy & paste this code into a template file to include the slideshow within "
|
541 |
+
"your theme."
|
542 |
+
msgstr "复制并粘贴这个代码到模板文件中使得您的主题包含本幻灯片"
|
543 |
+
|
544 |
+
#: ../ml-slider.php:1615
|
545 |
+
msgid "Delete Slider"
|
546 |
+
msgstr "删除幻灯片"
|
547 |
+
|
548 |
+
#: ../ml-slider.php:1635
|
549 |
+
msgid "Select slideshow to insert into post"
|
550 |
+
msgstr "选择要插入到博文的幻灯片"
|
551 |
+
|
552 |
+
#: ../ml-slider.php:1638
|
553 |
+
msgid "Add slider"
|
554 |
+
msgstr "添加幻灯片"
|
555 |
+
|
556 |
+
#: ../ml-slider.php:1672
|
557 |
+
msgid "Insert Meta Slider"
|
558 |
+
msgstr "插入梅塔幻灯片"
|
559 |
+
|
560 |
+
#: ../ml-slider.php:1674
|
561 |
+
msgid "Choose slideshow"
|
562 |
+
msgstr "选择幻灯片"
|
563 |
+
|
564 |
+
#: ../ml-slider.php:1679
|
565 |
+
msgid "Insert slideshow"
|
566 |
+
msgstr "插入幻灯片"
|
567 |
+
|
568 |
+
#: ../ml-slider.php:1681 ../inc/metaslider.widget.class.php:121
|
569 |
+
msgid "No slideshows found"
|
570 |
+
msgstr "没有幻灯片"
|
571 |
+
|
572 |
+
#: ../ml-slider.php:1698
|
573 |
+
msgid "Go Pro"
|
574 |
+
msgstr "查看专业版"
|
575 |
+
|
576 |
+
#: ../ml-slider.php:1717
|
577 |
+
msgid "Upgrade to Pro $19"
|
578 |
+
msgstr "升级到专业版(19美金)"
|
579 |
+
|
580 |
+
#: ../inc/metaslider.widget.class.php:18
|
581 |
+
msgid "Meta Slider"
|
582 |
+
msgstr "梅塔幻灯片"
|
583 |
+
|
584 |
+
#: ../inc/metaslider.widget.class.php:108
|
585 |
+
msgid "Title:"
|
586 |
+
msgstr "标题:"
|
587 |
+
|
588 |
+
#: ../inc/metaslider.widget.class.php:111
|
589 |
+
msgid "Select Slider:"
|
590 |
+
msgstr "选择幻灯片:"
|
591 |
+
|
592 |
+
#: ../inc/slide/metaslide.class.php:71
|
593 |
+
#: ../inc/slide/metaslide.image.class.php:27
|
594 |
+
msgid "Security check failed. Refresh page and try again."
|
595 |
+
msgstr "安全检查失败。刷新页面,然后重试。"
|
596 |
+
|
597 |
+
#: ../inc/slide/metaslide.class.php:116
|
598 |
+
msgid "File copy failed. Please check upload directory permissions."
|
599 |
+
msgstr "文件复制失败,请检查上传目录权限。"
|
600 |
+
|
601 |
+
#: ../inc/slide/metaslide.class.php:275
|
602 |
+
msgid "Delete slide"
|
603 |
+
msgstr "删除幻灯片"
|
604 |
+
|
605 |
+
#: ../inc/slide/metaslide.image.class.php:43
|
606 |
+
msgid "Failed to add slide. Slide already exists in slideshow."
|
607 |
+
msgstr "添加幻灯片失败。幻灯片已存在"
|
608 |
+
|
609 |
+
#: ../inc/slide/metaslide.image.class.php:47
|
610 |
+
msgid "Failed to add slide. Slide is not of type 'image'."
|
611 |
+
msgstr "添加幻灯片失败。幻灯片不是'image'类型"
|
612 |
+
|
613 |
+
#: ../inc/slide/metaslide.image.class.php:111
|
614 |
+
msgid "Image Slide"
|
615 |
+
msgstr "图像幻灯片"
|
616 |
+
|
617 |
+
#: ../inc/slide/metaslide.image.class.php:153
|
618 |
+
msgid "Warning: Image data does not exist. Please re-upload the image."
|
619 |
+
msgstr "警告:图像数据不存在。请重新上传图片。"
|
620 |
+
|
621 |
+
#: ../inc/slide/metaslide.image.class.php:158
|
622 |
+
msgid "Image Title Text"
|
623 |
+
msgstr "图片的标题文字"
|
624 |
+
|
625 |
+
#: ../inc/slide/metaslide.image.class.php:160
|
626 |
+
msgid "Image Alt Text"
|
627 |
+
msgstr "图片的替代文字(alt)"
|
628 |
+
|
629 |
+
#: ../inc/slide/metaslide.image.class.php:165
|
630 |
+
msgid "General"
|
631 |
+
msgstr "通用"
|
632 |
+
|
633 |
+
#: ../inc/slide/metaslide.image.class.php:169
|
634 |
+
msgid "SEO"
|
635 |
+
msgstr "SEO"
|
636 |
+
|
637 |
+
#: ../inc/slide/metaslide.image.class.php:182
|
638 |
+
msgid "Crop Position"
|
639 |
+
msgstr "裁剪位置"
|
640 |
+
|
641 |
+
#: ../inc/slide/metaslide.image.class.php:185
|
642 |
+
msgid "Top Left"
|
643 |
+
msgstr "顶部左对齐"
|
644 |
+
|
645 |
+
#: ../inc/slide/metaslide.image.class.php:186
|
646 |
+
msgid "Top Center"
|
647 |
+
msgstr "顶部居中"
|
648 |
+
|
649 |
+
#: ../inc/slide/metaslide.image.class.php:187
|
650 |
+
msgid "Top Right"
|
651 |
+
msgstr "顶部右对齐"
|
652 |
+
|
653 |
+
#: ../inc/slide/metaslide.image.class.php:188
|
654 |
+
msgid "Center Left"
|
655 |
+
msgstr "水平左对齐"
|
656 |
+
|
657 |
+
#: ../inc/slide/metaslide.image.class.php:189
|
658 |
+
msgid "Center Center"
|
659 |
+
msgstr "水平居中"
|
660 |
+
|
661 |
+
#: ../inc/slide/metaslide.image.class.php:190
|
662 |
+
msgid "Center Right"
|
663 |
+
msgstr "水平右对齐"
|
664 |
+
|
665 |
+
#: ../inc/slide/metaslide.image.class.php:191
|
666 |
+
msgid "Bottom Left"
|
667 |
+
msgstr "底部左对齐"
|
668 |
+
|
669 |
+
#: ../inc/slide/metaslide.image.class.php:192
|
670 |
+
msgid "Bottom Center"
|
671 |
+
msgstr "底部居中"
|
672 |
+
|
673 |
+
#: ../inc/slide/metaslide.image.class.php:193
|
674 |
+
msgid "Bottom Right"
|
675 |
+
msgstr "底部右对齐"
|
676 |
+
|
677 |
+
#: ../inc/slide/metaslide.image.class.php:198
|
678 |
+
msgid "Crop"
|
679 |
+
msgstr "剪裁"
|
680 |
+
|
681 |
+
#~ msgid "Post Feed"
|
682 |
+
#~ msgstr "文章资讯"
|
683 |
+
|
684 |
+
#~ msgid "Layer Slide"
|
685 |
+
#~ msgstr "幻灯片"
|
686 |
+
|
687 |
+
#~ msgid "Responsive"
|
688 |
+
#~ msgstr "响应式"
|
689 |
+
|
690 |
+
#~ msgid "Thumbnails (Pro)"
|
691 |
+
#~ msgstr "缩略图 (Pro)"
|
692 |
+
|
693 |
+
#~ msgid "Change the slider style"
|
694 |
+
#~ msgstr "更改滑盖造型"
|
695 |
+
|
696 |
+
#~ msgid ""
|
697 |
+
#~ "Display as carousel - when selected the effect and direction options will "
|
698 |
+
#~ "be ignored."
|
699 |
+
#~ msgstr "显示为旋转 - 当选择后其他效果和方向设置将被忽略。"
|
700 |
+
|
701 |
+
#~ msgid "Version"
|
702 |
+
#~ msgstr "版本"
|
703 |
+
|
704 |
+
#~ msgid "Size"
|
705 |
+
#~ msgstr "大小"
|
706 |
+
|
707 |
+
#~ msgid "Mobile Friendly"
|
708 |
+
#~ msgstr "移动"
|
709 |
+
|
710 |
+
#~ msgid "Set the initial size for the slides (width x height)"
|
711 |
+
#~ msgstr "设置幻灯片的初始大小( 宽 x 高 )"
|
712 |
+
|
713 |
+
#~ msgid "Controls"
|
714 |
+
#~ msgstr "控制"
|
715 |
+
|
716 |
+
#~ msgid "Number of squares (width x height)"
|
717 |
+
#~ msgstr "宽 x 高"
|
718 |
+
|
719 |
+
#~ msgid "More Slide Types"
|
720 |
+
#~ msgstr "更多幻灯片类型"
|
ml-slider.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin Name: Meta Slider
|
6 |
* Plugin URI: https://www.metaslider.com
|
7 |
* Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
|
8 |
-
* Version: 3.3.
|
9 |
* Author: Matcha Labs
|
10 |
* Author URI: https://www.metaslider.com
|
11 |
* License: GPL-2.0+
|
@@ -31,7 +31,7 @@ class MetaSliderPlugin {
|
|
31 |
/**
|
32 |
* @var string
|
33 |
*/
|
34 |
-
public $version = '3.3.
|
35 |
|
36 |
|
37 |
/**
|
@@ -177,13 +177,6 @@ class MetaSliderPlugin {
|
|
177 |
add_action( 'admin_post_metaslider_create_slider', array( $this, 'create_slider' ) );
|
178 |
add_action( 'admin_post_metaslider_update_slider', array( $this, 'update_slider' ) );
|
179 |
|
180 |
-
|
181 |
-
if ( defined( 'METASLIDER_ENABLE_RESOURCE_MANAGER' ) && METASLIDER_ENABLE_RESOURCE_MANAGER === true ) {
|
182 |
-
|
183 |
-
add_action( 'template_redirect', array( $this, 'start_resource_manager'), 0 );
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
}
|
188 |
|
189 |
|
@@ -201,6 +194,9 @@ class MetaSliderPlugin {
|
|
201 |
|
202 |
add_filter( "plugin_action_links_{$plugin}", array( $this, 'upgrade_to_pro_link' ) );
|
203 |
|
|
|
|
|
|
|
204 |
}
|
205 |
|
206 |
|
@@ -1846,56 +1842,20 @@ class MetaSliderPlugin {
|
|
1846 |
|
1847 |
|
1848 |
/**
|
1849 |
-
*
|
1850 |
*
|
1851 |
-
*
|
1852 |
-
*
|
|
|
1853 |
*/
|
1854 |
-
public function
|
1855 |
-
|
1856 |
-
ob_start( array( $this, 'resource_manager' ) );
|
1857 |
-
|
1858 |
-
}
|
1859 |
-
|
1860 |
-
/**
|
1861 |
-
* Process the whole page output. Move link tags with an ID starting
|
1862 |
-
* with 'metaslider' into the <head> of the page.
|
1863 |
-
*/
|
1864 |
-
public function resource_manager( $buffer ) {
|
1865 |
-
|
1866 |
-
// create dom document from buffer
|
1867 |
-
$html = new simple_html_dom();
|
1868 |
-
|
1869 |
-
// Load from a string
|
1870 |
-
$html->load( $buffer, true, false );
|
1871 |
-
|
1872 |
-
if ( ! $html->find( 'body link[id^="metaslider"]' ) )
|
1873 |
-
return $buffer;
|
1874 |
-
|
1875 |
-
// selectors to find Meta Slider links
|
1876 |
-
$selectors = array(
|
1877 |
-
'body link[id^="metaslider"]',
|
1878 |
-
);
|
1879 |
-
|
1880 |
-
$selectors = apply_filters( "metaslider_resource_manager_selectors", $selectors );
|
1881 |
-
|
1882 |
-
if ( $head = $html->find( 'head', 0 ) ) {
|
1883 |
-
|
1884 |
-
// move meta slider elemends to <head>
|
1885 |
-
foreach ( $selectors as $selector ) {
|
1886 |
-
|
1887 |
-
foreach ( $html->find( $selector ) as $element ) {
|
1888 |
-
|
1889 |
-
$head->innertext .= "\t" . $element->outertext . "\n";
|
1890 |
-
$element->outertext = '';
|
1891 |
-
|
1892 |
-
}
|
1893 |
-
|
1894 |
-
}
|
1895 |
|
|
|
|
|
|
|
1896 |
}
|
1897 |
|
1898 |
-
return $
|
1899 |
|
1900 |
}
|
1901 |
|
5 |
* Plugin Name: Meta Slider
|
6 |
* Plugin URI: https://www.metaslider.com
|
7 |
* Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
|
8 |
+
* Version: 3.3.4
|
9 |
* Author: Matcha Labs
|
10 |
* Author URI: https://www.metaslider.com
|
11 |
* License: GPL-2.0+
|
31 |
/**
|
32 |
* @var string
|
33 |
*/
|
34 |
+
public $version = '3.3.4';
|
35 |
|
36 |
|
37 |
/**
|
177 |
add_action( 'admin_post_metaslider_create_slider', array( $this, 'create_slider' ) );
|
178 |
add_action( 'admin_post_metaslider_update_slider', array( $this, 'update_slider' ) );
|
179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
|
182 |
|
194 |
|
195 |
add_filter( "plugin_action_links_{$plugin}", array( $this, 'upgrade_to_pro_link' ) );
|
196 |
|
197 |
+
// html5 compatibility for stylesheets enqueued within <body>
|
198 |
+
add_filter( 'style_loader_tag', array( $this, 'add_property_attribute_to_stylesheet_links' ), 10, 2 );
|
199 |
+
|
200 |
}
|
201 |
|
202 |
|
1842 |
|
1843 |
|
1844 |
/**
|
1845 |
+
* Add a 'property=stylesheet' attribute to the Meta Slider CSS links for HTML5 validation
|
1846 |
*
|
1847 |
+
* @since 3.3.4
|
1848 |
+
* @param string $tag
|
1849 |
+
* @param string $handle
|
1850 |
*/
|
1851 |
+
public function add_property_attribute_to_stylesheet_links( $tag, $handle ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1852 |
|
1853 |
+
if ( strpos( $handle, 'metaslider' ) !== FALSE && strpos( $tag, "property='" ) === FALSE ) {
|
1854 |
+
// we're only filtering tags with metaslider in the handle, and links which don't already have a property attribute
|
1855 |
+
$tag = str_replace( "/>", "property='stylesheet' />", $tag );
|
1856 |
}
|
1857 |
|
1858 |
+
return $tag;
|
1859 |
|
1860 |
}
|
1861 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: wordpress slideshow,seo,slideshow,slider,widget,wordpress slider,image sli
|
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CQ84KC4X8YKW8
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.2.2
|
7 |
-
Stable tag: 3.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -59,7 +59,7 @@ Upgrade to [Meta Slider Pro](http://www.metaslider.com/upgrade) to add support f
|
|
59 |
* Spanish (thanks to eltipografico)
|
60 |
* German (thanks to Rewolve44)
|
61 |
* Polish (thanks to gordon34)
|
62 |
-
* Chinese (thanks to 断青丝)
|
63 |
* Taiwanese (thanks to 断青丝)
|
64 |
* Norwegian (thanks to Dreamsoft)
|
65 |
* Romanian (thanks to Octav Madalin Stanoaia)
|
@@ -147,6 +147,12 @@ See www.metaslider.com/documentation/image-cropping/
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
= 3.3.3 [11/06/15] =
|
151 |
|
152 |
* Ukrainian language pack added (thanks to mister_r!)
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CQ84KC4X8YKW8
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.2.2
|
7 |
+
Stable tag: 3.3.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
59 |
* Spanish (thanks to eltipografico)
|
60 |
* German (thanks to Rewolve44)
|
61 |
* Polish (thanks to gordon34)
|
62 |
+
* Chinese (thanks to 断青丝 and mamsds)
|
63 |
* Taiwanese (thanks to 断青丝)
|
64 |
* Norwegian (thanks to Dreamsoft)
|
65 |
* Romanian (thanks to Octav Madalin Stanoaia)
|
147 |
|
148 |
== Changelog ==
|
149 |
|
150 |
+
= 3.3.4 [16/07/15] =
|
151 |
+
|
152 |
+
* Add HTML5 validation by applying a property="stylesheet" attribute to meta slider <link> CSS tags
|
153 |
+
* Remove unused "Resource Manager" code
|
154 |
+
* Chinese language pack updated (thanks to mamsds!)
|
155 |
+
|
156 |
= 3.3.3 [11/06/15] =
|
157 |
|
158 |
* Ukrainian language pack added (thanks to mister_r!)
|