diff --git a/edit-comic.php b/edit-comic.php index 24a1b2c..656964f 100644 --- a/edit-comic.php +++ b/edit-comic.php @@ -87,7 +87,7 @@ if( $_POST ) { $imagedata = getimagesize($_FILES['comicFile']['tmp_name']); $strip->media = $imagedata[2]; } - $fileext = $dbConnection->fetchColumn('SELECT extension FROM media_t WHERE id = ?', array($strip->media), array(PDO::PARAM_INT)); + $fileext = $dbConnection->fetchColumn('SELECT extension FROM media_t WHERE id = ?', array($strip->media), 0, array(PDO::PARAM_INT)); if(strlen($fileext) < 3) { diff --git a/include/twitter.php b/include/twitter.php index 8774d6c..4bab4fa 100644 --- a/include/twitter.php +++ b/include/twitter.php @@ -2,6 +2,8 @@ function twitterpost($message, $user=TWITTER_USER, $password=TWITTER_PASS) { + if (!TWITTER_ENABLED) return; + global $dbConnection, $info, $error; if( $user == '' ) { # preserve existing twitterpost(message) style posting until OAuth has been vetted. diff --git a/manage-types.php b/manage-types.php index 790544b..d93a7e9 100644 --- a/manage-types.php +++ b/manage-types.php @@ -6,12 +6,12 @@ auth_redirect(); // Require logged in user to access this page. if( isset($_GET['delete']) && (int)$_GET['delete'] ) { check_nonce('delete-type-' . (int)$_GET['delete']); - if(! $dbConnection->executeUpdate('DELETE FROM strip_t WHERE id = ?', array($_GET['delete']))) + if(false === $dbConnection->executeUpdate('DELETE FROM strip_t WHERE id = ?', array($_GET['delete']))) { adminlog("Error deleting type ".(int)$_GET['delete'], MTS_TYPE, MTA_DELETE, E_WARNING); mtdie("Error on deletion of existing type: " . $dbConnection->errorCode(), 'SQL Error'); } - if(! $dbConnection->executeUpdate('DELETE FROM meta WHERE type = ?', array($_GET['delete']))) + if(false === $dbConnection->executeUpdate('DELETE FROM meta WHERE type = ?', array($_GET['delete']))) { adminlog("Error on deletion of type ".(int)$_GET['delete']."'s metadata.", MTS_TYPE, MTA_DELETE, E_WARNING); mtdie("Error on deletion of existing type's metadata: " . $dbConnection->errorCode(), 'SQL Error'); @@ -101,7 +101,7 @@ if( isset($_POST['action']) && $_POST['action'] == 'edit_type' ) { } //display all types -$types = $dbConnection->fetchAll('SELECT strip_t.id AS id, strip_t.name AS name, strip_t.description AS description, COUNT(strip.id) AS strips FROM strip_t JOIN strip ON strip.type = strip_t.id GROUP BY strip_t.id'); +$types = $dbConnection->fetchAll('SELECT strip_t.id AS id, strip_t.name AS name, strip_t.description AS description, COUNT(strip.id) AS strips FROM strip_t LEFT JOIN strip ON strip.type = strip_t.id GROUP BY strip_t.id'); adminhead('Types'); adminmenu();