Beispiel #1
0
function mysql2AssocArray($mysqlPostRow)
{
    global $db, $userPosition, $forumId, $usersForumId;
    $postId = $mysqlPostRow['id'];
    // Times
    $htmlDatetime = date('c', $mysqlPostRow['post_time']);
    $readableTime = date('D, d M Y H:i:s', $mysqlPostRow['post_time']);
    $niceTime = nicetime($mysqlPostRow['post_time']);
    // User and message
    $forumUser = html_entity_decode($mysqlPostRow['sender']);
    $forumUser = smilify($forumUser, $forumUser);
    $forumMessage = URL2link(smilify(nl2br(html_entity_decode($mysqlPostRow['message'])), $forumUser));
    // ip address, delete, edit button
    $headerActions = $userPosition == 'Webmaster' ? decode_ip($mysqlPostRow['ipaddress']) . ' 
        <a class="forum-post-delete" style="color:black;" title="Delete post" href="forum/delete/' . $postId . '">
            <i class="fa fa-trash-o"></i> <span class="sr-only">Delete</span>
        </a>' : '';
    if ($mysqlPostRow['users_forum_id'] == $usersForumId || $userPosition == 'Webmaster') {
        $headerActions .= '
            <a class="forum-post-edit" style="color:black;" title="Edit post" href="forum/edit/' . $postId . '">
                <i class="fa fa-pencil"></i> <span class="sr-only">Edit</span>
            </a>';
    }
    // Likes
    $likeCount = mysqli_query($db, "SELECT count(1) c FROM forum_plusone WHERE message = {$postId} LIMIT 1");
    $likeCount = mysqli_fetch_array($likeCount)['c'];
    if (mysqli_num_rows(mysqli_query($db, "SELECT 1 FROM forum_plusone WHERE message = {$postId} AND cookie = '{$usersForumId}' LIMIT 1"))) {
        $likedClass = 'liked';
        $likeTitle = 'Approved';
    } else {
        $likedClass = 'not-liked';
        $likeTitle = 'Approve Post';
    }
    return array('id' => $mysqlPostRow['id'], 'parentPostId' => $mysqlPostRow['parent_id'], 'htmlDatetime' => $htmlDatetime, 'readableTime' => $readableTime, 'niceTime' => $niceTime, 'forumUser' => $forumUser, 'forumMessage' => $forumMessage, 'headerActions' => $headerActions, 'likeCount' => $likeCount, 'likedClass' => $likedClass, 'likeTitle' => $likeTitle);
}
Beispiel #2
0
    $event = mysqli_real_escape_string($db, $_POST['eventname']);
    // intialize to be blank, not used
    $email = NULL;
    $confirmed = 1;
    $auth = '';
    $insert_post = mysqli_query($db, "INSERT INTO photo_comments (photoid, event, sender, email, post_time, message, ipaddress, confirmed, auth) VALUES('{$photoid}', '{$event}', '{$sender}', '{$email}', '" . time() . "', '{$message}', '{$user_ip}', '{$confirmed}', '{$auth}')");
    if (!$insert_post) {
        die(json_encode(array('error' => mysqli_error($db))));
    } else {
        $special = $userPosition == 'Webmaster' ? $client_ip : '';
        die(json_encode(array('newComment' => array('sender' => smilify(html_entity_decode($_POST['sender']), $_POST['sender']), 'message' => URL2link(smilify(nl2br(html_entity_decode($_POST['message'])), $_POST['sender'])), 'htmlDatetime' => date('c', time()), 'readableTime' => date('D, d M Y H:i:s', time()), 'niceTime' => nicetime(time()), 'special' => $special))));
    }
} else {
    if ($_POST['action'] == 'getComments') {
        $photoid = mysqli_real_escape_string($db, $_POST['photoid']);
        $event = mysqli_real_escape_string($db, $_POST['eventname']);
        $photo_comments = mysqli_query($db, "SELECT * FROM photo_comments WHERE photoid='{$photoid}' AND event='{$event}' ");
        if (mysqli_num_rows($photo_comments) == 0) {
            die(json_encode(array('empty' => 'no comments')));
        } else {
            $comments = array();
            while ($comment = mysqli_fetch_array($photo_comments, MYSQL_ASSOC)) {
                $datetime = date('G:i j/M/y', $comment['post_time']);
                $nicetime = nicetime($comment['post_time']);
                $special = $userPosition == 'Webmaster' ? decode_ip($comment['ipaddress']) : '';
                $comments[] = array('sender' => smilify(html_entity_decode($comment['sender']), $comment['sender']), 'message' => URL2link(smilify(nl2br(html_entity_decode($comment['message'])), $comment['sender'])), 'htmlDatetime' => date('c', $comment['post_time']), 'readableTime' => date('D, d M Y H:i:s', $comment['post_time']), 'niceTime' => nicetime($comment['post_time']), 'special' => $special);
            }
            die(json_encode(array('comments' => $comments)));
        }
    }
}
Beispiel #3
0
            $specific_posts = mysqli_query($db, "SELECT * FROM forum_posts WHERE id='" . $_GET['id'] . "' AND forum='" . $forum . "' ORDER BY `post_time` DESC");
            echo "<h3 class=\"col-xs-12\">Showing " . $_GET['title'] . " post</h3>";
        } elseif (isset($_GET['person'])) {
            $specific_posts = mysqli_query($db, "SELECT * FROM forum_posts WHERE sender='" . $_GET['person'] . "' AND forum='" . $forum . "' ORDER BY `post_time` DESC");
            echo "<h3 class=\"col-xs-12\">Showing posts submitted by " . $_GET['person'] . "</h3>";
        } elseif (isset($_GET['day'])) {
            $specific_posts = mysqli_query($db, "SELECT * FROM forum_posts WHERE post_time>='" . $_GET['day'] . "' AND post_time <'" . ($_GET['day'] + 86400) . "' AND forum='" . $forum . "' ORDER BY `post_time` DESC");
            echo "<h3 class=\"col-xs-12\">Showing all posts from " . date('j M Y', $_GET['day']) . "</h3>";
        }
        while ($specific_post = mysqli_fetch_array($specific_posts, MYSQL_ASSOC)) {
            $htmlDatetime = date('c', $specific_post['post_time']);
            $readableTime = date('D, d M Y H:i:s', $specific_post['post_time']);
            $niceTime = nicetime($specific_post['post_time']);
            $forumUserEmoji = html_entity_decode($specific_post['sender']);
            $forumUser = smilify($forumUserEmoji, $forumUserEmoji);
            $forumMessage = URL2link(smilify(nl2br(html_entity_decode($specific_post['message'])), $forumUserEmoji));
            ?>
            <div class="col-xs-12 forum-post">
                <div class="post-header"> <!--top bar with name, time and other details. bottom border-->
                    <strong class="post-header-name"><?php 
            echo $forumUser;
            ?>
</strong>
                    <small class="post-header-time">
                        <time datetime="<?php 
            echo $htmlDatetime;
            ?>
" title="<?php 
            echo $readableTime;
            ?>
">
/**
 * Replace certain ascii patterns with ossn emoticons in comments.
 *
 * @note Please don't call this function directly in your code.
 * 
 * @param string $hook Name of hook
 * @param string $type Hook type
 * @param array|object $return Array or Object
 * @params array $params Array contatins params
 *
 * @return array
 * @access private
 */
function ossn_smiley_in_comments($hook, $type, $return, $params)
{
    $return['comment']['comments:post'] = smilify($return['comment']['comments:post']);
    return $return;
}
Beispiel #5
0
    while ($news = mysqli_fetch_array($news_query, MYSQL_ASSOC)) {
        $newstext = strlen($news['text']) > 200 ? substr($news['text'], 0, 199) . '...' : $news['text'];
        echo '
            <tr>
                <td>
                    <a href="manage_news.php?action=Edit&newsId=' . $news['id'] . '" title="Edit">
                        <i class="fa fa-pencil"></i>
                    </a>';
        if ($news['inuse'] == 1) {
            echo '
                    <a style="color:green" href="manage_news.php?action=Hide&newsId=' . $news['id'] . '" title="Click to hide">
                        <i class="fa fa-eye"></i>
                    </a>';
        } else {
            echo '
                    <a style="color:red" href="manage_news.php?action=Unhide&newsId=' . $news['id'] . '" title="Click to unhide">
                        <i class="fa fa-eye-slash"></i>
                    </a>';
        }
        echo '
                </td>
                <td>' . $news['formatted_date'] . '</td>
                <td>' . $news['title'] . '</td>
                <td>' . smilify($newstext, 0) . '</td>
            </tr>';
    }
    echo '
        </tbody>
    </table>';
}
addFooter();
Beispiel #6
0
<?php

