function render_article($subject, $article, $info) { global $locale; $category = "<a href='" . INFUSIONS . "articles/articles.php?cat_id=" . $info['cat_id'] . "'>" . $info['cat_name'] . "</a>\n"; $comment = "<a href='" . INFUSIONS . "articles/articles.php?article_id=" . $info['article_id'] . "#comments'> " . format_word($info['article_comments'], $locale['fmt_comment']) . " </a>\n"; echo render_breadcrumbs(); echo "<!--pre_article-->"; echo "<article>\n"; echo "<div class='news-action text-right'>"; echo "<a title='" . $locale['global_075'] . "' href='" . BASEDIR . "print.php?type=A&item_id=" . $info['article_id'] . "'><i class='entypo print'></i></a>"; echo !empty($info['edit_link']) ? "<a href='" . $info['edit_link'] . "' title='" . $locale['global_076'] . "' /><i class='entypo pencil'></i></a>\n" : ''; echo "</div>\n"; echo "<div class='news-info'>" . ucfirst($locale['posted']) . " <span class='news-date'>" . showdate("%d %b %Y", $info['article_date']) . "</span> " . $locale['in'] . " {$category} " . $locale['and'] . " {$comment}</div>\n"; echo "<h2 class='news-title'>{$subject}</h2>"; echo "<div class='article'>\n"; echo ($info['article_breaks'] == "y" ? nl2br($article) : $article) . "<br />\n"; echo "</div>\n"; echo "<hr />\n"; echo "<div class='news-user-info clearfix m-b-10'>\n"; echo "<h4>" . $locale['about'] . " <a href='" . BASEDIR . "profile.php?lookup=" . $info['user_id'] . "'>" . $info['user_name'] . "</a>\n</h4>"; echo "<div class='pull-left m-r-10'>" . display_avatar($info, '80px') . "</div>\n"; echo "<strong>" . getuserlevel($info['user_level']) . "</strong><br/>\n"; echo "<strong>" . $locale['joined'] . showdate('newsdate', $info['user_joined']) . "</strong><br/>\n"; echo "</div>\n"; echo "</article>"; echo "<!--sub_article-->"; echo $info['page_nav']; echo "<hr />\n"; if ($info['article_allow_comments']) { showcomments("A", DB_ARTICLES, "article_id", $_GET['article_id'], INFUSIONS . "articles/articles.php?article_id=" . $_GET['article_id']); } if ($info['article_allow_ratings']) { showratings("A", $_GET['article_id'], INFUSIONS . "articles/articles.php?article_id=" . $_GET['article_id']); } }
function show_blacklist($data) { global $locale; echo "<div class='alert alert-info display-none' id='ignore-message'></div>\n"; if (is_array($data) && count($data) > 0) { foreach ($data as $id) { $result = dbquery("SELECT user_id, user_name, user_status, user_avatar FROM " . DB_USERS . " WHERE user_id='{$id}' ORDER BY user_id ASC"); if (dbrows($result) > 0) { while ($data = dbarray($result)) { echo "<div id='" . $data['user_id'] . "-user-list' class='panel panel-default'>\n<div class='panel-body'>\n"; echo "<button type='button' value='" . $data['user_id'] . "' class='unblock pull-right m-t-5 btn btn-sm btn-primary'>" . $locale['uf_blacklist_001'] . "</button>\n"; echo "<div class='pull-left m-r-10'>" . display_avatar($data, '50px') . "</div>\n"; echo "<div class='clearfix'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br/>\n"; echo "<span class='text-lighter'>" . $locale['uf_blacklist_002'] . "</span>\n"; echo "</div>\n"; echo "</div>\n</div>\n"; } } } } add_to_jquery("\n\t\$('.unblock').bind('click', function(e) {\n\tvar user_id = \$(this).val();\n\t\$.ajax({\n\t\ttype: 'POST',\n\t\turl: '" . INCLUDES . "user_fields/user_blacklist.ajax.php',\n\t\tdata: { user_id : user_id },\n\t\tdataType: 'html',\n\t\tsuccess: function(data) {\n\t\t\talert(data);\n\t\t\t\$('#'+user_id+'-user-list').addClass('display-none');\n\t\t\t\$('#ignore-message').html(data).removeClass('display-none');\n\t\t},\n\t\terror: function() {\n\t\t\talert('" . $locale['uf_blacklist_desc'] . "');\n\t\t}\n\t\t});\n\t});\n\t"); }
function render_article($subject, $article, $info) { global $locale, $settings, $aidlink; $category = "<a href='" . BASEDIR . "articles.php?cat_id=" . $info['cat_id'] . "'>" . $info['cat_name'] . "</a>\n"; $comment = "<a href='" . BASEDIR . "articles.php?article_id=" . $info['article_id'] . "#comments'>" . $info['article_comments'] . " comment</a>\n"; echo "<article>\n"; echo "<div class='news-action text-right'>"; echo "<a title='" . $locale['global_075'] . "' href='" . BASEDIR . "print.php?type=A&item_id=" . $info['article_id'] . "'><i class='entypo print'></i></a>"; echo iADMIN && checkrights("A") ? "<a href='" . ADMIN . "articles.php" . $aidlink . "&action=edit&article_id=" . $info['article_id'] . "' title='" . $locale['global_076'] . "' /><i class='entypo pencil'></i></a>\n" : ''; echo "</div>\n"; echo "<div class='news-info'>Posted <span class='news-date'>" . showdate("%d %b %Y", $info['article_date']) . "</span> in {$category} and {$comment}</div>\n"; echo "<h2 class='news-title'>{$subject}</h2>"; echo "<div class='article'>\n"; echo ($info['article_breaks'] == "y" ? nl2br($article) : $article) . "<br />\n"; echo "</div>\n"; echo "<div class='news-user-info'>\n"; echo "<h4>About <a href='" . BASEDIR . "profile.php?lookup=" . $info['user_id'] . "'>" . $info['user_name'] . "</a>\n</h4>"; echo "<div class='pull-left m-r-10'>" . display_avatar($info, '80px') . "</div>\n"; echo "<strong>" . getuserlevel($info['user_level']) . "</strong><br/>\n"; echo "<strong>Joined since: " . showdate('newsdate', $info['user_joined']) . "</strong><br/>\n"; echo "</div>\n"; echo "</article>"; }
function render_comments_form($comment_type, $clink, $comment_item_id, $_CAPTCHA_HIDE_INPUT) { $userdata = fusion_get_userdata(); $settings = fusion_get_settings(); $locale = fusion_get_locale(); $comment_cat = ""; $comment_message = ""; if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $eresult = dbquery("SELECT tcm.*, tcu.user_name\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $comment_item_id . "'\n\t\t\t\tAND comment_type='" . $comment_type . "' AND comment_hidden='0'"); if (dbrows($eresult) > 0) { $edata = dbarray($eresult); if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) { $clink .= "&c_action=edit&comment_id=" . $edata['comment_id']; $comment_message = $edata['comment_message']; $comment_cat = $edata['comment_cat']; } } } // Comments form if (iMEMBER || fusion_get_settings("guestposts") == 1) { $comments_form = openform('inputform', 'post', $clink); $comments_form .= form_hidden("comment_cat", "", $comment_cat); if (iGUEST) { $comments_form .= form_text('comment_name', $locale['c104'], '', array('max_length' => 30, 'required' => TRUE)); } $comments_form .= form_textarea('comment_message', '', $comment_message, array('required' => 1, 'autosize' => 1, 'form_name' => 'inputform', "tinymce" => "simple", 'type' => fusion_get_settings("tinymce_enabled") ? "tinymce" : "bbcode")); if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) { $_CAPTCHA_HIDE_INPUT = FALSE; $comments_form .= "<div class='m-t-10 m-b-10'>"; $comments_form .= "<label class='col-xs-12 col-sm-3'>" . $locale['global_150'] . "</label><div class='col-xs-12 col-sm-9'>\n"; ob_start(); include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php"; $comments_form .= ob_get_contents(); ob_end_clean(); if (!$_CAPTCHA_HIDE_INPUT) { $comments_form .= "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>"; $comments_form .= "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n"; } $comments_form .= "</div>\n"; $comments_form .= "</div>\n"; } $comments_form .= form_button('post_comment', $comment_message ? $locale['c103'] : $locale['c102'], $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn-success m-t-10')); $comments_form .= closeform(); } else { $comments_form = "<div class='well'>\n"; $comments_form .= $locale['c105'] . "\n"; $comments_form .= "</div>\n"; } ?> <!---comments form---> <div class="comments-form-panel"> <!---comments header--> <div class="comments-form-header"> <?php echo $locale['c102']; ?> </div> <!---//comments header--> <div class="comments-form"> <div class="pull-left"> <?php echo display_avatar(fusion_get_userdata(), "50px", "", FALSE, "img-rounded"); ?> </div> <div class="overflow-hide"> <a id="edit_comment" name="edit_comment"></a> <?php echo $comments_form; ?> </div> </div> </div> <!---//comments form---> <?php }
| copyright header is strictly prohibited without | written permission from the original author(s). +--------------------------------------------------------*/ if (!defined("IN_FUSION")) { die("Access Denied"); } if (!defined("iAUTH") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) { redirect("../index.php"); } if (iADMIN && !$userdata['user_admin_password']) { echo "<div class='alert alert-danger text-center'>" . $locale['global_199'] . "</div>\n"; } $form_action = FUSION_SELF . $aidlink == ADMIN . "index.php" . $aidlink ? FUSION_SELF . $aidlink . "&pagenum=0" : FUSION_SELF . "?" . FUSION_QUERY; // we can now MVC this. echo openform('adminloginform', 'post', $form_action, array('max_tokens' => 2)); openside(''); echo "<div class='m-t-10 clearfix row'>\n"; echo "<div class='col-xs-3 col-sm-3 col-md-3 col-lg-3'>\n"; echo "<div class='pull-right'>\n"; echo display_avatar($userdata, '90px'); echo "</div>\n"; echo "</div>\n<div class='col-xs-9 col-sm-9 col-md-8 col-lg-7'>\n"; echo "<h5><strong>" . $locale['welcome'] . ", " . $userdata['user_name'] . "</strong><br/>" . getuserlevel($userdata['user_level']) . "</h5>"; echo "<div class='clearfix'>\n"; echo form_text('admin_password', '', '', array('placeholder' => $locale['281'], 'autocomplete_off' => 1, 'type' => 'password', 'required' => 1)); echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo form_button('admin_login', $locale['login'], 'Sign in', array('class' => 'btn-primary btn-block')); echo closeform();
} if (defender::safe()) { echo openmodal('article_preview', $locale['articles_0240']); echo "<h3>" . $callback_data['article_snippet'] . "</h3>\n"; echo $callback_data['article_snippet']; echo "<hr/>\n"; if (isset($callback_data['article_article'])) { echo $callback_data['article_article']; } echo closemodal(); } } echo openform("publish_article", "post", FUSION_REQUEST); echo "<div class='well clearfix'>\n"; echo "<div class='pull-left'>\n"; echo display_avatar($data, "30px", "", "", ""); echo "</div>\n"; echo "<div class='overflow-hide'>\n"; echo $locale['articles_0052'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br/>\n"; echo $locale['articles_0053'] . timer($data['submit_datestamp']) . " - " . showdate("shortdate", $data['submit_datestamp']); echo "</div>\n"; echo "</div>\n"; echo "<div class='container-fluid'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-8'>"; echo form_text("article_subject", $locale['articles_0200'], $callback_data['article_subject'], array("required" => TRUE, "inline" => FALSE)); echo form_select('article_keywords', $locale['articles_0204'], $callback_data['article_keywords'], array("max_length" => 320, "placeholder" => $locale['articles_0204a'], "width" => "100%", "error_text" => $locale['articles_0257'], "tags" => TRUE, "multiple" => TRUE)); $snippetSettings = array("required" => TRUE, "preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "form_name" => "inputform"); if (fusion_get_settings("tinymce_enabled")) { $snippetSettings = array("required" => TRUE); } echo form_textarea('article_snippet', $locale['articles_0202'], $callback_data['article_snippet'], $snippetSettings);
// xss injection $result = dbquery("SELECT tn.thread_id FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n WHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'"); $rows = dbrows($result); if (!isset($_GET['rowstart']) or !isnum($_GET['rowstart']) or $_GET['rowstart'] > $rows) { $_GET['rowstart'] = 0; } $info['post_rows'] = $rows; if ($rows) { require_once INCLUDES . "mimetypes_include.php"; $info['page_nav'] = $rows > 10 ? makepagenav($_GET['rowstart'], 16, $rows, 3, FUSION_REQUEST, "rowstart") : ""; $result = dbquery("\n SELECT tf.forum_id, tf.forum_name, tf.forum_access, tf.forum_type, tf.forum_mods,\n tn.thread_id, tn.notify_datestamp, tn.notify_user,\n ttc.forum_id AS forum_cat_id, ttc.forum_name AS forum_cat_name,\n tp.post_datestamp, tp.post_message,\n tt.thread_subject, tt.forum_id, tt.thread_lastpost, tt.thread_lastpostid, tt.thread_lastuser, tt.thread_postcount, tt.thread_views, tt.thread_locked,\n tt.thread_author, tt.thread_poll, tt.thread_sticky,\n uc.user_id AS s_user_id, uc.user_name AS author_name, uc.user_status AS author_status, uc.user_avatar AS author_avatar,\n u.user_id, u.user_name as last_user_name, u.user_status as last_user_status, u.user_avatar as last_user_avatar,\n count(v.post_id) AS vote_count,\n count(a1.attach_mime) 'attach_image',\n\t\t\t\tcount(a2.attach_mime) 'attach_files'\n FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n LEFT JOIN " . DB_FORUMS . " ttc ON ttc.forum_id = tf.forum_cat\n LEFT JOIN " . DB_USERS . " uc ON tt.thread_author = uc.user_id\n LEFT JOIN " . DB_USERS . " u ON tt.thread_lastuser = u.user_id\n LEFT JOIN " . DB_FORUM_POSTS . " tp ON tt.thread_id = tp.thread_id\n LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = tt.thread_id AND tp.post_id = v.post_id\n LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = tt.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = tt.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n WHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'\n GROUP BY tn.thread_id\n ORDER BY tn.notify_datestamp DESC\n LIMIT " . $_GET['rowstart'] . ",16\n "); $i = 0; while ($threads = dbarray($result)) { // opt for moderators. $this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']); $icon = ""; $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id']; if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) { if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) { $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>"; } else { $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>"; } } $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']); $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']); $threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"), "track_button" => array('link' => FORUM . "index.php?section=tracked&delete=" . $threads['thread_id'], 'title' => $locale['global_058'])); // push $this->forum_info['item'][$threads['thread_id']] = $threads; } }
} } opentable($locale['SB_edit_shout']); echo $nav; $result = dbquery("SELECT * FROM " . DB_SHOUTBOX); $rows = dbrows($result); if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; } if ($rows != 0) { $i = 0; $result = dbquery("SELECT s.shout_id, s.shout_name, s.shout_message, s.shout_datestamp, s.shout_ip, u.user_id, u.user_name, u.user_avatar, u.user_status\r\n\t\t\t\tFROM " . DB_SHOUTBOX . " s\r\n\t\t\t\tLEFT JOIN " . DB_USERS . " u ON s.shout_name=u.user_id\r\n\t\t\t\tORDER BY shout_datestamp DESC LIMIT " . $_GET['rowstart'] . ",20"); echo "<div class='list-group'>\n"; while ($data = dbarray($result)) { echo "<div class='list-group-item' style='min-height:100px;'>\n"; echo "<div class='pull-left m-r-10'>" . display_avatar($data, '80px') . "</div>\n"; echo "<div class='comment-name'>"; echo $data['user_name'] ? "<span class='slink'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>" : $data['shout_name']; echo "</span>\n"; echo "<span class='small'>" . $locale['SB_on_date'] . showdate("longdate", $data['shout_datestamp']) . "</div>\n"; echo "<div class='m-t-5'><small>\n"; echo "<a href='" . FUSION_SELF . $aidlink . "&action=edit&shout_id=" . $data['shout_id'] . "'>" . $locale['SB_edit'] . "</a> -\n"; echo "<a href='" . FUSION_SELF . $aidlink . "&action=delete&shout_id=" . $data['shout_id'] . "' onclick=\"return confirm('" . $locale['SB_warning_shout'] . "');\">" . $locale['SB_delete'] . "</a> -\n"; echo "<strong>" . $locale['SB_userip'] . $data['shout_ip'] . "</strong>\n"; echo "</small>\n</div>\n"; echo str_replace("<br />", "", parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color")) . "<br />\n"; echo "</div>\n"; } echo "</div>\n"; echo "<div align='center' style='margin-top:5px;'>\n" . makePageNav($_GET['rowstart'], 20, $rows, 3, FUSION_SELF . $aidlink . "&") . "\n</div>\n"; } else {
/** * @param $comment_type - abbr or short ID * @param $comment_db - Current Application DB - DB_BLOG for example. * @param $comment_col - current sql primary key column - 'blog_id' for example * @param $comment_item_id - current sql primary key value '$_GET['blog_id']' for example * @param $clink - current page link 'FUSION_SELF' is ok. */ function showcomments($comment_type, $comment_db, $comment_col, $comment_item_id, $clink) { global $settings, $locale, $userdata, $aidlink; $link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : ""); $link = preg_replace("^(&|\\?)c_action=(edit|delete)&comment_id=\\d*^", "", $link); $_GET['comment'] = isset($_GET['comment']) && isnum($_GET['comment']) ? $_GET['comment'] : 0; $cpp = $settings['comments_per_page']; if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) { $result = dbquery("DELETE FROM " . DB_COMMENTS . "\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\n\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'")); } redirect($clink . ($settings['comments_sorting'] == "ASC" ? "" : "&c_start=0")); } if ($settings['comments_enabled'] == "1") { if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) { if (!iMEMBER && $settings['guestpost'] == 1) { if (!isset($_POST['comment_name'])) { redirect($link); } if (isnum($_POST['comment_name'])) { $_POST['comment_name'] = ''; } $_CAPTCHA_IS_VALID = FALSE; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php"; if (!isset($_POST['captcha_code']) || $_CAPTCHA_IS_VALID == FALSE) { redirect($link); } } $comment_data = array('comment_id' => isset($_GET['comment_id']) && isnum($_GET['comment_id']) ? $_GET['comment_id'] : 0, 'comment_name' => iMEMBER ? $userdata['user_id'] : form_sanitizer($_POST['comment_name'], '', 'comment_name'), 'comment_message' => form_sanitizer($_POST['comment_message'], '', 'comment_message'), 'comment_datestamp' => time(), 'comment_item_id' => $comment_item_id, 'comment_type' => $comment_type, 'comment_cat' => 0, 'comment_ip' => USER_IP, 'comment_ip_type' => USER_IP_TYPE, 'comment_hidden' => 0); if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && $comment_data['comment_id']) { $comment_updated = FALSE; if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $comment_data['comment_id'] . "' \n\t\t\t\tAND comment_item_id='" . $comment_item_id . "'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tAND comment_type='" . $comment_type . "' \n\t\t\t\tAND comment_name='" . $userdata['user_id'] . "' \n\t\t\t\tAND comment_hidden='0'")) { dbquery_insert(DB_COMMENTS, $comment_data, 'update'); if ($comment_data['comment_message']) { $result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='" . $comment_data['comment_message'] . "'\n \t\t\t\t\t\t\t\t\t WHERE comment_id='" . $_GET['comment_id'] . "' " . (iADMIN ? "" : "AND comment_name='" . $userdata['user_id'] . "'")); if ($result) { $comment_updated = TRUE; } } } if ($comment_updated) { if ($settings['comments_sorting'] == "ASC") { $c_operator = "<="; } else { $c_operator = ">="; } $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_id" . $c_operator . "'" . $comment_data['comment_id'] . "'\n\t\t\t\t\t\t\t\tAND comment_item_id='" . $comment_item_id . "'\n\t\t\t\t\t\t\t\tAND comment_type='" . $comment_type . "'"); $c_start = (ceil($c_count / $cpp) - 1) * $cpp; } redirect($clink . "&c_start=" . (isset($c_start) && isnum($c_start) ? $c_start : "")); } else { if (!dbcount("(" . $comment_col . ")", $comment_db, $comment_col . "='" . $comment_item_id . "'")) { redirect(BASEDIR . "index.php"); } $id = 0; if ($comment_data['comment_name'] && $comment_data['comment_message']) { require_once INCLUDES . "flood_include.php"; if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) { dbquery_insert(DB_COMMENTS, $comment_data, 'save'); $id = dblastid(); } } if ($settings['comments_sorting'] == "ASC") { $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "'"); $c_start = (ceil($c_count / $cpp) - 1) * $cpp; } else { $c_start = 0; } //if (!$settings['site_seo']) { redirect($clink . "&c_start=" . $c_start . "#c" . $id); //} } } $c_arr = array("c_con" => array(), "c_info" => array("c_makepagenav" => FALSE, "admin_link" => FALSE)); $c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'"); if (!isset($_GET['c_start']) && $c_rows > $cpp) { $_GET['c_start'] = (ceil($c_rows / $cpp) - 1) * $cpp; } if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) { $_GET['c_start'] = 0; } $result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp,\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\n\t\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\t\tWHERE comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'\n\t\t\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp); if (dbrows($result) > 0) { $i = $settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start']; if ($c_rows > $cpp) { $c_arr['c_info']['c_makepagenav'] = makepagenav($_GET['c_start'], $cpp, $c_rows, 3, $clink . "&", "c_start"); } while ($data = dbarray($result)) { $c_arr['c_con'][$i]['comment_id'] = $data['comment_id']; $c_arr['c_con'][$i]['edit_dell'] = FALSE; $c_arr['c_con'][$i]['i'] = $i; if ($data['user_name']) { $c_arr['c_con'][$i]['comment_name'] = profile_link($data['comment_name'], $data['user_name'], $data['user_status'], 'strong text-dark'); } else { $c_arr['c_con'][$i]['comment_name'] = $data['comment_name']; } $c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '35px', '', true, 'img-rounded'); $c_arr['c_con'][$i]['user'] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_avatar' => $avatar = $data['user_avatar'] !== '' && file_exists(IMAGES . 'avatars/' . $data['user_avatar']) ? IMAGES . 'avatars/' . $data['user_avatar'] : IMAGES . "avatars/noavatar50.png", 'user_status' => $data['user_status']); $c_arr['c_con'][$i]['comment_datestamp'] = showdate('shortdate', $data['comment_datestamp']); $c_arr['c_con'][$i]['comment_time'] = timer($data['comment_datestamp']); $c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message']))); if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) { $edit_link = clean_request('c_action=edit&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false) . "#edit_comment"; $delete_link = clean_request('c_action=delete&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false); $c_arr['c_con'][$i]['edit_link'] = array('link' => $edit_link, 'name' => $locale['c108']); $c_arr['c_con'][$i]['delete_link'] = array('link' => $delete_link, 'name' => $locale['c109']); $c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<div class='btn-group'>"; $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $edit_link . "'>"; $c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a>\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $delete_link . "' onclick=\"return confirm('" . $locale['c110'] . "');\">"; $c_arr['c_con'][$i]['edit_dell'] .= "<i class='fa fa-trash'></i> " . $locale['c109'] . "</a>"; $c_arr['c_con'][$i]['edit_dell'] .= "</div>\n"; } $settings['comments_sorting'] == "ASC" ? $i++ : $i--; } if (iADMIN && checkrights("C")) { $c_arr['c_info']['admin_link'] = "<!--comment_admin-->\n"; $c_arr['c_info']['admin_link'] .= "<a href='" . ADMIN . "comments.php" . $aidlink . "&ctype=" . $comment_type . "&comment_item_id=" . $comment_item_id . "'>" . $locale['c106'] . "</a>"; } } opentable($locale['c102']); $comment_message = ""; if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $comment_item_id . "'\n\t\t\t\tAND comment_type='" . $comment_type . "' AND comment_hidden='0'"); if (dbrows($eresult) > 0) { $edata = dbarray($eresult); if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) { $clink .= "&c_action=edit&comment_id=" . $edata['comment_id']; $comment_message = $edata['comment_message']; } } else { $comment_message = ""; } } if (iMEMBER || $settings['guestposts'] == "1") { require_once INCLUDES . "bbcode_include.php"; echo "<a id='edit_comment' name='edit_comment'></a>\n"; echo openform('inputform', 'post', $clink, array('class' => 'm-b-20', 'max_tokens' => 1)); if (iGUEST) { echo form_text('comment_name', $locale['c104'], '', array('max_length' => 30)); } echo form_textarea('comment_message', '', $comment_message, array('required' => 1, 'autosize' => 1, 'form_name' => 'inputform', 'bbcode' => 1)); if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) { $_CAPTCHA_HIDE_INPUT = FALSE; echo "<div style='width:360px; margin:10px auto;'>"; echo $locale['global_150'] . "<br />\n"; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php"; if (!$_CAPTCHA_HIDE_INPUT) { echo "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>"; echo "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n"; } echo "</div>\n"; } echo form_button('post_comment', $comment_message ? $locale['c103'] : $locale['c102'], $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn-success m-t-10')); echo closeform(); } else { echo "<div class='well'>\n"; echo $locale['c105'] . "\n"; echo "</div>\n"; } closetable(); echo "<a id='comments' name='comments'></a>"; render_comments($c_arr['c_con'], $c_arr['c_info']); } }
function render_admin_panel() { global $locale, $userdata, $defender, $pages, $aidlink, $admin; $languages = fusion_get_enabled_languages(); // Admin panel page echo "<div id='admin-panel' class='clearfix in'>\n"; // Top header section echo "<section id='acp-header' class='pull-left affix clearfix' data-offset-top='0' data-offset-bottom='0'>\n"; // Top content sections navigation echo "<nav>\n"; echo "<ul class='top-left-menu pull-left m-l-15'>\n"; echo "<li><a title='" . $locale['ac00'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=0'>" . $locale['ac00'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac01'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=1'>" . $locale['ac01'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac02'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=2'>" . $locale['ac02'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac03'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=3'>" . $locale['ac03'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac04'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=4'>" . $locale['ac04'] . "</a></li>\n"; echo "<li><a title='" . $locale['ac05'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=5'>" . $locale['ac05'] . "</a></li>\n"; echo "</ul>\n"; echo "</nav>\n"; // Top navigation echo "<nav>\n"; // Top right menu links echo "<ul class='top-right-menu pull-right m-r-15'>\n"; echo "<li class='dropdown'>\n"; echo "<a class='dropdown-toggle pointer' data-toggle='dropdown'>" . display_avatar($userdata, '25px', '', '', '') . " " . $locale['logged'] . "<strong>" . $userdata['user_name'] . "</strong> <span class='caret'></span>\n</a>\n"; echo "<ul class='dropdown-menu' role='menu'>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "edit_profile.php'>" . $locale['edit'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['view'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li class='divider'> </li>\n"; echo "<li><a class='display-block' href='" . FUSION_REQUEST . "&logout'>" . $locale['admin-logout'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "index.php?logout=yes'>" . $locale['logout'] . "</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; if (count($languages) > 1) { echo "<li class='dropdown'><a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . $locale['282'] . "'><i class='fa fa-globe fa-lg fa-fw'></i> " . translate_lang_names(LANGUAGE) . "<span class='caret'></span></a>\n"; echo "<ul class='dropdown-menu'>\n"; foreach ($languages as $language_folder => $language_name) { echo "<li><a class='display-block' href='" . clean_request("lang=" . $language_folder, array("lang"), FALSE) . "'><img class='m-r-5' src='" . BASEDIR . "locale/{$language_folder}/{$language_folder}-s.png'> {$language_name}</a></li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; // .top-right-menu echo "</nav>\n"; echo "</section>\n"; // Content section echo "<div class='content-wrapper display-table pull-left'>\n"; // Main content wrapper echo "<div id='acp-content' class='m-t-20 col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; // Render breadcrumbs echo render_breadcrumbs(); // Get and render notices $notices = getNotices(); echo renderNotices($notices); // Render the content echo CONTENT; echo "</div>\n"; // #acp-content // Footer section echo "<footer class='m-l-20 display-inline-block m-t-20 m-b-20'>\n"; // Copyright echo "Old_School Admin © " . date("Y") . " created by <a href='https://www.php-fusion.co.uk'><strong>PHP-Fusion Inc.</strong></a>\n"; echo showcopyright(); // Render time if (fusion_get_settings('rendertime_enabled')) { echo "<br /><br />"; // Make showing of queries and memory usage separate settings echo showrendertime(); echo showMemoryUsage(); } echo "<hr />\n"; echo showFooterErrors(); echo "</footer>\n"; echo "</div>\n"; // .acp-main echo "</div>\n"; // #admin-panel // Wrappers echo "</div></div></div></div>\n"; add_to_footer("<script src='" . THEMES . "admin_themes/Old_School/includes/jquery.slimscroll.min.js'></script>"); add_to_jquery("\n// Initialize slimscroll\n\$('#adl').slimScroll({\n\theight: null\n});\n"); }
/** * Message Reader Functions for Inbox, Outbox, Archive */ function _inbox($info) { if (isset($_GET['msg_read']) && isset($info['items'][$_GET['msg_read']])) { // read view $data = $info['items'][$_GET['msg_read']]; echo ' <h4>' . $data['message']['message_header'] . '</h4> <div class="clearfix m-t-20 m-b-20"> <div class="pull-left m-r-15">' . display_avatar($data, "40px") . '</div> <div class="overflow-hide"> ' . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . '<br/> ' . showdate("shortdate", $data['message_datestamp']) . timer($data['message_datestamp']) . ' </div> </div> ' . $data['message']['message_text'] . ' <hr/> ' . $info['reply_form']; } elseif (isset($_GET['msg_send'])) { // send new message form echo $info['reply_form']; } else { // display view global $locale; if (!empty($info['items'])) { $unread = array(); $read = array(); foreach ($info['items'] as $message_id => $messageData) { if ($messageData['message_read']) { $read[$message_id] = $messageData; } else { $unread[$message_id] = $messageData; } } echo '<h5><a data-target="#unread_inbox" class="pointer text-dark" data-toggle="collapse"> <i class="fa fa-caret-down"></i> ' . $locale['446'] . '</a></h5> <div id="unread_inbox" class="collapse in">'; if (!empty($unread)) { echo '<table id="unread_tbl" class="table table-responsive table-hover">'; foreach ($unread as $id => $messageData) { echo "<tr>\n"; echo "<td>" . form_checkbox("pmID", "", $id, array("input_id" => "pmID-" . $id, "value" => $id, "class" => "checkbox m-b-0")) . "</td>\n"; echo "<td class='col-xs-2'><strong>" . $messageData['contact_user']['user_name'] . "</strong></td>\n"; echo "<td class='col-xs-7'><strong><a href='" . $messageData['message']['link'] . "'>" . $messageData['message']['name'] . "</a></strong></td>\n"; echo "<td>" . date("d M", $messageData['message_datestamp']) . "</td>\n"; echo "</tr>\n"; } echo '</table>'; } else { echo '<div class="text-center list-group-item">' . $locale['471'] . '</div>'; } echo '</div>'; echo '<h5><a data-target="#read_inbox" class="pointer text-dark" data-toggle="collapse"> <i class="fa fa-caret-down"></i> ' . $locale['447'] . '</a></h5> <div id="read_inbox" class="collapse in">'; if (!empty($read)) { echo '<table id="read_tbl" class="table table-responsive table-hover">'; foreach ($read as $id => $messageData) { echo "<tr>\n"; echo "<td>" . form_checkbox("pmID", "", $id, array("input_id" => "pmID-" . $id, "value" => $id, "class" => "checkbox m-b-0")) . "</td>\n"; echo "<td class='col-xs-2'>" . $messageData['contact_user']['user_name'] . "</td>\n"; echo "<td class='col-xs-7'><a href='" . $messageData['message']['link'] . "'>" . $messageData['message']['name'] . "</a></td>\n"; echo "<td>" . date("d M", $messageData['message_datestamp']) . "</td>\n"; echo "</tr>\n"; } } echo '</table>'; echo '</div>'; } else { echo '<div class="text-center list-group-item">' . $info['no_item'] . '</div>'; } } }
function render_photo_items(array $info = array()) { global $locale, $gallery_settings; echo "<div class='panel panel-default'>\n"; echo "<div class='overflow-hide' style='background: #ccc; height: " . ($gallery_settings['thumb_h'] - 15) . "px'>\n"; echo $info['image']; echo "</div>\n"; echo "<div class='panel-body'>\n"; echo "<a class='word-break' href='" . $info['photo_link']['link'] . "'><strong>" . $locale['450'] . "</strong></a>\n<br/>"; echo "</div>\n"; echo "<div class='panel-footer'>\n"; echo "<span><i class='fa fa-eye fa-fw'></i>" . $info['photo_views'] . "</span></br>\n"; if (isset($info['photo_comments'])) { echo "<span><i class='fa fa-comment-o fa-fw'></i><a href='" . $info['photo_comments']['link'] . "'>" . $info['photo_comments']['word'] . "</a>\n</span></br>\n"; } if (isset($info['photo_ratings'])) { echo "<span><i class='fa fa-star-o fa-fw'></i><a href='" . $info['photo_ratings']['link'] . "'>" . $info['photo_ratings']['word'] . "</a>\n</span></br>\n"; } echo "</div>\n"; echo "<div class='panel-footer'>\n"; echo "<small><strong>" . $locale['434'] . "</strong></small>\n<br/>\n"; echo "<div class='pull-left'>\n" . display_avatar($info, "15px", "", "", "") . "</div>"; echo "<div class='overflow-hide'>\n" . profile_link($info['user_id'], $info['user_name'], $info['user_status']) . "</div>\n"; echo "</div>\n"; echo "<div class='panel-footer'>\n"; echo "<abbr title='" . $locale['464'] . showdate("shortdate", $info['photo_datestamp']) . "'>\n\t\t\t<i class='entypo calendar text-lighter'></i></abbr> " . timer($info['photo_datestamp']) . ""; if (!empty($info['photo_edit']) && !empty($info['photo_delete'])) { echo "</div>\n<div class='panel-footer'>\n"; echo "<a class='btn btn-default' href='" . $info['photo_edit']['link'] . "' title='" . $info['photo_edit']['name'] . "'><i class='fa fa-edit fa-lg'></i></a>\n"; echo "<a class='btn btn-danger' href='" . $info['photo_delete']['link'] . "' title='" . $info['photo_delete']['name'] . "'><i class='fa fa-trash fa-lg'></i></a>\n"; } echo "</div></div>\n"; }
/** * Displays News Listing */ function display_news_listing() { $aidlink = fusion_get_aidlink(); $locale = fusion_get_locale(); // Run functions $allowed_actions = array_flip(array("publish", "unpublish", "sticky", "unsticky", "delete")); if (isset($_POST['table_action']) && isset($allowed_actions[$_POST['table_action']])) { $input = isset($_POST['news_id']) ? explode(",", form_sanitizer($_POST['news_id'], "", "news_id")) : ""; if (!empty($input)) { foreach ($input as $news_id) { // check input table if (dbcount("('news_id')", DB_NEWS, "news_id='" . intval($news_id) . "'") && defender::safe()) { switch ($_POST['table_action']) { case "publish": dbquery("UPDATE " . DB_NEWS . " SET news_draft='0' WHERE news_id='" . intval($news_id) . "'"); break; case "unpublish": dbquery("UPDATE " . DB_NEWS . " SET news_draft='1' WHERE news_id='" . intval($news_id) . "'"); break; case "sticky": dbquery("UPDATE " . DB_NEWS . " SET news_sticky='1' WHERE news_id='" . intval($news_id) . "'"); break; case "unsticky": dbquery("UPDATE " . DB_NEWS . " SET news_sticky='0' WHERE news_id='" . intval($news_id) . "'"); break; case "delete": $result = dbquery("SELECT news_image, news_image_t1, news_image_t2 FROM " . DB_NEWS . " WHERE news_id='" . intval($news_id) . "'"); if (dbrows($result) > 0) { $photo = dbarray($result); if (!empty($photo['news_image']) && file_exists(IMAGES_N . $photo['news_image'])) { unlink(IMAGES_N . $photo['news_image']); } if (!empty($photo['news_image_t1']) && file_exists(IMAGES_N_T . $photo['news_image_t1'])) { unlink(IMAGES_N_T . $photo['news_image_t1']); } if (!empty($photo['news_image_t2']) && file_exists(IMAGES_N_T . $photo['news_image_t2'])) { unlink(IMAGES_N_T . $photo['news_image_t2']); } if (!empty($photo['news_image_t2']) && file_exists(IMAGES_N . $photo['news_image_t2'])) { unlink(IMAGES_N . $photo['news_image_t2']); } } dbquery("DELETE FROM " . DB_NEWS . " WHERE news_id='" . intval($news_id) . "'"); break; default: addNotice("warning", "News ID {$news_id} is not valid and update aborted"); redirect(FUSION_REQUEST); } } } addNotice("success", "News listing has been updated"); redirect(FUSION_REQUEST); } addNotice("warning", "No news item selected. Please check a news item and try again"); redirect(FUSION_REQUEST); } if (isset($_POST['news_clear'])) { redirect(FUSION_SELF . $aidlink); } // Switch to post $sql_condition = ""; $search_string = array(); if (isset($_POST['p-submit-news_text'])) { $search_string['news_subject'] = array("input" => form_sanitizer($_POST['news_text'], "", "news_text"), "operator" => "LIKE"); } if (!empty($_POST['news_status']) && isnum($_POST['news_status'])) { switch ($_POST['news_status']) { case 1: // is a draft $search_string['news_draft'] = array("input" => 1, "operator" => "="); break; case 2: // is a sticky $search_string['news_sticky'] = array("input" => 1, "operator" => "="); break; } } if (!empty($_POST['news_visibility'])) { $search_string['news_visibility'] = array("input" => form_sanitizer($_POST['news_visibility'], "", "news_visibility"), "operator" => "="); } if (!empty($_POST['news_category'])) { $search_string['news_cat_id'] = array("input" => form_sanitizer($_POST['news_category'], "", "news_category"), "operator" => "="); } if (!empty($_POST['news_language'])) { $search_string['news_language'] = array("input" => form_sanitizer($_POST['news_language'], "", "news_language"), "operator" => "="); } if (!empty($_POST['news_author'])) { $search_string['news_name'] = array("input" => form_sanitizer($_POST['news_author'], "", "news_author"), "operator" => "="); } if (!empty($search_string)) { foreach ($search_string as $key => $values) { $sql_condition .= " AND `{$key}` " . $values['operator'] . ($values['operator'] == "LIKE" ? "'%" : "'") . $values['input'] . ($values['operator'] == "LIKE" ? "%'" : "'"); } } $result2 = dbquery("\n\tSELECT n.*, nc.*, IF(nc.news_cat_name !='', nc.news_cat_name, 'Uncategorized') 'news_cat_name',\n\tcount('c.comment_id') 'comments_count',\n\tcount('r.rating_id') 'ratings_count',\n\tu.user_id, u.user_name, u.user_status, u.user_avatar\n\tFROM " . DB_NEWS . " n\n\tLEFT JOIN " . DB_NEWS_CATS . " nc on nc.news_cat_id=n.news_cat\n\tLEFT JOIN " . DB_COMMENTS . " c on c.comment_item_id= n.news_id AND c.comment_type='N'\n\tLEFT JOIN " . DB_RATINGS . " r on r.rating_item_id= n.news_id AND r.rating_type='N'\n\tINNER JOIN " . DB_USERS . " u on u.user_id= n.news_name\n\tWHERE " . (multilang_table("NS") ? "news_language='" . LANGUAGE . "'" : "") . "\n\t{$sql_condition}\n\tGROUP BY n.news_id\n\tORDER BY news_draft DESC, news_sticky DESC, news_datestamp DESC\n\t"); ?> <div class="m-t-15"> <?php echo openform("news_filter", "post", FUSION_REQUEST); echo "<div class='clearfix'>\n"; echo "<div class='pull-right'>\n"; echo "<a class='btn btn-success btn-sm m-r-10' href='" . clean_request("ref=news_form", array("ref"), FALSE) . "'>Add New</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('publish');\"><i class='fa fa-check fa-fw'></i> " . $locale['publish'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('unpublish');\"><i class='fa fa-ban fa-fw'></i> " . $locale['unpublish'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('sticky');\"><i class='fa fa-sticky-note fa-fw'></i> " . $locale['sticky'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('unsticky');\"><i class='fa fa-sticky-note-o fa-fw'></i> " . $locale['unsticky'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('delete');\"><i class='fa fa-trash-o fa-fw'></i> " . $locale['delete'] . "</a>"; echo "</div>\n"; ?> <script> function run_admin(action) { $('#table_action').val(action); $('#news_table').submit(); } </script> <?php $filter_values = array("news_text" => !empty($_POST['news_text']) ? form_sanitizer($_POST['news_text'], "", "news_text") : "", "news_status" => !empty($_POST['news_status']) ? form_sanitizer($_POST['news_status'], "", "news_status") : "", "news_category" => !empty($_POST['news_category']) ? form_sanitizer($_POST['news_category'], "", "news_category") : "", "news_visibility" => !empty($_POST['news_visibility']) ? form_sanitizer($_POST['news_visibility'], "", "news_visibility") : "", "news_language" => !empty($_POST['news_language']) ? form_sanitizer($_POST['news_language'], "", "news_language") : "", "news_author" => !empty($_POST['news_author']) ? form_sanitizer($_POST['news_author'], "", "news_author") : ""); $filter_empty = TRUE; foreach ($filter_values as $val) { if ($val) { $filter_empty = FALSE; } } echo "<div class='display-inline-block pull-left m-r-10' style='width:300px;'>\n"; echo form_text("news_text", "", $filter_values['news_text'], array("placeholder" => "News Subject", "append_button" => TRUE, "append_value" => "<i class='fa fa-search'></i>", "append_form_value" => "search_news", "width" => "250px")); echo "</div>\n"; echo "<div class='display-inline-block'>"; echo "<a class='btn btn-sm " . ($filter_empty == FALSE ? "btn-info" : " btn-default'") . "' id='toggle_options' href='#'>Search Options\n <span id='filter_caret' class='fa " . ($filter_empty == FALSE ? "fa-caret-up" : "fa-caret-down") . "'></span></a>\n"; echo form_button("news_clear", "Clear", "clear"); echo "</div>\n"; echo "</div>\n"; add_to_jquery("\n \$('#toggle_options').bind('click', function(e) {\n \$('#news_filter_options').slideToggle();\n var caret_status = \$('#filter_caret').hasClass('fa-caret-down');\n if (caret_status == 1) {\n \$('#filter_caret').removeClass('fa-caret-down').addClass('fa-caret-up');\n \$(this).removeClass('btn-default').addClass('btn-info');\n } else {\n \$('#filter_caret').removeClass('fa-caret-up').addClass('fa-caret-down');\n \$(this).removeClass('btn-info').addClass('btn-default');\n }\n });\n\n // Select change\n \$('#news_status, #news_visibility, #news_category, #news_language, #news_author').bind('change', function(e){\n \$(this).closest('form').submit();\n });\n "); unset($filter_values['news_text']); echo "<div id='news_filter_options'" . ($filter_empty == FALSE ? "" : " style='display:none;'") . ">\n"; echo "<div class='display-inline-block'>\n"; echo form_select("news_status", "", $filter_values['news_status'], array("allowclear" => TRUE, "placeholder" => "- Select Status -", "options" => array(0 => "All Status", 1 => "Draft", 2 => "Sticky"))); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; echo form_select("news_visibility", "", $filter_values['news_visibility'], array("allowclear" => TRUE, "placeholder" => "- Select Access -", "options" => fusion_get_groups())); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; $news_cats_opts = array(0 => "All Categories"); $result = dbquery("SELECT * FROM " . DB_NEWS_CATS . " ORDER BY news_cat_name ASC"); if (dbrows($result) > 0) { while ($data = dbarray($result)) { $news_cats_opts[$data['news_cat_id']] = $data['news_cat_name']; } } echo form_select("news_category", "", $filter_values['news_category'], array("allowclear" => TRUE, "placeholder" => "- Select Category -", "options" => $news_cats_opts)); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; $language_opts = array(0 => "All Language"); $language_opts += fusion_get_enabled_languages(); echo form_select("news_language", "", $filter_values['news_language'], array("allowclear" => TRUE, "placeholder" => "- Select Language -", "options" => $language_opts)); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; $author_opts = array(0 => "All Author"); $result = dbquery("SELECT n.news_name, u.user_id, u.user_name, u.user_status\n FROM " . DB_NEWS . " n\n LEFT JOIN " . DB_USERS . " u on n.news_name = u.user_id\n GROUP BY u.user_id\n ORDER BY user_name ASC"); if (dbrows($result) > 0) { while ($data = dbarray($result)) { $author_opts[$data['user_id']] = $data['user_name']; } } echo form_select("news_author", "", $filter_values['news_author'], array("allowclear" => TRUE, "placeholder" => "- Select Author -", "options" => $author_opts)); echo "</div>\n"; echo "</div>\n"; echo closeform(); ?> </div> <?php echo openform("news_table", "post", FUSION_REQUEST); ?> <?php echo form_hidden("table_action", "", ""); ?> <table class="table table-responsive table-striped"> <thead> <tr> <td></td> <td class="strong col-xs-4">News Subject</td> <td class="strong">News Category</td> <td class="strong">Access</td> <td class="strong">Sticky</td> <td class="strong">Draft</td> <td class="strong">Comments</td> <td class="strong">Ratings</td> <td class="strong">News Author</td> <td class="strong">Actions</td> <td class="strong">ID</td> </tr> </thead> <tbody> <?php if (dbrows($result2) > 0) { while ($data = dbarray($result2)) { ?> <?php $edit_link = FUSION_SELF . $aidlink . "&action=edit&ref=news_form&news_id=" . $data['news_id']; $cat_edit_link = FUSION_SELF . $aidlink . "&action=edit&ref=news_category&cat_id=" . $data['news_cat_id']; $image_thumb = get_news_image_path($data['news_image'], $data['news_image_t1'], $data['news_image_t2']); if (!$image_thumb) { $image_thumb = IMAGES . "imagenotfound70.jpg"; } ?> <tr> <td><?php echo form_checkbox("news_id[]", "", "", array("value" => $data['news_id'], "class" => 'm-0')); ?> </td> <td> <a class="text-dark" href="<?php echo $edit_link; ?> "> <?php echo $data['news_subject']; ?> </a> </td> <td> <a class="text-dark" href="<?php echo $cat_edit_link; ?> "> <?php echo $data['news_cat_name']; ?> </a> </td> <td> <?php echo getgroupname($data['news_visibility']); ?> </td> <td> <span class="badge"><?php echo $data['news_sticky'] ? $locale['yes'] : $locale['no']; ?> </span> </td> <td> <span class="badge"><?php echo $data['news_draft'] ? $locale['yes'] : $locale['no']; ?> </span> </td> <td><?php echo $data['comments_count']; ?> </td> <td><?php echo $data['ratings_count']; ?> </td> <td> <div class="pull-left"><?php echo display_avatar($data, "20px", "", FALSE, "img-rounded"); ?> </div> <div class="overflow-hide"><?php echo profile_link($data['user_id'], $data['user_name'], $data['user_status']); ?> </div> </td> <td> <div class="btn-group"> <a class="btn btn-xs btn-default" href="<?php echo $edit_link; ?> "> <?php echo $locale['edit']; ?> </a> <a class="btn btn-xs btn-default" href="<?php echo FUSION_SELF . $aidlink . "&action=delete&news_id=" . $data['news_id']; ?> " onclick="return confirm('<?php echo $locale['news_0251']; ?> ')"> <?php echo $locale['delete']; ?> </a> </div> </td> <td><?php echo $data['news_id']; ?> </td> </tr> <?php } } else { ?> <tr> <td colspan="10" class="text-center strong"><?php echo $locale['news_0254']; ?> </td> </tr> <?php } ?> </tbody> </table> <?php closeform(); }
<?php /** * Displays all users */ echo "<h3 class='icon1 margin'>" . $locale['debonair_0400'] . "</h3>\n"; $result = dbquery("select user_id, user_name, user_status from " . DB_USERS . " order by user_joined DESC"); if (dbrows($result) > 0) { echo "<div class='m-b-10'>\n"; while ($data = dbarray($result)) { echo display_avatar($data, '25px', "", true, "img-circle"); } echo "</div>\n"; echo "<div class='link-holder'><a href='" . BASEDIR . "members.php' class='more-dark'>" . $locale['debonair_0401'] . "</a></div>\n"; } else { echo $locale['debonair_0402']; }
public function set_ForumInfo() { global $forum_settings, $userdata, $locale; if (stristr($_SERVER['PHP_SELF'], 'forum_id')) { if ($_GET['section'] == 'latest') { redirect(INFUSIONS . 'forum/index.php?section=latest'); } if ($_GET['section'] == 'mypost') { redirect(INFUSIONS . 'forum/index.php?section=mypost'); } if ($_GET['section'] == 'tracked') { redirect(INFUSIONS . 'forum/index.php?section=tracked'); } } // security boot due to insufficient access level if (isset($_GET['viewforum']) && !verify_forum($_GET['forum_id'])) { redirect(INFUSIONS . 'forum/index.php'); } // Xss sanitization $this->forum_info = array('forum_id' => isset($_GET['forum_id']) ? $_GET['forum_id'] : 0, 'parent_id' => isset($_GET['parent_id']) && verify_forum($_GET['parent_id']) ? $_GET['parent_id'] : 0, 'forum_branch' => isset($_GET['forum_branch']) && verify_forum($_GET['forum_branch']) ? $_GET['forum_branch'] : 0, 'new_thread_link' => '', 'lastvisited' => isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time(), 'posts_per_page' => $forum_settings['posts_per_page'], 'threads_per_page' => $forum_settings['threads_per_page'], 'forum_index' => dbquery_tree(DB_FORUMS, 'forum_id', 'forum_cat'), 'threads' => array(), 'section' => isset($_GET['section']) ? $_GET['section'] : 'thread'); // Set Max Rows -- XSS $this->forum_info['forum_max_rows'] = dbcount("('forum_id')", DB_FORUMS, (multilang_table("FO") ? "forum_language='" . LANGUAGE . "' AND" : '') . "\n\t\tforum_cat='" . $this->forum_info['parent_id'] . "' AND " . groupaccess('forum_access') . ""); // Sanitize Globals $_GET['forum_id'] = $this->forum_info['forum_id']; $_GET['rowstart'] = isset($_GET['rowstart']) && $_GET['rowstart'] <= $this->forum_info['forum_max_rows'] ? $_GET['rowstart'] : 0; $this->ext = isset($this->forum_info['parent_id']) && isnum($this->forum_info['parent_id']) ? "&parent_id=" . $this->forum_info['parent_id'] : ''; add_to_title($locale['global_200'] . $locale['forum_0000']); add_breadcrumb(array('link' => INFUSIONS . 'forum/index.php', 'title' => $locale['forum_0000'])); forum_breadcrumbs($this->forum_info['forum_index']); // Set Meta data if ($this->forum_info['forum_id'] > 0) { $meta_result = dbquery("SELECT forum_meta, forum_description FROM " . DB_FORUMS . " WHERE forum_id='" . intval($this->forum_info['forum_id']) . "'"); if (dbrows($meta_result) > 0) { $meta_data = dbarray($meta_result); if ($meta_data['forum_description'] !== '') { set_meta('description', $meta_data['forum_description']); } if ($meta_data['forum_meta'] !== '') { set_meta('keywords', $meta_data['forum_meta']); } } } // Additional Sections in Index View if (isset($_GET['section'])) { switch ($_GET['section']) { case 'participated': include INFUSIONS . "forum/sections/participated.php"; add_to_title($locale['global_201'] . $locale['global_024']); add_breadcrumb(array('link' => INFUSIONS . "forum/index.php?section=participated", 'title' => $locale['global_024'])); set_meta("description", $locale['global_024']); break; case 'latest': include INFUSIONS . "forum/sections/latest.php"; add_to_title($locale['global_201'] . $locale['global_021']); add_breadcrumb(array('link' => INFUSIONS . "forum/index.php?section=latest", 'title' => $locale['global_021'])); set_meta("description", $locale['global_021']); break; case 'tracked': include INFUSIONS . "forum/sections/tracked.php"; add_to_title($locale['global_201'] . $locale['global_056']); add_breadcrumb(array('link' => INFUSIONS . "forum/index.php?section=tracked", 'title' => $locale['global_056'])); set_meta("description", $locale['global_056']); break; case "unanswered": include INFUSIONS . "forum/sections/unanswered.php"; add_to_title($locale['global_201'] . $locale['global_027']); add_breadcrumb(array('link' => INFUSIONS . "forum/index.php?section=unanswered", 'title' => $locale['global_027'])); set_meta("description", $locale['global_027']); break; case "unsolved": include INFUSIONS . "forum/sections/unsolved.php"; add_to_title($locale['global_201'] . $locale['global_028']); add_breadcrumb(array('link' => INFUSIONS . "forum/index.php?section=unsolved", 'title' => $locale['global_028'])); set_meta("description", $locale['global_028']); break; default: redirect(FUSION_SELF); } } else { // Switch between view forum or forum index -- required: $_GET['viewforum'] if ($this->forum_info['forum_id'] && isset($this->forum_info['parent_id']) && isset($_GET['viewforum'])) { /** * View Forum Additional Views - add Filter Initialization */ $time = isset($_GET['time']) ? $_GET['time'] : ''; $type = isset($_GET['type']) ? $_GET['type'] : ''; $sort = isset($_GET['sort']) ? $_GET['sort'] : ''; $order = isset($_GET['order']) ? $_GET['order'] : ''; $timeCol = ''; $typeCol = ''; if ($time) { $time_array = array('today' => strtotime('today'), '2days' => strtotime('-2 day'), '1week' => strtotime('-1 week'), '2week' => strtotime('-2 week'), '1month' => strtotime('-2 month'), '2month' => strtotime('-2 month'), '3month' => strtotime('-2 month'), '6month' => strtotime('-6 month'), '1year' => strtotime('-1 year')); $time_stop = ''; foreach ($time_array as $key => $value) { if ($time == $key) { $time_stop = prev($time_array); break; } } if ($time !== 'today') { $timeCol = "AND ((post_datestamp >= '" . $time_array[$time] . "' OR t.thread_lastpost >= '" . $time_array[$time] . "') AND (post_datestamp <= '" . $time_stop . "' OR t.thread_lastpost <= '" . $time_stop . "')) "; } else { $timeCol = "AND (post_datestamp >= '" . $time_array[$time] . "' OR t.thread_lastpost >= '" . $time_array[$time] . "') "; } } if ($type) { $type_array = array('all' => '', 'discussions' => "AND (a1.attach_name IS NULL or a1.attach_name='') AND (a2.attach_name IS NULL or a2.attach_name='') AND (forum_poll_title IS NULL or forum_poll_title='')", 'attachments' => "AND a1.attach_name !='' OR a2.attach_name !='' AND (forum_poll_title IS NULL or forum_poll_title='')", 'poll' => "AND (a1.attach_name IS NULL or a1.attach_name='') AND (a2.attach_name IS NULL or a2.attach_name='') AND forum_poll_title !=''", 'solved' => "AND t.thread_answered = '1'", 'unsolved' => "AND t.thread_answered = '0'"); $typeCol = $type_array[$type]; } $sortCol = "ORDER BY t.thread_lastpost "; $orderCol = 'ASC'; if ($sort) { $sort_array = array('author' => 't.thread_author', 'time' => 't.thread_lastpost', 'subject' => 't.thread_subject', 'reply' => 't.thread_postcount', 'view' => 't.thread_views'); $sortCol = "ORDER BY " . $sort_array[$sort] . " "; } if ($order) { $order_array = array('ascending' => 'ASC', 'descending' => 'DESC'); $orderCol = $order_array[$order]; } $sql_condition = $timeCol . $typeCol; $sql_order = $sortCol . $orderCol; // Filter Links $timeExt = isset($_GET['time']) ? "&time=" . $_GET['time'] : ''; $typeExt = isset($_GET['type']) ? "&type=" . $_GET['type'] : ''; $sortExt = isset($_GET['sort']) ? "&sort=" . $_GET['sort'] : ''; $orderExt = isset($_GET['order']) ? "&order=" . $_GET['order'] : ''; $baseLink = INFUSIONS . 'forum/index.php?viewforum&forum_id=' . $_GET['forum_id'] . '' . (isset($_GET['parent_id']) ? '&parent_id=' . $_GET['parent_id'] . '' : ''); $timeLink = $baseLink . $typeExt . $sortExt . $orderExt; $this->forum_info['filter']['time'] = array($locale['forum_3006'] => INFUSIONS . 'forum/index.php?viewforum&forum_id=' . $_GET['forum_id'] . '' . (isset($_GET['parent_id']) ? '&parent_id=' . $_GET['parent_id'] . '' : ''), $locale['forum_3007'] => $timeLink . '&time=today', $locale['forum_3008'] => $timeLink . '&time=2days', $locale['forum_3009'] => $timeLink . '&time=1week', $locale['forum_3010'] => $timeLink . '&time=2week', $locale['forum_3011'] => $timeLink . '&time=1month', $locale['forum_3012'] => $timeLink . '&time=2month', $locale['forum_3013'] => $timeLink . '&time=3month', $locale['forum_3014'] => $timeLink . '&time=6month', $locale['forum_3015'] => $timeLink . '&time=1year'); $typeLink = $baseLink . $timeExt . $sortExt . $orderExt; $this->forum_info['filter']['type'] = array($locale['forum_3000'] => $typeLink . '&type=all', $locale['forum_3001'] => $typeLink . '&type=discussions', $locale['forum_3002'] => $typeLink . '&type=attachments', $locale['forum_3003'] => $typeLink . '&type=poll', $locale['forum_3004'] => $typeLink . '&type=solved', $locale['forum_3005'] => $typeLink . '&type=unsolved'); $sortLink = $baseLink . $timeExt . $typeExt . $orderExt; $this->forum_info['filter']['sort'] = array($locale['forum_3016'] => $sortLink . '&sort=author', $locale['forum_3017'] => $sortLink . '&sort=time', $locale['forum_3018'] => $sortLink . '&sort=subject', $locale['forum_3019'] => $sortLink . '&sort=reply', $locale['forum_3020'] => $sortLink . '&sort=view'); $orderLink = $baseLink . $timeExt . $typeExt . $sortExt; $this->forum_info['filter']['order'] = array($locale['forum_3021'] => $orderLink . '&order=descending', $locale['forum_3022'] => $orderLink . '&order=ascending'); // Forum SQL $result = dbquery("SELECT f.*, f2.forum_name AS forum_cat_name,\n\t\t\t\tt.thread_id, t.thread_lastpost, t.thread_lastpostid, t.thread_subject,\n\t\t\t\tcount(t.thread_id) as forum_threadcount, p.post_message,\n\t\t\t\tu.user_id, u.user_name, u.user_status, u.user_avatar\n\t\t\t\tFROM " . DB_FORUMS . " f\n\t\t\t\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat = f2.forum_id\n\t\t\t\tLEFT JOIN " . DB_FORUM_THREADS . " t ON t.forum_id = f.forum_id\n\t\t\t\tLEFT JOIN " . DB_FORUM_POSTS . " p on p.thread_id = t.thread_id and p.post_id = t.thread_lastpostid\n\t\t\t\tLEFT JOIN " . DB_USERS . " u ON f.forum_lastuser=u.user_id ## -- redo this part -- ##\n\t\t\t\t" . (multilang_table("FO") ? "WHERE f.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('f.forum_access') . "\n\t\t\t\tAND f.forum_id='" . intval($this->forum_info['forum_id']) . "' OR f.forum_cat='" . intval($this->forum_info['forum_id']) . "' OR f.forum_branch='" . intval($this->forum_info['forum_branch']) . "'\n\t\t\t\tgroup by f.forum_id ORDER BY forum_cat ASC\n\t\t\t\t"); $refs = array(); if (dbrows($result) > 0) { while ($row = dbarray($result) and checkgroup($row['forum_access'])) { // Calculate Forum New Status $newStatus = ""; $forum_match = "\\|" . $row['forum_lastpost'] . "\\|" . $row['forum_id']; $last_visited = isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time(); if ($row['forum_lastpost'] > $last_visited) { if (iMEMBER && ($row['forum_lastuser'] !== $userdata['user_id'] || !preg_match("({$forum_match}\\.|{$forum_match}\$)", $userdata['user_threads']))) { $newStatus = "<span class='forum-new-icon'><i title='" . $locale['forum_0260'] . "' class='" . Functions::get_forumIcons('new') . "'></i></span>"; } } // Calculate lastpost information $lastPostInfo = array(); if ($row['forum_lastpostid']) { $last_post = array('avatar' => '', 'avatar_src' => $row['user_avatar'] && file_exists(IMAGES . 'avatars/' . $row['user_avatar']) && !is_dir(IMAGES . 'avatars/' . $row['user_avatar']) ? IMAGES . 'avatars/' . $row['user_avatar'] : '', 'message' => fusion_first_words(parseubb(parsesmileys($row['post_message'])), 10), 'profile_link' => profile_link($row['forum_lastuser'], $row['user_name'], $row['user_status']), 'time' => timer($row['forum_lastpost']), 'date' => showdate("forumdate", $row['forum_lastpost']), 'thread_link' => INFUSIONS . "forum/viewthread.php?forum_id=" . $row['forum_id'] . "&thread_id=" . $row['thread_id'], 'post_link' => INFUSIONS . "forum/viewthread.php?forum_id=" . $row['forum_id'] . "&thread_id=" . $row['thread_id'] . "&pid=" . $row['thread_lastpostid'] . "#post_" . $row['thread_lastpostid']); if ($forum_settings['forum_last_post_avatar']) { $last_post['avatar'] = display_avatar($row, '30px', '', '', 'img-rounded'); } $lastPostInfo = $last_post; } /** * Default system icons - why do i need this? Why not let themers decide? */ switch ($row['forum_type']) { case '1': $forum_icon = "<i class='" . Functions::get_forumIcons('forum') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . Functions::get_forumIcons('forum') . " fa-3x fa-fw m-r-10'></i>"; break; case '2': $forum_icon = "<i class='" . Functions::get_forumIcons('thread') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . Functions::get_forumIcons('thread') . " fa-3x fa-fw m-r-10'></i>"; break; case '3': $forum_icon = "<i class='" . Functions::get_forumIcons('link') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . Functions::get_forumIcons('link') . " fa-3x fa-fw m-r-10'></i>"; break; case '4': $forum_icon = "<i class='" . Functions::get_forumIcons('question') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . Functions::get_forumIcons('question') . " fa-3x fa-fw m-r-10'></i>"; break; default: $forum_icon = ""; $forum_icon_lg = ""; } $row += array("forum_moderators" => Functions::parse_forumMods($row['forum_mods']), "forum_new_status" => $newStatus, "forum_link" => array("link" => INFUSIONS . "forum/index.php?viewforum&forum_id=" . $row['forum_id'] . "&parent_id=" . $row['forum_cat'], "title" => $row['forum_name']), "forum_description" => nl2br(parseubb($row['forum_description'])), "forum_postcount_word" => format_word($row['forum_postcount'], $locale['fmt_post']), "forum_threadcount_word" => format_word($row['forum_threadcount'], $locale['fmt_thread']), "last_post" => $lastPostInfo, "forum_icon" => $forum_icon, "forum_icon_lg" => $forum_icon_lg, "forum_image" => $row['forum_image'] && file_exists(FORUM . "images/" . $row['forum_image']) ? $row['forum_image'] : ""); $this->forum_info['forum_moderators'] = $row['forum_moderators']; // child hierarchy data. $thisref =& $refs[$row['forum_id']]; $thisref = $row; if ($row['forum_cat'] == $this->forum_info['parent_id']) { $this->forum_info['item'][$row['forum_id']] =& $thisref; // will push main item out. } else { $refs[$row['forum_cat']]['child'][$row['forum_id']] =& $thisref; } /** * The current forum */ if ($row['forum_id'] == $this->forum_info['forum_id']) { require_once INCLUDES . "mimetypes_include.php"; define_forum_mods($row); // do the full string of checks for forums access $this->setForumPermission($row); // Generate Links if ($this->getForumPermission("can_post")) { $this->forum_info['new_thread_link'] = INFUSIONS . "forum/newthread.php?forum_id=" . $row['forum_id']; } /** * Get threads with filter conditions */ //xss $count = dbarray(dbquery("SELECT\n\t\t\t\t\t\t\t\tcount(t.thread_id) 'thread_max_rows',\n\t\t\t\t\t\t\t\tcount(a1.attach_id) 'attach_image',\n\t\t\t\t\t\t\t\tcount(a2.attach_id) 'attach_files'\n\n\t\t\t\t\t\t\t\tFROM " . DB_FORUM_THREADS . " t\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n\t\t\t\t\t\t\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\t\t\t\tWHERE t.forum_id='" . $this->forum_info['forum_id'] . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . " {$sql_condition}\n\t\t\t\t\t\t\t\t##GROUP BY t.thread_id {$sql_order}\n\t\t\t\t\t\t")); $this->forum_info['thread_max_rows'] = $count['thread_max_rows']; if ($this->forum_info['thread_max_rows'] > 0) { $this->forum_info['threads']['pagenav'] = ""; $this->forum_info['threads']['pagenav2'] = ""; // anti-XSS filtered rowstart $_GET['thread_rowstart'] = isset($_GET['thread_rowstart']) && isnum($_GET['thread_rowstart']) && $_GET['thread_rowstart'] <= $this->forum_info['thread_max_rows'] ? $_GET['thread_rowstart'] : 0; $t_result = dbquery("\n SELECT t.*, tu1.user_name AS author_name, tu1.user_status AS author_status, tu1.user_avatar as author_avatar,\n\t\t\t\t\t\t\t\ttu2.user_name AS last_user_name, tu2.user_status AS last_user_status, tu2.user_avatar AS last_user_avatar,\n\t\t\t\t\t\t\t\tp1.post_datestamp, p1.post_message,\n\t\t\t\t\t\t\t\tp.forum_poll_title,\n\t\t\t\t\t\t\t\tcount(v.post_id) AS vote_count,\n\t\t\t\t\t\t\t\ta1.attach_name, a1.attach_id,\n\t\t\t\t\t\t\t\ta2.attach_name, a2.attach_id,\n\t\t\t\t\t\t\t\tcount(a1.attach_mime) 'attach_image',\n\t\t\t\t\t\t\t\tcount(a2.attach_mime) 'attach_files'\n\t\t\t\t\t\t\t\tFROM " . DB_FORUM_THREADS . " t\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n\t\t\t\t\t\t\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\t\t\t\tWHERE t.forum_id='" . $this->forum_info['forum_id'] . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . " {$sql_condition}\n\t\t\t\t\t\t\t\tGROUP BY t.thread_id {$sql_order} LIMIT " . intval($_GET['thread_rowstart']) . ", " . $this->forum_info['threads_per_page']); $thread_rows = dbrows($t_result); if ($thread_rows > 0) { while ($threads = dbarray($t_result)) { $icon = ""; $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id']; if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) { if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) { $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>"; } else { $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>"; } } $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']); $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']); $threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $row['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>")); //if ($threads['thread_status']['reads']) $threads['thread_status']['icon'] = $threads['thread_status']['reads']; //if ($threads['thread_status']['hot']) $threads['thread_status']['icon'] = $threads['thread_status']['hot']; //if ($threads['thread_status']['sticky']) $threads['thread_status']['icon'] = $threads['thread_status']['sticky']; //if ($threads['thread_status']['lock']) $threads['thread_status']['icon'] = $threads['thread_status']['lock']; // Threads Customized Output /* $attach_image = 0; $attach_file = 0; $a_result = dbquery("SELECT attach_id, attach_mime FROM ".DB_FORUM_ATTACHMENTS." WHERE thread_id ='".$threads['thread_id']."'"); if (dbrows($a_result) > 0) { require_once INCLUDES."mimetypes_include.php"; while ($adata = dbarray($a_result)) { if (in_array($adata['attach_mime'], img_mimeTypes())) { $attach_image = $attach_image+1; } else { $attach_file = $attach_file+1; } } }*/ if ($threads['thread_sticky']) { $this->forum_info['threads']['sticky'][$threads['thread_id']] = $threads; } else { $this->forum_info['threads']['item'][$threads['thread_id']] = $threads; } } } if ($this->forum_info['thread_max_rows'] > $this->forum_info['threads_per_page']) { $this->forum_info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $this->forum_info['threads_per_page'], $this->forum_info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&", "thread_rowstart"); $this->forum_info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $this->forum_info['threads_per_page'], $this->forum_info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&", "thread_rowstart", TRUE); } } } } } else { redirect(INFUSIONS . 'forum/index.php'); } } else { $this->forum_info['forums'] = Functions::get_forum(); } } }
/** * Get the forum structure * * @param bool $forum_id * @param bool $branch_id * * @return array */ public static function get_forum($forum_id = FALSE, $branch_id = FALSE) { // only need to fetch child. $forum_settings = self::get_forum_settings(); $userdata = fusion_get_userdata(); $locale = fusion_get_locale("", FORUM_LOCALE); $index = array(); // define what a row is $row = array('forum_new_status' => '', 'last_post' => '', 'forum_icon' => '', 'forum_icon_lg' => '', 'forum_moderators' => '', 'forum_link' => array('link' => '', 'title' => ''), 'forum_description' => '', 'forum_postcount_word' => '', 'forum_threadcount_word' => ''); $query = dbquery("\n\t\t\t\tSELECT tf.forum_id, tf.forum_cat, tf.forum_branch, tf.forum_name, tf.forum_description, tf.forum_image,\n\t\t\t\ttf.forum_type, tf.forum_mods, tf.forum_threadcount, tf.forum_postcount, tf.forum_order, tf.forum_lastuser, tf.forum_access, tf.forum_lastpost, tf.forum_lastpostid,\n\t\t\t\tt.thread_id, t.thread_lastpost, t.thread_lastpostid, t.thread_subject, p.post_message,\n\t\t\t\tu.user_id, u.user_name, u.user_status, u.user_avatar\n\t\t\t\tFROM " . DB_FORUMS . " tf\n\t\t\t\tLEFT JOIN " . DB_FORUM_THREADS . " t ON tf.forum_lastpostid = t.thread_lastpostid\n\t\t\t\tLEFT JOIN " . DB_FORUM_POSTS . " p ON p.thread_id = t.thread_id AND p.post_id = t.thread_lastpostid\n\t\t\t\tLEFT JOIN " . DB_USERS . " u ON tf.forum_lastuser = u.user_id\n\t\t\t\t" . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . "\n\t\t\t\t" . ($forum_id && $branch_id ? "AND tf.forum_id = '" . intval($forum_id) . "' or tf.forum_cat = '" . intval($forum_id) . "' OR tf.forum_branch = '" . intval($branch_id) . "'" : '') . "\n\t\t\t\tGROUP BY tf.forum_id ORDER BY tf.forum_cat ASC, tf.forum_order ASC, t.thread_lastpost DESC\n\t\t"); while ($data = dbarray($query) and checkgroup($data['forum_access'])) { // Calculate Forum New Status $newStatus = ""; $forum_match = "\\|" . $data['forum_lastpost'] . "\\|" . $data['forum_id']; $last_visited = isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time(); if ($data['forum_lastpost'] > $last_visited) { if (iMEMBER && ($data['forum_lastuser'] !== $userdata['user_id'] || !preg_match("({$forum_match}\\.|{$forum_match}\$)", $userdata['user_threads']))) { $newStatus = "<span class='forum-new-icon'><i title='" . $locale['forum_0260'] . "' class='" . self::get_forumIcons('new') . "'></i></span>"; } } // Calculate lastpost information $lastPostInfo = array(); if ($data['forum_lastpostid']) { $last_post = array('avatar' => '', 'avatar_src' => $data['user_avatar'] && file_exists(IMAGES . 'avatars/' . $data['user_avatar']) && !is_dir(IMAGES . 'avatars/' . $data['user_avatar']) ? IMAGES . 'avatars/' . $data['user_avatar'] : '', 'message' => fusion_first_words(parseubb(parsesmileys($data['post_message'])), 10), 'profile_link' => profile_link($data['forum_lastuser'], $data['user_name'], $data['user_status']), 'time' => timer($data['forum_lastpost']), 'date' => showdate("forumdate", $data['forum_lastpost']), 'thread_link' => INFUSIONS . "forum/viewthread.php?forum_id=" . $data['forum_id'] . "&thread_id=" . $data['thread_id'], 'post_link' => INFUSIONS . "forum/viewthread.php?forum_id=" . $data['forum_id'] . "&thread_id=" . $data['thread_id'] . "&pid=" . $data['thread_lastpostid'] . "#post_" . $data['thread_lastpostid']); if ($forum_settings['forum_last_post_avatar']) { $last_post['avatar'] = display_avatar($data, '30px', '', '', 'img-rounded'); } $lastPostInfo = $last_post; } /** * Default system icons - why do i need this? Why not let themers decide? */ switch ($data['forum_type']) { case '1': $forum_icon = "<i class='" . self::get_forumIcons('forum') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . self::get_forumIcons('forum') . " fa-3x fa-fw m-r-10'></i>"; break; case '2': $forum_icon = "<i class='" . self::get_forumIcons('thread') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . self::get_forumIcons('thread') . " fa-3x fa-fw m-r-10'></i>"; break; case '3': $forum_icon = "<i class='" . self::get_forumIcons('link') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . self::get_forumIcons('link') . " fa-3x fa-fw m-r-10'></i>"; break; case '4': $forum_icon = "<i class='" . self::get_forumIcons('question') . " fa-fw m-r-10'></i>"; $forum_icon_lg = "<i class='" . self::get_forumIcons('question') . " fa-3x fa-fw m-r-10'></i>"; break; default: $forum_icon = ""; $forum_icon_lg = ""; } $mod = new Moderator(); $row = array_merge($row, $data, array("forum_moderators" => $mod::parse_forum_mods($data['forum_mods']), "forum_new_status" => $newStatus, "forum_link" => array("link" => INFUSIONS . "forum/index.php?viewforum&forum_id=" . $data['forum_id'] . "&parent_id=" . $data['forum_cat'], "title" => $data['forum_name']), "forum_description" => nl2br(parseubb($data['forum_description'])), "forum_postcount_word" => format_word($data['forum_postcount'], $locale['fmt_post']), "forum_threadcount_word" => format_word($data['forum_threadcount'], $locale['fmt_thread']), "last_post" => $lastPostInfo, "forum_icon" => $forum_icon, "forum_icon_lg" => $forum_icon_lg)); $data["forum_image"] = $data['forum_image'] && file_exists(FORUM . "images/" . $data['forum_image']) ? $data['forum_image'] : ""; $thisref =& $refs[$data['forum_id']]; $thisref = $row; if ($data['forum_cat'] == 0) { $index[0][$data['forum_id']] =& $thisref; } else { $refs[$data['forum_cat']]['child'][$data['forum_id']] =& $thisref; } } return (array) $index; }
/** Custom data formatter */ function parseInfo($data) { global $locale, $dl_settings; $download_image = ''; if ($data['download_image'] && $dl_settings['download_screenshot'] == "1") { $hiRes_image_path = get_download_image_path($data['download_image'], $data['download_image_thumb'], TRUE); $lowRes_image_path = get_download_image_path($data['download_image'], $data['download_image_thumb'], FALSE); $download_image = "<a href='" . INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'] . "'>" . thumbnail($lowRes_image_path, '100px') . "</a>"; } return array('download_anchor' => "<a name='download_" . $data['download_id'] . "' id='download_" . $data['download_id'] . "'></a>", 'download_description_short' => nl2br(parseubb(parsesmileys(html_entity_decode(stripslashes($data['download_description_short']))))), 'download_description' => nl2br(parseubb(parsesmileys(html_entity_decode(stripslashes($data['download_description']))))), 'download_link' => INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'], 'download_category_link' => "<a href='" . INFUSIONS . "downloads/downloads.php?cat_id=" . $data['download_cat'] . "'>" . $data['download_cat_name'] . "</a>\n", 'download_readmore_link' => "<a href='" . INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'] . "'>" . $locale['download_1006'] . "</a>\n", 'download_title' => stripslashes($data['download_title']), 'download_image' => $download_image, 'download_thumb' => get_download_image_path($data['download_image'], $data['download_image_thumb'], FALSE), "download_count" => format_word($data['download_count'], $locale['fmt_download']), "download_comments" => format_word($data['count_comment'], $locale['fmt_comment']), 'download_sum_rating' => format_word($data['sum_rating'], $locale['fmt_rating']), 'download_count_votes' => format_word($data['count_votes'], $locale['fmt_vote']), 'download_user_avatar' => display_avatar($data, '25px', '', TRUE, 'img-rounded'), 'download_user_link' => profile_link($data['user_id'], $data['user_name'], $data['user_status'], 'strong'), 'download_post_time' => showdate('shortdate', $data['download_datestamp']), 'download_post_time2' => $locale['global_049'] . " " . timer($data['download_datestamp']), 'download_file_link' => file_exists(DOWNLOADS . '/files/' . $data['download_file']) ? INFUSIONS . "downloads/downloads.php?file_id=" . $data['download_id'] : ''); }
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '" . INCLUDES . "captchas/securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='" . INCLUDES . "captchas/securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n"; echo $locale['SB_enter_validation_code'] . "<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n"; } echo form_button('post_shout', $locale['SB_shout'], $locale['SB_shout'], array('class' => 'btn-block btn-primary button', 'icon' => "entypo icomment")); echo closeform(); } else { echo "<div style='text-align:center'>" . $locale['SB_login_req'] . "</div><br />\n"; } $numrows = dbcount("(shout_id)", DB_SHOUTBOX, "shout_hidden='0'"); $result = dbquery("SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, tu.user_id, tu.user_name, tu.user_status, tu.user_avatar\r\n\tFROM " . DB_SHOUTBOX . " ts\r\n\tLEFT JOIN " . DB_USERS . " tu ON ts.shout_name=tu.user_id\r\n\t" . (multilang_table("SB") ? "WHERE shout_language='" . LANGUAGE . "' AND" : "WHERE") . " shout_hidden='0'\r\n\tORDER BY ts.shout_datestamp DESC LIMIT 0," . $shout_settings['visible_shouts']); if (dbrows($result)) { $i = 0; while ($data = dbarray($result)) { echo "<div class='display-block shoutboxwrapper clearfix' style='width:100%;'>\n"; echo "<div class='shoutboxavatar pull-left m-r-10 m-t-5'>\n"; echo display_avatar($data, '50px'); echo "</div>\n"; if (iADMIN && checkrights("S") || iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name'])) { echo "<div class='pull-right btn-group'>\n"; echo "<a class='btn btn-default btn-xs' title='" . $locale['SB_edit'] . "' href='" . $link . $sep . "s_action=edit&shout_id=" . $data['shout_id'] . "#edit_shout" . "' class='side'><i class='entypo pencil'></i></a>\n"; // echo "<a class='btn btn-default btn-xs' title='" . $locale['SB_delete'] . "' href='" . $link . $sep . "s_action=delete&shout_id=" . $data['shout_id'] . "' onclick=\"return confirm('" . $locale['SB_warning_shout'] . "');\" class='side'><i class='entypo trash'></i></a>\n"; // echo "</div>\n"; } echo "<div class='shoutboxname'>\n"; echo $data['user_name'] ? "<span class='side'>" . profile_link($data['shout_name'], $data['user_name'], $data['user_status']) . "</span>\n" : $data['shout_name'] . "\n"; echo "</div>\n"; echo "<div class='shoutboxdate'>" . timer($data['shout_datestamp']) . "</div>\n"; //".showdate("forumdate", $data['shout_datestamp'])."</div>"; echo "<div class='shoutbox'>" . sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color")) . "</div>\n";
} if (iMEMBER) { if (isset($_GET['aid'])) { opensidex($locale['UM096'] . $userdata['user_name'], "off"); } else { openside($locale['UM096'] . $userdata['user_name']); } $messages_count = dbquery("SELECT\n\tSUM(message_folder=0) AS inbox_count,\n\tSUM(message_folder=1) AS outbox_count,\n\tSUM(message_folder=2) AS archive_count,\n\tSUM(message_read=0 AND message_folder=0) AS unread_count\n\tFROM " . DB_MESSAGES . " \n\tWHERE message_to='" . $userdata['user_id'] . "'\n\t"); $messages_count = dbarray($messages_count); $inbox_count = (int) $messages_count['inbox_count']; $outbox_count = (int) $messages_count['outbox_count']; $archive_count = (int) $messages_count['archive_count']; $msg_count = (int) $messages_count['unread_count']; echo "<div class='clearfix'>\n"; echo "<div class='avatar-row text-center'>\n"; echo "<div class='pull-left m-r-10'>\n" . display_avatar($userdata, '90px') . "</div>\n"; echo "</div>\n"; echo "<h4 class='m-t-10 m-b-0'><strong>" . $userdata['user_name'] . "</strong></h4>\n"; echo "<small>" . getuserlevel($userdata['user_level']) . "</small>\n<br/>"; echo "</div>\n"; echo "<ul class='user-info-bar'>\n"; echo $msg_count ? "<li><a href='" . BASEDIR . "messages.php?folder=inbox' title='" . sprintf($locale['UM085'], $msg_count) . ($msg_count == 1 ? $locale['UM086'] : $locale['UM087']) . "' ><i class='entypo icomment'></i><label style='position:absolute; margin-left:-20px;' class='pointer label label-danger'>{$msg_count}</label></a>\n</li>\n" : ""; echo "</ul>\n"; $inbox_cfg = user_pm_settings($userdata['user_id'], "user_inbox"); $inbox_percent = $inbox_cfg > 1 ? number_format($inbox_count / $inbox_cfg * 99, 0) : number_format(0 * 99, 0); echo progress_bar($inbox_percent, $locale['UM098']); $outbox_cfg = user_pm_settings($userdata['user_id'], "user_outbox"); $outbox_percent = $outbox_cfg > 1 ? number_format($outbox_count / $outbox_cfg * 99, 0) : number_format(0 * 99, 0); echo progress_bar($outbox_percent, $locale['UM099']); $archive_cfg = user_pm_settings($userdata['user_id'], "user_archive"); $archive_percent = $archive_cfg > 1 ? number_format($archive_count / $archive_cfg * 99, 0) : number_format(0 * 99, 0);
} } echo "</div>\n"; echo "</td>\n</tr>\n</table>\n"; echo "<div style='text-align:center;margin-bottom:10px;'></div>\n"; if ($rows) { $i = 0; echo "<table cellpadding='0' cellspacing='1' class='table table-responsive tbl-border center'>\n<thead>\n<tr>\n"; echo "<th class='tbl2'><div class='pull-left m-r-10'><strong>" . $locale['401'] . "</strong></th>\n"; echo "<th align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['403'] . "</strong></th>\n"; echo "<th align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['404'] . "</strong></th>\n"; echo "</tr>\n</thead>\n<tbody>\n"; while ($data = dbarray($result)) { $cell_color = $i % 2 == 0 ? "tbl1" : "tbl2"; $title = ""; echo "<tr>\n<td class='{$cell_color}'><a href='" . FUSION_SELF . $aidlink . "&step=view&user_id=" . $data['user_id'] . "'><div class='pull-left m-r-10'>\n" . display_avatar($data, '50px') . "</div>\n " . $data['user_name'] . "</a></td>\n"; echo "<td align='center' width='1%' class='{$cell_color}' style='white-space:nowrap'>" . getuserlevel($data['user_level']) . "</td>\n"; echo "<td align='center' width='40%' class='{$cell_color}' style='white-space:nowrap'>"; $ban_link = FUSION_SELF . $aidlink . "&sortby={$sortby}&status={$status}&rowstart={$rowstart}&user_id=" . $data['user_id'] . "&action=1"; $suspend_link = FUSION_SELF . $aidlink . "&sortby={$sortby}&status={$status}&rowstart={$rowstart}&user_id=" . $data['user_id'] . "&action=3"; $cancel_link = FUSION_SELF . $aidlink . "&sortby={$sortby}&status={$status}&rowstart={$rowstart}&user_id=" . $data['user_id'] . "&action=5"; $anon_link = FUSION_SELF . $aidlink . "&sortby={$sortby}&status={$status}&rowstart={$rowstart}&user_id=" . $data['user_id'] . "&action=6"; $deac_link = FUSION_SELF . $aidlink . "&sortby={$sortby}&status={$status}&rowstart={$rowstart}&user_id=" . $data['user_id'] . "&action=7"; $inac_link = FUSION_SELF . $aidlink . "&sortby={$sortby}&status={$status}&rowstart={$rowstart}&user_id=" . $data['user_id'] . "&action=8"; echo "<div class='btn-group'>\n"; if (iSUPERADMIN || $data['user_level'] < 102) { echo "<a class='btn btn-primary' href='" . FUSION_SELF . $aidlink . "&step=edit&user_id=" . $data['user_id'] . "'>" . $locale['406'] . "</a>\n"; if ($status == 0) { echo "<a class='btn btn-primary' href='" . stripinput(USER_MANAGEMENT_SELF . "&action=3&user_id=" . $data['user_id']) . "'>" . $locale['553'] . "</a>\n"; } elseif ($status == 2) { $title = $locale['407'];
function render_admin_panel() { global $locale, $userdata, $defender, $pages, $aidlink, $admin; $languages = fusion_get_enabled_languages(); // Admin panel page echo "<div id='admin-panel' class='clearfix in'>\n"; // Top header section echo "<section id='acp-header' class='pull-left affix clearfix' data-offset-top='0' data-offset-bottom='0'>\n"; // Top left logo echo "<div class='brand'>\n"; echo "<div class='pull-right'>\n"; echo "</div>\n</div>\n"; // Top navigation echo "<nav>\n"; // Top side panel toggler echo "<ul class='venus-toggler'>\n"; echo "<li><a id='toggle-canvas' class='pointer' style='border-left:none;'><i class='fa fa-bars fa-lg'></i></a></li>\n"; echo "</ul>\n"; echo $admin->horiziontal_admin_nav(true); // Top right menu links echo "<ul class='top-right-menu pull-right m-r-15'>\n"; echo "<li class='dropdown'>\n"; echo "<a class='dropdown-toggle pointer' data-toggle='dropdown'>" . display_avatar($userdata, '25px', '', '', '') . " " . $locale['logged'] . "<strong>" . $userdata['user_name'] . "</strong> <span class='caret'></span>\n</a>\n"; echo "<ul class='dropdown-menu' role='menu'>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "edit_profile.php'>" . $locale['edit'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['view'] . " " . $locale['profile'] . "</a></li>\n"; echo "<li class='divider'> </li>\n"; echo "<li><a class='display-block' href='" . FUSION_REQUEST . "&logout'>" . $locale['admin-logout'] . "</a></li>\n"; echo "<li><a class='display-block' href='" . BASEDIR . "index.php?logout=yes'>" . $locale['logout'] . "</a></li>\n"; echo "</ul>\n"; echo "</li>\n"; echo "<li><a title='" . $locale['settings'] . "' href='" . ADMIN . "settings_main.php" . $aidlink . "'><i class='fa fa-cog fa-lg'></i></a></li>\n"; echo "<li><a title='" . fusion_get_settings('sitename') . "' href='" . BASEDIR . "index.php'><i class='fa fa-home fa-lg'></i></a>\n</li>\n"; echo "<li><a title='" . $locale['message'] . "' href='" . BASEDIR . "messages.php'><i class='fa fa-envelope-o fa-lg'></i></a>\n</li>\n"; if (count($languages) > 1) { echo "<li class='dropdown'><a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . $locale['282'] . "'><i class='fa fa-globe fa-lg fa-fw'></i> " . translate_lang_names(LANGUAGE) . "<span class='caret'></span></a>\n"; echo "<ul class='dropdown-menu'>\n"; foreach ($languages as $language_folder => $language_name) { echo "<li><a class='display-block' href='" . clean_request("lang=" . $language_folder, array("lang"), FALSE) . "'><img class='m-r-5' src='" . BASEDIR . "locale/{$language_folder}/{$language_folder}-s.png'> {$language_name}</a></li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; // .top-right-menu echo "</nav>\n"; echo "</section>\n"; // Content section echo "<div class='content-wrapper display-table pull-left'>\n"; // Left side panel echo "<div id='acp-left' class='pull-left affix' data-offset-top='0' data-offset-bottom='0'>\n"; // collapse to top menu on sm and xs echo "<div class='panel panel-default admin'><div class='panel-body clearfix'>\n"; echo "<div class='pull-left m-r-10'>\n" . display_avatar($userdata, '50px', '', '', '') . "</div>\n"; echo "<span class='overflow-hide m-t-10'><h4 class='m-b-0 text-stronger'>\n" . $userdata['user_name'] . "</h4>\n" . getuserlevel($userdata['user_level']) . "</span></div>\n"; echo "</div>\n"; echo $admin->vertical_admin_nav(); echo "</div>\n"; // #acp-left // Control panel content wrapper echo "<div id='acp-main' class='clearfix' style='vertical-align:top;'>\n"; // Main content wrapper echo "<div id='acp-content' class='m-t-20 col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; // Render breadcrumbs echo render_breadcrumbs(); // Get and render notices $notices = getNotices(); echo renderNotices($notices); // Render the content echo CONTENT; echo "</div>\n"; // #acp-content // Footer section echo "<footer class='m-l-20 display-inline-block m-t-20 m-b-20'>\n"; // Copyright echo "Venus Admin © " . date("Y") . " created by <a href='https://www.php-fusion.co.uk'><strong>PHP-Fusion Inc.</strong></a>\n"; echo showcopyright(); // Render time if (fusion_get_settings('rendertime_enabled')) { echo "<br /><br />"; // Make showing of queries and memory usage separate settings echo showrendertime(); echo showMemoryUsage(); } echo "</footer>\n"; echo "</div>\n"; // .acp-main echo "</div>\n"; // .content-wrapper echo "</div>\n"; // #admin-panel add_to_footer("<script src='" . THEMES . "admin_themes/Venus/includes/jquery.slimscroll.min.js'></script>"); if (!isset($_COOKIE['acp_sidemenu'])) { setcookie("acp_sidemenu", 1, 64800); } add_to_jquery("\n\t// Initialize slimscroll\n\t\$('#adl').slimScroll({\n\t\theight: null\n\t});\n\n\t// Function to toggle side menu\n\tfunction toggleSideMenu(state) {\n\t\tvar panel_state = null;\n\t\tif (state == 'show') {\n\t\t\t\$('#admin-panel').addClass('in');\n\t\t\tvar panel_state = 1;\n\t\t} else if (state == 'hide') {\n\t\t\t\$('#admin-panel').removeClass('in');\n\t\t\tvar panel_state = 0;\n\t\t} else {\n\t\t\t\$('#admin-panel').toggleClass('in');\n\t\t\tvar panel_state = \$('#admin-panel').hasClass('in');\n\t\t}\n\t\tif (panel_state) {\n\t\t\t\$.cookie('" . COOKIE_PREFIX . "acp_sidemenu', '1', {expires: 164800});\n\t\t} else {\n\t\t\t\$.cookie('" . COOKIE_PREFIX . "acp_sidemenu', '0', {expires: 164800});\n\t\t}\n\t}\n\n\t// Adjust side menu height on page load, resize or orientation change\n\t\$(window).on('load resize orientationchange', function(event) {\n\t\tvar init_hgt = \$(window).height();\n\t\tvar small = \$('.brand-text').is(':visible');\n\t\tvar panel_height = (small ? init_hgt-125 : init_hgt-80);\n\t\tvar hgt = \$(this).height();\n\t\t\$('#acp-left').css('height', hgt);\n\t\t\$('.admin-vertical-link').css('height', panel_height);\n\t\t// Hide side menu on orientation change\n\t\t//if (event.type === 'orientationchange') {\n\t\t//\ttoggleSideMenu('show');\n\t\t//}\n\t});\n\t// Side menu toggler\n\t\$('#toggle-canvas').on('click', toggleSideMenu);\n\t"); }
/** * Get thread structure when given specific tag id * @param string $tag_id * @param bool|FALSE $filter * @return array */ public static function get_tag_thread($tag_id = '0', $filter = FALSE) { $info = array(); $locale = fusion_get_locale("", FORUM_LOCALE); $forum_settings = ForumServer::get_forum_settings(); $userdata = fusion_get_userdata(); $userdata['user_id'] = !empty($userdata['user_id']) ? (int) intval($userdata['user_id']) : 0; $lastVisited = isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time(); /** * Get threads with filter conditions (XSS prevention) */ $thread_query = "\n SELECT\n count(t.thread_id) 'thread_max_rows',\n count(a1.attach_id) 'attach_image',\n count(a2.attach_id) 'attach_files'\n FROM " . DB_FORUM_THREADS . " t\n LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n #LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n #LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n WHERE " . in_group('t.thread_tags', intval($tag_id), '.') . " AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n GROUP BY tf.forum_id\n "; $thread_result = dbquery($thread_query); $thread_rows = dbrows($thread_result); $count = array("thread_max_rows" => 0, "attach_image" => 0, "attach_files" => 0); $info['item'][$tag_id]['forum_threadcount'] = 0; $info['item'][$tag_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']); if ($thread_rows > 0) { $count = dbarray($thread_result); $info['item'][$tag_id]['forum_threadcount'] = 0; $info['item'][$tag_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']); } $info['thread_max_rows'] = $count['thread_max_rows']; if ($info['thread_max_rows'] > 0) { $info['threads']['pagenav'] = ""; $info['threads']['pagenav2'] = ""; // anti-XSS filtered rowstart $_GET['thread_rowstart'] = isset($_GET['thread_rowstart']) && isnum($_GET['thread_rowstart']) && $_GET['thread_rowstart'] <= $count['thread_max_rows'] ? $_GET['thread_rowstart'] : 0; $thread_query = "\n SELECT t.*, tf.forum_type, tf.forum_name, tf.forum_cat,\n tu1.user_name ' author_name', tu1.user_status 'author_status', tu1.user_avatar 'author_avatar',\n tu2.user_name 'last_user_name', tu2.user_status 'last_user_status', tu2.user_avatar 'last_user_avatar',\n p1.post_datestamp, p1.post_message,\n IF (n.thread_id > 0, 1 , 0) 'user_tracked',\n count(v.vote_user) 'thread_rated',\n count(pv.forum_vote_user_id) 'poll_voted',\n p.forum_poll_title,\n count(v.post_id) AS vote_count,\n a1.attach_name, a1.attach_id,\n a2.attach_name, a2.attach_id,\n count(a1.attach_mime) 'attach_image',\n count(a2.attach_mime) 'attach_files',\n min(p2.post_datestamp) 'first_post_datestamp'\n FROM " . DB_FORUM_THREADS . " t\n LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n LEFT JOIN " . DB_FORUM_POSTS . " p2 ON p2.thread_id = t.thread_id\n LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n #LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n LEFT JOIN " . DB_FORUM_VOTES . " v on v.thread_id = t.thread_id AND v.vote_user='******'user_id'] . "' AND v.forum_id = t.forum_id AND tf.forum_type='4'\n LEFT JOIN " . DB_FORUM_POLL_VOTERS . " pv on pv.thread_id = t.thread_id AND pv.forum_vote_user_id='" . $userdata['user_id'] . "' AND t.thread_poll=1\n LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n LEFT JOIN " . DB_FORUM_THREAD_NOTIFY . " n on n.thread_id = t.thread_id and n.notify_user = '******'user_id'] . "'\n WHERE " . in_group('t.thread_tags', intval($tag_id), '.') . " AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n " . (multilang_table("FO") ? "AND tf.forum_language='" . LANGUAGE . "'" : '') . "\n GROUP BY t.thread_id\n " . (isset($filter['order']) ? $filter['order'] : '') . "\n LIMIT " . intval($_GET['thread_rowstart']) . ", " . $forum_settings['threads_per_page']; $cthread_result = dbquery($thread_query); if (dbrows($cthread_result) > 0) { while ($threads = dbarray($cthread_result)) { $icon = ""; $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id']; if ($threads['thread_lastpost'] > $lastVisited) { if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) { $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>"; } else { $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>"; } } $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']); $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']); $threads += array("thread_link" => array("link" => FORUM . "viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . self::get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . self::get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . self::get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . self::get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . self::get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . self::get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . self::get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['first_post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>")); if ($threads['thread_sticky']) { $info['threads']['sticky'][$threads['thread_id']] = $threads; } else { $info['threads']['item'][$threads['thread_id']] = $threads; } } } if ($info['thread_max_rows'] > $forum_settings['threads_per_page']) { $info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&", "thread_rowstart"); $info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&", "thread_rowstart", TRUE); } } return (array) $info; }
function showcomments($ctype, $cdb, $ccol, $cid, $clink) { global $settings, $locale, $userdata, $aidlink; $link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : ""); $link = preg_replace("^(&|\\?)c_action=(edit|delete)&comment_id=\\d*^", "", $link); $cpp = $settings['comments_per_page']; if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) { $result = dbquery("DELETE FROM " . DB_COMMENTS . "\r\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\r\n\t\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'")); } redirect($clink . ($settings['comments_sorting'] == "ASC" ? "" : "&c_start=0")); } if ($settings['comments_enabled'] == "1") { if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) { if (iMEMBER) { $comment_name = $userdata['user_id']; } elseif ($settings['guestposts'] == "1") { if (!isset($_POST['comment_name'])) { redirect($link); } $comment_name = trim(stripinput($_POST['comment_name'])); $comment_name = preg_replace("(^[+0-9\\s]*)", "", $comment_name); if (isnum($comment_name)) { $comment_name = ""; } $_CAPTCHA_IS_VALID = FALSE; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php"; if (!isset($_POST['captcha_code']) || $_CAPTCHA_IS_VALID == FALSE) { redirect($link); } } $comment_message = trim(stripinput(censorwords($_POST['comment_message']))); if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $comment_updated = FALSE; if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_name='" . $userdata['user_id'] . "'\r\n\t\t\t\t\t\tAND comment_hidden='0'")) { if ($comment_message) { $result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='" . $comment_message . "'\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\r\n\t\t\t\t\t\t\t\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'")); $comment_updated = TRUE; } } if ($comment_updated) { if ($settings['comments_sorting'] == "ASC") { $c_operator = "<="; } else { $c_operator = ">="; } $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_id" . $c_operator . "'" . $_GET['comment_id'] . "'\r\n\t\t\t\t\t\t\t\tAND comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\t\tAND comment_type='" . $ctype . "'"); $c_start = (ceil($c_count / $cpp) - 1) * $cpp; } redirect($clink . "&c_start=" . (isset($c_start) && isnum($c_start) ? $c_start : "")); } else { if (!dbcount("(" . $ccol . ")", $cdb, $ccol . "='" . $cid . "'")) { redirect(BASEDIR . "index.php"); } if ($comment_name && $comment_message) { require_once INCLUDES . "flood_include.php"; if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) { $result = dbquery("INSERT INTO " . DB_COMMENTS . " (\r\n\t\t\t\t\t\t\t\tcomment_item_id, comment_type, comment_name, comment_message, comment_datestamp,\r\n\t\t\t\t\t\t\t\tcomment_ip, comment_ip_type, comment_hidden\r\n\t\t\t\t\t\t\t) VALUES (\r\n\t\t\t\t\t\t\t\t'" . $cid . "', '" . $ctype . "', '" . $comment_name . "', '" . $comment_message . "', '" . time() . "',\r\n\t\t\t\t\t\t\t\t'" . USER_IP . "', '" . USER_IP_TYPE . "', '0'\r\n\t\t\t\t\t\t\t)"); } } if ($settings['comments_sorting'] == "ASC") { $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\t\t\t\tAND comment_type='" . $ctype . "'"); $c_start = (ceil($c_count / $cpp) - 1) * $cpp; } else { $c_start = 0; } redirect($clink . "&c_start=" . $c_start); } } $c_arr = array("c_con" => array(), "c_info" => array("c_makepagenav" => FALSE, "admin_link" => FALSE)); $c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_hidden='0'"); if (!isset($_GET['c_start']) && $c_rows > $cpp) { $_GET['c_start'] = (ceil($c_rows / $cpp) - 1) * $cpp; } if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) { $_GET['c_start'] = 0; } $result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp,\r\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\r\n\t\t\tFROM " . DB_COMMENTS . " tcm\r\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\tWHERE comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "' AND comment_hidden='0'\r\n\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp); if (dbrows($result)) { $i = $settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start']; if ($c_rows > $cpp) { $c_arr['c_info']['c_makepagenav'] = makepagenav($_GET['c_start'], $cpp, $c_rows, 3, $clink . "&", "c_start"); } while ($data = dbarray($result)) { $c_arr['c_con'][$i]['comment_id'] = $data['comment_id']; $c_arr['c_con'][$i]['edit_dell'] = FALSE; $c_arr['c_con'][$i]['i'] = $i; if ($data['user_name']) { $c_arr['c_con'][$i]['comment_name'] = profile_link($data['comment_name'], $data['user_name'], $data['user_status']); } else { $c_arr['c_con'][$i]['comment_name'] = $data['comment_name']; } //Add user avatar in comments new feature in v7.02.04 $c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '80px'); $c_arr['c_con'][$i]['comment_datestamp'] = $locale['global_071'] . showdate("longdate", $data['comment_datestamp']); $c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message']))); if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) { $c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<a href='" . FUSION_REQUEST . "&c_action=edit&comment_id=" . $data['comment_id'] . "#edit_comment'>"; $c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a> |\n"; $c_arr['c_con'][$i]['edit_dell'] .= "<a href='" . FUSION_REQUEST . "&c_action=delete&comment_id=" . $data['comment_id'] . "' onclick=\"return confirm('" . $locale['c110'] . "');\">"; $c_arr['c_con'][$i]['edit_dell'] .= $locale['c109'] . "</a>"; } $settings['comments_sorting'] == "ASC" ? $i++ : $i--; } if (iADMIN && checkrights("C")) { $c_arr['c_info']['admin_link'] = "<!--comment_admin-->\n"; $c_arr['c_info']['admin_link'] .= "<a href='" . ADMIN . "comments.php" . $aidlink . "&ctype=" . $ctype . "&cid=" . $cid . "'>" . $locale['c106'] . "</a>"; } } // Render comments echo "<a id='comments' name='comments'></a>"; render_comments($c_arr['c_con'], $c_arr['c_info']); // Add / edit comment opentable($locale['c102']); if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) { $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name\r\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\r\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "'\r\n\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_hidden='0'"); if (dbrows($eresult)) { $edata = dbarray($eresult); if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) { $clink .= "&c_action=edit&comment_id=" . $edata['comment_id']; $comment_message = $edata['comment_message']; } } else { $comment_message = ""; } } else { $comment_message = ""; } if (iMEMBER || $settings['guestposts'] == "1") { require_once INCLUDES . "bbcode_include.php"; echo "<a id='edit_comment' name='edit_comment'></a>\n"; echo openform('inputform', 'inputform', 'post', $clink); if (iGUEST) { echo "<div align='center' class='tbl'>\n" . $locale['c104'] . "<br />\n"; echo "<input type='text' name='comment_name' maxlength='30' class='textbox' style='width:360px' />\n"; echo "</div>\n"; } echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n"; echo form_textarea('', 'comment_message', 'comment_message', $comment_message, array('required' => 1)); echo display_bbcodes("360px", "comment_message"); if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) { $_CAPTCHA_HIDE_INPUT = FALSE; echo "<div style='width:360px; margin:10px auto;'>"; echo $locale['global_150'] . "<br />\n"; include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php"; if (!$_CAPTCHA_HIDE_INPUT) { echo "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>"; echo "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n"; } echo "</div>\n"; } echo form_button($comment_message ? $locale['c103'] : $locale['c102'], 'post_comment', 'post_comment', $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn btn-primary m-t-10')); echo "</div>\n</div>\n"; echo closeform(); } else { echo $locale['c105'] . "\n"; } closetable(); } }
} $result = dbquery("DELETE FROM " . DB_SUBMISSIONS . " WHERE submit_id='" . intval($callback_data['submit_id']) . "'"); addNotice("success", $locale['download_0062']); } redirect(clean_request("", array("submit_id"), FALSE)); } else { $result = dbquery("SELECT ts.submit_id,\n\t\t\tts.submit_datestamp, ts.submit_criteria, tu.user_id, tu.user_name, tu.user_avatar, tu.user_status\n\t\t\tFROM " . DB_SUBMISSIONS . " ts\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ts.submit_user=tu.user_id\n\t\t\tWHERE submit_type='d' order by submit_datestamp desc"); if (dbrows($result) > 0) { $data = dbarray($result); $submit_criteria = unserialize($data['submit_criteria']); $callback_data = array("download_title" => $submit_criteria['download_title'], "download_keywords" => $submit_criteria['download_keywords'], "download_description" => $submit_criteria['download_description'], "download_description_short" => $submit_criteria['download_description_short'], "download_cat" => $submit_criteria['download_cat'], "download_homepage" => $submit_criteria['download_homepage'], "download_license" => $submit_criteria['download_license'], "download_copyright" => $submit_criteria['download_copyright'], "download_os" => $submit_criteria['download_os'], "download_version" => $submit_criteria['download_version'], "download_file" => $submit_criteria['download_file'], "download_url" => $submit_criteria['download_url'], "download_filesize" => $submit_criteria['download_file'] ? $submit_criteria['download_filesize'] : 0, "download_image" => $submit_criteria['download_image'], "download_image_thumb" => $submit_criteria['download_image_thumb'], "download_id" => 0, "download_allow_comments" => TRUE, "download_allow_ratings" => TRUE, "download_visibility" => iGUEST, "download_datestamp" => $data['submit_datestamp']); add_to_title($locale['global_200'] . $locale['503'] . $locale['global_201'] . $callback_data['download_title'] . "?"); echo openform("publish_download", "post", FUSION_REQUEST); echo "<div class='well clearfix'>\n"; echo "<div class='pull-left'>\n"; echo display_avatar($callback_data, "30px", "", "", ""); echo "</div>\n"; echo "<div class='overflow-hide'>\n"; echo $locale['download_0056'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br/>\n"; echo $locale['download_0057'] . timer($data['submit_datestamp']) . " - " . showdate("shortdate", $data['submit_datestamp']); echo "</div>\n"; echo "</div>\n"; echo "<div class='row'>\n"; echo "<div class='col-xs-12 col-sm-8'>\n"; openside(''); echo form_hidden('submit_id', '', $data['submit_id']); echo form_hidden('download_datestamp', '', $callback_data['download_datestamp']); echo form_text('download_title', $locale['download_0200'], $callback_data['download_title'], array('required' => TRUE, "inline" => TRUE, 'error_text' => $locale['download_0110'])); echo form_select('download_keywords', $locale['download_0203'], $callback_data['download_keywords'], array("placeholder" => $locale['download_0203a'], 'max_length' => 320, "inline" => TRUE, 'width' => '100%', 'tags' => 1, 'multiple' => 1)); echo form_textarea('download_description_short', $locale['download_0202'], $callback_data['download_description_short'], array('required' => TRUE, "inline" => TRUE, 'error_text' => $locale['download_0112'], 'maxlength' => '255', 'autosize' => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE)); closeside();
function render_dashboard() { global $members, $forum, $download, $news, $articles, $weblinks, $photos, $global_comments, $global_ratings, $global_submissions, $link_type, $submit_type, $comments_type, $locale, $aidlink, $settings, $infusions_count; $mobile = '12'; $tablet = '12'; $laptop = '6'; $desktop = '3'; opentable($locale['250']); echo "<!--Start Members-->\n"; echo "<div class='row'>\n"; echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside(); echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n"; echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['registered']) . "</h4>"; echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['251'] . "</strong></span>\n"; closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "'>" . $locale['255'] . "</a><i class='entypo right-open-mini'></i></div>\n" : '') . ""); echo "</div>\n<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside(); echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n"; echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['cancelled']) . "</h4>"; echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['263'] . "</strong></span>\n"; closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "&status=5'>" . $locale['255'] . "</a> <i class='entypo right-open-mini'></i></div>\n" : '') . ""); echo "</div>\n<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside(); echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n"; echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['unactivated']) . "</h4>"; echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['252'] . "</strong></span>\n"; closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "&status=2'>" . $locale['255'] . "</a> <i class='entypo right-open-mini'></i></div>\n" : '') . ""); echo "</div>\n<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside(); echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n"; echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['security_ban']) . "</h4>"; echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['253'] . "</strong></span>\n"; closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'><a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "&status=4'>" . $locale['255'] . "</a> <i class='entypo right-open-mini'></i></div>\n" : '') . ""); echo "</div>\n</div>\n"; echo "<!--End Members-->\n"; $mobile = '12'; $tablet = '12'; $laptop = '6'; $desktop = '4'; echo "<div class='row'>\n"; if (db_exists(DB_FORUMS)) { echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside("", "well"); echo "<span class='text-smaller text-uppercase'><strong>" . $locale['265'] . " " . $locale['258'] . "</strong></span>\n<br/>\n"; echo "<div class='clearfix m-t-10'>\n"; echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_F") . "'/>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['265'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($forum['count']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['256'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($forum['thread']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['259'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($forum['post']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['260'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . $forum['users'] . "</h4>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo "</div>\n"; } if (db_exists(DB_DOWNLOADS)) { echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside("", "well"); echo "<span class='text-smaller text-uppercase'><strong>" . $locale['268'] . " " . $locale['258'] . "</strong></span>\n<br/>\n"; echo "<div class='clearfix m-t-10'>\n"; echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_D") . "'/>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['268'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($download['download']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($download['comment']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($download['submit']) . "</h4>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo "</div>\n"; } if (db_exists(DB_NEWS)) { echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside("", "well"); echo "<span class='text-smaller text-uppercase'><strong>" . $locale['269'] . " " . $locale['258'] . "</strong></span>\n<br/>\n"; echo "<div class='clearfix m-t-10'>\n"; echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_N") . "'/>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['269'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($news['news']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($news['comment']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($news['submit']) . "</h4>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo "</div>\n"; } if (db_exists(DB_ARTICLES)) { echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside("", "well"); echo "<span class='text-smaller text-uppercase'><strong>" . $locale['270'] . " " . $locale['258'] . "</strong></span>\n<br/>\n"; echo "<div class='clearfix m-t-10'>\n"; echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_A") . "'/>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['270'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($articles['article']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($articles['comment']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($articles['submit']) . "</h4>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo "</div>\n"; } if (db_exists(DB_WEBLINKS)) { echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside("", "well"); echo "<span class='text-smaller text-uppercase'><strong>" . $locale['271'] . " " . $locale['258'] . "</strong></span>\n<br/>\n"; echo "<div class='clearfix m-t-10'>\n"; echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_W") . "'/>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['271'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($weblinks['weblink']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($weblinks['comment']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($weblinks['submit']) . "</h4>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo "</div>"; } if (db_exists(DB_PHOTOS)) { echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n"; openside("", "well"); echo "<span class='text-smaller text-uppercase'><strong>" . $locale['272'] . " " . $locale['258'] . "</strong></span>\n<br/>\n"; echo "<div class='clearfix m-t-10'>\n"; echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_PH") . "'/>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['272'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($photos['photo']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($photos['comment']) . "</h4>\n"; echo "</div>\n"; echo "<div class='pull-left display-inline-block m-r-10'>\n"; echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n"; echo "<h4 class='m-t-0'>" . number_format($photos['submit']) . "</h4>\n"; echo "</div>\n"; echo "</div>\n"; closeside(); echo "</div>\n"; } echo "</div>\n"; echo "<div class='row'>\n"; echo "<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n"; openside("<span class='text-smaller text-uppercase'><strong>" . $locale['283'] . "</strong></span><span class='pull-right badge'>" . number_format($infusions_count) . "</span>"); if ($infusions_count > 0) { global $global_infusions; echo "<div class='comment_content'>\n"; if (!empty($global_infusions)) { foreach ($global_infusions as $inf_id => $inf_data) { echo "<span class='badge m-b-10'>" . $inf_data['inf_title'] . "</span>\n"; } } echo "</div>\n"; closeside("" . (checkrights("I") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "infusions.php" . $aidlink . "'>" . $locale['285'] . "</a><i class='entypo right-open-mini'></i></div>\n" : '') . ""); } else { echo "<div class='text-center'>" . $locale['284'] . "</div>\n"; closeside(); } // comments echo "</div>\n<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n"; openside("<span class='text-smaller text-uppercase'><strong>" . $locale['277'] . "</strong></span><span class='pull-right badge'>" . number_format($global_comments['rows']) . "</span>"); if (count($global_comments['data']) > 0) { foreach ($global_comments['data'] as $i => $comment_data) { echo "<!--Start Comment Item-->\n"; echo "<div data-id='{$i}' class='comment_content clearfix p-t-10 p-b-10' " . ($i > 0 ? "style='border-top:1px solid #ddd;'" : '') . " >\n"; echo "<div class='pull-left display-inline-block' style='margin-top:0px; margin-bottom:10px;'>" . display_avatar($comment_data, "25px", "", FALSE, "", "") . "</div>\n"; echo "<div id='comment_action-{$i}' class='btn-group pull-right display-none' style='position:absolute; right: 30px; margin-top:25px;'>\n\n\t\t\t\t<a class='btn btn-xs btn-default' title='" . $locale['274'] . "' href='" . ADMIN . "comments.php" . $aidlink . "&ctype=" . $comment_data['comment_type'] . "&comment_item_id=" . $comment_data['comment_item_id'] . "'><i class='entypo eye'></i></a>\n\t\t\t\t<a class='btn btn-xs btn-default' title='" . $locale['275'] . "' href='" . ADMIN . "comments.php" . $aidlink . "&action=edit&comment_id=" . $comment_data['comment_id'] . "&ctype=" . $comment_data['comment_type'] . "&comment_item_id=" . $comment_data['comment_item_id'] . "'><i class='entypo pencil'></i></a>\n\t\t\t\t<a class='btn btn-xs btn-default' title='" . $locale['276'] . "' href='" . ADMIN . "comments.php" . $aidlink . "&action=delete&comment_id=" . $comment_data['comment_id'] . "&ctype=" . $comment_data['comment_type'] . "&comment_item_id=" . $comment_data['comment_item_id'] . "'><i class='entypo trash'></i></a></div>\n"; echo "<strong>" . profile_link($comment_data['user_id'], $comment_data['user_name'], $comment_data['user_status']) . "</strong>\n"; echo "<span class='text-lighter'>" . $locale['273'] . "</span> <a href='" . sprintf($link_type[$comment_data['comment_type']], $comment_data['comment_item_id']) . "'><strong>" . $comments_type[$comment_data['comment_type']] . "</strong></a>"; echo "<br/>\n" . timer($comment_data['comment_datestamp']) . "<br/>\n"; echo "<span class='text-smaller text-lighter'>" . trimlink(parseubb($comment_data['comment_message']), 70) . "</span>\n"; echo "</div>\n"; echo "<!--End Comment Item-->\n"; } if (isset($global_comments['comments_nav'])) { echo "<div class='clearfix'>\n"; echo "<span class='pull-right text-smaller'>" . $global_comments['comments_nav'] . "</span>"; echo "</div>\n"; } } else { echo "<div class='text-center'>" . $global_comments['nodata'] . "</div>\n"; } closeside(); echo "</div>\n<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n"; // Ratings openside("<span class='text-smaller text-uppercase'><strong>" . $locale['278'] . "</strong></span>"); if (count($global_ratings['data']) > 0) { foreach ($global_ratings['data'] as $i => $ratings_data) { echo "<!--Start Rating Item-->\n"; echo "<div class='comment_content clearfix p-t-10 p-b-10' " . ($i > 0 ? "style='border-top:1px solid #ddd;'" : '') . " >\n"; echo "<div class='pull-left display-inline-block' style='margin-top:0px; margin-bottom:10px;'>" . display_avatar($ratings_data, "25px", "", FALSE, "", "") . "</div>\n"; echo "<strong>" . profile_link($ratings_data['user_id'], $ratings_data['user_name'], $ratings_data['user_status']) . "</strong>\n"; echo "<span class='text-lighter'>" . $locale['273a'] . "</span>\n"; echo "<a href='" . sprintf($link_type[$ratings_data['rating_type']], $ratings_data['rating_item_id']) . "'><strong>" . $comments_type[$ratings_data['rating_type']] . "</strong></a>"; echo "<span class='text-lighter m-l-10'>" . str_repeat("<i class='fa fa-star fa-fw'></i>", $ratings_data['rating_vote']) . "</span>\n<br/>"; echo timer($ratings_data['rating_datestamp']) . "<br/>\n"; echo "</div>\n"; echo "<!--End Rating Item-->\n"; } if (isset($global_ratings['ratings_nav'])) { echo "<div class='clearfix'>\n"; echo "<span class='pull-right text-smaller'>" . $global_ratings['ratings_nav'] . "</span>"; echo "</div>\n"; } } else { echo "<div class='text-center'>" . $global_ratings['nodata'] . "</div>\n"; } closeside(); echo "</div>\n<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n"; openside("<span class='text-smaller text-uppercase'><strong>" . $locale['279'] . "</strong></span><span class='pull-right badge'>" . number_format($global_submissions['rows']) . "</span>"); if (count($global_submissions['data']) > 0) { foreach ($global_submissions['data'] as $i => $submit_data) { switch ($submit_data['submit_type']) { case "n": $review_link = INFUSIONS . "news/news_admin.php" . $aidlink . "&section=submissions&submit_id=" . $submit_data['submit_id']; break; case "a": $review_link = INFUSIONS . "articles/articles_admin.php" . $aidlink . "&section=submissions&submit_id=" . $submit_data['submit_id']; break; case "p": $review_link = INFUSIONS . "gallery/gallery_admin.php" . $aidlink . "&section=submissions&submit_id=" . $submit_data['submit_id']; break; case "b": $review_link = INFUSIONS . "blog/blog_admin.php" . $aidlink . "&section=submissions&submit_id=" . $submit_data['submit_id']; break; case "d": $review_link = INFUSIONS . "downloads/downloads_admin.php" . $aidlink . "&section=submissions&submit_id=" . $submit_data['submit_id']; break; case "l": $review_link = INFUSIONS . "weblinks/weblinks_admin.php" . $aidlink . "&section=submissions&submit_id=" . $submit_data['submit_id']; break; default: // @todo: add admin class API to use infusion_db.php to register submission link $review_link = ""; } echo "<!--Start Submissions Item-->\n"; echo "<div data-id='{$i}' class='submission_content clearfix p-t-10 p-b-10' " . ($i > 0 ? "style='border-top:1px solid #ddd;'" : '') . " >\n"; echo "<div class='pull-left display-inline-block' style='margin-top:0px; margin-bottom:10px;'>" . display_avatar($submit_data, "25px", "", FALSE, "", "") . "</div>\n"; echo "<strong>" . profile_link($submit_data['user_id'], $submit_data['user_name'], $submit_data['user_status']) . "</strong>\n"; echo "<span class='text-lighter'>" . $locale['273b'] . " <strong>" . $submit_type[$submit_data['submit_type']] . "</strong></span><br/>\n"; echo timer($submit_data['submit_datestamp']) . "<br/>\n"; if (!empty($review_link)) { echo "<a class='btn btn-xs btn-default m-t-5' title='" . $locale['286'] . "' href='" . $review_link . "'>" . $locale['286'] . "</a>\n"; } echo "</div>\n"; echo "<!--End Submissions Item-->\n"; } if (isset($global_submissions['submissions_nav'])) { echo "<div class='clearfix'>\n"; echo "<span class='pull-right text-smaller'>" . $global_submissions['submissions_nav'] . "</span>"; echo "</div>\n"; } } else { echo "<div class='text-center'>" . $global_submissions['nodata'] . "</div>\n"; } closeside(); echo "</div>\n"; closetable(); add_to_jquery("\n\t\$('.comment_content').hover(function() {\n\t\$('#comment_action-'+\$(this).data('id')).removeClass('display-none');\n\t},function(){\n\t\$('#comment_action-'+\$(this).data('id')).addClass('display-none');\n\t});\n\t\$('.submission_content').hover(function() {\n\t\$('#submission_action-'+\$(this).data('id')).removeClass('display-none');\n\t},function(){\n\t\$('#submission_action-'+\$(this).data('id')).addClass('display-none');\n\t});\n\t"); }
// Start Item based on $result and $info['blog_rows'] if ($info['blog_max_rows'] > $blog_settings['blog_pagination'] && (!isset($_GET['readmore']) || !isnum($_GET['readmore']))) { $info['blog_nav'] = makepagenav($_GET['rowstart'], $blog_settings['blog_pagination'], $info['blog_max_rows'], 3); } if (!empty($info['blog_rows'])) { while ($data = dbarray($result)) { // remove category image binding on item. each item is capable of housing hundreds of category. $blog_image = "<a href='" . INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'] . "'>" . thumbnail(INFUSIONS . "blog/images/blog_default.jpg", '150px') . "</a>"; if ($data['blog_image']) { $hiRes_image_path = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2'], TRUE); $lowRes_image_path = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2'], FALSE); $blog_image = "<a href='" . INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'] . "'>" . thumbnail($lowRes_image_path, '150px') . "</a>"; } $blog_blog = parse_textarea($data['blog_blog']); $blog_extended = parse_textarea($data['blog_extended']); $cdata = array('blog_ialign' => $data['blog_ialign'] == 'center' ? 'clearfix' : $data['blog_ialign'], 'blog_anchor' => "<a name='blog_" . $data['blog_id'] . "' id='blog_" . $data['blog_id'] . "'></a>", 'blog_blog' => preg_replace("/<!?--\\s*pagebreak\\s*-->/i", "", $data['blog_breaks'] == "y" ? nl2br($blog_blog) : $blog_blog), 'blog_extended' => preg_replace("/<!?--\\s*pagebreak\\s*-->/i", "", $data['blog_breaks'] == "y" ? nl2br($blog_extended) : $blog_extended), 'blog_link' => INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'], 'blog_category_link' => "", 'blog_readmore_link' => "<a href='" . INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'] . "'>" . $locale['blog_1006'] . "</a>\n", 'blog_subject' => stripslashes($data['blog_subject']), 'blog_image' => $blog_image, 'blog_thumb' => get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2'], FALSE), "blog_reads" => format_word($data['blog_reads'], $locale['fmt_read']), "blog_comments" => format_word($data['count_comment'], $locale['fmt_comment']), 'blog_sum_rating' => format_word($data['sum_rating'], $locale['fmt_rating']), 'blog_count_votes' => format_word($data['count_votes'], $locale['fmt_vote']), 'blog_user_avatar' => display_avatar($data, '35px', '', TRUE, 'img-rounded'), 'blog_user_link' => profile_link($data['user_id'], $data['user_name'], $data['user_status'], 'strong')); // refetch category per item and parse as string if (!empty($data['blog_cat'])) { $blog_cat = str_replace(".", ",", $data['blog_cat']); $result2 = dbquery("SELECT blog_cat_id, blog_cat_name from " . DB_BLOG_CATS . " WHERE blog_cat_id in ({$blog_cat})"); $rows2 = dbrows($result2); if ($rows2 > 0) { $i = 1; while ($catData = dbarray($result2)) { $cdata['blog_category_link'] .= "<a href='" . INFUSIONS . "blog/blog.php?cat_id=" . $catData['blog_cat_id'] . "'>" . $catData['blog_cat_name'] . "</a>"; $cdata['blog_category_link'] .= $i == $rows2 ? "" : ", "; $i++; } } } $data = array_merge($data, $cdata);
public function render_reply_form() { global $locale, $userdata, $forum_settings, $defender; $thread_data = $this->thread_info['thread']; if ((!iMOD or !iSUPERADMIN) && $thread_data['thread_locked']) { redirect(INFUSIONS . 'forum/index.php'); } if ($this->getThreadPermission("can_reply")) { add_to_title($locale['global_201'] . $locale['forum_0503']); add_breadcrumb(array('link' => '', 'title' => $locale['forum_0503'])); // field data $post_data = array('post_id' => 0, 'forum_id' => $this->thread_info['thread']['forum_id'], 'thread_id' => $this->thread_info['thread']['thread_id'], 'post_message' => isset($_POST['post_message']) ? form_sanitizer($_POST['post_message'], '', 'post_message') : '', 'post_showsig' => isset($_POST['post_showsig']) ? 1 : 0, 'post_smileys' => isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? 1 : 0, 'post_author' => $userdata['user_id'], 'post_datestamp' => time(), 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => 0, 'post_edittime' => 0, 'post_editreason' => '', 'post_hidden' => 0, 'notify_me' => 0, 'post_locked' => $forum_settings['forum_edit_lock'] || isset($_POST['post_locked']) ? 1 : 0); // execute form post actions if (isset($_POST['post_reply'])) { require_once INCLUDES . "flood_include.php"; // all data is sanitized here. if (!flood_control("post_datestamp", DB_FORUM_POSTS, "post_author='" . $userdata['user_id'] . "'")) { // have notice $update_forum_lastpost = FALSE; if ($defender->safe()) { // Prepare forum merging action $last_post_author = dbarray(dbquery("SELECT post_author FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC LIMIT 1")); if ($last_post_author['post_author'] == $post_data['post_author'] && $thread_data['forum_merge']) { $last_message = dbarray(dbquery("SELECT post_id, post_message FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC")); $post_data['post_id'] = $last_message['post_id']; $post_data['post_message'] = $last_message['post_message'] . "\n\n" . $locale['forum_0640'] . " " . showdate("longdate", time()) . ":\n" . $post_data['post_message']; dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE)); } else { $update_forum_lastpost = TRUE; dbquery_insert(DB_FORUM_POSTS, $post_data, 'save', array('primary_key' => 'post_id', 'keep_session' => TRUE)); $post_data['post_id'] = dblastid(); if (!defined("FUSION_NULL")) { dbquery("UPDATE " . DB_USERS . " SET user_posts=user_posts+1 WHERE user_id='" . $post_data['post_author'] . "'"); } } // Attach files if permitted if (!empty($_FILES) && is_uploaded_file($_FILES['file_attachments']['tmp_name'][0]) && $this->getThreadPermission("can_upload_attach")) { $upload = form_sanitizer($_FILES['file_attachments'], '', 'file_attachments'); if ($upload['error'] == 0) { foreach ($upload['target_file'] as $arr => $file_name) { $adata = array('thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], 'attach_name' => $file_name, 'attach_mime' => $upload['type'][$arr], 'attach_size' => $upload['source_size'][$arr], 'attach_count' => 0); dbquery_insert(DB_FORUM_ATTACHMENTS, $adata, "save", array('keep_session' => TRUE)); } } } // Update stats in forum and threads if ($update_forum_lastpost == TRUE) { // find all parents and update them $list_of_forums = get_all_parent(dbquery_tree(DB_FORUMS, 'forum_id', 'forum_cat'), $thread_data['forum_id']); foreach ($list_of_forums as $fid) { dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . time() . "', forum_postcount=forum_postcount+1, forum_lastpostid='" . $post_data['post_id'] . "', forum_lastuser='******'post_author'] . "' WHERE forum_id='" . $fid . "'"); } // update current forum dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . time() . "', forum_postcount=forum_postcount+1, forum_lastpostid='" . $post_data['post_id'] . "', forum_lastuser='******'post_author'] . "' WHERE forum_id='" . $thread_data['forum_id'] . "'"); // update current thread dbquery("UPDATE " . DB_FORUM_THREADS . " SET thread_lastpost='" . time() . "', thread_lastpostid='" . $post_data['post_id'] . "', thread_postcount=thread_postcount+1, thread_lastuser='******'post_author'] . "' WHERE thread_id='" . $thread_data['thread_id'] . "'"); } if ($forum_settings['thread_notify'] && isset($_POST['notify_me'])) { if (!dbcount("(thread_id)", DB_FORUM_THREAD_NOTIFY, "thread_id='" . $thread_data['thread_id'] . "' AND notify_user='******'post_author'] . "'")) { dbquery("INSERT INTO " . DB_FORUM_THREAD_NOTIFY . " (thread_id, notify_datestamp, notify_user, notify_status) VALUES('" . $thread_data['thread_id'] . "', '" . time() . "', '" . $post_data['post_author'] . "', '1')"); } } if ($defender->safe()) { redirect(INFUSIONS . "forum/postify.php?post=reply&error=0&forum_id=" . intval($post_data['forum_id']) . "&thread_id=" . intval($post_data['thread_id']) . "&post_id=" . intval($post_data['post_id'])); } } } } // template data $form_action = INFUSIONS . "forum/viewthread.php?action=reply&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id']; // Quote Get if (isset($_GET['quote']) && isnum($_GET['quote'])) { $quote_result = dbquery("SELECT a.post_message, b.user_name\n\t\t\t\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . " a\n\t\t\t\t\t\t\t\t\t\tINNER JOIN " . DB_USERS . " b ON a.post_author=b.user_id\n\t\t\t\t\t\t\t\t\t\tWHERE thread_id='" . $thread_data['thread_id'] . "' and post_id='" . $_GET['quote'] . "'"); if (dbrows($quote_result) > 0) { $quote_data = dbarray($quote_result); // do not do this. to silently inject. $post_data['post_message'] = "[quote name=" . $quote_data['user_name'] . " post=" . $_GET['quote'] . "]@" . $quote_data['user_name'] . " - " . strip_bbcodes($quote_data['post_message']) . "[/quote]" . $post_data['post_message']; $form_action .= "&post_id=" . $_GET['post_id'] . "&quote=" . $_GET['quote']; } else { redirect(INFUSIONS . "forum/index.php"); } } $info = array('title' => $locale['forum_0503'], 'description' => $locale['forum_2000'] . $thread_data['thread_subject'], 'openform' => openform('input_form', 'post', $form_action, array('enctype' => $this->getThreadPermission("can_upload_attach") ? TRUE : FALSE, 'max_tokens' => 1)), 'closeform' => closeform(), 'forum_id_field' => form_hidden('forum_id', "", $post_data['forum_id']), 'thread_id_field' => form_hidden('thread_id', "", $post_data['thread_id']), "forum_field" => "", 'subject_field' => form_hidden('thread_subject', "", $thread_data['thread_subject']), 'message_field' => form_textarea('post_message', $locale['forum_0601'], $post_data['post_message'], array('required' => TRUE, 'error_text' => '', 'autosize' => TRUE, 'no_resize' => TRUE, 'preview' => TRUE, 'form_name' => 'input_form', 'bbcode' => TRUE)), 'delete_field' => '', 'edit_reason_field' => '', 'attachment_field' => $this->getThreadPermission("can_upload_attach") ? form_fileinput('file_attachments[]', $locale['forum_0557'], "", array('input_id' => 'file_attachments', 'upload_path' => INFUSIONS . 'forum/attachments/', 'type' => 'object', 'preview_off' => TRUE, "multiple" => TRUE, "inline" => false, 'max_count' => $forum_settings['forum_attachmax_count'], 'valid_ext' => $forum_settings['forum_attachtypes'], "class" => "m-b-0")) . "\n\t\t\t\t\t\t\t\t <div class='m-b-20'>\n<small>" . sprintf($locale['forum_0559'], parsebytesize($forum_settings['forum_attachmax']), str_replace('|', ', ', $forum_settings['forum_attachtypes']), $forum_settings['forum_attachmax_count']) . "</small>\n</div>\n" : "", "poll_form" => "", 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0')), 'signature_field' => array_key_exists("user_sig", $userdata) && $userdata['user_sig'] ? form_checkbox('post_showsig', $locale['forum_0623'], $post_data['post_showsig'], array('class' => 'm-b-0')) : '', 'sticky_field' => '', 'lock_field' => '', 'hide_edit_field' => '', 'post_locked_field' => '', 'notify_field' => $forum_settings['thread_notify'] ? form_checkbox('notify_me', $locale['forum_0626'], $post_data['notify_me'], array('class' => 'm-b-0')) : '', 'post_buttons' => form_button('post_reply', $locale['forum_0504'], $locale['forum_0504'], array('class' => 'btn-primary')) . form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-l-10')), 'last_posts_reply' => ''); // only in reply if ($forum_settings['forum_last_posts_reply']) { $result = dbquery("\n\t\t\t\tSELECT\n\t\t\t\tp.thread_id, p.post_message, p.post_smileys, p.post_author, p.post_datestamp, p.post_hidden,\n\t\t\t\t\t\t\tu.user_id, u.user_name, u.user_status, u.user_avatar\n\t\t\t\t\t\t\tFROM " . DB_FORUM_POSTS . " p\n\t\t\t\t\t\t\tLEFT JOIN " . DB_USERS . " u ON p.post_author = u.user_id\n\t\t\t\t\t\t\tWHERE p.thread_id='" . $thread_data['thread_id'] . "' AND p.post_hidden='0'\n\t\t\t\t\t\t\tGROUP BY p.post_id\n\t\t\t\t\t\t\tORDER BY p.post_datestamp DESC LIMIT 0," . $forum_settings['posts_per_page']); if (dbrows($result)) { $title = sprintf($locale['forum_0526'], $forum_settings['forum_last_posts_reply']); if ($forum_settings['forum_last_posts_reply'] == "1") { $title = $locale['forum_0525']; } ob_start(); echo "<p><strong>" . $title . "</strong>\n</p>\n"; echo "<table class='table table-responsive'>\n"; $i = $forum_settings['posts_per_page']; while ($data = dbarray($result)) { $message = $data['post_message']; if ($data['post_smileys']) { $message = parsesmileys($message); } $message = parseubb($message); echo "<tr>\n<td class='tbl2 forum_thread_user_name' style='width:10%'><!--forum_thread_user_name-->" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</td>\n"; echo "<td class='tbl2 forum_thread_post_date'>\n"; echo "<div style='float:right' class='small'>\n"; echo $i . ($i == $forum_settings['forum_last_posts_reply'] ? " (" . $locale['forum_0525'] . ")" : ""); echo "</div>\n"; echo "<div class='small'>" . $locale['forum_0524'] . showdate("forumdate", $data['post_datestamp']) . "</div>\n"; echo "</td>\n"; echo "</tr>\n<tr>\n<td valign='top' class='tbl2 forum_thread_user_info' style='width:10%'>\n"; echo display_avatar($data, '50px'); echo "</td>\n<td valign='top' class='tbl1 forum_thread_user_post'>\n"; echo nl2br($message); echo "</td>\n</tr>\n"; $i--; } echo "</table>\n"; $info['last_posts_reply'] = ob_get_contents(); ob_end_clean(); } } postform($info); } else { redirect(INFUSIONS . 'forum/index.php'); } }
/** * Get thread posts info */ private function get_thread_post() { $forum_settings = $this->get_forum_settings(); $userdata = fusion_get_userdata(); $locale = fusion_get_locale(); $user_sig_module = \UserFields::check_user_field('user_sig'); $user_web_module = \UserFields::check_user_field('user_web'); $userid = isset($userdata['user_id']) ? (int) $userdata['user_id'] : 0; switch ($this->thread_info['section']) { case 'oldest': $sortCol = 'post_datestamp ASC'; break; case 'latest': $sortCol = 'post_datestamp DESC'; break; case 'high': $sortCol = 'vote_points DESC'; break; default: $sortCol = 'post_datestamp ASC'; } // @todo: where to calculate has voted without doing it in while loop? require_once INCLUDES . "mimetypes_include.php"; $result = dbquery("\n\t\t\t\t\tSELECT p.*,\n\t\t\t\t\tt.thread_id,\n\t\t\t\t\tu.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups,\n\t\t\t\t\tu.user_joined, u.user_lastvisit, u.user_ip,\n\t\t\t\t\t" . ($user_sig_module ? " u.user_sig," : "") . ($user_web_module ? " u.user_web," : "") . "\n\t\t\t\t\tu2.user_name AS edit_name, u2.user_status AS edit_status,\n\t\t\t\t\tcount(a1.attach_id) 'attach_image_count',\n\t\t\t\t\tcount(a2.attach_id) 'attach_files_count',\n\t\t\t\t\tSUM(v.vote_points) as vote_points, count(v2.thread_id) as has_voted\n\t\t\t\t\tFROM " . DB_FORUM_POSTS . " p\n\t\t\t\t\tINNER JOIN " . DB_FORUM_THREADS . " t ON t.thread_id = p.thread_id\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.post_id = p.post_id\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v2 on v2.thread_id = p.thread_id AND v2.vote_user = '******'\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " u ON p.post_author = u.user_id\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.post_id = p.post_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.post_id = p.post_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\tWHERE p.thread_id='" . intval($_GET['thread_id']) . "' AND post_hidden='0'\n\t\t\t\t\t" . ($this->thread_info['thread']['forum_type'] == '4' ? "OR p.post_id='" . intval($this->thread_info['post_firstpost']) . "'" : '') . "\n\t\t\t\t\tGROUP by p.post_id\n\t\t\t\t\tORDER BY {$sortCol} LIMIT " . intval($_GET['rowstart']) . ", " . intval($forum_settings['posts_per_page'])); $this->thread_info['post_rows'] = dbrows($result); if ($this->thread_info['post_rows'] > 0) { $response = $this->mood()->post_mood(); if ($response) { redirect(FUSION_REQUEST); } /* Set Threads Navigation */ $this->thread_info['thread_posts'] = format_word($this->thread_info['post_rows'], $locale['fmt_post']); $this->thread_info['page_nav'] = ''; if ($this->thread_info['max_post_items'] > $this->thread_info['posts_per_page']) { $this->thread_info['page_nav'] = "<div class='pull-right'>" . makepagenav($_GET['rowstart'], $this->thread_info['posts_per_page'], $this->thread_info['max_post_items'], 3, FORUM . "viewthread.php?thread_id=" . $this->thread_info['thread']['thread_id'] . (isset($_GET['highlight']) ? "&highlight=" . urlencode($_GET['highlight']) : '') . "&") . "</div>"; } add_to_jquery("\n \$('.reason_button').bind('click', function(e) {\n var reason_div = \$(this).data('target');\n console.log(reason_div);\n if ( \$('#'+reason_div).is(':visible') ) {\n \$('#'+reason_div).slideUp();\n } else {\n \$('#'+reason_div).slideDown();\n }\n });\n "); $i = 1; while ($pdata = dbarray($result)) { // Format Post Message $post_message = empty($pdata['post_smileys']) ? parsesmileys($pdata['post_message']) : $pdata['post_message']; $post_message = nl2br(parseubb($post_message)); if (isset($_GET['highlight'])) { $post_message = "<div class='search_result'>" . $post_message . "</div>\n"; } // Marker $marker = array('link' => "#post_" . $pdata['post_id'], "title" => "#" . ($i + $_GET['rowstart']), 'id' => "post_" . $pdata['post_id']); $post_marker = "<a class='marker' href='" . $marker['link'] . "' id='" . $marker['id'] . "'>" . $marker['title'] . "</a>"; $post_marker .= "<a title='" . $locale['forum_0241'] . "' href='#top'><i class='entypo up-open'></i></a>\n"; // Post Attachments $post_attachments = ""; if ($pdata['attach_files_count'] || $pdata['attach_image_count']) { if ($this->getThreadPermission("can_download_attach")) { $attachResult = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . intval($pdata['post_id']) . "'"); if (dbrows($attachResult) > 0) { $aImage = ""; $aFiles = ""; while ($attachData = dbarray($attachResult)) { if (in_array($attachData['attach_mime'], img_mimeTypes())) { $aImage .= display_image_attach($attachData['attach_name'], "50", "50", $pdata['post_id']) . "\n"; } else { $aFiles .= "<div class='display-inline-block'><i class='entypo attach'></i><a href='" . INFUSIONS . "forum/viewthread.php?thread_id=" . $pdata['thread_id'] . "&getfile=" . $attachData['attach_id'] . "'>" . $attachData['attach_name'] . "</a> "; $aFiles .= "[<span class='small'>" . parsebytesize(filesize(INFUSIONS . "forum/attachments/" . $attachData['attach_name'])) . " / " . $attachData['attach_count'] . $locale['forum_0162'] . "</span>]</div>\n"; } } if (!empty($aFiles)) { $post_attachments .= "<div class='emulated-fieldset'>\n"; $post_attachments .= "<span class='emulated-legend'>" . profile_link($pdata['user_id'], $pdata['user_name'], $pdata['user_status']) . $locale['forum_0154'] . ($pdata['attach_files_count'] > 1 ? $locale['forum_0158'] : $locale['forum_0157']) . "</span>\n"; $post_attachments .= "<div class='attachments-list m-t-10'>" . $aFiles . "</div>\n"; $post_attachments .= "</div>\n"; } if (!empty($aImage)) { $post_attachments .= "<div class='emulated-fieldset'>\n"; $post_attachments .= "<span class='emulated-legend'>" . profile_link($pdata['user_id'], $pdata['user_name'], $pdata['user_status']) . $locale['forum_0154'] . ($pdata['attach_image_count'] > 1 ? $locale['forum_0156'] : $locale['forum_0155']) . "</span>\n"; $post_attachments .= "<div class='attachments-list'>" . $aImage . "</div>\n"; $post_attachments .= "</div>\n"; if (!defined('COLORBOX')) { define('COLORBOX', TRUE); add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />"); add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>"); add_to_jquery("\$('a[rel^=\"attach\"]').colorbox({ current: '" . $locale['forum_0159'] . " {current} " . $locale['forum_0160'] . " {total}',width:'80%',height:'80%'});"); } } } else { $post_attachments = "Failed to fetch the attachment"; } } else { $post_attachments = "<small><i class='fa fa-clipboard'></i> " . $locale['forum_0184'] . "</small>\n"; } } $pdata['user_ip'] = $forum_settings['forum_ips'] && iMOD ? $locale['forum_0268'] . ' ' . $pdata['post_ip'] : ''; $pdata += array("user_online" => $pdata['user_lastvisit'] >= time() - 3600 ? TRUE : FALSE, "is_first_post" => $pdata['post_id'] == $this->thread_info['post_firstpost'] ? TRUE : FALSE, "is_last_post" => $pdata['post_id'] == $this->thread_info['post_lastpost'] ? TRUE : FALSE, "user_profile_link" => profile_link($pdata['user_id'], $pdata['user_name'], $pdata['user_status']), "user_avatar_image" => display_avatar($pdata, '50px', FALSE, FALSE, 'img-rounded'), "user_post_count" => format_word($pdata['user_posts'], $locale['fmt_post']), "print" => array('link' => BASEDIR . "print.php?type=F&item_id=" . $_GET['thread_id'] . "&post=" . $pdata['post_id'] . "&nr=" . ($i + $_GET['rowstart']), 'title' => $locale['forum_0179']), "post_marker" => $post_marker, "marker" => $marker, "post_attachments" => $post_attachments, 'post_reply_message' => ''); $pdata['post_message'] = $post_message; // Reply notifications $reply_result = dbquery("\n SELECT p.post_id, p.post_datestamp, u.user_id, u.user_name, u.user_status\n FROM " . DB_FORUM_POSTS . " p\n INNER JOIN " . DB_USERS . " u ON u.user_id = p.post_author\n WHERE p.post_cat= " . intval($pdata['post_id']) . "\n GROUP BY u.user_id ORDER BY p.post_datestamp DESC\n "); if (dbrows($reply_result) > 0) { // who has replied $reply_sender = ""; $last_datestamp = 0; while ($r_data = dbarray($reply_result)) { $reply_sender[$r_data['post_id']] = "<a class='reply_sender' href='" . FUSION_REQUEST . "#post_" . $r_data['post_id'] . "'>\n" . profile_link($r_data['user_id'], $r_data['user_name'], $r_data['user_status'], "", FALSE) . "</a>"; $last_datestamp = $r_data['post_datestamp']; } $senders = implode(", ", $reply_sender); $pdata['post_reply_message'] = "<i class='fa fa-reply fa-fw'></i>" . sprintf($locale['forum_0527'], $senders, timer($last_datestamp)); } // Displays mood buttons $pdata['post_mood'] = $this->mood()->set_PostData($pdata)->display_mood_buttons(); $pdata['post_mood_message'] = $this->mood()->get_mood_message(); /** * User Stuffs, Sig, User Message, Web */ // Quote & Edit Link if ($this->getThreadPermission("can_reply")) { if (!$this->thread_info['thread']['thread_locked']) { $pdata['post_quote'] = array('link' => INFUSIONS . "forum/viewthread.php?action=reply&forum_id=" . $pdata['forum_id'] . "&thread_id=" . $pdata['thread_id'] . "&post_id=" . $pdata['post_id'] . "&quote=" . $pdata['post_id'], 'title' => $locale['forum_0266']); if (iMOD || ($forum_settings['forum_edit_lock'] == TRUE && $pdata['is_last_post'] || $forum_settings['forum_edit_lock'] == FALSE) && $userdata['user_id'] == $pdata['post_author'] && ($forum_settings['forum_edit_timelimit'] <= 0 || time() - $forum_settings['forum_edit_timelimit'] * 60 < $pdata['post_datestamp'])) { $pdata['post_edit'] = array('link' => INFUSIONS . "forum/viewthread.php?action=edit&forum_id=" . $pdata['forum_id'] . "&thread_id=" . $pdata['thread_id'] . "&post_id=" . $pdata['post_id'], 'title' => $locale['forum_0265']); } $pdata['post_reply'] = array('link' => INFUSIONS . "forum/viewthread.php?action=reply&forum_id=" . $pdata['forum_id'] . "&thread_id=" . $pdata['thread_id'] . "&post_id=" . $pdata['post_id'], 'title' => $locale['forum_0509']); } elseif (iMOD) { $pdata['post_edit'] = array('link' => INFUSIONS . "forum/viewthread.php?action=edit&forum_id=" . $pdata['forum_id'] . "&thread_id=" . $pdata['thread_id'] . "&post_id=" . $pdata['post_id'], 'title' => $locale['forum_0265']); } } // rank img if ($pdata['user_level'] <= USER_LEVEL_ADMIN) { if ($forum_settings['forum_ranks']) { $pdata['user_rank'] = show_forum_rank($pdata['user_posts'], $pdata['user_level'], $pdata['user_groups']); // in fact now is get forum rank } else { $pdata['user_rank'] = getuserlevel($pdata['user_level']); } } else { if ($forum_settings['forum_ranks']) { $pdata['user_rank'] = iMOD ? show_forum_rank($pdata['user_posts'], 104, $pdata['user_groups']) : show_forum_rank($pdata['user_posts'], $pdata['user_level'], $pdata['user_groups']); } else { $pdata['user_rank'] = iMOD ? $locale['userf1'] : getuserlevel($pdata['user_level']); } } // Website if ($pdata['user_web'] && (iADMIN || $pdata['user_status'] != 6 && $pdata['user_status'] != 5)) { $user_web_url = !preg_match("@^http(s)?\\:\\/\\/@i", $pdata['user_web']) ? "http://" . $pdata['user_web'] : $pdata['user_web']; $pdata['user_web'] = array('link' => $user_web_url, 'title' => $locale['forum_0364']); } else { $pdata['user_web'] = array('link' => '', 'title' => ''); } // PM link $pdata['user_message'] = array('link' => '', 'title' => ''); if (iMEMBER && $pdata['user_id'] != $userdata['user_id'] && (iADMIN || $pdata['user_status'] != 6 && $pdata['user_status'] != 5)) { $pdata['user_message'] = array('link' => BASEDIR . 'messages.php?msg_send=' . $pdata['user_id'], "title" => $locale['send_message']); } // User Sig if ($pdata['user_sig'] && isset($pdata['post_showsig']) && $pdata['user_status'] != 6 && $pdata['user_status'] != 5) { $pdata['user_sig'] = nl2br(parseubb(parsesmileys(stripslashes($pdata['user_sig'])), "b|i|u||center|small|url|mail|img|color")); } else { $pdata['user_sig'] = ""; } // Voting - need up or down link - accessible to author also the vote // answered and on going questions. // Answer rating $pdata['vote_message'] = ''; //echo $data['forum_type'] == 4 ? "<br/>\n".(number_format($data['thread_postcount']-1)).$locale['forum_0365']."" : ''; // answers // form components $pdata['post_checkbox'] = iMOD ? "<input type='checkbox' name='delete_post[]' value='" . $pdata['post_id'] . "'/>" : ''; $pdata['post_votebox'] = ''; if ($this->thread_info['thread']['forum_type'] == 4) { if ($this->getThreadPermission("can_rate")) { // can vote. $pdata['vote_up'] = array('link' => INFUSIONS . "forum/postify.php?post=voteup&forum_id=" . $pdata['forum_id'] . "&thread_id=" . $pdata['thread_id'] . "&post_id=" . $pdata['post_id'], "title" => $locale['forum_0265']); $pdata['vote_down'] = array('link' => INFUSIONS . "forum/postify.php?post=votedown&forum_id=" . $pdata['forum_id'] . "&thread_id=" . $pdata['thread_id'] . "&post_id=" . $pdata['post_id'], "title" => $locale['forum_0265']); $pdata['post_votebox'] = "<div class='text-center'>\n"; $pdata['post_votebox'] .= "<a href='" . $pdata['vote_up']['link'] . "' class='btn btn-default btn-xs m-b-5 p-5' title='" . $locale['forum_0265'] . "'>\n<i class='entypo up-dir icon-xs'></i></a>"; $pdata['post_votebox'] .= "<h3 class='m-0'>" . (!empty($pdata['vote_points']) ? $pdata['vote_points'] : 0) . "</h3>\n"; $pdata['post_votebox'] .= "<a href='" . $pdata['vote_down']['link'] . "' class='btn btn-default btn-xs m-t-5 p-5' title='" . $locale['forum_0265'] . "'>\n<i class='entypo down-dir icon-xs'></i></a>"; $pdata['post_votebox'] .= "</div>\n"; } else { $pdata['post_votebox'] = "<div class='text-center'>\n"; $pdata['post_votebox'] .= "<h3 class='m-0'>" . (!empty($pdata['vote_points']) ? $pdata['vote_points'] : 0) . "</h3>\n"; $pdata['post_votebox'] .= "</div>\n"; } } $pdata['post_edit_reason'] = ''; if ($pdata['post_edittime']) { $edit_reason = "<small><div class='edit_reason'>" . $locale['forum_0164'] . profile_link($pdata['post_edituser'], $pdata['edit_name'], $pdata['edit_status']) . $locale['forum_0167'] . showdate("forumdate", $pdata['post_edittime']) . " - "; if ($pdata['post_editreason'] && iMEMBER) { $edit_reason .= "<a id='reason_pid_" . $pdata['post_id'] . "' rel='" . $pdata['post_id'] . "' class='reason_button pointer' data-target='reason_div_pid_" . $pdata['post_id'] . "'>"; $edit_reason .= "<strong>" . $locale['forum_0165'] . "</strong>"; $edit_reason .= "</a></div>"; $edit_reason .= "<div id='reason_div_pid_" . $pdata['post_id'] . "' class='post_reason' style='display:none;'><small class='text-lighter'>- " . $pdata['post_editreason'] . "</small></div>\n"; } else { $edit_reason .= "</div>\n</small>"; } $pdata['post_edit_reason'] = $edit_reason; //$this->edit_reason = TRUE; } // Custom Post Message Link/Buttons $pdata['post_links'] = ''; $pdata['post_links'] .= !empty($pdata['post_quote']) ? "<a class='btn btn-xs btn-default' title='" . $pdata['post_quote']["title"] . "' href='" . $pdata['post_quote']['link'] . "'>" . $pdata['post_quote']['title'] . "</a>\n" : ''; $pdata['post_links'] .= !empty($pdata['post_edit']) ? "<a class='btn btn-xs btn-default' title='" . $pdata['post_edit']["title"] . "' href='" . $pdata['post_edit']['link'] . "'>" . $pdata['post_edit']['title'] . "</a>\n" : ''; $pdata['post_links'] .= !empty($pdata['print']) ? "<a class='btn btn-xs btn-default' title='" . $pdata['print']["title"] . "' href='" . $pdata['print']['link'] . "'>" . $pdata['print']['title'] . "</a>\n" : ''; $pdata['post_links'] .= !empty($pdata['user_web']) ? "<a class='btn btn-xs btn-default' class='forum_user_actions' href='" . $pdata['user_web']['link'] . "' target='_blank'>" . $pdata['user_web']['title'] . "</a>\n" : ''; $pdata['post_links'] .= !empty($pdata['user_message']) ? "<a class='btn btn-xs btn-default' href='" . $pdata['user_message']['link'] . "' target='_blank'>" . $pdata['user_message']['title'] . "</a>\n" : ''; // Post Date $pdata['post_date'] = $locale['forum_0524'] . " " . timer($pdata['post_datestamp']) . " - " . showdate('forumdate', $pdata['post_datestamp']); $pdata['post_shortdate'] = $locale['forum_0524'] . " " . timer($pdata['post_datestamp']); $pdata['post_longdate'] = $locale['forum_0524'] . " " . showdate('forumdate', $pdata['post_datestamp']); $this->thread_info['post_items'][$pdata['post_id']] = $pdata; $i++; } } }
/** * News Item Container * @param $info */ function render_news($subject, $news, $info) { global $aidlink; $locale = fusion_get_locale(); $news_settings = \PHPFusion\News\NewsServer::get_news_settings(); add_to_jquery("\n\t\t\t\$('.news-img-header').hover(\n\t\t\t\tfunction() { \$(this).closest('.news-article').find('.news-snippet').css({'opacity': 1, 'height': " . $news_settings['news_thumb_h'] . " }); },\n\t\t\t\tfunction() { \$(this).closest('.news-article').find('.news-snippet').css({'opacity': 0}); }\n\t\t\t);\n\t\t\t"); ?> <!--news_prepost_<?php echo $info['news_id']; ?> --> <article class="news-article"> <div class="news-img-info" style="height: <?php echo $news_settings['news_thumb_h']; ?> px"> <?php echo $info['news_image']; ?> <div class="news-box-overlay"> <a title="<?php echo $info['news_subject']; ?> " href="<?php echo $info['news_image_url']; ?> " rel="bookmark"> <h4><?php echo $info['news_subject']; ?> </h4> <?php echo trim_text(strip_tags($info['news_news']), 120); ?> </a> </div> </div> <h4 class="news-title-info"> <a class="strong text-dark" href="<?php echo $info['news_url']; ?> "> <?php $info['news_sticky'] ? "<i class='pull-right fa fa-warning icon-sm'></i>\n" : ''; ?> <?php echo $info['news_subject']; ?> </a> </h4> <div class="news-poster-info"> <div class="pull-left"> <?php echo display_avatar($info, '30px', '', false, 'img-circle'); ?> </div> <div class="overflow-hide"> <span class="news-author"> <?php echo profile_link($info['user_id'], $info['user_name'], $info['user_status'], "text-lighter"); ?> </span> <span class="news-date m-r-10"> <i class="fa fa-calendar fa-fw"></i> <?php echo showdate("newsdate", $info['news_date']); ?> </span> <?php if ($info['news_display_comments']) { ?> <span class="news-comments"><i class="fa fa-comment-o"></i> <?php echo $info['news_display_comments']; ?> </span> <?php } ?> <?php if ($info['news_display_ratings']) { ?> <span class="news-ratings"><i class="fa fa-star-o fa-fw"></i> <?php echo $info['news_display_ratings']; ?> </span> <?php } ?> <span class="news-read"> <i class="fa fa-eye fa-fw"></i> <?php echo number_format($info['news_reads']); ?> </span> </div> </div> <div class="news-description-info"> <?php echo ucwords($locale['in']); ?> <?php echo $info['news_cat_name'] ? "<a href='" . INFUSIONS . "news/news.php?cat_id=" . $info['news_cat_id'] . "'>" . $info['news_cat_name'] . "</a>" : "<a href='" . INFUSIONS . "news/news.php?cat_id=0&filter=false'>" . $locale['news_0006'] . "</a> "; ?> <br/> <?php echo trim_text(strip_tags($info['news_news']), 250); ?> </div> </article> <!--//news_prepost_<?php echo $info['news_id']; ?> --> <?php }
?> </ul> <?php closeside(); } if (!empty($member_user)) { openside("<i class='fa fa-legal fa-fw'></i> " . $locale['fmp_0102']); ?> <ul> <?php foreach ($member_user as $user_id => $user_data) { ?> <li> <div class="pull-left m-t-5"> <?php echo display_avatar($user_data, "35px", "", TRUE, "img-rounded"); ?> </div> <div class="overflow-hide"> <div class="display-block strong"><?php echo profile_link($user_data['user_id'], ucfirst($user_data['user_name']), $user_data['user_status']); ?> </div> <span class="text-lighter"><?php echo $user_data['user_title']; ?> </span> </div> </li> <?php }