It looks like you're new here. If you want to get involved, click one of these buttons!
<?php $films = fuel_model('films', array('find' => 'all', 'order' => 'precedence desc')); ?>
<?php echo fuel_edit('create', 'Add Film', 'films'); ?>
<div class="videoWrap">
<?php if (!empty($films)) : ?>
<?php foreach($films as $film) : ?>
<div class="video">
<?php if (!empty($film->name)) : ?>
<iframe src="<?php echo $film->vimeo_url;?>?title=0&byline=0&portrait=0&badge=0&color=f02c00" width ="450" height="262" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen</iframe>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
require_once(FUEL_PATH.'models/base_module_model.php');
class Films_model extends Base_module_model {
public $filters = array('name');
public $required = array('name');
//public $linked_fields = array('slug' => array('name' => 'url_title'));
//public $linked_fields = array('slug' => 'name', 'client' => 'name');
function __construct()
{
parent::__construct('films'); // table name
}
function list_items($limit = null, $offset = null, $col = 'precedence', $order = 'desc')
{
$this->db->select('id, name, vimeo_url, precedence, published', FALSE);
$data = parent::list_items($limit, $offset, $col, $order);
return $data;
}
function form_fields($values = array())
{
$fields = parent::form_fields($values);
return $fields;
}
}
class Film_model extends Base_module_record {
function get_url()
{
return site_url('film/'.$this->slug);
}
function get_image_path()
{
return img_path('films/'.$this->name);
}
function get_thumb()
{
$thumb = $this->_parent_model->thumb_name($this->name);
return img_path('films/'.$thumb);
}
}
?>
Comments