Beispiel #1
0
<?php

require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/dmartinez337.ini");
$tweet = new Tweet(null, 1, "this is from PHP");
$tweet->insert($pdo);
$tweet->setTweetContent("now I changed the message");
$tweet->update($pdo);
$tweet->delete($pdo);
Beispiel #2
0
 /**
  * test deleting a Tweet that does not exist
  *
  * @expectedException PDOException
  **/
 public function testDeleteInvalidTweet()
 {
     // create a Tweet and try to delete it without actually inserting it
     $tweet = new Tweet(null, $this->profile->getProfileId(), $this->VALID_TWEETCONTENT, $this->VALID_TWEETDATE);
     $tweet->update($this->getPDO());
 }
Beispiel #3
0
$applications = DBObject::glob('Application', 'SELECT * FROM shine_applications ORDER BY name');
if (isset($_GET['refresh'])) {
    include 'tweet-cron.php';
}
if (isset($_GET['delete'])) {
    $t = new Tweet($_GET['delete']);
    $t->deleted = 1;
    $t->new = 0;
    $t->update();
}
if (isset($_GET['reply'])) {
    $t = new Tweet($_GET['reply']);
    $t->replied_to = 1;
    $t->reply_date = dater();
    $t->new = 0;
    $t->update();
    redirect("http://twitter.com/home?status=@{$t->username}%20&in_reply_to={$t->tweet_id}");
}
$sql = '';
$app_id = '';
$group = '';
if (isset($_GET['id']) && !empty($_GET['id'])) {
    $sql = 'AND app_id = ' . intval($_GET['id']);
    $app_id = intval($_GET['id']);
} else {
    $group = ' GROUP BY tweet_id ';
}
if (isset($_GET['read'])) {
    $db = Database::getDatabase();
    $db->query("UPDATE shine_tweets SET new = 0 WHERE 1 = 1 {$sql}");
    redirect("tweets.php?id={$app_id}");