本文整理汇总了PHP中Pack::get_single_pack_info方法的典型用法代码示例。如果您正苦于以下问题:PHP Pack::get_single_pack_info方法的具体用法?PHP Pack::get_single_pack_info怎么用?PHP Pack::get_single_pack_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pack
的用法示例。
在下文中一共展示了Pack::get_single_pack_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view($id = null)
{
if (empty($id)) {
redirect('packs');
} else {
if (Pack::count(array('conditions' => array('id = ?', $id))) == 0) {
redirect('packs');
} else {
$this->data['pack'] = Pack::get_single_pack_info($id);
$this->data['subtitle'] = $this->data['pack']->name;
$this->data['songs'] = Ranked_file::all(array('conditions' => array("pack_id = ?", $id), 'order' => "rate ASC"));
if (isset($_GET['recalc'])) {
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_WARNING);
set_time_limit(0);
foreach ($this->data['songs'] as $file) {
$calculated_difficulty = $this->_process_everything($file->raw_file, $file->rate);
$file->difficulty_score = $calculated_difficulty;
}
}
$this->content_view = 'packs/view';
}
}
}