当前位置: 首页>>代码示例>>PHP>>正文


PHP License::get_by_comic方法代码示例

本文整理汇总了PHP中License::get_by_comic方法的典型用法代码示例。如果您正苦于以下问题:PHP License::get_by_comic方法的具体用法?PHP License::get_by_comic怎么用?PHP License::get_by_comic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在License的用法示例。


在下文中一共展示了License::get_by_comic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_licenses

	/**
	 * Gets the nations where the comic is licensed
	 * 
	 * @author	Woxxy
	 * @return	bool true on success
	 */
	public function get_licenses() {
		if (isset($this->licenses))
			return true;
		$license = new License();
		$this->licenses = $license->get_by_comic($this->id);
		// Check if the variable is not yet set, in order to save a databse read.
		foreach ($this->all as $item) {
			if (isset($item->licenses))
				continue;
			$license = new License();
			$item->licenses = $license->get_by_comic($item->id);
		}

		// All good, return true.
		return true;
	}
开发者ID:Nakei,项目名称:FoOlSlide,代码行数:22,代码来源:comic.php

示例2: serie

 function serie($stub = NULL, $chapter_id = "")
 {
     $comic = new Comic();
     $comic->where("stub", $stub)->get();
     if ($comic->result_count() == 0) {
         set_notice('warn', _('Sorry, the series you are looking for does not exist.'));
         $this->manage();
         return false;
     }
     $this->viewdata["function_title"] = '<a href="' . site_url('/admin/series/manage/') . '">' . _('Manage') . '</a>';
     if ($chapter_id == "") {
         $this->viewdata["extra_title"][] = $comic->name;
     }
     $data["comic"] = $comic;
     if ($chapter_id != "") {
         if ($this->input->post()) {
             $chapter = new Chapter();
             $chapter->update_chapter_db($this->input->post());
             $subchapter = is_int($chapter->subchapter) ? $chapter->subchapter : 0;
             set_notice('notice', sprintf(_('Information for Chapter %s has been updated.'), $chapter->chapter . '.' . $subchapter));
         }
         $chapter = new Chapter($chapter_id);
         $data["chapter"] = $chapter;
         $team = new Team();
         $teams = $team->get_teams($chapter->team_id, $chapter->joint_id);
         $table = ormer($chapter);
         $table[] = array(_('Teams'), array('name' => 'team', 'type' => 'input', 'value' => $teams, 'help' => _('Insert the names of the teams who worked on this chapter.')));
         $table = tabler($table);
         $data["table"] = $table;
         $this->viewdata["extra_title"][] = '<a href="' . site_url('admin/series/series/' . $comic->stub) . '">' . $comic->name . '</a>';
         $this->viewdata["extra_title"][] = $chapter->name != "" ? $chapter->name : $chapter->chapter . "." . $chapter->subchapter;
         $data["pages"] = $chapter->get_pages();
         $this->viewdata["main_content_view"] = $this->load->view("admin/series/chapter.php", $data, TRUE);
         $this->load->view("admin/default.php", $this->viewdata);
         return true;
     }
     if ($this->input->post()) {
         // Prepare for stub change in case we have to redirect instead of just printing the view
         $old_comic_stub = $comic->stub;
         $comic->update_comic_db($this->input->post());
         $config['upload_path'] = 'content/cache/';
         $config['allowed_types'] = 'jpg|png|gif';
         $this->load->library('upload', $config);
         $field_name = "thumbnail";
         if (count($_FILES) > 0 && $this->upload->do_upload($field_name)) {
             $up_data = $this->upload->data();
             if (!$this->files_model->comic_thumb($comic, $up_data)) {
                 log_message("error", "Controller: series.php/serie: image failed being added to folder");
             }
             if (!unlink($up_data["full_path"])) {
                 log_message('error', 'series.php/serie: couldn\'t remove cache file ' . $data["full_path"]);
                 return false;
             }
         }
         flash_notice('notice', sprintf(_('Updated series information for %s.'), $comic->name));
         // Did we change the stub of the comic? We need to redirect to the new page then.
         if (isset($old_comic_stub) && $old_comic_stub != $comic->stub) {
             redirect('/admin/series/series/' . $comic->stub);
         }
     }
     $chapters = new Chapter();
     $chapters->where('comic_id', $comic->id)->include_related('team')->order_by('volume', 'DESC')->order_by('chapter', 'DESC')->order_by('subchapter', 'DESC')->get();
     foreach ($chapters->all as $key => $item) {
         if ($item->joint_id > 0) {
             $teams = new Team();
             $jointers = $teams->get_teams(0, $item->joint_id);
             $item->jointers = $jointers;
             unset($jointers);
             unset($teams);
         }
     }
     $data["chapters"] = $chapters;
     if ($comic->get_thumb()) {
         $comic->thumbnail = $comic->get_thumb();
     }
     $table = ormer($comic);
     $licenses = new License();
     $table[] = array(_('Licensed in'), array('name' => 'licensed', 'type' => 'nation', 'value' => $licenses->get_by_comic($comic->id), 'help' => _('Insert the nations where the series is licensed in order to limit the availability.')));
     $table = tabler($table);
     $data['table'] = $table;
     $this->viewdata["main_content_view"] = $this->load->view("admin/series/series.php", $data, TRUE);
     $this->load->view("admin/default.php", $this->viewdata);
 }
开发者ID:bonsoirval,项目名称:FoOlSlide,代码行数:83,代码来源:series.php


注:本文中的License::get_by_comic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。