Beispiel #1
0
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()) {
            ?>
                <tr>
                    <td>
                        <h3><?php 
            echo GetCap('capTopic') . ": {$subject}";
            ?>
</h3>
                    </td>
                </tr>
            <?php 
        }
        if (isset($posts)) {
            foreach ($posts as $post) {
                $text = $post->Text();
                $text = wordwrap(strip_tags($text), 75);
                $text = str_replace("\n", '<br />', $text);
                $date = $post->DatePosted();
                $postID = $post->ID();
                $username = $post->Username();
                $pad = str_repeat('&nbsp;', 20 - strlen($username));
                $disabled = $post->Disabled();
                if ($disabled) {
                    if ($user == null || $username != $user->Username() && !$user->IsMaintainer()) {
                        continue;
                    }
                }
                ?>
                    <tr <?php 
                echo $bbsRow;
                ?>
>
                        <td>
                            <?php 
                echo "<b><a href=\"user.php?username={$username}\">{$username}</a></b>" . '<br />' . $date . "";
                ?>
                            &nbsp;<?php 
                echo "<a href=\"bbsReport.php?postID={$postID}&amp;type=" . REPORT_TYPE_SPAM . "\">[" . GetCap('capReport') . "]</a>";
                ?>
                        </td>
                    </tr>
                    <?php 
                if ($editable) {
                    ?>
                        <tr align="right">
                        <?php 
                    if ($post->Disabled()) {
                        echo "<td><a href=\"bbs.php?id={$id}&amp;postID={$postID}&amp;enablePost=1\">" . GetCap('capEnable') . "</a></td>";
                    } else {
                        echo "<td><a href=\"bbs.php?id={$id}&amp;postID={$postID}&amp;disablePost=1\">" . GetCap('capDisable') . "</a></td>";
                    }
                    ?>
                        </td>
                        <?php 
                }
                ?>
                    <tr>
                        <td>
                            <?php 
                if ($disabled) {
                    if ($user->IsMaintainer()) {
                        echo "&nbsp;&nbsp;&nbsp;&nbsp;";
                        echo "<b>" . strtoupper(GetCap('capDisabled')) . "</b><br />";
                    } else {
                        echo "<b>" . GetCap('capThisPostWasDisabledBecauseItViolatedOurPolicy') . "</b>";
                        echo "<br>&nbsp;&nbsp;&nbsp;&nbsp";
                        echo "<b>" . GetCap('capOnlyYouCanSeeThisPost') . "</b>";
                        echo "<br>&nbsp;&nbsp;&nbsp;&nbsp";
                    }
                }
                echo "<p>{$text}</p>";
                ?>
                        </td>
                    </tr>
                    <?php 
            }
        }
        ?>
        </table>
        <?php 
        if ($user != null) {
            ?>
            <form name="frm" method="post" action="<?php 
            echo $PHP_SELF . "?id={$id}&amp;movID={$movID}";
            ?>
">
                <table>
                    <?php 
            if ($topic->IsNew()) {
                ?>
                        <tr>
                            <td>
                                <?php 
                echo "<b>" . GetCap('capSubject') . "</b>";
                ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input type="text" name="txtSubject" value="<?php 
                echo $subject;
                ?>
"/>
                            </td>
                        </tr>
                    <?php 
            }
            ?>
                    <tr <?php 
            echo $postMessageRow;
            ?>
>
                        <td>
                            <?php 
            echo "<b>" . GetCap('capPostMessage') . "</b>";
            ?>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <textarea rows="10" cols="57" name="txtText"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="submit" name="btnPost" value="<?php 
            echo GetCap('capPost');
            ?>
"/>
                        </td>
                        <td>
                            <input type="hidden" name="blnPost" value="1"/>
                        </td>
                    </tr>
                </table>
            </form>
        <?php 
        } else {
            ?>
            <table>
                <tr>
                    <td>
                        <?php 
            echo GetCap('capYouMustBeLoggedInToPostA Message');
            ?>
                    </td>
                </tr>
            </table>
        <?php 
        }
    } catch (Exception $ex) {
        ProcessException($ex);
    }
}
Beispiel #2
0
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 
        echo GetCap("capEditCategoryList");
        ?>
 </a>
                     </td>
                </tr>
            </table>
         </form>
        <?php 
    } catch (Exception $ex) {
        ProcessException($ex);
    }
}
Beispiel #3
0
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 
        }
        ?>
                <tr>
                    <td><?php 
        echo GetCap('capRelationship');
        ?>
