コード例 #1
0
             # If a comment was supplied, use it (replace _ with spaces ) else use a default
             if (isset($options['comment']) || trim($options['comment'] != '')) {
                 $comment = str_replace('_', ' ', $options['comment']);
             } else {
                 $comment = 'Importing text file';
             }
             echo "Using edit summary '{$comment}'.\n";
             # Do we need to update recent changes?
             if (isset($options['norc']) && $options['norc']) {
                 $rc = false;
             } else {
                 $rc = true;
             }
             # Attempt the insertion
             echo "Attempting to insert page...";
             $success = insertNewArticle($title, $text, $user, $comment, $rc);
             if ($success) {
                 echo "done.\n";
             } else {
                 echo "failed. Title exists.\n";
             }
         } else {
             # Dud user
             echo "invalid username.\n";
         }
     } else {
         # Dud title
         echo "invalid title.\n";
     }
 } else {
     # File not found
コード例 #2
0
ファイル: modnews.php プロジェクト: nwoki/2s2h-website
            <?php 
if (isset($_POST['chosenArticle'])) {
    /* show input fields to mod article */
    showModArticle($_POST['chosenArticle']);
} elseif (isset($_POST['articleToModId'])) {
    /* submit article mod */
    submitModArticle($_POST['modArticleTitle'], $_SESSION['username'], $_POST['modArticleText'], $_POST['articleToModId']);
} elseif (isset($_POST['articleToDeleteId'])) {
    /* id of admin to delete */
    deleteArticle($_POST['articleToDeleteId']);
} elseif (isset($_POST['addNewArticle'])) {
    /* show addNewAdmin form */
    addNewArticleForm();
} elseif (isset($_POST['submitNewArticle'])) {
    /* insert new article to database */
    insertNewArticle($_POST['newTitle'], $_SESSION['username'], $_POST['newArticle']);
} else {
    /* show news selection form */
    showNewsList();
}
?>
        </div>

        <div class="separate sfondo-footer"><?php 
bottomPageInfo();
?>
</div>

</body>
</html>