Beispiel #1
0
                    <form class="write-form" action="add.php" method="post">
                        <input type="text" placeholder="Author" name="author">
                        <div>
                            <input type="text" placeholder="Content" name="content">
                        </div>
                        <input type="submit" value="write">
                    </form>
                </div>
                <div class="tweet">
                    <?php 
$temp;
$timeline = new Timeline();
if (isset($_GET["type"]) && isset($_GET["query"]) && $_GET["type"] != "" && $_GET["query"] != "") {
    $temp = $timeline->searchTweets($_GET["type"], $_GET["query"]);
} else {
    $temp = $timeline->loadTweets();
}
foreach ($temp as $row) {
    $content = $row['content'];
    $replace = preg_replace_callback("/#[^\\s#]+/", create_function('$matches', '$tag = substr($matches[0], 1);return "<a href=index.php?type=content&query=$tag>$matches[0]</a>";'), $content);
    ?>
                    <form class="delete-form" action="delete.php" method="post" >
                    <input type="submit" value="delete">
                    <input type="hidden" name="no" value=<?php 
    echo $row['no'];
    ?>
>
                    </form>
                    <div class="tweet-info">
                        <span><?php 
    echo $row['author'];
Beispiel #2
0
                    <form class="write-form" action="add.php" method="post">
                        <input type="text" placeholder="Author" name="author">
                        <div>
                            <input type="text" placeholder="Content" name="content">
                        </div>
                        <input type="submit" value="write">
                    </form>
                </div>
                <!-- Ex 3: Modify forms & Load tweets -->
                <?php 
$type = $_GET["type"];
$query = $_GET["query"];
if (isset($type) and isset($query)) {
    $rows = $timeline->searchTweets($type, $query);
} else {
    $rows = $timeline->loadTweets();
}
foreach ($rows as $key => $value) {
    ?>
                <div class="tweet">
                    <form class="delete-form" action="delete.php" method="post">
                        <input type="submit" value="delete">
                        <input type="hidden" name="number" value="<?php 
    echo $value["no"];
    ?>
">
                    </form>
                    <div class="tweet-info">
                        <span><?php 
    echo $value["author"];
    ?>
Beispiel #3
0
                        <input type="text" placeholder="Author" name="author">
                        <div>
                            <input type="text" placeholder="Content" name="content">
                        </div>
                        <input type="submit" value="write">
                    </form>
                </div>
                <!-- Ex 3: Modify forms & Load tweets -->
                <div class="tweet">
                    <?php 
$result;
$timeline = new Timeline();
if (isset($_GET["type"]) && isset($_GET["query"]) && $_GET["type"] != "" && $_GET["query"] != "") {
    $result = $timeline->searchTweets($_GET["type"], $_GET["query"]);
} else {
    $result = $timeline->loadTweets();
}
foreach ($result as $row) {
    $content = $row['content'];
    $replaced = preg_replace_callback("/#[^\\s#]+/", create_function('$matches', '$tag = substr($matches[0], 1);
                                    return "<a href=index.php?type=content&query=$tag>$matches[0]</a>";'), $content);
    ?>
                    <form class="delete-form" action="delete.php" method="post" >
                    <input type="submit" value="delete">
                    <input type="hidden" name="no" value=<?php 
    echo $row['no'];
    ?>
>
                    </form>
                    <div class="tweet-info">
                        <span><?php 
                <div class="panel-heading">
                    <!-- Ex 3: Modify forms -->
                    <form class="write-form" method="post" action="add.php">
                        <input type="text" placeholder="Author" name="wau">
                        <div>
                            <input type="text" placeholder="Content" name="wco">
                        </div>
                        <input type="submit" value="write">
                    </form>
                </div>
                <!-- Ex 3: Modify forms & Load tweets -->
                <?php 
include "timeline.php";
$tl = new Timeline();
if (!isset($_GET["query"])) {
    $rows = $tl->loadTweets();
    foreach ($rows as $row) {
        /* Hash Tag */
        // $con = $row[2];
        // $tag = "<a href=\"index.php?type=Content&query=%23$1\">#$1</a>";
        // $con = preg_replace("/#([_]*[a-zA-Z0-9가-힣]+[\w가-힣]*)/", $tag, $con);
        // $row[2] = $con;
        /* Time Format */
        $hour = substr($row[3], 11, 8);
        $date = substr($row[3], 8, 2);
        $month = substr($row[3], 5, 2);
        $year = substr($row[3], 0, 4);
        $time = $hour . " " . $date . "/" . $month . "/" . $year;
        ?>
                            <div class="tweet">
                                <form class="delete-form" method="post" action="delete.php">