</td>
                    <td><input type=text name=txtRelationship value=<?php 
        echo $relationship;
        ?>
></td>
                </tr>
                <tr>
                    <td> <input type=submit name=btnSubmit value=<?php 
        echo GetCap('capSubmit');
        ?>
> </td>
                    <td> <a href=<?php 
        echo "{$PHP_SELF}?movID={$movID}";
        ?>
><?php 
        echo GetCap('capNew');
        ?>
</a>
                </tr>
                <input type=hidden name=blnPost value=1>
            </table>
         </form>
        <?php 
    } catch (Exception $ex) {
        ProcessException($ex);
    }
    require_once 'tailer.php';
}
Beispiel #4
0
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();
        $writers =& $mov->MovieToPerson_Writers();
        $directors =& $mov->MovieToPerson_Directors();
        $otherSiteLinks =& $mov->OtherSiteLinks();
        $reviewLinks =& $mov->ReviewLinks();
        $trailerLinks =& $mov->TrailerLinks();
        $topics =& $mov->Topics();
        $nowPlaying = $mov->NowPlaying();
        $visible = $mov->Visible();
        $id = $mov->ID();
        if (isset($user)) {
            $location = $user->PlayTimesLocation();
        } else {
            $location = $session->PlayTimesLocation();
        }
        $playTimesURL = htmlentities($link->URLPlugged($location, $mov->GoogleID()));
        print "<br/>";
        if ($editable) {
            ?>
            <?php 
            if (!$mov->IsNew()) {
                ?>
                <form name="frmSnarf" method="post" action="<?php 
                echo $thisURI;
                ?>
">
                    <b><?php 
                echo GetCap('capURL');
                ?>
: </b>
                    <input type="text" size="52" name="txtURL" value="<?php 
                echo $url;
                ?>
"/>
                    <input type="submit" name="btnSnarf" value="<?php 
                echo GetCap('capSnarfPictureURL');
                ?>
"/>
                    <input type="hidden" name="blnPost" value="1"/>
                </form>
            <?php 
            }
            ?>
            <form name="frm" method="post" action="<?php 
            echo $PHP_SELF . "?id={$id}";
            ?>
">
                <table>
                    <tr>
                        <td>
                            <b><?php 
            echo GetCap('capTitle');
            ?>
: </b>
                            <input type="text" name="txtTitle" value="<?php 
            echo $title;
            ?>
"/>
                            &nbsp;&nbsp;
                            <b><?php 
            echo GetCap('capDate');
            ?>
: </b>
                            <input type="text" name="txtReleaseDate" value="<?php 
            echo $releaseDate;
            ?>
"/>
                            &nbsp;&nbsp;
                            <b><?php 
            echo GetCap('capNowPlaying');
            ?>
: </b>
                            <input type="checkbox" name="chkNowPlaying" value="1" <?php 
            echo $nowPlaying ? 'checked="checked"' : '';
            ?>
/>
                            &nbsp;&nbsp;
                            <b><?php 
            echo GetCap('capVisible');
            ?>
: </b>
                            <input type="checkbox" name="chkVisible" value="1" <?php 
            echo $visible ? 'checked="checked"' : '';
            ?>
/>
                        </td>
                    </tr>
                </table>

        <?php 
        }
        ?>
            <table bgcolor=#dddddd frame="border" width=800>
                <?php 
        if (!$editable) {
            ?>
                    <tr>
                        <td colspan="2">
                            <font size="12"><?php 
            echo $title;
            ?>
</font>
                        </td>
                    </tr>
                <tr> 
                <?php 
        }
        ?>
                    <td valign="top">
                        <?php 
        if (file_exists($mov->MainPicture())) {
            ?>
                            <img src="<?php 
            echo $mov->MainPicture();
            ?>
" alt=""/>
                        <?php 
        }
        ?>
                    </td>
                    <td valign="top">
                        <table>
                            <?php 
        /* If the below form were printed while $editable==true
           if would be nested in another form and cause lagic problems */
        if (!$editable) {
            ?>
                                <tr>
                                    <td>
                                        <b><?php 
            echo GetCap('capPlayTimes');
            ?>
</b>:
                                    </td>
                                    <?php 
            if ($location == "" || $_GET['changePlayTimesLocation'] == 1) {
                ?>
                                        <td valign="top">
                                            <b><?php 
                echo GetCap('capEnterCityStateOrZip');
                ?>
<br/></b>
                                                <form name="frmLocation0" method="post" action="<?php 
                echo $PHP_SELF;
                ?>
?id=<?php 
                echo $id;
                ?>
">
                                                    <input type="text" name="txtLocation" value="<?php 
                echo $location;
                ?>
" />
                                                    <input type="submit" name="btnLocation" value="<?php 
                echo GetCap('capShowPlayTimes');
                ?>
"/>
                                                </form>
                                        </td>
                                    <?php 
            } else {
                print "<td><a href=\"{$playTimesURL}\">" . GetCap('capShowPlayTimes') . " ({$location})</a>&nbsp;&nbsp;";
                print "<a href=\"{$PHP_SELF}?id={$id}&amp;changePlayTimesLocation=1\">[" . GetCap('capChangeLocation') . "]</a></td>";
            }
            ?>
                                </tr>
                            <?php 
        }
        ?>
                            <tr>
                                <td>
                                    <b><?php 
        echo GetCap('capCategories');
        ?>
