本文整理汇总了PHP中Movie::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::IsEmpty方法的具体用法?PHP Movie::IsEmpty怎么用?PHP Movie::IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
try {
global $editable;
global $user;
global $thisURIEncoded;
global $session;
global $bbsRow;
$PHP_SELF = $_SERVER['PHP_SELF'];
$post = $_POST['blnPost'];
$id = $_GET['id'];
$topic = new Post($id);
if (!$topic->IsNew()) {
$session->Viewed("Post", $id);
}
$enablePost = $_GET['enablePost'] == '1' ? true : false;
$disablePost = $_GET['disablePost'] == '1' ? true : false;
if ($enablePost || $disablePost) {
if (!NoteViolation("toggle {$enablePost}:{$disablePost} ({$id})")) {
$postID = $_GET['postID'];
$posts = $topic->Posts();
foreach ($posts as $post0) {
if ($post0->ID() == $postID) {
$post0->Disabled($disablePost);
UpdateObject($post0);
if ($disabled) {
$session->Disabled('Post', $postID);
} else {
$session->Enabled('Post', $postID);
}
break;
}
}
}
}
if ($id == "") {
$movID = $_GET['movID'];
$mov = new Movie($movID);
$topic->MovieID($movID);
} else {
$mov =& $topic->Movie();
$movID = $mov->ID();
}
if ($mov->IsEmpty()) {
BlockIfViolation("non-exisisting movie (id={$movID})");
}
if (!$mov->Visible()) {
BlockIfViolation("invisable view (id={$movID})");
}
?>
<a href="movie.php?id=<?php
echo $mov->ID();
?>
"> <img src="<?php
echo $mov->MainPicture();
?>
" alt=""/></a>
<b><font size="6"><a href="movie.php?id=<?php
echo $movID;
?>
"><?php
echo $mov->Title();
?>
</a></font></b>
<?php
if ($post) {
ThrowExceptionOnMaliciousInput($_POST['txtText'], 'BBS_TEXT');
ThrowExceptionOnMaliciousInput($_POST['txtSubject'], 'BBS_SUB');
$username = $user->Username();
if ($topic->IsNew()) {
$topic->Text($_POST['txtText']);
$topic->Subject($_POST['txtSubject']);
$topic->Username($username);
$topic->ParentID(0);
// Currently non-threaded, may change...
$topic->MovieID($movID);
$upd =& $topic;
} else {
$objPost = new Post();
$objPost->Text($_POST['txtText']);
$objPost->Username($username);
$objPost->ParentID($topic->ID());
// Currently non-threaded, may change...
$objPost->MovieID($movID);
$upd =& $objPost;
}
UpdateObject($upd);
$id = $topic->ID();
}
if (!$topic->IsNew()) {
$posts =& $topic->Posts();
}
$subject = $topic->Subject();
$username = $topic->Username();
$text = $topic->Text();
?>
<table>
<?php
if (!$topic->IsNew()) {
?>
//.........这里部分代码省略.........
示例2: main
function main()
{
try {
global $pageTitle;
global $locale;
global $editable;
global $session;
global $user;
global $gs;
global $thisURI;
global $thisURIEncoded;
global $topicRowAlt1;
global $topicRowAlt2;
global $messaageBoardHeaderRow;
$enableThread = $_GET['enableThread'] == '1' ? true : false;
$disableThread = $_GET['disableThread'] == '1' ? true : false;
$nowPlaying = $_POST['chkNowPlaying'] == '1' ? true : false;
$visible = $_POST['chkVisible'] == '1' ? true : false;
$id = $_GET['id'];
if ($id == "") {
$id = $_POST['id'];
}
$mov = new Movie($id);
if ($mov->IsEmpty()) {
BlockIfViolation("non-exisisting movie (id={$id})");
}
if (!$mov->Visible()) {
BlockIfViolation("invisable view (id={$id})");
}
/*TODO:PERF: This is very redundant. Keep in memory when resource
becomes available */
$link = new Link();
$link->LoadLinkID('US_GOOGLE_PLAYTIMES');
if ($enableThread) {
if (!NoteViolation('enableThread')) {
$postID = $_GET['postID'];
$post = new Post($postID);
$post->EnableRecursivly();
UpdateObject($post);
$session->Enabled("Post", $postID);
}
}
if ($disableThread) {
if (!NoteViolation('disableThread')) {
$postID = $_GET['postID'];
$post = new Post($postID);
$post->DisableRecursivly();
UpdateObject($post);
$session->Disabled("Post", $postID);
}
}
if ($_POST['btnLocation'] != '') {
$location = $_POST['txtLocation'];
if (isset($user)) {
$user->PlayTimesLocation($location);
UpdateObject($user, false);
} else {
$session->PlayTimesLocation($location);
UpdateObject($session, false);
}
$session->ChangedPlayTimesLocation('Movie', $mov->ID(), $location);
UpdateObject($session, false);
$playTimesURL = $link->URLPlugged($location, $mov->GoogleID());
header("Location: {$playTimesURL}");
exit;
}
$classID = $gs->ClassName2ID('Movie');
if (!$editable && $id == "") {
throw new Exception(GetCap("capNoMovieID ParameterInURL"));
}
$PHP_SELF = $_SERVER['PHP_SELF'];
if ($_POST['blnPost']) {
if ($_POST['btnSnarf'] != '') {
BlockIfViolation('snarf');
$url = $_POST['txtURL'];
$mov->SnarfMainPicture($url);
$session->Snarfed("Movie", $mov->ID(), $url);
} else {
BlockIfViolation('update');
$mov->Title($_POST['txtTitle']);
$mov->ReleaseDate($_POST['txtReleaseDate']);
$mov->Plot($locale, $_POST['txtPlot']);
$mov->PlotOutline($locale, $_POST['txtPlotOutline']);
$mov->GoogleID($_POST['txtGoogleID']);
$mov->NowPlaying($nowPlaying);
$mov->Visible($visible);
UpdateObject($mov);
}
} else {
if ($id != "") {
$session->Viewed('Movie', $id);
}
}
$title = $mov->Title();
$pageTitle = $title;
$gid = $mov->GoogleID();
$releaseDate = $mov->ReleaseDate();
$plot = $mov->Plot($locale);
$plotOutline = $mov->PlotOutline($locale);
$stars =& $mov->MovieToPerson_Stars();
//.........这里部分代码省略.........