include_once './includes/functions.php';
// This had to be manually set up based on the json in the emojiSorted var in emoji.js
$tabs = array("people" => array("People", ":smile:"), "nature" => array("Nature", ":whale:"), "food_drink" => array("Food and drink", ":doughnut:"), "celebration" => array("Celebration", ":tada:"), "activity" => array("Activity", ":lifter:"), "travel_places" => array("Travel and places", ":rocket:"), "objects_symbols" => array("Objects and symbols", ":high_heel:"));
?>

<!-- Emoji tabs -->
<ul class="nav nav-tabs emoji-tabs" role="tablist">
    <?php 
foreach ($tabs as $tabCatagory => $tabInfo) {
    echo '
        <li role="presentation">
            <a class="emoji-tabs__title" href="forum#' . $tabCatagory . '" title="' . $tabInfo[0] . '" aria-controls="' . $tabCatagory . '" role="tab" data-toggle="tab">' . smilify($tabInfo[1], NULL) . '
            </a>
        </li>';
}
?>
    <li role="presentation">
        <a class="emoji-tabs__title--ucdtc" href="#ucdtc-smilies" title="UCDTC's Home grown oldies" aria-controls="ucdtc-smilies" role="tab" data-toggle="tab">
            <img src="images/emoji/normal-smilies/pstar.gif" alt="Pstar" title="Pstar">
        </a>
    </li>