</b>:
                                </td>
                                <td>
                                    <?php 
        $m2cs =& $mov->MovieToCategories();
        foreach ($m2cs as $m2c) {
            $cat =& $m2c->Category();
            $catID = $cat->ID();
            $name = $cat->Name($locale);
            print "<a href=\"movies.php?catID={$catID}\">{$name}</a> ";
        }
        if ($editable && !$mov->IsNew()) {
            ?>
                                        <sup><a href="<?php 
            echo 'movieToCategories.php?movID=' . $mov->ID();
            ?>
"><?php 
            echo '[' . GetCap('capE') . ']';
            ?>
</a></sup>
                                    <?php 
        }
        ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <?php 
        if ($stars->Count() > 1) {
            print "<b>" . GetCap('capStars') . ": </b>";
        } else {
            print "<b>" . GetCap('capStar') . ": </b>";
        }
        ?>
                                </td>
                                <td>
                                    <?php 
        foreach ($stars as $m2p) {
            $m2pID = $m2p->ID();
            $per =& $m2p->Person();
            $perID = $per->ID();
            $name = $per->Name();
            print "<a href=\"person.php?id={$perID}&amp;movID={$id}\">{$name}</a> ";
            if ($editable) {
                print "<sup><a href=\"movieToPerson.php?id={$m2pID}&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capE') . "]</a></sup>";
                $deleteURI = GetDeleteURI($m2pID, 'MovieToPerson', 'MoviesToPerson');
                print "<sup><a href=\"{$deleteURI}\">[" . GetCap('capD') . "]</a></sup>";
            }
        }
        if ($editable && !$mov->IsNew()) {
            if (!$mov->IsNew()) {
                print "&nbsp;<a href=\"movieToPerson.php?movID={$id}&amp;relationship=s&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capAdd') . "]</a>";
            }
        }
        ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <?php 
        if ($directors->Count() > 1) {
            print "<b>" . GetCap('capDirectors') . ": </b>";
        } else {
            print "<b>" . GetCap('capDirector') . ": </b>";
        }
        ?>
                                </td>
                                <td>
                                    <?php 
        foreach ($directors as $m2p) {
            $m2pID = $m2p->ID();
            $per =& $m2p->Person();
            $perID = $per->ID();
            $name = $per->Name();
            print "<a href=\"person.php?id={$perID}&amp;movID={$id}\">{$name}</a> ";
            if ($editable) {
                print "<sup><a href=\"movieToPerson.php?id={$m2pID}&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capE') . "]</a></sup>";
                $deleteURI = GetDeleteURI($m2pID, 'MovieToPerson', 'MoviesToPerson');
                print "<sup><a href=\"{$deleteURI}\">[" . GetCap('capD') . "]</a></sup>";
            }
        }
        if ($editable && !$mov->IsNew()) {
            print "&nbsp;<a href=\"movieToPerson.php?movID={$id}&amp;relationship=d&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capAdd') . "]</a>";
        }
        ?>
                                </td>
                           </tr>
                           <tr>
                                <td>
                                <?php 
        if ($writers->Count() > 1) {
            print "<b>" . GetCap('capWriters') . ": </b>";
        } else {
            print "<b>" . GetCap('capWriter') . ": </b>";
        }
        ?>
                                </td>
                                <td>
                                    <?php 
        foreach ($writers as $m2p) {
            $m2pID = $m2p->ID();
            $per =& $m2p->Person();
            $perID = $per->ID();
            $name = $per->Name();
            print "<a href=\"person.php?id={$perID}&amp;movID={$id}\">{$name}</a> ";
            if ($editable) {
                print "<sup><a href=\"movieToPerson.php?id={$m2pID}&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capE') . "]</a></sup>";
                $deleteURI = GetDeleteURI($m2pID, 'MovieToPerson', 'MoviesToPerson');
                print "<sup><a href=\"{$deleteURI}\">[" . GetCap('capD') . "]</a></sup>";
            }
        }
        if ($editable && !$mov->IsNew()) {
            print "&nbsp;<a href=\"movieToPerson.php?movID={$id}&amp;relationship=w&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capAdd') . "]</a>";
        }
        ?>
                                </td>
                            </tr>
                            <tr>
                                <td valign="top">
                                    <?php 
        $capPlot = GetCap('capPlot');
        print "<b>{$capPlot}: </b>";
        ?>
                                </td>
                                <td>
                                    <?php 
        $plotWrapped = wordwrap($plotOutline, 75, '<br />');
        if ($editable) {
            print "<textarea rows=\"5\" cols=\"75\" name=\"txtPlotOutline\">{$plotOutline}</textarea>";
        } else {
            echo $plotWrapped;
        }
        ?>
                                </td>
                            </tr>
                            <?php 
        if ($editable) {
            ?>
                            <tr>
                                <td valign="top">
                                    <b><?php 
            echo GetCap('capPreview');
            ?>
:</b><br />
                                    <?php 
            echo '<b>(' . strlen($plotOutline) . ')</b>';
            ?>
                                </td>
                                <td>
                                    <?php 
            echo $plotWrapped;
            ?>
                                </td>
                            </tr>
                            <?php 
        }
        ?>
                            <tr>
                                <td>
                                    <b><?php 
        echo GetCap('capTrailers');
        ?>
