本文整理汇总了PHP中Playlist::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP Playlist::getById方法的具体用法?PHP Playlist::getById怎么用?PHP Playlist::getById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist::getById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
<?php
session_start();
ob_start();
include "./common.php";
$error = '';
$action_name = 'add';
$action_value = _('Add');
Admin::checkAuth();
Admin::checkAccess(AdminAccess::ACCESS_VIEW);
foreach (@$_POST as $key => $value) {
$_POST[$key] = trim($value);
}
$id = @intval($_GET['id']);
$playlist = new Playlist();
$item = $playlist->getById($_GET['playlist_id']);
if (empty($item)) {
echo 'wtf?';
exit;
}
$time = 0;
if (!empty($_POST)) {
$time = intval($_POST['hh']) * 60 + intval($_POST['mm']);
}
if (@$_POST['add']) {
Admin::checkAccess(AdminAccess::ACCESS_CREATE);
$playlist->addRecord(array('time' => $time, 'video_id' => $_POST['video_id'], 'playlist_id' => $_GET['playlist_id']));
header("Location: playlist.php?playlist_id=" . @$_GET['playlist_id']);
exit;
}
if (!empty($id)) {
示例2: header
$id = @intval($_GET['id']);
if (!empty($id)) {
if (@$_POST['edit']) {
Admin::checkAccess(AdminAccess::ACCESS_EDIT);
$playlist->set(array('name' => $_POST['name'], 'group_id' => $_POST['group_id']), $_GET['id']);
header("Location: playlists.php");
} elseif (@$_GET['del']) {
Admin::checkAccess(AdminAccess::ACCESS_DELETE);
$playlist->del($id);
header("Location: playlists.php");
}
}
if (@$_GET['edit'] && !empty($id)) {
$action_name = 'edit';
$action_value = _('Save');
$edit_playlist = $playlist->getById($id);
}
$playlists = $playlist->getAll();
$debug = '<!--' . ob_get_contents() . '-->';
ob_clean();
echo $debug;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}