Changeset 3874:ab8368569446 for inc/core/class.dc.meta.php
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.meta.php
r3733 r3874 42 42 public function splitMetaValues($str) 43 43 { 44 $res = array();44 $res = []; 45 45 foreach (explode(',', $str) as $i => $tag) { 46 46 $tag = trim($tag); … … 80 80 81 81 if (!is_array($meta)) { 82 return array();82 return []; 83 83 } 84 84 … … 118 118 { 119 119 $meta = $this->getMetaArray($str); 120 $data = array();120 $data = []; 121 121 122 122 if (isset($meta[$type])) { 123 123 foreach ($meta[$type] as $v) { 124 $data[] = array(124 $data[] = [ 125 125 'meta_id' => $v, 126 126 'meta_type' => $type, … … 129 129 'percent' => 0, 130 130 'roundpercent' => 0 131 );131 ]; 132 132 } 133 133 } … … 191 191 $rs = $this->con->select($strReq); 192 192 193 $meta = array();193 $meta = []; 194 194 while ($rs->fetch()) { 195 195 $meta[$rs->meta_type][] = $rs->meta_id; … … 216 216 @return <b>record</b> the resulting posts record 217 217 */ 218 public function getPostsByMeta($params = array(), $count_only = false)218 public function getPostsByMeta($params = [], $count_only = false) 219 219 { 220 220 if (!isset($params['meta_id'])) { … … 248 248 @return <b>record</b> the resulting comments record 249 249 */ 250 public function getCommentsByMeta($params = array(), $count_only = false)250 public function getCommentsByMeta($params = [], $count_only = false) 251 251 { 252 252 if (!isset($params['meta_id'])) { … … 282 282 public function getMeta($type = null, $limit = null, $meta_id = null, $post_id = null) 283 283 { 284 $params = array();284 $params = []; 285 285 286 286 if ($type != null) { … … 320 320 @return <b>record</b> the resulting comments record 321 321 */ 322 public function getMetadata($params = array(), $count_only = false)322 public function getMetadata($params = [], $count_only = false) 323 323 { 324 324 if ($count_only) { … … 390 390 $rs_static = $rs->toStatic(); 391 391 392 $max = array();392 $max = []; 393 393 while ($rs_static->fetch()) { 394 394 $type = $rs_static->meta_type; … … 513 513 } 514 514 515 $to_update = $to_remove = array();515 $to_update = $to_remove = []; 516 516 517 517 $rs = $this->con->select(sprintf($getReq, $this->con->escape($meta_id), … … 587 587 588 588 if ($rs->isEmpty()) { 589 return array();590 } 591 592 $ids = array();589 return []; 590 } 591 592 $ids = []; 593 593 while ($rs->fetch()) { 594 594 $ids[] = $rs->post_id;
Note: See TracChangeset
for help on using the changeset viewer.