: </b>
                                </td>
                                <td>
                                    <?php 
        foreach ($trailerLinks as $link) {
            ?>
                                            <a href="<?php 
            echo $link->URL();
            ?>
"><?php 
            echo GetCap($link->Source());
            ?>
</a>
                                            <?php 
            if ($editable) {
                $deleteURI = GetDeleteURI($link->ID(), 'Link');
                ?>
                                                <sup><a href="<?php 
                echo "link.php?id=" . $link->ID() . "&amp;instanceID={$id}&amp;classID={$classID}&amp;returnURI={$thisURIEncoded}";
                ?>
"> <?php 
                echo '[' . GetCap('capE') . ']';
                ?>
 </a></sup>
                                                <sup><a href="<?php 
                echo $deleteURI;
                ?>
"><?php 
                echo '[' . GetCap('capD') . ']';
                ?>
</a></sup>
                                            <?php 
            }
            ?>
                                        <?php 
        }
        if ($editable && !$mov->IsNew()) {
            print "&nbsp;<a href=\"link.php?type=t&amp;instanceID={$id}&amp;classID={$classID}&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capAdd') . "]</a>";
        }
        ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b><?php 
        echo GetCap('capReviews');
        ?>
: </b>
                                </td>
                                <td>
                                    <?php 
        foreach ($reviewLinks as $link) {
            ?>
                                            <a href="<?php 
            echo $link->URL();
            ?>
"><?php 
            echo GetCap($link->Source()) . ' (' . $link->Author() . ')';
            ?>
</a>
                                            <?php 
            if ($editable) {
                $deleteURI = GetDeleteURI($link->ID(), 'Link');
                ?>
                                                <sup><a href="<?php 
                echo "link.php?id=" . $link->ID() . "&amp;instanceID={$id}&amp;classID={$classID}&amp;returnURI={$thisURIEncoded}";
                ?>
"> <?php 
                echo '[' . GetCap('capE') . ']';
                ?>
 </a></sup>
                                                <sup><a href="<?php 
                echo $deleteURI;
                ?>
"><?php 
                echo '[' . GetCap('capD') . ']';
                ?>
</a></sup>
                                            <?php 
            }
            ?>
                                        <?php 
        }
        if ($editable && !$mov->IsNew()) {
            print "&nbsp;<a href=\"link.php?type=r&amp;instanceID={$id}&amp;classID={$classID}&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capAdd') . "]</a>";
        }
        ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b><?php 
        echo GetCap('capOtherSites');
        ?>
