$item) { $ctimes[$id] = $item['fstat']['ctime']; } if ($way == 'desc') { arsort($ctimes, SORT_NUMERIC); }else { asort($ctimes, SORT_NUMERIC); } $sorted = array(); foreach($ctimes as $id => $ctime) { array_push($sorted, $files[$id]); } return $sorted; } //生成GA统计代码 public static function getGACode() { if (!empty(FSC::$app['config']['debug'])) {return '';} $msid = !empty(FSC::$app['config']['GA_MEASUREMENT_ID']) ? FSC::$app['config']['GA_MEASUREMENT_ID'] : ''; if (empty($msid)) {return '';} $gacode = << eof; return $gacode; } //根据收藏和分类,获取单个收藏视频的所在分类 public static function getFavsTags($filename, $tags) { $fileTags = array(); foreach($tags as $tag_id => $item) { if (in_array($filename, $item['files'])) { array_push($fileTags, $item['name']); } } return $fileTags; } //获取只包含分类名的数组 public static function getTagNames($tags) { $tmp_arr = array(); foreach ($tags as $id => $tag) { array_push($tmp_arr, $tag['name']); } return $tmp_arr; } }