本文整理汇总了PHP中content::get_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP content::get_by_id方法的具体用法?PHP content::get_by_id怎么用?PHP content::get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::get_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addaction
public function addaction()
{
$c = new content();
if ($this->input->post("id") !== FALSE) {
$c->get_by_id($this->input->post("id"));
} else {
if ($this->input->post("id") === FALSE) {
$c->user = $this->ion_auth->get_user();
$c->user = $c->user->id;
}
}
$c->parent_section = $this->input->post("parent_section");
$c->parent_content = $this->input->post("parent_content");
$c->title = $this->input->post("title");
$c->cell = $this->input->post("cell");
$c->sort = $this->input->post("sort");
$c->path = $this->input->post("path");
$c->type = $this->input->post("type");
$c->subsection = $this->input->post("subsection") == FALSE ? FALSE : TRUE;
$c->view = $this->input->post("view");
$c->info = $this->input->post("info");
$c->filter = $this->input->post("filter");
// this is a workaround, cuz it makes 2 newline characters
// and i don't know what the hell is wrong with it.
$c->filter = str_replace("\n\n", "\n", $c->filter);
$p = new Content($c->parent_content);
if ($this->input->post("id") === FALSE) {
$this->add_info(lang('system_content_added'));
} else {
$this->ajax = TRUE;
$this->print_text(lang('system_content_edited'));
}
$c->save();
}
示例2: content
<?php
$ci =& get_instance();
$ci->load->library('gui');
$c = new content();
if ($ci->input->post("id")) {
$c->get_by_id($ci->input->post("id"));
}
$c->parent_section = $ci->input->post("parent_section");
$c->parent_content = $ci->input->post("parent_content");
$c->cell = $ci->input->post("cell");
$c->sort = $ci->input->post("sort");
$c->path = $ci->input->post("path");
$c->type = $ci->input->post("type");
$c->subsection = $ci->input->post("subsection") == NULL ? FALSE : TRUE;
$c->view = $ci->input->post("view");
$c->addin = $ci->input->post("addin");
$old_edit = $c->can_edit();
$c->edit = $ci->input->post("edit");
$c->del = $ci->input->post("del");
$c->info = $ci->input->post("info");
if (!$ci->input->post("id")) {
$p = new content();
$p->get_by_id($c->parent_content);
$c->attach($ci->vunsy->section, $p, $c->cell, $c->sort);
}
$p = new Section();
$p->get_by_id($c->parent_section);
if ($p->can_addin() and !$ci->input->post("id") or $ci->input->post("id") and $old_edit) {
$c->save();
if ($ci->input->post("id")) {