: </b>
                                </td>
                                <td>
                                    <?php 
        foreach ($otherSiteLinks as $link) {
            ?>
                                            <a href="<?php 
            echo $link->URL();
            ?>
"><?php 
            echo GetCap($link->Source());
            ?>
</a>
                                            <?php 
            if ($editable) {
                $deleteURI = GetDeleteURI($link->ID(), 'Link');
                ?>
                                                <sup><a href="<?php 
                echo "link.php?id=" . $link->ID() . "&amp;instanceID={$id}&amp;classID={$classID}&amp;returnURI={$thisURIEncoded}";
                ?>
"> <?php 
                echo '[' . GetCap('capE') . ']';
                ?>
 </a></sup>
                                                <sup><a href="<?php 
                echo $deleteURI;
                ?>
"><?php 
                echo '[' . GetCap('capD') . ']';
                ?>
</a></sup>
                                            <?php 
            }
            ?>
                                        <?php 
        }
        if ($editable && !$mov->IsNew()) {
            print "&nbsp;<a href=\"link.php?type=o&amp;instanceID={$id}&amp;classID={$classID}&amp;returnURI={$thisURIEncoded}\">[" . GetCap('capAdd') . "]</a>";
        }
        ?>
                                    <input type="hidden" name="blnPost" value="1" />
                                </td>
                            </tr>
                            <?php 
        if ($editable) {
            ?>
                                <tr>
                                    <?php 
            echo '<td><b>' . GetCap('capGoogleID') . ":</b></td><td><input type=\"text\" name=\"txtGoogleID\" value=\"{$gid}\"/></td>";
            ?>
                                </tr>
                            <?php 
        }
        ?>
                        </table>
                    </td>
                </tr>
                <?php 
        if ($editable) {
            ?>
                    <tr>
                        <td>&nbsp;</td>
                        <td> <input type="submit" name="btnSubmit" value="<?php 
            echo GetCap('capSubmit');
            ?>
"/> </td>
                    </tr>
                <?php 
        }
        ?>
            </table>
         <?php 
        if ($editable) {
            echo "</form>";
        }
        ?>

         <br />
         <form name="frmBB" method="post" action="<?php 
        echo $PHP_SELF;
        ?>
">
            <table>
                <tr>
                    <td>
                        <?php 
        echo '<b>' . GetCap('capMessageBoard') . '</b>';
        ?>
 &nbsp; &nbsp;
                        [<?php 
        echo "<a href=\"bbs.php?movID={$id}\">" . GetCap('capNewTopic') . "</a>";
        ?>
]
                    </td>
                </tr>
            </table>
            <table border="1">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <b><?php 
        echo GetCap('capTopics') . str_repeat('&nbsp;', 60);
        ?>
</b>
                                </td>
                                <td>
                                    <b><?php 
        echo GetCap('capUsers');
        ?>
</b>
                                </td>
                            <?php 
        if ($user != null && $user->IsMaintainer()) {
            ?>
                                        <td>
                                            <b><?php 
            echo GetCap('capBowdlerisation');
            ?>
</b>
                                        </td>
                                    <?php 
        }
        ?>
                            </tr>
                        <?php 
        $alt = false;
        foreach ($topics as $topic) {
            $alt = !$alt;
            if ($alt) {
                $rowAttr = $topicRowAlt1;
            } else {
                $rowAttr = $topicRowAlt2;
            }
            $topID = $topic->ID();
            $sub = $topic->Subject();
            $username = $topic->Username();
            $viewCount = $topic->ViewCount();
            if (!$topic->RecursiveDisabled() || $user != null && $user->IsMaintainer()) {
                ?>
                                    <tr <?php 
                echo $rowAttr;
                ?>
>
                                        <td>
                                            <?php 
                echo "<a href=\"bbs.php?id={$topID}\">{$sub}</a>";
                ?>
                                        </td>
                                        <td>
                                            <?php 
                echo "<a href=\"user.php?username={$username}\">{$username}</a>";
                ?>
                                        </td>
                                        <?php 
                if ($editable) {
                    if ($topic->RecursiveDisabled()) {
                        echo "<td><a href=\"movie.php?id={$id}&amp;postID={$topID}&amp;enableThread=1\">" . GetCap('capEnable') . "</a></td>";
                    } else {
                        echo "<td><a href=\"movie.php?id={$id}&amp;postID={$topID}&amp;disableThread=1\">" . GetCap('capDisable') . "</a></td>";
                    }
                }
                ?>
                                    </tr>
                                <?php 
            }
        }
        ?>
                        </table>
                    </td>
                </tr>
            </table>
        </form>
        <?php 
    } catch (Exception $ex) {
        ProcessException($ex);
    }
}