</ul>

<!-- Emojoi tab panes -->
<div class="tab-content">
    <?php 
// Sort each catagory by the catagory order var
foreach ($tabs as $tabCatagory => $tabInfo) {
    echo '
Beispiel #7
0
                <em><strong>No</strong></em>, you can't "do a flip" until you've worked up to the skill. <br>
                <em><strong>Yes</strong></em>, it's only €15 for a whole years membership!  <br>
            </p>
            <p><?php 
echo smilify("Since the dawn of time man has looked :eyes: to the sky :partly_sunny:, at the birds :whale2: and the bees :bee: and the pterodactyls :dragon:, with one dream; to <span title=\"#theMoonLandingsWereFaked\">fly <span class=\"emojione-1F680\">🚀</span></span>.", null);
?>
 Here in the UCD Trampoline club, we help you fly up... and back down again and back up in a repeated fashion, usually wearing some kind of lycra with white socks on the most beautifully pointed toes, all this fuelled by your own massive muscles! <span style="cursor:pointer;" onclick="playSound();" onmouseenter="playSound();"><i class="fa fa-volume-up"></i> YEEEAAHHH!</span></p>
            <audio id="yeah" src="files/sounds/yeah.mp3"></audio>
            <script>
                function playSound(){
                    document.getElementById('yeah').load();
                    document.getElementById('yeah').play();
                }
            </script>
            <p>Trampolining is a unique sport that combines cardio, co-ordination, core strenght, flexibilty, balance and stamina and wait for it, you won't believe this one; it's fun <?php 
echo smilify(':tramp:', null);
?>
. With 6 olympic standard trampolines and experienced coaches available for <strong>one on one coaching</strong> at every training session, the odds are definitely in your favour. </p>
            
            What do you want in a sports club?
            <ul class="greetings-list">
                <li>Regular training times like every <strong>Tuesday 8-10</strong> and <strong>Thursdays 5-7</strong>?</li>
                <li>A club unaffected by the weather? Indoors!</li>
                <li>A chance to talk to some people? What else would you be doing when you're waiting for your turn!</li>
                <li>A club with a formiddable background? <strong>UCD Club of the year 2011</strong> and Intervarsities winners the last 4 years running!</li>
            </ul>

            <p>If you're here looking at the website, you're obviously interested. You'll go far my friend <span class="emojione-1F463" title=":footprints:">👣</span>. Take a look around the site, we're quite proud of it. You'll find details on the history of the club, pictures and reports from our (many) trips away on the <a href="events">Events</a> page, our coaches and committee on the <a href="about">About</a> page and games and videos and everything else on the <a href="everythingelse">EE</a> page. It's all just a click away...</p>

            <p>
                Yours with reckless abondon, <br><em>El Crapitan Rosie</em>
Beispiel #8
0
                        <a href="polls" title="Click to see all polls">Recent Polls</a>                        
                    </th>
                </tr>
            </thead>
            <tbody>
<?php 
$recentPolls = mysqli_query($db, "SELECT * FROM polls ORDER BY id DESC LIMIT 5");
while ($poll = mysqli_fetch_array($recentPolls)) {
    echo '<tr>
                        <td> 
                            <a href="polls/' . $poll['id'] . '&results=show" title="View Results">
                                <i class="fa fa-bar-chart-o"></i>
                            </a>
                            <a href="polls/' . $poll['id'] . '" title="Vote">
                                <i class="fa fa-crosshairs"></i>
                            </a>' . smilify($poll['question'], NULL) . '
                        </td>
                    </tr>';
}
?>
            </tbody>
        </table>
        
    </div>
    <div class="col-xs-12 col-md-6" id="other">
            <h3>Other stuff</h3>
    
            <a href="page/quotes">Trampy Quotes</a><br>
            <a href="page/ryanbjface">Hahaha!</a><br>
            <!-- <a href="page/log">Website Changelog</a>
            - Info about updates to the website are half documented here -->
Beispiel #9
0
        <table class="table table-striped">
            <tr>
                <th>ID</th>
                <th>Action</th>
                <th>Num Choices</th>
                <th>Num Votes</th>
                <th style="text-align:left;">Question</th>
            </tr>
            <tbody>';
        // List all polls with view results/vote buttons
        while ($poll = mysqli_fetch_array($polls)) {
            echo '
                <tr> 
                    <td>' . $poll['id'] . '</td>
                    <td>
                        <a href="polls/results/' . $poll['id'] . '" title="View Results"><i class="fa fa-bar-chart-o"></i> Results</a>
                        <br>
                        <a href="polls/' . $poll['id'] . '" title="Vote"><i class="fa fa-crosshairs"></i> Vote</a>
                    </td>
                    <td>' . $poll['numofoptions'] . '</td>
                    <td>' . $poll['numofvotes'] . '</td>
                    <td>' . smilify($poll['question'], 0) . '
                    </td>
                </tr>';
        }
        echo '
            </tbody>
        </table>';
    }
}
addFooter();