本文整理汇总了PHP中Movie::ID方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::ID方法的具体用法?PHP Movie::ID怎么用?PHP Movie::ID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::ID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 {
BlockIfViolation();
global $locale;
$PHP_SELF = $_SERVER['PHP_SELF'];
$post = $_POST['blnPost'];
$id = $_GET['id'];
$movID = $_GET['movID'];
$mov = new Movie($movID);
$movToCats =& $mov->MovieToCategories();
$cats = new Categories();
$cats->LoadAll();
$cats->Sort("Description");
$movID = $mov->ID();
print "<h3><a href=movie.php?id={$movID}>" . $mov->Title() . "</a></h3>\n";
if ($post) {
$adds = array();
$deletes = array();
$proposedCats = $_POST['lstCategories'];
foreach ($proposedCats as $proposedCat) {
$found = false;
foreach ($movToCats as $movToCat) {
if ($movToCat->CategoryID() == $proposedCat) {
$found = true;
}
}
if (!$found) {
$proposedMovToCat = new MovieToCategory();
$proposedMovToCat->MovieID($movID);
$proposedMovToCat->CategoryID($proposedCat);
$adds[] = $proposedMovToCat;
}
}
foreach ($movToCats as $movToCat) {
$found = false;
foreach ($proposedCats as $proposedCat) {
if ($proposedCat == $movToCat->CategoryID()) {
$found = true;
}
}
if (!$found) {
$deletes[] = $movToCat;
}
}
foreach ($adds as $add) {
$movToCats->Add($add);
}
foreach ($deletes as $delete) {
$delete->MarkForDeletion();
}
/* TODO:NICE: This should redirect on save to previous page */
UpdateObject($movToCats);
}
?>
<form name=frm method=post action=<?php
echo $PHP_SELF . "?id={$id}&movID={$movID}";
?>
>
<table border=1>
<tr>
<td>
<select name="lstCategories[]" multiple=true>
<?php
foreach ($cats as $cat) {
$selectTag = '';
foreach ($movToCats as $movToCat) {
if ($cat->ID() == $movToCat->CategoryID()) {
$selectTag = 'SELECTED';
break;
}
}
?>
<option value=<?php
echo $cat->ID();
?>
<?php
echo $selectTag;
?>
><?php
echo $cat->Name($locale);
?>
</option>
<?php
}
?>
</select>
</td>
<td>
<input type=hidden name=blnPost value=1>
</td>
</tr>
<tr>
<td>
<input type=submit value=Submit>
</td>
</tr>
<tr>
<td>
<a href=categories.php> <?php
//.........这里部分代码省略.........
示例3: main
function main()
{
try {
BlockIfViolation();
global $locale;
global $returnURI;
$PHP_SELF = $_SERVER['PHP_SELF'];
$post = $_POST['blnPost'];
$id = $_GET['id'];
$movID = $_GET['movID'];
$relationship = $_GET['relationship'];
$m2p = new MovieToPerson($id);
if (!$m2p->IsNew()) {
$mov =& $m2p->Movie();
$person =& $m2p->Person();
} else {
$m2p->Relationship($relationship);
$person = new Person();
if ($movID == "") {
throw new Exception("Missing movID");
}
$mov = new Movie($movID);
}
$movID = $mov->ID();
$persons = new Persons();
$persons->LoadAll();
$persons->Sort("FirstName");
print "<h3><a href=movie.php?id={$movID}>" . $mov->Title() . "</a></h3>\n";
$characterName = $m2p->CharacterName();
$relationship = $m2p->Relationship();
if ($post) {
if ($_POST['btnDelete'] != '') {
$m2p->MarkForDeletion();
$characterName = $relationship = '';
} else {
$person = new Person($_POST['cboPersons']);
$m2p->Person($person);
$m2p->PersonID($person->ID());
$m2p->Movie($mov);
$m2p->CharacterName($_POST['txtCharacterName']);
$m2p->Relationship($_POST['txtRelationship']);
$characterName = $m2p->CharacterName();
$relationship = $m2p->Relationship();
}
if (UpdateObject($m2p)) {
ReturnURI();
}
}
$firstName = $person->FirstName();
$lastName = $person->LastName();
?>
<form name=frm method=post action=<?php
echo $PHP_SELF . "?id={$id}&movID={$movID}&returnURI={$returnURI}";
?>
>
<table border=1>
<tr>
<td>
<?php
print "<select name=cboPersons>\n";
foreach ($persons as $person) {
$name = $person->Name();
$id = $person->ID();
if ($id == $m2p->PersonID()) {
$selectTag = 'SELECTED';
} else {
$selectTag = '';
}
?>
<option value=<?php
echo $id;
?>
<?php
echo $selectTag;
?>
><?php
echo $name;
?>
</option>
<?php
}
print "</select>\n";
?>
</td>
</tr>
<?php
if ($relationship == 's') {
?>
<tr>
<td><?php
echo GetCap('capCharacterName');
?>
</td>
<td><input type=text name=txtCharacterName value='<?php
echo $characterName;
?>
'></td>
</tr>
<?php
}
//.........这里部分代码省略.........
示例4: 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();
//.........这里部分代码省略.........