當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Playlist::getById方法代碼示例

本文整理匯總了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)) {
開發者ID:Eugen1985,項目名稱:stalker_portal,代碼行數:31,代碼來源:playlist.php

示例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;
}
開發者ID:Eugen1985,項目名稱:stalker_portal,代碼行數:31,代碼來源:playlists.php


注:本文中的Playlist::getById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。