MetaSlider - Version 3.3.4

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 Icon 128x128 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 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,'/')."#x2F;", $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-:]+#x2F;", $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: 2013-12-16 17:32-0000\n"
5
- "PO-Revision-Date: 2013-12-16 17:32-0000\n"
6
- "Last-Translator: 断青丝 <181138991@qq.com>\n"
7
- "Language-Team: 断青丝 <181138991@qq.com>\n"
8
- "Language: zh_CN\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.5.7\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:102
19
- msgid "Go Pro"
20
- msgstr "查看专业版"
21
-
22
- #: ../ml-slider.php:156
23
- msgid "Image"
24
- msgstr "图像"
25
-
26
- #: ../ml-slider.php:157
27
- msgid "Add to slider"
28
- msgstr "添加到幻灯片"
29
-
30
- #: ../ml-slider.php:177
31
- msgid "Post Feed"
32
- msgstr "文章资讯"
33
-
34
- #: ../ml-slider.php:178
35
- msgid "Vimeo"
36
- msgstr ""
37
-
38
- #: ../ml-slider.php:179
39
- msgid "YouTube"
40
- msgstr ""
41
-
42
- #: ../ml-slider.php:180
43
- msgid "Layer Slide"
44
- msgstr "幻灯片"
45
-
46
- #: ../ml-slider.php:235 ../inc/slide/metaslide.image.class.php:103
47
- msgid "URL"
48
- msgstr ""
49
-
50
- #: ../ml-slider.php:236 ../inc/slide/metaslide.image.class.php:101
51
- msgid "Caption"
52
- msgstr "标题"
53
-
54
- #: ../ml-slider.php:237 ../inc/slide/metaslide.image.class.php:102
55
- msgid "New Window"
56
- msgstr "新窗口"
57
-
58
- #: ../ml-slider.php:238
59
- msgid "Are you sure?"
60
- msgstr "你确定吗?"
61
-
62
- #: ../ml-slider.php:242
63
- msgid ""
64
- "Caution: This setting is for advanced developers only. If you're unsure, "
65
- "leave it checked."
66
- msgstr "注意:此设置仅适用于高级开发。"
67
-
68
- #: ../ml-slider.php:278
69
- msgid "Upgrade to Pro $19"
70
- msgstr "升级到专业版$19"
71
-
72
- #: ../ml-slider.php:294
73
- msgid "Documentation"
74
- msgstr "文档"
75
-
76
- #: ../ml-slider.php:430
77
- msgid "New Slider"
78
- msgstr "新的滑块"
79
-
80
- #: ../ml-slider.php:692
81
- msgid "New slideshow created. Click 'Add Slide' to get started!"
82
- msgstr "创建新的幻灯片。点击“添加幻灯片”以开始浏览网页!"
83
-
84
- #: ../ml-slider.php:709
85
- msgid "or"
86
- msgstr "或"
87
-
88
- #: ../ml-slider.php:710
89
- msgid "Add New Slideshow"
90
- msgstr "添加新的幻灯片"
91
-
92
- #: ../ml-slider.php:726
93
- msgid "Create your first slideshow"
94
- msgstr "创建第一份幻灯片"
95
-
96
- #: ../ml-slider.php:744
97
- msgid "Settings"
98
- msgstr "设置"
99
-
100
- #: ../ml-slider.php:745
101
- msgid "Save"
102
- msgstr "保存"
103
-
104
- #: ../ml-slider.php:746
105
- msgid "Save & Preview"
106
- msgstr "保存并预览"
107
-
108
- #: ../ml-slider.php:759
109
- msgid "Flex Slider"
110
- msgstr ""
111
-
112
- #: ../ml-slider.php:760
113
- msgid "Responsive"
114
- msgstr "响应"
115
-
116
- #: ../ml-slider.php:761
117
- msgid "Nivo Slider"
118
- msgstr ""
119
-
120
- #: ../ml-slider.php:762
121
- msgid "Coin Slider"
122
- msgstr ""
123
-
124
- #: ../ml-slider.php:773 ../ml-slider.php:995
125
- msgid "Width"
126
- msgstr "宽度"
127
-
128
- #: ../ml-slider.php:775
129
- #, fuzzy
130
- msgid "Slideshow width"
131
- msgstr "幻灯片标题"
132
-
133
- #: ../ml-slider.php:776 ../ml-slider.php:789
134
- msgid "px"
135
- msgstr ""
136
-
137
- #: ../ml-slider.php:786 ../ml-slider.php:1008
138
- msgid "Height"
139
- msgstr "高度"
140
-
141
- #: ../ml-slider.php:788
142
- #, fuzzy
143
- msgid "Slideshow height"
144
- msgstr "幻灯片标题"
145
-
146
- #: ../ml-slider.php:795
147
- msgid "Effect"
148
- msgstr "效果"
149
-
150
- #: ../ml-slider.php:797
151
- msgid "Slide transition effect"
152
- msgstr "幻灯片过渡效果"
153
-
154
- #: ../ml-slider.php:799 ../ml-slider.php:927
155
- msgid "Random"
156
- msgstr "随机"
157
-
158
- #: ../ml-slider.php:800
159
- msgid "Swirl"
160
- msgstr "漩涡"
161
-
162
- #: ../ml-slider.php:801
163
- msgid "Rain"
164
- msgstr "雨"
165
-
166
- #: ../ml-slider.php:802
167
- msgid "Straight"
168
- msgstr "直"
169
-
170
- #: ../ml-slider.php:803
171
- msgid "Slide Down"
172
- msgstr "向下滑动"
173
-
174
- #: ../ml-slider.php:804
175
- msgid "Slice Up"
176
- msgstr "切片"
177
-
178
- #: ../ml-slider.php:805
179
- msgid "Slide Up Left"
180
- msgstr "向左滑动"
181
-
182
- #: ../ml-slider.php:806
183
- msgid "Slice Up Down"
184
- msgstr "切片向下"
185
-
186
- #: ../ml-slider.php:807
187
- msgid "Slide Up Down Left"
188
- msgstr "向上滑动"
189
-
190
- #: ../ml-slider.php:808
191
- msgid "Fold"
192
- msgstr "折"
193
-
194
- #: ../ml-slider.php:809
195
- msgid "Fade"
196
- msgstr "褪色"
197
-
198
- #: ../ml-slider.php:810
199
- msgid "Slide In Right"
200
- msgstr "向右滑动"
201
-
202
- #: ../ml-slider.php:811
203
- msgid "Slide In Left"
204
- msgstr "向左滑动"
205
-
206
- #: ../ml-slider.php:812
207
- msgid "Box Random"
208
- msgstr "随机"
209
-
210
- #: ../ml-slider.php:813
211
- msgid "Box Rain"
212
- msgstr "箱式"
213
-
214
- #: ../ml-slider.php:814
215
- msgid "Box Rain Reverse"
216
- msgstr "箱式"
217
-
218
- #: ../ml-slider.php:815
219
- msgid "Box Rain Grow Reverse"
220
- msgstr ""
221
-
222
- #: ../ml-slider.php:816
223
- msgid "Slide"
224
- msgstr "滑动"
225
-
226
- #: ../ml-slider.php:823
227
- msgid "Theme"
228
- msgstr "主题"
229
-
230
- #: ../ml-slider.php:825
231
- #, fuzzy
232
- msgid "Slideshow theme"
233
- msgstr "幻灯片标题"
234
-
235
- #: ../ml-slider.php:827
236
- msgid "Default"
237
- msgstr ""
238
-
239
- #: ../ml-slider.php:828
240
- msgid "Dark (Nivo)"
241
- msgstr ""
242
-
243
- #: ../ml-slider.php:829
244
- msgid "Light (Nivo)"
245
- msgstr ""
246
-
247
- #: ../ml-slider.php:830
248
- msgid "Bar (Nivo)"
249
- msgstr ""
250
-
251
- #: ../ml-slider.php:836
252
- msgid "Arrows"
253
- msgstr "箭头"
254
-
255
- #: ../ml-slider.php:839
256
- msgid "Show the previous/next arrows"
257
- msgstr ""
258
-
259
- #: ../ml-slider.php:844
260
- msgid "Navigation"
261
- msgstr "导航"
262
-
263
- #: ../ml-slider.php:847
264
- #, fuzzy
265
- msgid "Show the slide navigation bullets"
266
- msgstr "显示幻灯片导航"
267
-
268
- #: ../ml-slider.php:849
269
- msgid "Hidden"
270
- msgstr "隐藏"
271
-
272
- #: ../ml-slider.php:850
273
- msgid "Dots"
274
- msgstr "点"
275
-
276
- #: ../ml-slider.php:851
277
- msgid "Thumbnails (Pro)"
278
- msgstr "缩略图(临)"
279
-
280
- #: ../ml-slider.php:862
281
- msgid "Title"
282
- msgstr "标题"
283
-
284
- #: ../ml-slider.php:863
285
- msgid "Slideshow title"
286
- msgstr "幻灯片标题"
287
-
288
- #: ../ml-slider.php:877
289
- msgid "Advanced Settings"
290
- msgstr "“高级设置”"
291
-
292
- #: ../ml-slider.php:886
293
- msgid "Stretch"
294
- msgstr ""
295
-
296
- #: ../ml-slider.php:888
297
- msgid "100% wide output"
298
- msgstr ""
299
-
300
- #: ../ml-slider.php:890
301
- #, fuzzy
302
- msgid "Stretch the slideshow output to fill it's parent container"
303
- msgstr "在页面加载启动幻灯片"
304
-
305
- #: ../ml-slider.php:895
306
- msgid "Center align"
307
- msgstr "居中对齐"
308
-
309
- #: ../ml-slider.php:898
310
- msgid "Center align the slideshow"
311
- msgstr "居中对齐幻灯片"
312
-
313
- #: ../ml-slider.php:903
314
- msgid "Auto play"
315
- msgstr "自动播放"
316
-
317
- #: ../ml-slider.php:906
318
- msgid "Transition between slides automatically"
319
- msgstr ""
320
-
321
- #: ../ml-slider.php:911
322
- msgid "Smart crop"
323
- msgstr "智能裁剪"
324
-
325
- #: ../ml-slider.php:914
326
- msgid ""
327
- "Smart Crop ensures your responsive slides are cropped to a ratio that "
328
- "results in a consistent slideshow size"
329
- msgstr ""
330
- "智能裁剪,将您的幻灯片图片裁剪到一个相同比例,使其显示结果在幻灯片中大小保存"
331
- "一致。"
332
-
333
- #: ../ml-slider.php:919
334
- msgid "Carousel mode"
335
- msgstr "传送带模式"
336
-
337
- #: ../ml-slider.php:922
338
- msgid "Display multiple slides at once. Slideshow output will be 100% wide."
339
- msgstr ""
340
-
341
- #: ../ml-slider.php:930
342
- msgid "Randomise the order of the slides"
343
- msgstr "随机顺序幻灯片"
344
-
345
- #: ../ml-slider.php:935
346
- msgid "Hover pause"
347
- msgstr "悬停时间"
348
-
349
- #: ../ml-slider.php:938
350
- #, fuzzy
351
- msgid ""
352
- "Pause the slideshow when hovering over slider, then resume when no longer "
353
- "hovering."
354
- msgstr "当鼠标悬停在图片上时暂停幻灯片"
355
-
356
- #: ../ml-slider.php:943
357
- msgid "Reverse"
358
- msgstr "逆转"
359
-
360
- #: ../ml-slider.php:946
361
- msgid "Reverse the animation direction"
362
- msgstr "反向动画"
363
-
364
- #: ../ml-slider.php:956
365
- msgid "Slide delay"
366
- msgstr "滑动延迟"
367
-
368
- #: ../ml-slider.php:958
369
- msgid "How long to display each slide, in milliseconds"
370
- msgstr "幻灯片的播放间隔,单位毫秒"
371
-
372
- #: ../ml-slider.php:959 ../ml-slider.php:972 ../ml-slider.php:985
373
- #: ../ml-slider.php:1061 ../ml-slider.php:1087
374
- msgid "ms"
375
- msgstr "毫秒"
376
-
377
- #: ../ml-slider.php:969
378
- msgid "Animation speed"
379
- msgstr "动画速度"
380
-
381
- #: ../ml-slider.php:971
382
- msgid "Set the speed of animations, in milliseconds"
383
- msgstr "设置动画的速度,单位毫秒"
384
-
385
- #: ../ml-slider.php:982 ../ml-slider.php:984
386
- msgid "Number of slices"
387
- msgstr "切片数"
388
-
389
- #: ../ml-slider.php:995 ../ml-slider.php:997 ../ml-slider.php:1008
390
- #: ../ml-slider.php:1010
391
- msgid "Number of squares"
392
- msgstr "方格数"
393
-
394
- #: ../ml-slider.php:1016
395
- msgid "Slide direction"
396
- msgstr "滑动方向"
397
-
398
- #: ../ml-slider.php:1018
399
- msgid "Select the sliding direction"
400
- msgstr "选择的滑动方向"
401
-
402
- #: ../ml-slider.php:1021
403
- msgid "Horizontal"
404
- msgstr "横向"
405
-
406
- #: ../ml-slider.php:1022
407
- msgid "Vertical"
408
- msgstr "垂直"
409
-
410
- #: ../ml-slider.php:1028
411
- msgid "Easing"
412
- msgstr "松"
413
-
414
- #: ../ml-slider.php:1030
415
- msgid "Animation easing effect"
416
- msgstr "动画宽松效果"
417
-
418
- #: ../ml-slider.php:1037
419
- msgid "Previous text"
420
- msgstr "上一张图片"
421
-
422
- #: ../ml-slider.php:1039
423
- msgid "Set the text for the 'previous' direction item"
424
- msgstr "选择图片为'上一张'"
425
-
426
- #: ../ml-slider.php:1045
427
- msgid "Next text"
428
- msgstr "下一张图片"
429
-
430
- #: ../ml-slider.php:1047
431
- msgid "Set the text for the 'next' direction item"
432
- msgstr "选择图片为'下一张'"
433
-
434
- #: ../ml-slider.php:1058
435
- msgid "Square delay"
436
- msgstr "延迟"
437
-
438
- #: ../ml-slider.php:1060
439
- #, fuzzy
440
- msgid "Delay between squares in ms"
441
- msgstr "以毫秒为单位"
442
-
443
- #: ../ml-slider.php:1071
444
- msgid "Opacity"
445
- msgstr "透明度"
446
-
447
- #: ../ml-slider.php:1073
448
- msgid "Opacity of title and navigation"
449
- msgstr "标题和导航的透明度"
450
-
451
- #: ../ml-slider.php:1084
452
- msgid "Caption speed"
453
- msgstr "速度"
454
-
455
- #: ../ml-slider.php:1086
456
- msgid "Set the fade in speed of the caption"
457
- msgstr "设置速度的标题淡入"
458
-
459
- #: ../ml-slider.php:1093
460
- #, fuzzy
461
- msgid "Developer options"
462
- msgstr "开发人员选项"
463
-
464
- #: ../ml-slider.php:1098
465
- msgid "CSS classes"
466
- msgstr "CSS 类"
467
-
468
- #: ../ml-slider.php:1100
469
- msgid ""
470
-