Файл: adultscript-2.0.3-pro/files/admin/modules/nuevo/components/embed2.php
Строк: 91
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_Admin_nuevo_embed2
{
private $db;
private $cache;
private $filter;
public function __construct()
{
$this->db = VF::factory('database');
$this->cache = VF::factory('cache');
$this->filter = VF::factory('filter');
}
public function render()
{
$errors = array();
$messages = array();
$warnings = array();
$data = array();
$this->db->query("SELECT * FROM nuevo__player WHERE ID = '2' LIMIT 1");
$player= $this->db->fetch_assoc();
if (isset($_POST['submit_player_settings'])) {
$data['viral_menu'] = trim($_POST['viral_menu']);
$data['viral_share'] = trim($_POST['viral_share']);
$data['viral_slomo'] = trim($_POST['viral_slomo']);
$data['viral_offset'] = intval($_POST['viral_offset']);
$data['viral_align'] = trim($_POST['viral_align']);
$data['related'] = $_POST['guide']; if($data['related']=='0') $data['related']='';
$data['related_show'] = $_POST['related_show'];
$data['embed_show'] = $_POST['embed_show'];
$data['email_show'] = $_POST['email_show'];
$data['share_show'] = $_POST['share_show'];
$data['screen_show'] = $_POST['screen_show'];
$data['replay_button'] = $_POST['replay_button'];
$data['zoom_button'] = $_POST['zoom_button'];
$data['volume_button'] = $_POST['volume_button'];
$data['size_button'] = $_POST['size_button'];
$data['fullscreen_button'] = $_POST['fullscreen_button'];
if(!is_numeric(trim($data['viral_offset'])))
$errors[] = "Invalid viral icons offset value";
if (!$errors) {
$sql = update_player($data)." where ID = 2";
$this->db->query($sql);
if($this->db->affected_rows()) {
$messages[] = 'Nuevoplayer settings updated succesfully!';
} else {
$errors[] = 'Error while saving data in database or nothing has changed.';
}
}
$player=$data;
}
$tpl = &VF::factory('template');
$tpl->menu = 'nuevo';
$tpl->submenu = 'nuevo_embed2';
$tpl->meta_title = 'Admin::Nuevo::Embed Player';
$tpl->errors = $errors;
$tpl->messages = $messages;
$tpl->pmenu = 'embed2';
$tpl->player = $player;
$tpl->load(array('header', 'nuevo_embed2', 'footer'));
$tpl->display();
}
}
function update_player($data)
{
$sql="UPDATE nuevo__player set
viral_menu='".mysql_real_escape_string($data['viral_menu'])."',
viral_share='".mysql_real_escape_string($data['viral_share'])."',
viral_slomo='".mysql_real_escape_string($data['viral_slomo'])."',
viral_offset='".mysql_real_escape_string($data['viral_offset'])."',
viral_align='".mysql_real_escape_string($data['viral_align'])."',
related='".mysql_real_escape_string($data['related'])."',
related_show='".mysql_real_escape_string($data['related_show'])."',
embed_show='".mysql_real_escape_string($data['embed_show'])."',
email_show='".mysql_real_escape_string($data['email_show'])."',
share_show='".mysql_real_escape_string($data['share_show'])."',
screen_show='".mysql_real_escape_string($data['screen_show'])."',
replay_button='".mysql_real_escape_string($data['replay_button'])."',
zoom_button='".mysql_real_escape_string($data['zoom_button'])."',
settings_button='".mysql_real_escape_string($data['settings_button'])."',
volume_button='".mysql_real_escape_string($data['volume_button'])."',
fullscreen_button='".mysql_real_escape_string($data['fullscreen_button'])."'";
return $sql;
}
?>