示例#1
0
    // player rebranding
    $logo_url = $filter->process($_POST['logo_url']);
    $logo_link = $filter->process($_POST['logo_link']);
    $logo_position = $filter->process($_POST['logo_position']);
    $logo_alpha = intval($_POST['logo_alpha']);
    if ($profile == '') {
        $errors[] = 'Please enter a name for your profile!';
    }
    if ($buffertime == '0') {
        $errors[] = 'Please enter a value greater then 0 for the player buffertime!';
    }
    if ($text_adv_delay == '0') {
        $errors[] = 'Please enter a value greater then 0 for the player text advertising delay!';
    }
    if (!$errors) {
        $autorun = $autorun == 'true' ? 'true' : 'false';
        $buttons = $buttons == '0' ? 0 : 1;
        $replay = $replay == '0' ? 0 : 1;
        $related = $related == '0' ? 0 : 1;
        $share = $share == '0' ? 0 : 1;
        $mail = $mail == '0' ? 0 : 1;
        $embed = $embed == '0' ? 0 : 1;
        $text_adv = $text_adv == '0' ? 0 : 1;
        $video_adv = $video_adv == '0' ? 0 : 1;
        $sql = "INSERT INTO player (profile, autorun, buffertime, buttons, skin, replay, share, mail, embed, related, related_content,\n                                                    text_adv, text_adv_type, text_adv_delay, video_adv, video_adv_type, video_adv_position,\n                                                    mail_color, related_color, replay_color, embed_color, copy_color, time_color, share_color,\n                                                    adv_nav_color, adv_title_color, adv_body_color, adv_link_color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogo_url, logo_link, logo_position, logo_alpha)\n                       VALUES ('" . mysql_real_escape_string($profile) . "', '" . $autorun . "', '" . $buffertime . "', '" . $buttons . "', '" . mysql_real_escape_string($skin) . "',\n                               '" . $replay . "', '" . $share . "', '" . $mail . "', '" . $embed . "', '" . $related . "', '" . mysql_real_escape_string($related_content) . "',\n                               '" . $text_adv . "', '" . mysql_real_escape_string($text_adv_type) . "', '" . $text_adv_delay . "',\n                               '" . $video_adv . "', '" . mysql_real_escape_string($video_adv_type) . "', '" . mysql_real_escape_string($video_adv_position) . "',\n                               '" . mysql_real_escape_string($mail_color) . "', '" . mysql_real_escape_string($related_color) . "',\n                               '" . mysql_real_escape_string($replay_color) . "', '" . mysql_real_escape_string($embed_color) . "',\n                               '" . mysql_real_escape_string($copy_color) . "', '" . mysql_real_escape_string($time_color) . "',\n\t\t\t      \t\t\t   '" . mysql_real_escape_string($share_color) . "',\n                               '" . mysql_real_escape_string($adv_nav_color) . "', '" . mysql_real_escape_string($adv_title_color) . "',\n                               '" . mysql_real_escape_string($adv_body_color) . "', '" . mysql_real_escape_string($adv_link_color) . "',\n\t\t\t\t\t\t\t   '" . mysql_real_escape_string($logo_url) . "', '" . mysql_real_escape_string($logo_link) . "',  \n                               '" . mysql_real_escape_string($logo_position) . "', '" . $logo_alpha . "')";
        $conn->execute($sql);
        $messages[] = 'New player profile successfully added!';
    }
}
$smarty->assign('skins', get_player_skins());
$smarty->assign('player', $player);
示例#2
0
    }
    if ($text_adv_delay == '0') {
        $errors[] = 'Please enter a value greater then 0 for the player text advertising delay!';
    }
    if (!$errors) {
        $autorun = $autorun == 'true' ? 'true' : 'false';
        $buttons = $buttons == '0' ? 0 : 1;
        $replay = $replay == '0' ? 0 : 1;
        $related = $related == '0' ? 0 : 1;
        $share = $share == '0' ? 0 : 1;
        $mail = $mail == '0' ? 0 : 1;
        $embed = $embed == '0' ? 0 : 1;
        $text_adv = $text_adv == '0' ? 0 : 1;
        $video_adv = $video_adv == '0' ? 0 : 1;
        $sql = "UPDATE player SET autorun = '" . $autorun . "', buttons = '" . $buttons . "', buffertime = '" . $buffertime . "',\n                                              replay = '" . $replay . "', share = '" . $share . "', mail = '" . $mail . "', embed = '" . $embed . "',\n                                              related = '" . $related . "', related_content = '" . mysql_real_escape_string($related_content) . "', skin = '" . mysql_real_escape_string($skin) . "',\n                                              text_adv = '" . $text_adv . "', text_adv_type = '" . mysql_real_escape_string($text_adv_type) . "', text_adv_delay = '" . $text_adv_delay . "',\n                                              video_adv = '" . $video_adv . "', video_adv_type = '" . mysql_real_escape_string($video_adv_type) . "', video_adv_position = '" . mysql_real_escape_string($video_adv_position) . "',\n                                              mail_color = '" . mysql_real_escape_string($mail_color) . "', related_color = '" . mysql_real_escape_string($related_color) . "', \n                                              replay_color = '" . mysql_real_escape_string($replay_color) . "', embed_color = '" . mysql_real_escape_string($embed_color) . "', \n                                              copy_color = '" . mysql_real_escape_string($copy_color) . "', time_color = '" . mysql_real_escape_string($time_color) . "',\n\t\t\t\t\t      share_color = '" . mysql_real_escape_string($share_color) . "', adv_nav_color = '" . mysql_real_escape_string($adv_nav_color) . "',\n\t\t\t\t\t      adv_title_color = '" . mysql_real_escape_string($adv_title_color) . "', adv_body_color = '" . mysql_real_escape_string($adv_body_color) . "',\n\t\t\t\t\t      adv_link_color = '" . mysql_real_escape_string($adv_link_color) . "',\n\t\t\t\t\t\t  logo_url = '" . mysql_real_escape_string($logo_url) . "', logo_link = '" . mysql_real_escape_string($logo_link) . "', \n                          logo_position = '" . mysql_real_escape_string($logo_position) . "', logo_alpha = '" . $logo_alpha . "' \n                   WHERE status = '1' LIMIT 1";
        $conn->execute($sql);
        $messages[] = 'Default video player profile updated!';
    }
}
$player = array();
$sql = "SELECT * FROM player WHERE id = " . $profile_id . " LIMIT 1";
$rs = $conn->execute($sql);
if ($conn->Affected_Rows() == '1') {
    $player = $rs->getrows();
    $player = $player['0'];
} else {
    $errors[] = 'Failed to load default player profile!';
}
$skins = get_player_skins();
$smarty->assign('skins', $skins);
$smarty->assign('player', $player);