本文整理汇总了PHP中Publication::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::load方法的具体用法?PHP Publication::load怎么用?PHP Publication::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::load方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view($issue_id)
{
$this->load->model(['Issue', 'Publication']);
$issue = new Issue();
$issue->load($issue_id);
if (!$issue->issue_id) {
show_404();
}
$publication = new Publication();
$publication->load($issue->publication_id);
$this->load->view('bootstrap/main', ['main' => 'magazines/magazine', 'issue' => $issue, 'publication' => $publication]);
}
示例2: index
/**
* Index page for Magazine controller.
*/
public function index() {
/*// echo '<h2>My magazines</h2>';
$this->load->model('Publication');
$this->Publication->publication_name = 'Sandy Shore'; // create the record
$this->Publication->save();
// print_r($this->Publication);
echo '<tt><pre>' . var_export($this->Publication,TRUE) . '<pre><tt>';
$this->load->model('Issue');
$issue = new Issue();
$issue->publication_id = $this->Publication->publication_id;
$issue->issue_number = 2;
$issue->issue_date_publication = date('2015-02-01');
$issue->save();
echo '<tt><pre>' . var_export($issue,TRUE) . '<pre><tt>';
$this->load->view('magazines');
// $this->load->view('magazines');*/
$data = array();
$this->load->model('Publication');
$publication = new Publication();
$publication->load(2);
$data['publication'] = $publication;
$this->load->model('Issue');
$issue = new Issue();
$issue->load(2);
$data['issue'] = $issue;
$this->load->view('magazines');
$this->load->view('magazine',$data);
// echo "<pre>";
// echo print_r($data);
// echo "</pre>";
}
示例3: Issue
function view_rapport()
{
require 'vendor/autoload.php';
$this->load->helper('html');
$this->load->helper('url');
$this->load->view('bootstrap/header');
$this->load->view('bootstrap/nav');
$this->load->model(array('Issue', 'Publication'));
$this->load->model("extract");
$issue = new Issue();
//$this->load->library('MY_Chart');
//$this->load->My_Chart->load();
$issue->load($issue_id);
if (!$issue->issue_id) {
show_404();
}
$publication = new Publication();
$publication->load($issue->publication_id);
$table1 = $this->extract->extract_csv('uploads/' . $issue->issue_cover);
foreach ($table1 as $table) {
$period = array_shift($table);
foreach ($table as $value) {
//$period = array_shift($value);
//unset($value[0]);
$data[] = $value;
//print_r($value);
}
}
foreach ($data as $key) {
$topsökord[] = $key['Sökord'];
$topklicks[] = $key['Klick'];
}
$top = array_combine($topsökord, $topklicks);
arsort($top);
array_shift($top);
$top5 = array_slice($top, 0, 5);
/*
foreach($data as $key) {
$topsökord[] = $data;
$topklicks[] = $key;
}*/
while ($sökord = current($top5)) {
$sökordtop[] = key($top5);
$klickstop[] = $sökord;
next($top5);
}
$lava = new Lavacharts();
// See note below for Laravel
$finances = $lava->DataTable();
$finances->addStringColumn('sökord')->addNumberColumn('Klick')->setDateTimeFormat('Y')->addRow(array($sökordtop[0], $klickstop[0]))->addRow(array($sökordtop[1], $klickstop[1]))->addRow(array($sökordtop[2], $klickstop[2]))->addRow(array($sökordtop[3], $klickstop[3]))->addRow(array($sökordtop[4], $klickstop[4]));
$columnchart = $lava->ColumnChart('Finances')->setOptions(array('datatable' => $finances, 'title' => 'Top 5 sökord', 'colors' => ['#FF0000'], 'titleTextStyle' => $lava->TextStyle(array('color' => '#FF0000', 'fontSize' => 20))));
$this->load->view('magazine', array('issue' => $issue, 'foretagsnamn' => $issue->foretagsnamn, 'table1' => $table1, 'columnchart' => $columnchart, 'lava' => $lava, 'publication' => $publication));
$this->load->helper('url');
$this->load->view('bootstrap/footer');
$data = $this->customers_model->editFöretagsinformation($_REQUEST['id']);
//echo $id;
//print_r($data);
if (isset($_REQUEST['search_option']) && $_REQUEST['search_option'] != "") {
$search_option = $_REQUEST['search_option'];
$get_search = $_REQUEST['get_search'];
} else {
$search_option = "";
$get_search = "";
}
$total = $this->customers_model->gettotalCustomers();
/* Load the 'pagination' library */
$this->load->library('pagination');
/* Set the config parameters */
$config['base_url'] = base_url() . "index.php/dashboard/index";
$config['total_rows'] = $total;
$config['per_page'] = 5;
$config["uri_segment"] = 3;
$this->pagination->initialize($config);
$page = $this->uri->segment(3) ? $this->uri->segment(3) : 0;
/* Setup the variables that will be passed to the view */
$data = array('rows' => $this->customers_model->getCustomers($search_option, $get_search, $config["per_page"], $page), 'pages' => $this->pagination->create_links());
$this->load->view('includes/header', $data);
//redirect('customers/customers_information');
$data["customers_information"] = $this->customers_model->getdataCustomers();
$data["supplier_lists"] = $this->modeladmin->Get_supplierDetails();
$data["billing_duration"] = $this->modeladmin->Get_billingdetails();
$data["getcontacttype"] = $this->customers_model->getcontractType();
$this->load->view('customers/customers_information', $data);
//$this->load->view('dashboard/index',$data);
$this->load->view('includes/footer');
}
示例4: load_all
/**
* Load ISSUE table and PUBLICATION table
* @param type $where
* @param type $limit
* @param type $offset
* @param type $orderBy
* @return $magazines array
*/
private function load_all($where, $limit, $offset, $orderBy)
{
$magazines = array();
$this->load->model(array('Issue', 'Publication'));
$issues = $this->Issue->get($limit, $offset, $where, $orderBy);
foreach ($issues as $issue) {
$publication = new Publication();
$publication->load($issue->publication_id);
$magazines[] = array($publication->publication_name, $issue->issue_number, $issue->issue_date_publication, "<a href=\"/ci-2.2.5/magazine/remove/" . $issue->issue_id . "\">Del</a>" . " <a href=\"/ci-2.2.5/magazine/magazine_form/" . $issue->issue_id . "\">Edit</a>");
}
return $magazines;
}
示例5: deleteReportedItem
/**
* Removes an item reported as abusive
*
* @param integer $referenceid ID of the database table row
* @param integer $parentid If the element has a parent element
* @param string $category Element type (determines table to look in)
* @param string $message Message to user to append to
* @return string
*/
public function deleteReportedItem($referenceid, $parentid, $category, $message)
{
if ($category != 'pubreview' && $category != 'pubreviewcomment') {
return null;
}
$this->loadLanguage();
$msg = Lang::txt('PLG_SUPPORT_PUBLICATIONS_CONTENT_FOUND_OBJECTIONABLE');
$database = App::get('db');
switch ($category) {
case 'review':
include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'publication.php';
include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'review.php';
// Delete the review
$review = new PublicationReview($database);
$review->load($referenceid);
//$comment->anonymous = 1;
if (preg_match('/^<!-- \\{FORMAT:(.*)\\} -->/i', $review->comment, $matches)) {
$format = strtolower(trim($matches[1]));
switch ($format) {
case 'html':
$review->comment = '<!-- {FORMAT:HTML} --><span class="warning">' . $msg . '</span>';
break;
case 'wiki':
default:
$review->comment = '<!-- {FORMAT:WIKI} -->[[Span(' . $msg . ', class="warning")]]';
break;
}
} else {
$review->comment = '[[Span(' . $msg . ', class="warning")]]';
}
$review->store();
// Recalculate the average rating for the parent resource
$pub = new Publication($database);
$pub->load($parentid);
$pub->calculateRating();
$pub->updateRating();
if (!$pub->store()) {
$this->setError($pub->getError());
return false;
}
$message .= Lang::txt('PLG_SUPPORT_PUBLICATIONS_NOTIFICATION_OF_REMOVAL', $parentid);
break;
case 'reviewcomment':
$comment = \Hubzero\Item\Comment::oneOrFail($referenceid);
if (preg_match('/^<!-- \\{FORMAT:(.*)\\} -->/i', $comment->get('content'), $matches)) {
$format = strtolower(trim($matches[1]));
switch ($format) {
case 'html':
$comment->set('content', '<!-- {FORMAT:HTML} --><span class="warning">' . $msg . '</span>');
break;
case 'wiki':
default:
$comment->set('content', '<!-- {FORMAT:WIKI} -->[[Span(' . $msg . ', class="warning")]]');
break;
}
} else {
$comment->set('content', '[[Span(' . $msg . ', class="warning")]]');
}
if (!$comment->save()) {
$this->setError($comment->getError());
return false;
}
$message .= Lang::txt('PLG_SUPPORT_PUBLICATIONS_NOTIFICATION_OF_REMOVAL', $parentid);
break;
}
return $message;
}
示例6: view
public function view($issue_id)
{
$this->load->helper('url');
$this->load->library('session');
$this->load->model('My_User');
$this->load->library('table');
$this->load->model(array('Issue', 'Publication'));
$this->load->view('bootstrap/header');
$this->load->helper('html');
$issue = new Issue();
$issue->load($issue_id);
if (!$issue->issue_id) {
show_404();
}
$publication = new Publication();
$publication->load($issue->publication_id);
$this->load->view('magazine', array('issue' => $issue, 'publication' => $publication));
$this->load->view('bootstrap/footer');
}