Esempio n. 1
0
function display_posts($name)
{
    include 'html/showposts.php';
    $conn = connect();
    $id = getId($name);
    mysql_select_db("unihub", $conn);
    $query = "SELECT * FROM posts WHERE `id` = '{$id}'";
    $result = mysql_query($query, $conn) or die(mysql_error());
    if (mysql_num_rows($result) > 0) {
        // output data of each row
        while ($row = mysql_fetch_array($result)) {
            show_posts($row['title'], $row['thumb-desc'], $row['published'], $row['avatar'], $row['feature'], $row['main-desc'], $row['likes'], $row['comments']);
        }
    }
}
Esempio n. 2
0
        break;
    case 1:
        show_team_forum_title($forum, $thread);
        break;
}
echo "<p>";
if ($preview == tra("Preview")) {
    $options = new output_options();
    echo "<div id=\"preview\">\n";
    echo "<div class=\"header\">" . tra("Preview") . "</div>\n";
    echo output_transform($content, $options);
    echo "</div>\n";
}
start_forum_table(array(tra("Author"), tra("Message")));
show_message_row($thread, $parent_post);
show_posts($thread, $forum, $sort_style, $filter, $logged_in_user, true);
end_table();
page_tail();
function show_message_row($thread, $parent_post)
{
    global $g_logged_in_user;
    global $content;
    global $preview;
    $x1 = "Message:" . html_info() . post_warning();
    $x2 = "";
    if ($parent_post) {
        $x2 .= " reply to <a href=#" . $parent_post->id . ">Message ID " . $parent_post->id . "</a>:";
    }
    $x2 .= "<form action=forum_reply.php?thread=" . $thread->id;
    if ($parent_post) {
        $x2 .= "&post=" . $parent_post->id;
Esempio n. 3
0
    //unset($_SESSION['username']);
}
if (isset($_SESSION['message'])) {
    echo "<b id='message'>" . $_SESSION['message'] . "</b><br>";
    unset($_SESSION['message']);
}
?>

<a href="07_send_post.php"><input type="submit" value="   SEND A NEW POST   "></a><br>

<strong>Your Latest Posts | Read The Comments</strong>

<div style="border-width: 2px; border-style: solid; border-color: rgba(0, 0, 0, 0.7); " class="posts" align="left">

<?php 
$posts = show_posts($_SESSION['userid']);
if (count($posts)) {
    ?>

<table border='1' cellspacing='0' cellpadding='1' width='315'>	
<?php 
    foreach ($posts as $key => $list) {
        //echo "<tr valign='top'>";
        echo $list['message'] . "&nbsp<a href= 'post_comment.php?id=" . $list['id'] . "'> more </a><br>" . "<small>" . $list['stamp'] . "\n\t\t&nbsp &nbsp&nbsp&nbsp<img src='images/like.png' alt='Like' style='width:17px;height:14px' />[" . $list['likes'] . "] &nbsp | &nbsp [" . $list['dislikes'] . "]<img src='images/dislike.png' alt='Like' style='width:17px;height:14px'/><a href= 'action.php?id=" . $list['id'] . "&do=delete'>&nbsp &nbsp &nbsp<img src='images/delete.png' style='width:50px;height:13px' alt='Delete'></a><br><hr> </small>";
    }
    ?>
</table>
<br>

<?php 
} else {
Esempio n. 4
0
    <hr/>
</div>
<?php 
if (!wp_is_mobile()) {
    echo "<div class='row'>";
}
$sorted_name_array = get_sorted_cat_arr();
static $counter = 0;
foreach ($sorted_name_array as $cat) {
    $category = get_cat_object($cat);
    if ($category->name != 'Uncategorized') {
        if ($counter % 2 == 0 && !wp_is_mobile()) {
            echo "</div>";
            echo "<div class='row'>";
        }
        show_posts($category);
        $counter++;
    }
}
if ($counter % 2 != 0 && !wp_is_mobile()) {
    echo "</div>";
}
?>
</div>
</div>  
<div class="container"></div>
<?php 
get_footer();
?>
</body>
</html>
Esempio n. 5
0
}
echo "<p>";
if ($preview == tra("Preview")) {
    $options = new output_options();
    echo "<h2>" . tra("Preview") . "</h2>\n";
    echo "<div class=\"pm_preview\">" . output_transform($content, $options) . "</div>\n";
}
start_table();
show_message_row($thread, $parent_post);
end_table();
if ($parent_post) {
    start_forum_table(array(tra("Author"), tra("Message")));
    show_post($parent_post, $thread, $forum, $logged_in_user, 0, 0, false, false);
    end_table();
} else {
    show_posts($thread, $forum, 0, 0, CREATE_TIME_NEW, 0, $logged_in_user);
}
end_table();
page_tail();
function show_message_row($thread, $parent_post)
{
    global $logged_in_user, $bbcode_html;
    global $content, $preview;
    $x1 = tra("Message:") . html_info() . post_warning();
    $x2 = "";
    if ($parent_post) {
        $x2 .= " " . tra("reply to %1Message ID%2:", "<a href=#" . $parent_post->id . ">", " " . $parent_post->id . "</a>");
    }
    $x2 .= "<form action=forum_reply.php?thread=" . $thread->id;
    if ($parent_post) {
        $x2 .= "&post=" . $parent_post->id;
Esempio n. 6
0
    // let admins decide whether a news item should be exported as notice
    //
    if (is_news_forum($forum) && $logged_in_user && $logged_in_user->id == $thread->owner) {
        if ($thread->status) {
            show_button("forum_thread_status.php?action=clear&amp;id={$thread->id}", tra("Export as Notice"), "Show this message to all volunteers in the desktop GUI.  Use this only for messages of interest or importance to all volunteers.");
        } else {
            show_button("forum_thread_status.php?action=set&amp;id={$thread->id}", tra("Don't export"), tra("Don't export this news item as a Notice"));
        }
    }
}
// Display a box that allows the user to select sorting of the posts
//
echo "</td><td align=\"right\">\n    <input type=\"hidden\" name=\"id\" value=\"", $thread->id, "\">" . tra("Sort");
echo select_from_array("sort", $thread_sort_styles, $sort_style);
echo "<input class=\"btn btn-default\" type=\"submit\" value=\"" . tra('Sort') . "\">\n    </td></tr></table></form>\n";
show_posts($thread, $forum, $start, $postid, $sort_style, $filter, $logged_in_user);
if ($reply_url) {
    echo "<br>";
    show_button($reply_url, tra("Post to thread"), tra("Add a new message to this thread"));
}
echo "<p>";
switch ($forum->parent_type) {
    case 0:
        show_forum_title($category, $forum, $thread);
        break;
    case 1:
        show_team_forum_title($forum, $thread);
        break;
}
$thread->update("views=views+1");
page_tail();
Esempio n. 7
0
?>
</title>
	<link rel="stylesheet" type="text/css" href="<?php 
_u('/css/skin.css');
?>
" />
	<link rel="stylesheet" type="text/css" href="<?php 
_u('/css/archive.css');
?>
" />
  </head>
  <body>
  <div class="title-date"><?php 
echo date('d', $time);
?>
<span class="title-month"><?php 
echo date('M', $time);
?>
</span><em class="permalink"> <a href="<?php 
_u("/date/" . date("ymd", $time));
?>
">&rarr;</a></em></div>
<hr />
<?php 
$result = db('SELECT * FROM public.notes WHERE "time">\'' . date('Y-m-d', $time) . '\'
		AND "time"<\'' . date('Y-m-d', $time + 60 * 60 * 24) . '\'');
show_posts($result);
?>
</body>
</html>
Esempio n. 8
0
function include_forums_text()
{
    global $orkTime, $cat;
    // Get stored session id from a user account
    if (isset($GLOBALS["objSrcUser"])) {
        $objSrcUser =& $GLOBALS["objSrcUser"];
        $strSession = $objSrcUser->get_user_info(SESSION);
    } elseif ($cat == 'main') {
        $strSession = 'guest';
        // Allow people without a stored session to read
        echo '<h2 style="margin: 15px auto; text-align: center;"><img src="' . HOST_PICS . 'first_forum.gif" alt="Forums" /></h2>';
    }
    // Show Links
    $set = 'news';
    if (isset($_GET['set'])) {
        $set = $_GET['set'];
    }
    echo get_forum_links($set);
    include_once 'inc/functions/forums.php';
    $posttype = select_forum($set, TRUE);
    session_start();
    $session = session_id();
    if ($strSession == $session || $strSession == 'guest') {
        $action = '';
        if (isset($_GET['action'])) {
            $action = $_GET['action'];
        }
        switch ($action) {
            case "moderation":
                if (mod_access($posttype) == 'yes') {
                    if (isset($_POST['posts'])) {
                        $posts = $_POST['posts'];
                        $postcount = count($posts);
                        $ids = "";
                        for ($i = 0; $i < $postcount; $i++) {
                            $ids .= intval($posts[$i]);
                            if ($i != $postcount - 1) {
                                $ids .= ",";
                            }
                        }
                        forum_moderation($objSrcUser, $posttype, $ids);
                    } else {
                        echo '<div class="center">' . 'Please select a topic or post first.' . '</div>';
                    }
                }
                break;
            case "edit":
                record_an_edit($posttype, $set, intval($_POST['postid']), intval($_POST['edit_id']), $orkTime);
                break;
        }
        $mode = 'threads';
        if (isset($_GET['mode'])) {
            $mode = $_GET['mode'];
        }
        switch ($mode) {
            case "threads":
                if (isset($_GET['action']) && $_GET['action'] == "post") {
                    record_a_thread_post($posttype, $set, $_POST['title'], $_POST['text']);
                }
                show_threads($posttype, $set);
                break;
            case "posts":
                if (isset($_GET['action']) && $_GET['action'] == "post") {
                    record_a_post($posttype, $set, intval($_POST['postid']), $_POST['text']);
                }
                show_posts($posttype, $set, intval($_GET['postid']), intval($_GET['start']), intval($_GET['finish']));
                break;
            case "edit":
                show_edit_form($posttype, $set, intval($_GET['postid']), intval($_GET['edit_id']));
                break;
        }
    } else {
        echo '<div class="center">' . 'Sorry, we lost your session. You need to log in again to see ' . 'the forums.' . '</div>';
    }
}