Example #1
0
 /**
  * Get thread structure on specific forum id.
  * @param            $forum_id
  * @param bool|FALSE $filter
  * @return array
  */
 public static function get_forum_thread($forum_id, $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 t.forum_id='" . intval($forum_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'][$forum_id]['forum_threadcount'] = 0;
     $info['item'][$forum_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     if ($thread_rows > 0) {
         $count = dbarray($thread_result);
         $info['item'][$forum_id]['forum_threadcount'] = 0;
         $info['item'][$forum_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 t.forum_id='" . $forum_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'] . "&amp;"), "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) . "&amp;", "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) . "&amp;", "thread_rowstart", TRUE);
         }
     }
     return (array) $info;
 }
Example #2
0
 /**
  * Format Blog Category Listing
  * @return array
  */
 public static function get_blogCatsData()
 {
     $data = dbquery_tree_full(DB_BLOG_CATS, 'blog_cat_id', 'blog_cat_parent', "" . (multilang_table("BL") ? "WHERE blog_cat_language='" . LANGUAGE . "'" : '') . "");
     foreach ($data as $index => $cat_data) {
         foreach ($cat_data as $blog_cat_id => $cat) {
             $data[$index][$blog_cat_id]['blog_cat_link'] = "<a href='" . INFUSIONS . "blog/blog.php?cat_id=" . $cat['blog_cat_id'] . "'>" . $cat['blog_cat_name'] . "</a>";
         }
     }
     return $data;
 }
function showsidelinks(array $options = array(), $id = 0)
{
    global $userdata;
    static $data = array();
    $settings = fusion_get_settings();
    $acclevel = isset($userdata['user_level']) ? $userdata['user_level'] : 0;
    $res =& $res;
    if (empty($data)) {
        $data = dbquery_tree_full(DB_SITE_LINKS, "link_id", "link_cat", "WHERE link_position <= 2" . (multilang_table("SL") ? " AND link_language='" . LANGUAGE . "'" : "") . " AND " . groupaccess('link_visibility') . " ORDER BY link_cat, link_order");
    }
    if (!$id) {
        $res .= "<ul class='main-nav'>\n";
    } else {
        $res .= "<ul class='sub-nav p-l-10' style='display: none;'>\n";
    }
    foreach ($data[$id] as $link_id => $link_data) {
        $li_class = "";
        if ($link_data['link_name'] != "---" && $link_data['link_name'] != "===") {
            $link_target = $link_data['link_window'] == "1" ? " target='_blank'" : "";
            if (START_PAGE == $link_data['link_url']) {
                $li_class .= ($li_class ? " " : "") . "current-link";
            }
            if (preg_match("!^(ht|f)tp(s)?://!i", $link_data['link_url'])) {
                $item_link = $link_data['link_url'];
            } else {
                $item_link = BASEDIR . $link_data['link_url'];
            }
            $link_icon = "";
            if ($link_data['link_icon']) {
                $link_icon = "<i class='" . $link_data['link_icon'] . "'></i>";
            }
            $res .= "<li" . ($li_class ? " class='" . $li_class . "'" : "") . ">\n";
            $res .= "<a class='display-block p-5 p-l-0 p-r-0' href='{$item_link}' {$link_target}>\n";
            $res .= $link_icon . $link_data['link_name'];
            $res .= "</a>\n";
            if (isset($data[$link_id])) {
                $res .= showsidelinks($options, $link_data['link_id']);
            }
            $res .= "</li>\n";
        } elseif ($link_data['link_cat'] > 0) {
            echo "<li class='divider'></li>";
        }
    }
    $res .= "</ul>\n";
    return $res;
}
Example #4
0
function faq_listing()
{
    global $locale, $aidlink, $show_faqs;
    $total_cat_count = dbcount("(faq_cat_id)", DB_FAQ_CATS, multilang_table("FQ") ? "faq_cat_language='" . LANGUAGE . "'" : "");
    $_GET['show_faq'] = isset($_GET['show_faq']) && isnum($_GET['show_faq']) ? $_GET['show_faq'] : 0;
    $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $total_cat_count ? $_GET['rowstart'] : 0;
    $result = dbquery("SELECT fc.faq_cat_id, fc.faq_cat_name,\n\tcount(faq_id) 'faq_count'\n\tFROM " . DB_FAQ_CATS . " fc\n\tleft join " . DB_FAQS . " f using (faq_cat_id)\n\t" . (multilang_table("FQ") ? "WHERE fc.faq_cat_language='" . LANGUAGE . "'" : "") . "\n\tgroup by fc.faq_cat_id\n\tORDER BY fc.faq_cat_name\n\tlimit " . intval($_GET['rowstart']) . ", " . intval($show_faqs) . "\n\t");
    $cat_rows = dbrows($result);
    if ($cat_rows > 0) {
        echo "<div class='m-t-10'>\n";
        echo "<div class='clearfix'>\n";
        if ($total_cat_count > $cat_rows) {
            echo "<div class='pull-right'>\n";
            echo makepagenav($_GET['rowstart'], $show_faqs, $total_cat_count, 3, FUSION_SELF . $aidlink . "&amp;", "rowstart");
            echo "</div>\n";
        }
        echo sprintf($locale['faq_0115'], $cat_rows, $total_cat_count);
        echo "</div>\n";
        echo "</div>\n";
        echo "<table class='table table-responsive table-striped m-t-20'>\n<thead><tr>\n";
        echo "<th class='col-xs-4'>" . $locale['faq_0103'] . "</th>\n";
        echo "<th>" . $locale['faq_0104'] . "</th>\n";
        echo "<th>" . $locale['faq_0105'] . "</th>\n";
        echo "<th class='text-right'>" . $locale['faq_0106'] . "</th>\n";
        echo "</tr>\n";
        echo "</thead>\n<tbody>\n";
        while ($data = dbarray($result)) {
            echo "<tr>\n";
            // let us use 2 page nav. :)
            echo "<td><a href='" . FUSION_SELF . $aidlink . "&amp;show_faq=" . $data['faq_cat_id'] . "'>" . $data['faq_cat_name'] . "</a></td>\n";
            echo "<td><span class='badge'>" . $data['faq_count'] . "</span></td>\n";
            echo "<td>" . $data['faq_cat_id'] . "</td>\n";
            echo "<td class='text-right'>\n\t\t\t<a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;cat_id=" . $data['faq_cat_id'] . "&amp;section=faq-category'>" . $locale['faq_0107'] . "</a> -\n";
            echo "<a href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;cat_id=" . $data['faq_cat_id'] . "&amp;section=faq-category' onclick=\"return confirm('" . $locale['faq_0109'] . "');\">" . $locale['faq_0108'] . "</a></td>\n";
            echo "</tr>\n";
            if ($_GET['show_faq'] == $data['faq_cat_id']) {
                show_faq($data['faq_cat_id'], $data['faq_count']);
            }
        }
        // simple toggle
        add_to_jquery("\n\t\t\$('.faq_toggle').bind('click', function() {\n\t\t\tvar faqs = \$(this).data('target');\n\t\t\tvar faq_length = \$('#' + faqs + ':visible').length;\n\t\t\t\$('.faq_list').hide();\n\t\t\tif (faq_length > 0) {\n\t\t\t\t\$('#'+faqs).hide();\n\t\t\t} else {\n\t\t\t\t\$('#'+faqs).show();\n\t\t\t}\n\t\t});\n\t\t");
        echo "</table>\n";
    } else {
        echo "<div class='well text-center'>" . $locale['faq_0116'] . "<br />\n</div>\n";
    }
}
Example #5
0
function forum_rank_cache()
{
    global $settings, $forum_mod_rank_cache, $forum_post_rank_cache, $forum_special_rank_cache;
    $forum_post_rank_cache = array();
    $forum_mod_rank_cache = array();
    $forum_special_rank_cache = array();
    if ($settings['forum_ranks']) {
        $result = dbquery("SELECT rank_title, rank_image, rank_type, rank_posts, rank_apply, rank_language FROM " . DB_FORUM_RANKS . " " . (multilang_table("FR") ? "WHERE rank_language='" . LANGUAGE . "'" : "") . " ORDER BY rank_apply DESC, rank_posts ASC");
        if (dbrows($result)) {
            while ($data = dbarray($result)) {
                if ($data['rank_type'] == 0) {
                    $forum_post_rank_cache[] = $data;
                } elseif ($data['rank_type'] == 1) {
                    $forum_mod_rank_cache[] = $data;
                } else {
                    $forum_special_rank_cache[] = $data;
                }
            }
        }
    }
}
function showsublinks($sep = "&middot;", $class = "")
{
    global $settings;
    require_once INCLUDES . "mobile.menu.inc.php";
    $mobile_icon = isset($default_mobile_icon) ? $default_mobile_icon : '';
    $sres = dbquery("SELECT link_name, link_url, link_window, link_visibility FROM " . DB_SITE_LINKS . "\r\n\t        " . (multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "' AND" : "WHERE") . " link_position>='2' ORDER BY link_order");
    $mobile_link = array();
    if (dbrows($sres)) {
        $i = 0;
        if ($settings['bootstrap']) {
            $res = "<nav class='navbar' role='navigation'>\n";
            $res .= "<div class='mobile-menu'>\n<button type='button' class='navbar-toggle collapsed' data-toggle='collapse' data-target='#mp'><i class='entypo menu'></i></button>\n</div>\n";
            $res .= "<div id='mp' class='navbar-collapse collapse'>\n";
            // collect all navbar item.
            $res .= "<ul class='nav navbar-nav hidden-xs'>\n";
        } else {
            $res = "<ul>\n";
        }
        while ($sdata = dbarray($sres)) {
            $mobile_link[$sdata['link_name']] = $sdata['link_url'];
            // order, visibility, language - complied.
            $li_class = $class;
            $i++;
            if ($sdata['link_url'] != "---" && checkgroup($sdata['link_visibility'])) {
                $link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
                if ($i == 1) {
                    $li_class .= ($li_class ? " " : "") . "first-link";
                }
                if (START_PAGE == $sdata['link_url']) {
                    $li_class .= ($li_class ? " " : "") . "current-link";
                }
                if (preg_match("!^(ht|f)tp(s)?://!i", $sdata['link_url'])) {
                    $res .= "<li" . ($li_class ? " class='" . $li_class . "'" : "") . ">" . $sep . "<a href='" . $sdata['link_url'] . "'" . $link_target . ">\n";
                    $res .= "<span>" . parseubb($sdata['link_name'], "b|i|u|color|img") . "</span></a></li>\n";
                } else {
                    $res .= "<li" . ($li_class ? " class='" . $li_class . "'" : "") . ">" . $sep . "<a href='" . BASEDIR . $sdata['link_url'] . "'" . $link_target . ">\n";
                    $res .= "<span>" . parseubb($sdata['link_name'], "b|i|u|color|img") . "</span></a></li>\n";
                }
            }
        }
        if ($settings['bootstrap']) {
            $res .= "</ul>\n";
            $res .= "<!--start of mobile menu -->\n";
            $res .= "<div class='hidden-sm hidden-md hidden-lg mobile-panel m-0'>\n";
            $res .= "<div class='mobile-pane'>\n";
            $res .= "<div class='mobile-header'>\n";
            $res .= "<button class='btn mobile-btn-close' data-toggle='collapse' data-target='#mp'>Close</button>\n";
            $res .= "<div class='mobile-header-text text-center'>Navigation</div>";
            $res .= "</div>\n";
            if (count($mobile_link) > 0) {
                $res .= "<div class='row m-0 mobile-body'>\n";
                foreach ($mobile_link as $link_name => $link_url) {
                    $icon = array_key_exists($link_url, $mobile_icon) ? $mobile_icon[$link_url] : 'entypo layout';
                    $res .= "<div class='col-xs-3 mobile-grid text-center'><a href='{$link_url}' class='btn btn-menu btn-block btn-default m-b-10'><i class='" . $icon . "'></i><br/><span class='mobile-text'>" . trimlink($link_name, 10) . "</span></a></div>\n";
                }
                $res .= "</div>\n";
            }
            $res .= "</div>\n";
            $res .= "</div>\n";
            $res .= "<!--end of mobile menu -->\n";
        } else {
            $res .= "</ul>\n";
        }
        $res .= "</div>\n";
        $res .= "</nav>\n";
        return $res;
    }
}
Example #7
0
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once dirname(__FILE__) . "../../../../maincore.php";
header('Content-Type: application/rss+xml; charset=' . $locale['charset'] . '');
if (file_exists(INFUSIONS . "rss_feeds_panel/locale/" . LANGUAGE . ".php")) {
    include INFUSIONS . "rss_feeds_panel/locale/" . LANGUAGE . ".php";
} else {
    include INFUSIONS . "rss_feeds_panel/locale/English.php";
}
if (db_exists(DB_NEWS)) {
    $result = dbquery("SELECT * FROM " . DB_NEWS . " WHERE " . groupaccess('news_visibility') . (multilang_table("NS") ? " AND news_language='" . LANGUAGE . "'" : "") . "\tORDER BY news_datestamp DESC LIMIT 0,10");
    $rssimage = $settings['siteurl'] . $settings['sitebanner'];
    echo "<?xml version=\"1.0\" encoding=\"" . $locale['charset'] . "\"?>\n\n";
    echo "<rss version=\"2.0\">\n\n\t<image>\n <url>{$rssimage}</url>\n </image>\n\t<channel>\n";
    if (dbrows($result) != 0) {
        echo "<title>" . $settings['sitename'] . $locale['rss004'] . (multilang_table("NS") ? " " . $locale['rss007'] . " " . LANGUAGE : "") . "</title>\n";
        echo "<link>" . $settings['siteurl'] . "</link>\n \r\n\t  <description>" . $settings['description'] . "</description>\n";
        while ($row = dbarray($result)) {
            $rsid = intval($row['news_id']);
            $rtitle = $row['news_subject'];
            $description = stripslashes(nl2br($row['news_news']));
            $description = strip_tags($description, "<a><p><br /><br /><hr />");
            echo "<item>\n";
            echo "<title>" . htmlspecialchars($rtitle) . "</title>\n";
            echo "<link>" . $settings['siteurl'] . "infusions/news/news.php?readmore=" . $rsid . "</link>\n";
            echo "<description>" . htmlspecialchars($description) . "</description>\n";
            echo "</item>\n";
        }
    } else {
        echo "<title>" . $settings['sitename'] . $locale['rss004'] . "</title>\n \r\n\t  <link>" . $settings['siteurl'] . "</link>\n \r\n\t  <description>" . $locale['rss008'] . "</description>\n";
    }
Example #8
0
            echo $locale['news_0203'] . " " . nl2br(parseubb($news_snippet)) . "<br /><br />";
            echo $locale['news_0204'] . " " . nl2br(parseubb($news_body));
            closetable();
        }
        add_to_title($locale['global_200'] . $locale['news_0400']);
        echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
        echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['news_0703']) . "</div>\n";
        echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=n", array("enctype" => $news_settings['news_allow_submission_files'] ? TRUE : FALSE));
        echo form_text('news_subject', $locale['news_0200'], $criteriaArray['news_subject'], array("required" => TRUE, "inline" => TRUE));
        if (multilang_table("NS")) {
            echo form_select('news_language', $locale['global_ML100'], $criteriaArray['news_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
        } else {
            echo form_hidden('news_language', '', $criteriaArray['news_language']);
        }
        echo form_select('news_keywords', $locale['news_0205'], $criteriaArray['news_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['news_0205a'], "width" => "100%", "error_text" => $locale['news_0255'], "tags" => TRUE, "multiple" => TRUE));
        echo form_select_tree("news_cat", $locale['news_0201'], $criteriaArray['news_cat'], array("width" => "250px", "inline" => TRUE, "parent_value" => $locale['news_0202'], "query" => multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : ""), DB_NEWS_CATS, "news_cat_name", "news_cat_id", "news_cat_parent");
        if ($news_settings['news_allow_submission_files']) {
            $file_input_options = array('upload_path' => IMAGES_N, 'max_width' => $news_settings['news_photo_max_w'], 'max_height' => $news_settings['news_photo_max_h'], 'max_byte' => $news_settings['news_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $news_settings['news_thumb_w'], 'thumbnail_h' => $news_settings['news_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $news_settings['news_photo_w'], 'thumbnail2_h' => $news_settings['news_photo_h'], 'type' => 'image', "inline" => TRUE);
            echo form_fileinput("news_image", $locale['news_0216'], "", $file_input_options);
            echo "<div class='small col-sm-offset-3 m-b-10'><span class='p-l-15'>" . sprintf($locale['news_0217'], parsebytesize($news_settings['news_photo_max_b'])) . "</span></div>\n";
            $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
            echo form_select('news_ialign', $locale['news_0218'], $criteriaArray['news_ialign'], array("options" => $alignOptions, "inline" => TRUE));
        }
        echo form_textarea('news_news', $locale['news_0203'], $criteriaArray['news_snippet'], array("required" => TRUE, "html" => TRUE, "form_name" => "submit_form", "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE));
        echo form_textarea('news_body', $locale['news_0203b'], $criteriaArray['news_body'], array("required" => $news_settings['news_extended_required'] ? TRUE : FALSE, "html" => TRUE, "form_name" => "submit_form", "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE));
        echo fusion_get_settings("site_seo") ? "" : form_button('preview_news', $locale['news_0240'], $locale['news_0240'], array('class' => 'btn-primary m-r-10'));
        echo form_button('submit_news', $locale['news_0700'], $locale['news_0700'], array('class' => 'btn-primary'));
        echo closeform();
        echo "</div>\n</div>\n";
    }
} else {
Example #9
0
    if (dbrows($result) > 0) {
        $data = dbarray($result);
        add_to_title($locale['global_201'] . $data['faq_cat_name']);
        $data['faq_link'] = INFUSIONS . "faq/faq.php?cat_id=" . $data['faq_cat_id'];
        $info = $data;
        if (dbcount("(faq_id)", DB_FAQS, "faq_cat_id='" . intval($_GET['cat_id']) . "'")) {
            $result = dbquery("SELECT faq_id, faq_question, faq_answer from " . DB_FAQS . " WHERE faq_cat_id='" . intval($_GET['cat_id']) . "' ORDER BY faq_question");
            while ($data = dbarray($result)) {
                $info['items'][$data['faq_id']] = $data;
            }
        } else {
            $info['nofaq_items'] = $locale['411'];
        }
        render_faq_item($info);
    } else {
        redirect(FUSION_SELF);
    }
} else {
    $result = dbquery("\n\t\t\t\tSELECT fc.faq_cat_id, fc.faq_cat_name, fc.faq_cat_description, fc.faq_cat_language,\n\t\t\t\tcount(f.faq_id) 'faq_count'\n\t \t\t\tFROM " . DB_FAQ_CATS . " fc\n\t \t\t\tLEFT JOIN " . DB_FAQS . " f using (faq_cat_id)\n\t \t\t\t" . (multilang_table("FQ") ? "WHERE faq_cat_language='" . LANGUAGE . "'" : "") . "\n\t \t\t\tgroup by fc.faq_cat_id\n\t \t\t\tORDER BY faq_cat_name\n\t \t\t\t");
    $info['faq_title'] = $locale['400'];
    if (dbrows($result) > 0) {
        while ($data = dbarray($result)) {
            $data['faq_link'] = INFUSIONS . "faq/faq.php?cat_id=" . $data['faq_cat_id'];
            $info['items'][$data['faq_cat_id']] = $data;
        }
    } else {
        $info['nofaqs'] = $locale['410'];
    }
    render_faq($info);
}
require_once THEMES . "templates/footer.php";
Example #10
0
| Author: PHP-Fusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
pageAccess("PH");
$data = array("album_id" => 0, "album_title" => "", "album_keywords" => "", "album_description" => "", "album_access" => "", "album_language" => LANGUAGE, "album_image" => "", "album_thumb1" => "", "album_thumb2" => "", "album_order" => dbcount("(album_id)", DB_PHOTO_ALBUMS, multilang_table("PG") ? "album_language='" . LANGUAGE . "'" : "") + 1);
if (isset($_POST['save_album'])) {
    $data = array("album_id" => form_sanitizer($_POST['album_id'], 0, "album_id"), "album_title" => form_sanitizer($_POST['album_title'], "", "album_title"), "album_keywords" => form_sanitizer($_POST['album_keywords'], "", "album_keywords"), "album_description" => form_sanitizer($_POST['album_description'], "", "album_description"), "album_access" => form_sanitizer($_POST['album_access'], "", "album_access"), "album_language" => form_sanitizer($_POST['album_language'], "", "album_language"), "album_order" => form_sanitizer($_POST['album_order'], "", "album_order"), "album_image" => "", "album_thumb1" => "", "album_thumb2" => "", "album_user" => $userdata['user_id'], "album_datestamp" => time());
    if (empty($data['album_order'])) {
        $data['album_order'] = dbresult(dbquery("SELECT MAX(album_order) FROM " . DB_PHOTO_ALBUMS . "\n\t\t\t\t" . (multilang_table("PG") ? "where album_language='" . LANGUAGE . "'" : "") . ""), 0) + 1;
    }
    // do delete image
    if (defender::safe()) {
        if (!empty($_FILES['album_image']) && is_uploaded_file($_FILES['album_image']['tmp_name'])) {
            $upload = form_sanitizer($_FILES['album_image'], "", "album_image");
            if (empty($upload['error'])) {
                $data['album_image'] = $upload['image_name'];
                $data['album_thumb1'] = $upload['thumb1_name'];
                $data['album_thumb2'] = $upload['thumb2_name'];
            }
        } else {
            if (isset($_POST['del_image'])) {
                // album_id
                $result = dbquery("select album_image, album_thumb1, album_thumb2 FROM " . DB_PHOTO_ALBUMS . " WHERE album_id='" . $data['album_id'] . "'");
                if (dbrows($result) > 0) {
Example #11
0
                default:
                    $filter_condition = dbresult(dbquery("SELECT download_cat_sorting FROM " . DB_DOWNLOAD_CATS . " WHERE download_cat_id='" . intval($_GET['cat_id']) . "'"), 0);
            }
            $sql = "SELECT d.*, dc.*,\n\t\t\t\ttu.user_id, tu.user_name, tu.user_status, tu.user_avatar , tu.user_level, tu.user_joined,\n\t\t\t\tIF(SUM(tr.rating_vote)>0, SUM(tr.rating_vote), 0) AS sum_rating,\n\t\t\t\tCOUNT(tr.rating_item_id) AS count_votes,\n\t\t\t\tCOUNT(td.comment_item_id) AS count_comment,\n\t\t\t\tMAX(d.download_datestamp) as last_updated\n\t\t\t\tFROM " . DB_DOWNLOADS . " d\n\t\t\t\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON d.download_cat=dc.download_cat_id\n\t\t\t\tLEFT JOIN " . DB_USERS . " tu ON d.download_user=tu.user_id\n\t\t\t\tLEFT JOIN " . DB_RATINGS . " tr ON tr.rating_item_id = d.download_id AND tr.rating_type='D'\n\t\t\t\tLEFT JOIN " . DB_COMMENTS . " td ON td.comment_item_id = d.download_id AND td.comment_type='D' AND td.comment_hidden='0'\n\t\t\t\t" . (multilang_table("DL") ? "WHERE download_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('download_visibility') . "\n\t\t\t\tAND download_cat = '" . intval($_GET['cat_id']) . "'\n\t\t\t\tGROUP BY d.download_id\n\t\t\t\tORDER BY " . (!empty($filter_condition) ? $filter_condition : "dc.download_cat_sorting") . "\n\t\t\t\tLIMIT " . intval($_GET['rowstart']) . "," . intval($dl_settings['download_pagination']);
            $result = dbquery($sql);
            $info['download_rows'] = dbrows($result);
        }
    } else {
        set_title($locale['download_1000']);
        /**
         * Everyone's Download Posts
         */
        $info['download_max_rows'] = dbcount("('download_id')", DB_DOWNLOADS, groupaccess('download_visibility'));
        $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $info['download_max_rows'] ? $_GET['rowstart'] : 0;
        if ($info['download_max_rows'] > 0) {
            $download_query = "SELECT d.*, dc.*,\n\t\t\t\ttu.user_id, tu.user_name, tu.user_status, tu.user_avatar , tu.user_level, tu.user_joined,\n\t\t\t\tIF(SUM(tr.rating_vote)>0, SUM(tr.rating_vote), 0) AS sum_rating,\n\t\t\t\tCOUNT(tr.rating_item_id) AS count_votes,\n\t\t\t\tCOUNT(td.comment_item_id) AS count_comment,\n\t\t\t\tmax(d.download_datestamp) as last_updated\n\t\t\t\tFROM " . DB_DOWNLOADS . " d\n\t\t\t\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON d.download_cat=dc.download_cat_id\n\t\t\t\tLEFT JOIN " . DB_USERS . " tu ON d.download_user=tu.user_id\n\t\t\t\tLEFT JOIN " . DB_RATINGS . " tr ON tr.rating_item_id = d.download_id AND tr.rating_type='D'\n\t\t\t\tLEFT JOIN " . DB_COMMENTS . " td ON td.comment_item_id = d.download_id AND td.comment_type='D' AND td.comment_hidden='0'\n\t\t\t\t" . (multilang_table("DL") ? "WHERE dc.download_cat_language = '" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('download_visibility') . "\n\t\t\t\t" . $condition . "\n\t\t\t\tGROUP BY d.download_id\n\t\t\t\tORDER BY " . ($filter_condition ? $filter_condition : "dc.download_cat_sorting") . "\n\t\t\t\tLIMIT " . intval($_GET['rowstart']) . "," . intval($dl_settings['download_pagination']);
            $result = dbquery($download_query);
            $info['download_rows'] = dbrows($result);
        }
    }
}
if (!empty($info['download_max_rows']) && $info['download_max_rows'] > $dl_settings['download_pagination'] && !isset($_GET['download_id'])) {
    $page_nav_link = "";
    if (!empty($_GET['cat_id']) && isnum($_GET['cat_id'])) {
        $page_nav_link = INFUSIONS . "downloads/downloads.php?cat_id=" . $_GET['cat_id'] . "&amp;";
    } elseif (!empty($_GET['author']) && isnum($_GET['author'])) {
        $page_nav_link = INFUSIONS . "downloads/downloads.php?author=" . $_GET['author'] . "&amp;";
    }
    $info['download_nav'] = makepagenav($_GET['rowstart'], $dl_settings['download_pagination'], $info['download_max_rows'], 3, $page_nav_link);
}
if (!empty($info['download_rows'])) {
Example #12
0
 function forum_newtopic()
 {
     global $settings, $locale;
     if (isset($_POST['select_forum'])) {
         $_POST['forum_sel'] = isset($_POST['forum_sel']) && isnum($_POST['forum_sel']) ? $_POST['forum_sel'] : 0;
         redirect(FORUM . 'post.php?action=newthread&forum_id=' . $_POST['forum_sel']);
     }
     echo openmodal('newtopic', $locale['forum_0057'], array('button_id' => 'newtopic', 'class' => 'modal-md'));
     $index = dbquery_tree(DB_FORUMS, 'forum_id', 'forum_cat');
     $result = dbquery("SELECT a.forum_id, a.forum_name, b.forum_name as forum_cat_name, a.forum_post\n\t\t FROM " . DB_FORUMS . " a\n\t\t LEFT JOIN " . DB_FORUMS . " b ON a.forum_cat=b.forum_id\n\t\t WHERE " . groupaccess('a.forum_access') . " " . (multilang_table("FO") ? "AND a.forum_language='" . LANGUAGE . "' AND" : "AND") . "\n\t\t (a.forum_type ='2' or a.forum_type='4') AND a.forum_post < " . USER_LEVEL_PUBLIC . " AND a.forum_lock !='1' ORDER BY a.forum_cat ASC, a.forum_branch ASC, a.forum_name ASC");
     $options = array();
     if (dbrows($result) > 0) {
         while ($data = dbarray($result)) {
             $depth = get_depth($index, $data['forum_id']);
             if (checkgroup($data['forum_post'])) {
                 $options[$data['forum_id']] = str_repeat("&#8212;", $depth) . $data['forum_name'] . " " . ($data['forum_cat_name'] ? "(" . $data['forum_cat_name'] . ")" : '');
             }
         }
         echo "<div class='well clearfix m-t-10'>\n";
         echo form_select('forum_sel', $locale['forum_0395'], '', array('options' => $options, 'inline' => 1, 'width' => '100%'));
         echo "<div class='display-inline-block col-xs-12 col-sm-offset-3'>\n";
         echo form_button('select_forum', $locale['forum_0396'], 'select_forum', array('class' => 'btn-primary btn-sm'));
         echo "</div>\n";
         echo "</div>\n";
         echo closeform();
     } else {
         echo "<div class='well text-center'>\n";
         echo $locale['forum_0328'];
         echo "</div>\n";
     }
     echo closemodal();
 }
Example #13
0
            dbquery_insert(DB_FAQS, $data, "update");
            addNotice("success", $locale['faq_0306']);
        } else {
            dbquery_insert(DB_FAQS, $data, "save");
            addNotice("success", $locale['faq_0305']);
        }
        // it's 15 limiter in show_faq function
        // 5, 10, 15.
        // 17/5 = 3.4*5 = 15
        $total_faqs = dbcount("(faq_id)", DB_FAQS, "faq_cat_id='" . $data['faq_cat_id'] . "'");
        $faq_start = $total_faqs > $show_faqs ? floor($total_faqs / $show_faqs) * $show_faqs : 0;
        redirect(FUSION_SELF . $aidlink . "&amp;show_faq=" . $data['faq_cat_id'] . "&amp;faq_start=" . $faq_start);
    }
}
$cat_opts = array();
$result2 = dbquery("SELECT faq_cat_id, faq_cat_name, faq_cat_language\n\tFROM " . DB_FAQ_CATS . " " . (multilang_table("FQ") ? "WHERE faq_cat_language='" . LANGUAGE . "'" : "") . " ORDER BY faq_cat_name");
if (dbrows($result2) != 0) {
    while ($data2 = dbarray($result2)) {
        $cat_opts[$data2['faq_cat_id']] = $data2['faq_cat_name'];
    }
    echo openform('inputform', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-8'>\n";
    openside("");
    echo form_hidden("faq_id", "", $data['faq_id']);
    echo form_text('faq_question', $locale['faq_0301'], $data['faq_question'], array('required' => TRUE));
    echo form_textarea('faq_answer', $locale['faq_0302'], $data['faq_answer'], $fusion_mce);
    closeside();
    echo "</div>\n";
    echo "<div class='col-xs-12 col-sm-4'>\n";
    openside("");
 echo "</div>\n";
 echo "</div>\n";
 // end package
 openside();
 if (fusion_get_settings('comments_enabled') == "0" || fusion_get_settings('ratings_enabled') == "0") {
     $sys = "";
     if (fusion_get_settings('comments_enabled') == "0" && fusion_get_settings('ratings_enabled') == "0") {
         $sys = $locale['comments_ratings'];
     } elseif (fusion_get_settings('comments_enabled') == "0") {
         $sys = $locale['comments'];
     } else {
         $sys = $locale['ratings'];
     }
     echo "<div class='well'>" . sprintf($locale['download_0256'], $sys) . "</div>\n";
 }
 echo form_select_tree("download_cat", $locale['download_0207'], $callback_data['download_cat'], array("no_root" => 1, "placeholder" => $locale['choose'], 'width' => '100%', "query" => multilang_table("DL") ? "WHERE download_cat_language='" . LANGUAGE . "'" : ""), DB_DOWNLOAD_CATS, "download_cat_name", "download_cat_id", "download_cat_parent");
 echo form_select('download_visibility', $locale['download_0205'], $callback_data['download_visibility'], array('options' => fusion_get_groups(), 'placeholder' => $locale['choose'], 'width' => '100%'));
 echo form_button('publish', $locale['download_0061'], $locale['download_0061'], array('class' => 'btn-primary m-r-10'));
 closeside();
 openside('');
 echo form_checkbox('download_allow_comments', $locale['download_0223'], $callback_data['download_allow_comments'], array('class' => 'm-b-0'));
 echo form_checkbox('download_allow_ratings', $locale['download_0224'], $callback_data['download_allow_ratings'], array('class' => 'm-b-0'));
 if (isset($_GET['action']) && $_GET['action'] == "edit") {
     echo form_checkbox('update_datestamp', $locale['download_0213'], '', array('class' => 'm-b-0'));
 }
 closeside();
 openside();
 echo form_text('download_license', $locale['download_0208'], $callback_data['download_license'], array('inline' => 1));
 echo form_text('download_copyright', $locale['download_0222'], $callback_data['download_copyright'], array('inline' => 1));
 echo form_text('download_os', $locale['download_0209'], $callback_data['download_os'], array('inline' => 1));
 echo form_text('download_version', $locale['download_0210'], $callback_data['download_version'], array('inline' => 1));
Example #15
0
        if (dbrows($result)) {
            $data = dbarray($result);
        } else {
            redirect(FUSION_SELF . $aidlink);
        }
    }
    echo openform('inputform', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-8'>\n";
    echo form_hidden("weblink_datestamp", "", $data['weblink_datestamp']);
    echo form_hidden("weblink_id", "", $data['weblink_id']);
    echo form_text('weblink_name', $locale['wl_0100'], $data['weblink_name'], array("placeholder" => $locale['wl_0101'], "error_text" => $locale['wl_0102'], "inline" => TRUE, 'required' => TRUE));
    echo form_text('weblink_url', $locale['wl_0104'], $data['weblink_url'], array("type" => "url", "placeholder" => "http://", "required" => TRUE, "inline" => TRUE));
    echo form_textarea('weblink_description', $locale['wl_0103'], $data['weblink_description'], array("inline" => TRUE, "html" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE, "preview" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE, "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE, "form_name" => "inputform"));
    echo "</div>\n";
    echo "<div class='col-xs-12 col-sm-4'>\n";
    if ($weblink_edit) {
        echo form_checkbox("update_datestamp", $locale['wl_0107'], "");
    }
    openside("");
    echo form_select_tree("weblink_cat", $locale['wl_0105'], $data['weblink_cat'], array("inline" => TRUE, "no_root" => 1, "placeholder" => $locale['choose'], "query" => multilang_table("WL") ? "WHERE weblink_cat_language='" . LANGUAGE . "'" : ""), DB_WEBLINK_CATS, "weblink_cat_name", "weblink_cat_id", "weblink_cat_parent");
    echo form_select('weblink_visibility', $locale['wl_0106'], $data['weblink_visibility'], array("inline" => TRUE, 'options' => fusion_get_groups()));
    echo form_button('save_link', $locale['wl_0108'], $locale['wl_0108'], array("input_id" => "savelink2", 'class' => 'btn-primary m-t-10'));
    closeside();
    echo "</div>\n</div>\n";
    echo form_button('save_link', $locale['wl_0108'], $locale['wl_0108'], array('class' => 'btn-primary m-t-10'));
    echo closeform();
} else {
    echo "<div class='text-center'>\n" . $locale['537'] . "<br />\n" . $locale['538'] . "<br />\n<br />\n";
    echo "<a href='" . INFUSIONS . "weblinks/weblinks_admin.php" . $aidlink . "&amp;section=weblinks_category'>" . $locale['539'] . "</a>" . $locale['540'] . "</div>\n";
}
<?php

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: latest_downloads_panel.php
| Author: PHP-Fusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
openside($locale['global_032']);
$result = dbquery("SELECT td.download_id, td.download_title, td.download_cat, td.download_datestamp, td.download_visibility\n\t\t\tFROM " . DB_DOWNLOADS . " td\n\t\t\tINNER JOIN " . DB_DOWNLOAD_CATS . " tc ON td.download_cat=tc.download_cat_id\n\t\t\t" . (multilang_table("DL") ? "WHERE download_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('download_visibility') . "\n\t\t\tORDER BY download_datestamp DESC LIMIT 0,5");
if (dbrows($result)) {
    while ($data = dbarray($result)) {
        echo THEME_BULLET . " <a href='" . INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'] . "' title='" . $data['download_title'] . "' class='side'>" . trimlink($data['download_title'], 23) . "</a><br />\n";
    }
} else {
    echo "<div style='text-align:center'>" . $locale['global_033'] . "</div>\n";
}
closeside();
Example #17
0
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
// Count Max
$result = dbquery("SELECT tp.post_id FROM " . DB_FORUM_POSTS . " tp\n\tINNER JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\n\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\n\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('forum_access') . "\n\tAND tt.thread_postcount='1' AND tt.thread_locked='0' AND post_hidden='0' AND thread_hidden='0'\n\tGROUP BY tt.thread_id\n\t");
$this->forum_info['post_rows'] = dbrows($result);
if (dbrows($result) > 0) {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    require_once INCLUDES . "mimetypes_include.php";
    $result = dbquery("\n\t\tSELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, tp.post_message, tp.post_datestamp,\n\t\tt.*, tf.*,\n\t\ttu1.user_name AS author_name, tu1.user_status AS author_status, tu1.user_avatar as author_avatar,\n\t\ttu2.user_name AS last_user_name, tu2.user_status AS last_user_status, tu2.user_avatar AS last_user_avatar,\n\t\tp.forum_poll_title,\n\t\tcount(v.post_id) AS vote_count,\n\t\ta1.attach_name, a1.attach_id,\n\t\ta2.attach_name, a2.attach_id,\n\t\tcount(a1.attach_mime) 'attach_image',\n\t\tcount(a2.attach_mime) 'attach_files'\n\t\tFROM " . DB_FORUM_POSTS . " tp\n\t\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id=tf.forum_id\n\t\tINNER JOIN " . DB_FORUM_THREADS . " t ON tp.thread_id=t.thread_id\n\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND tp.post_id = v.post_id\n\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\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" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . "\n\t\tAND t.thread_postcount='1' AND t.thread_locked='0'\n\t\tAND post_hidden='0' AND thread_hidden='0'\n\t\tGROUP BY t.thread_id\n\t\tORDER BY tp.post_datestamp DESC LIMIT " . $_GET['rowstart'] . "," . $forum_settings['posts_per_page'] . "\n\t\t");
    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'] . "&amp;"), "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>"));
Example #18
0
                    $data['new'] = $data['weblink_datestamp'] + 604800 > time() + $settings['timeoffset'] * 3600 ? 1 : 0;
                    $data['weblink'] = array('link' => INFUSIONS . "weblinks/weblinks.php?cat_id=" . $_GET['cat_id'] . "&amp;weblink_id=" . $data['weblink_id'], 'name' => $data['weblink_name']);
                    $info['item'][$data['weblink_id']] = $data;
                }
            }
        }
        render_weblinks_item($info);
    } else {
        redirect(FUSION_SELF);
    }
} else {
    /**
     * Main View
     * */
    $info['item'] = array();
    $result = dbquery("SELECT wc.weblink_cat_id, wc.weblink_cat_name, wc.weblink_cat_description, count(w.weblink_id) 'weblink_count'\n\tFROM " . DB_WEBLINK_CATS . " wc\n\tLEFT JOIN " . DB_WEBLINKS . " w on w.weblink_cat = wc.weblink_cat_id and " . groupaccess("weblink_visibility") . "\n\t" . (multilang_table("WL") ? "WHERE wc.weblink_cat_language='" . LANGUAGE . "'" : "") . "\n\tGROUP BY wc.weblink_cat_id\n\tORDER BY weblink_cat_name\n\t");
    $rows = dbrows($result);
    $info['weblink_cat_rows'] = $rows;
    if ($rows != 0) {
        while ($data = dbarray($result)) {
            $data['weblink_item'] = array('link' => INFUSIONS . "weblinks/weblinks.php?cat_id=" . $data['weblink_cat_id'], 'name' => $data['weblink_cat_name']);
            $info['item'][$data['weblink_cat_id']] = $data;
        }
    }
    render_weblinks($info);
}
require_once THEMES . "templates/footer.php";
/**
 * Weblinks Category Breadcrumbs Generator
 * @param $forum_index
 */
Example #19
0
    redirect(BASEDIR . "index.php");
}
require_once THEMES . "templates/header.php";
if (!isset($lastvisited) || !isnum($lastvisited)) {
    $lastvisited = time();
}
add_to_title($locale['global_200'] . $locale['global_043']);
opentable($locale['global_043']);
$result = dbquery("SELECT tp.post_id FROM " . DB_FORUM_POSTS . " tp\r\n\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\tLEFT JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . " AND tp.post_hidden='0' AND tt.thread_hidden='0' AND (tp.post_datestamp > " . $lastvisited . " OR tp.post_edittime > " . $lastvisited . ")");
$rows = dbrows($result);
$threads = 0;
if ($rows) {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, IF(tp.post_datestamp>tp.post_edittime, tp.post_datestamp, tp.post_edittime) AS post_timestamp,\r\n\t\ttf.forum_name, tf.forum_access, tt.thread_subject, tu.user_id, tu.user_name, tu.user_status\r\n\t\tFROM " . DB_FORUM_POSTS . " tp\r\n\t\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\t\tLEFT JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t\tLEFT JOIN " . DB_USERS . " tu ON tp.post_author = tu.user_id\r\n\t\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . " AND tp.post_hidden='0' AND tt.thread_hidden='0' AND (tp.post_datestamp > '" . $lastvisited . "' OR tp.post_edittime > '" . $lastvisited . "')\r\n\t\tGROUP BY tp.thread_id\r\n\t\tORDER BY post_timestamp DESC LIMIT " . $_GET['rowstart'] . ",20");
    $i = 0;
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
    echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_048'] . "</strong></td>\n";
    echo "<td class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_050'] . "</strong></td>\n";
    echo "</tr>\n";
    $threads = dbrows($result);
    while ($data = dbarray($result)) {
        if ($i % 2 == 0) {
            $row_color = "tbl1";
        } else {
            $row_color = "tbl2";
        }
        echo "<tr>\n";
        echo "<td width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . $data['forum_name'] . "</td>\n";
Example #20
0
 /**
  * Forum Listing
  */
 private function display_forum_list()
 {
     global $aidlink;
     $title = !empty($this->level['title']) ? sprintf(self::$locale['forum_000b'], $this->level['title'][0]) : self::$locale['forum_000c'];
     add_to_title(" " . $title);
     $forum_settings = $this->get_forum_settings();
     $threads_per_page = $forum_settings['threads_per_page'];
     $max_rows = dbcount("('forum_id')", DB_FORUMS, (multilang_table("FO") ? "forum_language='" . LANGUAGE . "' AND" : '') . " forum_cat='" . $_GET['parent_id'] . "'");
     // need max rows
     $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $max_rows ? intval($_GET['rowstart']) : 0;
     opentable($title);
     $result = dbquery("SELECT forum_id, forum_cat, forum_branch, forum_name, forum_description, forum_image, forum_alias, forum_type, forum_threadcount, forum_postcount, forum_order FROM\n\t\t\t" . DB_FORUMS . " " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='" . intval($_GET['parent_id']) . "'\n\t\t\t ORDER BY forum_order ASC LIMIT " . $_GET['rowstart'] . ", {$threads_per_page}\n\t\t\t ");
     $rows = dbrows($result);
     if ($rows > 0) {
         // To support entypo and font-awesome icon switching
         $has_entypo = fusion_get_settings("entypo") ? TRUE : FALSE;
         $has_fa = fusion_get_settings("fontawesome") ? TRUE : FALSE;
         $type_icon = array('1' => $has_entypo ? 'entypo folder' : $has_fa ? 'fa fa-folder fa-fw fa-2x' : "", '2' => $has_entypo ? 'entypo icomment' : $has_fa ? 'fa fa-comment-o fa-fw fa-2x' : "", '3' => $has_entypo ? 'entypo link' : $has_fa ? 'fa fa-external-link fa-fw fa-2x' : "", '4' => $has_entypo ? 'entypo info-circled' : $has_fa ? 'fa fa-lightbulb-o fa-fw fa-2x' : "");
         $ui_label = array("move_up" => $has_entypo ? "<i class='entypo up-bold m-r-10'></i>" : $has_fa ? "<i class='fa fa-arrow-up fa-lg m-r-10'></i>" : self::$locale['forum_046'], "move_down" => $has_entypo ? "<i class='entypo down-bold m-r-10'></i>" : $has_fa ? "<i class='fa fa-arrow-down fa-lg m-r-10'></i>" : self::$locale['forum_045'], "edit_permission" => $has_entypo ? "<i class='entypo key m-r-10'></i>" : $has_fa ? "<i class='fa fa-eye fa-lg m-r-10'></i>" : self::$locale['forum_047'], "edit" => $has_entypo ? "<i class='entypo cog m-r-10'></i>" : $has_fa ? "<i class='fa fa-cog fa-lg m-r-10'></i>" : self::$locale['forum_048'], "delete" => $has_entypo ? "<i class='entypo icancel m-r-10'></i>" : $has_fa ? "<i class='fa fa-trash-o fa-lg m-r-10'></i>" : self::$locale['forum_049']);
         $i = 1;
         while ($data = dbarray($result)) {
             $up = $data['forum_order'] - 1;
             $down = $data['forum_order'] + 1;
             $subforums = get_child($this->forum_index, $data['forum_id']);
             $subforums = !empty($subforums) ? count($subforums) : 0;
             echo "<div class='panel panel-default'>\n";
             echo "<div class='panel-body'>\n";
             echo "<div class='pull-left m-r-10'>\n";
             echo "<i class='display-inline-block text-lighter " . $type_icon[$data['forum_type']] . "'></i>\n";
             echo "</div>\n";
             echo "<div class='overflow-hide'>\n";
             echo "<div class='row'>\n";
             echo "<div class='col-xs-6 col-sm-6 col-md-6 col-lg-6'>\n";
             $html2 = '';
             if ($data['forum_image'] && file_exists(INFUSIONS . "forum/images/" . $data['forum_image'])) {
                 echo "<div class='pull-left m-r-10'>\n" . thumbnail(INFUSIONS . "forum/images/" . $data['forum_image'], '50px') . "</div>\n";
                 echo "<div class='overflow-hide'>\n";
                 $html2 = "</div>\n";
             }
             echo "<span class='strong text-bigger'><a href='" . FUSION_SELF . $aidlink . "&amp;parent_id=" . $data['forum_id'] . "&amp;branch=" . $data['forum_branch'] . "'>" . $data['forum_name'] . "</a></span><br/>" . nl2br(parseubb($data['forum_description'])) . $html2;
             echo "</div>\n<div class='col-xs-6 col-sm-6 col-md-6 col-lg-6'>\n";
             echo "<div class='pull-right'>\n";
             $upLink = FUSION_SELF . $aidlink . $this->ext . "&amp;action=mu&amp;order={$up}&amp;forum_id=" . $data['forum_id'];
             $downLink = FUSION_SELF . $aidlink . $this->ext . "&amp;action=md&amp;order={$down}&amp;forum_id=" . $data['forum_id'];
             echo $i == 1 ? '' : "<a title='" . self::$locale['forum_046'] . "' href='" . $upLink . "'>" . $ui_label['move_up'] . "</a>";
             echo $i == $rows ? '' : "<a title='" . self::$locale['forum_045'] . "' href='" . $downLink . "'>" . $ui_label['move_down'] . "</a>";
             echo "<a title='" . self::$locale['forum_047'] . "' href='" . FUSION_SELF . $aidlink . "&amp;action=p_edit&forum_id=" . $data['forum_id'] . "&amp;parent_id=" . $_GET['parent_id'] . "'>" . $ui_label['edit_permission'] . "</a>";
             // edit
             echo "<a title='" . self::$locale['forum_048'] . "' href='" . FUSION_SELF . $aidlink . "&amp;action=edit&forum_id=" . $data['forum_id'] . "&amp;parent_id=" . $_GET['parent_id'] . "'>" . $ui_label['edit'] . "</a>";
             // edit
             echo "<a title='" . self::$locale['forum_049'] . "' href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;forum_id=" . $data['forum_id'] . "&amp;forum_cat=" . $data['forum_cat'] . "&amp;forum_branch=" . $data['forum_branch'] . $this->ext . "' onclick=\"return confirm('" . self::$locale['delete_notice'] . "');\">" . $ui_label['delete'] . "</a>";
             // delete
             echo "</div>\n";
             echo "<span class='text-dark text-smaller strong'>" . self::$locale['forum_057'] . " " . number_format($data['forum_threadcount']) . " / " . self::$locale['forum_059'] . " " . number_format($data['forum_postcount']) . " </span>\n<br/>";
             echo "<span class='text-dark text-smaller strong'>" . self::$locale['forum_058'] . " " . number_format($subforums) . "</span>\n<br/>";
             echo "<span class='text-smaller text-dark strong'>" . self::$locale['forum_051'] . " </span> <span class='text-smaller'>" . $data['forum_alias'] . " </span>\n";
             echo "</div></div>\n";
             // end row
             echo "</div>\n";
             echo "</div>\n</div>\n";
             $i++;
         }
         if ($max_rows > $threads_per_page) {
             $ext = isset($_GET['parent_id']) ? "&amp;parent_id=" . $_GET['parent_id'] . "&amp;" : '';
             echo makepagenav($_GET['rowstart'], $threads_per_page, $max_rows, 3, FUSION_SELF . $aidlink . $ext);
         }
     } else {
         echo "<div class='well text-center'>" . self::$locale['560'] . "</div>\n";
     }
     closetable();
 }
Example #21
0
            echo "<p class='text-bigger'>" . $criteriaArray['article_snippet'] . "</p>";
            echo $criteriaArray['article_article'];
            closetable();
        }
        add_to_title($locale['global_200'] . $locale['articles_0060']);
        echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
        echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['articles_0063']) . "</div>\n";
        echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=a");
        echo form_text('article_subject', $locale['articles_0304'], $criteriaArray['article_subject'], array("required" => TRUE, "inline" => TRUE));
        if (multilang_table("AR")) {
            echo form_select('article_language', $locale['global_ML100'], $criteriaArray['article_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
        } else {
            echo form_hidden('article_language', '', $criteriaArray['article_language']);
        }
        echo form_select('article_keywords', $locale['articles_0204'], $criteriaArray['article_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['articles_0204a'], "width" => "100%", "error_text" => $locale['articles_0204a'], "tags" => TRUE, "multiple" => TRUE));
        echo form_select_tree("article_cat", $locale['articles_0201'], $criteriaArray['article_cat'], array("width" => "250px", "inline" => TRUE, "no_root" => TRUE, "query" => multilang_table("AR") ? "WHERE article_cat_language='" . LANGUAGE . "'" : ""), DB_ARTICLE_CATS, "article_cat_name", "article_cat_id", "article_cat_parent");
        $textArea_opts = array("required" => TRUE, "type" => fusion_get_settings("tinymce_enabled") ? "tinymce" : "html", "tinymce" => fusion_get_settings("tinymce_enabled") && iADMIN ? "advanced" : "simple", "autosize" => TRUE, "form_name" => "submit_form");
        echo form_textarea('article_snippet', $locale['articles_0202'], $criteriaArray['article_snippet'], $textArea_opts);
        $textArea_opts['required'] = $article_settings['article_extended_required'] ? TRUE : FALSE;
        echo form_textarea('article_article', $locale['articles_0203'], $criteriaArray['article_article'], $textArea_opts);
        echo fusion_get_settings("site_seo") ? "" : form_button('preview_article', $locale['articles_0240'], $locale['articles_0240'], array('class' => 'btn-primary m-r-10'));
        echo form_button('submit_article', $locale['articles_0060'], $locale['articles_0060'], array('class' => 'btn-primary'));
        echo closeform();
        echo "</div>\n</div>\n";
    }
} else {
    echo "<div class='well text-center'>\n";
    if (!$cat_exist) {
        echo $locale['articles_0043a'];
    } else {
        echo $locale['articles_0043'];
Example #22
0
 echo form_select('', 'cat_sort_by', 'cat_sort_by', $array, $cat_sort_by, array('placeholder' => $locale['choose'], 'class' => 'pull-left m-r-10'));
 $array = array('ASC' => $locale['426'], 'DESC' => $locale['427']);
 echo form_select('', 'cat_sort_order', 'cat_sort_order', $array, $cat_sort_order, array('placeholder' => $locale['choose'], 'class' => 'pull-left'));
 echo "</td>\n</tr>\n<tr>\n";
 echo "<td width='1%' class='tbl' style='white-space:nowrap'>" . $locale['428'] . "</td>\n";
 echo "<td class='tbl'>\n";
 echo form_select('', 'cat_access', 'cat_access', $access_opts, $cat_access, array('placeholder' => $locale['choose']));
 echo "</td>\n</tr>\n<tr>\n";
 echo "<td align='center' colspan='2' class='tbl'>\n";
 echo form_button($locale['429'], 'save_cat', 'save_cat', $locale['429'], array('class' => 'btn-primary m-t-10'));
 echo "</tr>\n</table>\n";
 echo closeform();
 closetable();
 opentable($locale['402']);
 echo "<table cellpadding='0' cellspacing='1' width='400' class='table table-responsive tbl-border center'>\n<thead>\n";
 $result = dbquery("SELECT weblink_cat_id, weblink_cat_name, weblink_cat_description, weblink_cat_access, weblink_cat_language FROM " . DB_WEBLINK_CATS . " " . (multilang_table("WL") ? "WHERE weblink_cat_language='" . LANGUAGE . "'" : "") . " ORDER BY weblink_cat_name");
 if (dbrows($result) != 0) {
     $i = 0;
     echo "<tr>\n";
     echo "<th class='tbl2'>" . $locale['430'] . "</th>\n";
     echo "<th align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['431'] . "</th>\n";
     echo "<th align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['532'] . "</th>\n";
     echo "</tr>\n";
     echo "</thead>\n<tbody>\n";
     while ($data = dbarray($result)) {
         $cell_color = $i % 2 == 0 ? "tbl1" : "tbl2";
         echo "<tr>\n";
         echo "<td class='{$cell_color}'><strong>" . $data['weblink_cat_name'] . "</strong>\n";
         echo ($data['weblink_cat_description'] ? "<br />\n<span class='small'>" . trimlink($data['weblink_cat_description'], 45) . "</span>" : "") . "</td>\n";
         echo "<td align='center' width='1%' class='{$cell_color}' style='white-space:nowrap'>" . getgroupname($data['weblink_cat_access']) . "</td>\n";
         echo "<td align='center' width='1%' class='{$cell_color}' style='white-space:nowrap'><a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;cat_id=" . $data['weblink_cat_id'] . "'>" . $locale['533'] . "</a> -\n";
Example #23
0
        echo "<img id='captcha' src='" . INCLUDES . "captchas/securimage/securimage_show.php' alt='' /><br />\n";
        echo "<a href='" . INCLUDES . "captchas/securimage/securimage_play.php'><img src='" . INCLUDES . "captchas/securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
        echo "<a href='#' onclick=\"document.getElementById('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='captcha_code' class='textbox' style='width:100px' /><br />\n";
    }
    echo "<br /><input type='submit' name='post_archive_shout' value='" . $locale['SB_shout'] . "' class='button' />\n";
    echo "</div>\n</form>\n<br />\n";
} else {
    echo "<div style='text-align:center'>" . $locale['SB_login_req'] . "</div>\n";
}
$rows = dbcount("(shout_id)", DB_SHOUTBOX, "shout_hidden='0'");
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
    $_GET['rowstart'] = 0;
}
if ($rows != 0) {
    $result = dbquery("SELECT s.shout_id, s.shout_name, s.shout_message, s.shout_datestamp, u.user_id, u.user_name, u.user_status\r\n\t\tFROM " . DB_SHOUTBOX . " s\r\n\t\tLEFT JOIN " . DB_USERS . " u ON s.shout_name=u.user_id\r\n\t\t" . (multilang_table("SB") ? "WHERE shout_language='" . LANGUAGE . "' AND" : "WHERE") . " s.shout_hidden='0'\r\n\t\tORDER BY s.shout_datestamp DESC LIMIT " . $_GET['rowstart'] . ",20");
    while ($data = dbarray($result)) {
        echo "<div class='tbl2'>\n";
        if (iADMIN && checkrights("S") || iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name'])) {
            echo "<div style='float:right'>\n<a href='" . FUSION_SELF . "?action=edit&amp;shout_id=" . $data['shout_id'] . "'>" . $locale['SB_edit'] . "</a> |\n";
            echo "<a href='" . FUSION_SELF . "?action=delete&amp;shout_id=" . $data['shout_id'] . "'>" . $locale['SB_delete'] . "</a>\n</div>\n";
        }
        if ($data['user_name']) {
            echo "<span class='comment-name'><span class='slink'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>\n</span>\n";
        } else {
            echo "<span class='comment-name'>" . $data['shout_name'] . "</span>\n";
        }
        echo "<span class='small'>" . showdate("longdate", $data['shout_datestamp']) . "</span>";
        echo "</div>\n<div class='tbl1'>\n" . sbawrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color")) . "</div>\n";
    }
} else {
Example #24
0
echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n";
echo form_hidden("blog_id", "", $data['blog_id']);
echo form_hidden("blog_datestamp", "", $data['blog_datestamp']);
echo form_text('blog_subject', $locale['blog_0422'], $data['blog_subject'], array('required' => TRUE, 'max_length' => 200, 'error_text' => $locale['blog_0450']));
// move keywords here because it's required
echo form_select('blog_keywords', $locale['blog_0443'], $data['blog_keywords'], array("max_length" => 320, "placeholder" => $locale['blog_0444'], "width" => "100%", "error_text" => $locale['blog_0457'], "tags" => TRUE, "multiple" => TRUE));
echo "<div class='pull-left m-r-10 display-inline-block'>\n";
echo form_datepicker('blog_start', $locale['blog_0427'], $data['blog_start'], array("placeholder" => $locale['blog_0429'], "join_to_id" => "blog_end"));
echo "</div>\n<div class='pull-left m-r-10 display-inline-block'>\n";
echo form_datepicker('blog_end', $locale['blog_0428'], $data['blog_end'], array("placeholder" => $locale['blog_0429'], "join_from_id" => "blog_start"));
echo "</div>\n";
echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-5 col-lg-4'>\n";
openside('');
echo form_select_tree("blog_cat[]", $locale['blog_0423'], $data['blog_cat'], array("width" => "100%", "delimiter" => ".", "inline" => TRUE, "no_root" => TRUE, "tags" => TRUE, "multiple" => TRUE, "query" => multilang_table("BL") ? "WHERE blog_cat_language='" . LANGUAGE . "'" : ""), DB_BLOG_CATS, "blog_cat_name", "blog_cat_id", "blog_cat_parent");
echo form_select('blog_visibility', $locale['blog_0430'], $data['blog_visibility'], array('options' => fusion_get_groups(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
if (multilang_table("BL")) {
    echo form_select('blog_language', $locale['global_ML100'], $data['blog_language'], array('options' => fusion_get_enabled_languages(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
} else {
    echo form_hidden('blog_language', '', $data['blog_language']);
}
echo form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-r-10'));
echo form_button('save', $locale['blog_0437'], $locale['blog_0437'], array('class' => 'btn-success', 'icon' => 'fa fa-square-check-o'));
closeside();
echo "</div>\n</div>\n";
$snippetSettings = array("required" => TRUE, "preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "placeholder" => $locale['blog_0425a'], "form_name" => "inputform");
if (fusion_get_settings("tinymce_enabled")) {
    $snippetSettings = array("required" => TRUE, "type" => "tinymce", "tinymce" => "advanced");
}
echo form_textarea('blog_blog', $locale['blog_0425'], $data['blog_blog'], $snippetSettings);
$extendedSettings = array();
if (!fusion_get_settings("tinymce_enabled")) {
Example #25
0
            }
            $num = dbcount("(faq_id)", DB_FAQS, "faq_cat_id='" . $data['faq_cat_id'] . "'");
            echo "<td valign='top'><a href='" . FUSION_SELF . "?cat_id=" . $data['faq_cat_id'] . "'>" . $data['faq_cat_name'] . "</a> <span class='small2'>({$num})</span>\n";
            if ($data['faq_cat_description']) {
                echo "<br />\n<span class='small'>" . $data['faq_cat_description'] . "</span>";
            }
            echo "</td>\n";
            $i++;
        }
        echo "</tr>\n</table>\n";
    } else {
        echo "<div style='text-align:center'><br />\n" . $locale['410'] . "<br /><br />\n</div>\n";
    }
    closetable();
} else {
    if ($data = dbarray(dbquery("SELECT faq_cat_name,faq_cat_language FROM " . DB_FAQ_CATS . " " . (multilang_table("FQ") ? "WHERE faq_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " faq_cat_id='" . $_GET['cat_id'] . "'"))) {
        add_to_title($locale['global_201'] . $data['faq_cat_name']);
        opentable($locale['401'] . ": " . $data['faq_cat_name']);
        echo "<table cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n";
        echo "<td class='tbl2'>\n<a href='" . FUSION_SELF . "'>" . $locale['400'] . "</a> &gt;";
        echo "<a href='" . FUSION_SELF . "?cat_id=" . $_GET['cat_id'] . "'>" . $data['faq_cat_name'] . "</a></td>\n";
        echo "</tr>\n</table>\n";
        $rows = dbcount("(faq_id)", DB_FAQS, "faq_cat_id='" . $_GET['cat_id'] . "'");
        if ($rows) {
            $i = 0;
            $ii = 1;
            $columns = 4;
            $faq_content = "";
            echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
            $result = dbquery("SELECT faq_id, faq_question, faq_answer from " . DB_FAQS . " WHERE faq_cat_id='" . $_GET['cat_id'] . "' ORDER BY faq_question");
            $numrows = dbrows($result);
Example #26
0
    $result = dbquery("select * from " . DB_FAQ_CATS . " WHERE faq_cat_id='" . intval($_GET['cat_id']) . "'");
    if (dbrows($result) > 0) {
        $data = dbarray($result);
    } else {
        redirect(FUSION_SELF . $aidlink);
    }
}
if (isset($_POST['save_cat'])) {
    $data = array("faq_cat_id" => form_sanitizer($_POST['faq_cat_id'], 0, "faq_cat_id"), "faq_cat_name" => form_sanitizer($_POST['faq_cat_name'], "", "faq_cat_name"), "faq_cat_description" => form_sanitizer($_POST['faq_cat_description'], "", "faq_cat_description"), "faq_cat_language" => form_sanitizer($_POST['faq_cat_language'], "", "faq_cat_language"));
    if (defender::safe()) {
        if (dbcount("(faq_cat_id)", DB_FAQ_CATS, "faq_cat_id='" . $data['faq_cat_id'] . "'")) {
            dbquery_insert(DB_FAQ_CATS, $data, "update");
            addNotice("success", $locale['faq_0205']);
        } else {
            dbquery_insert(DB_FAQ_CATS, $data, "save");
            addNotice("success", $locale['faq_0204']);
        }
        redirect(FUSION_SELF . $aidlink);
    }
}
echo openform('faqCat_form', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
echo form_hidden('faq_cat_id', "", $data['faq_cat_id']);
echo form_text('faq_cat_name', $locale['faq_0200'], $data['faq_cat_name'], array('error_text' => $locale['faq_0201'], 'required' => 1));
echo form_text('faq_cat_description', $locale['faq_0202'], $data['faq_cat_description']);
if (multilang_table("FQ")) {
    echo form_select("faq_cat_language", $locale['global_ML100'], $data['faq_cat_language'], array('options' => fusion_get_enabled_languages()));
} else {
    echo form_hidden("faq_cat_language", '', LANGUAGE);
}
echo form_button('save_cat', $locale['faq_0203'], $locale['faq_0203'], array('class' => 'btn-primary m-t-10'));
echo closeform();
Example #27
0
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
require_once THEMES . "templates/global/home.php";
require_once INCLUDES . "infusions_include.php";
include LOCALE . LOCALESET . "homepage.php";
add_to_title($locale['home']);
add_breadcrumb(array("title" => $locale['home'], "link" => BASEDIR . "home.php"));
$configs = array();
$configs[DB_NEWS] = array('select' => "SELECT\n\tns.news_id as id, ns.news_subject as title, ns.news_news as content,\n\tns.news_datestamp as datestamp, us.user_id, us.user_name,\n\tus.user_status, nc.news_cat_id as cat_id, nc.news_cat_name as cat_name,\n\tns.news_image as image,\n\tnc.news_cat_image as cat_image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_NEWS . " as ns\n\tLEFT JOIN " . DB_NEWS_CATS . " as nc ON nc.news_cat_id = ns.news_cat\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = ns.news_id and c1.comment_type = 'NS')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = ns.news_id AND r1.rating_type = 'NS')\n\tINNER JOIN " . DB_USERS . " as us ON ns.news_name = us.user_id\n\tWHERE (" . time() . " > ns.news_start OR ns.news_start = 0)\n\tAND (" . time() . " < ns.news_end OR ns.news_end = 0)\n\tAND " . groupaccess('ns.news_visibility') . " " . (multilang_table("NS") ? "AND news_language='" . LANGUAGE . "'" : "") . "\n\tgroup by ns.news_id\n\tORDER BY ns.news_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0050'], 'blockTitle' => $locale['home_0000']), 'infSettings' => get_settings("news"), 'categoryLinkPattern' => INFUSIONS . "news/news.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "news/news.php?readmore={id}");
$configs[DB_ARTICLES] = array('select' => "SELECT\n\tar.article_id as id, ar.article_subject as title, ar.article_snippet as content,\n\tar.article_datestamp as datestamp, ac.article_cat_id as cat_id, ac.article_cat_name as cat_name,\n\tus.user_id, us.user_name, us.user_status\n\tFROM " . DB_ARTICLES . " as ar\n\tINNER JOIN " . DB_ARTICLE_CATS . " as ac ON ac.article_cat_id = ar.article_cat\n\tINNER JOIN " . DB_USERS . " as us ON us.user_id = ar.article_name\n\tWHERE " . groupaccess('ar.article_visibility') . " " . (multilang_table("AR") ? "AND ac.article_cat_language='" . LANGUAGE . "'" : "") . "\n\tORDER BY ar.article_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0051'], 'blockTitle' => $locale['home_0001']), 'infSettings' => get_settings("article"), 'categoryLinkPattern' => INFUSIONS . "articles/articles.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "articles/articles.php?article_id={id}");
$configs[DB_BLOG] = array('select' => "SELECT\n\tbl.blog_id as id, bl.blog_subject as title, bl.blog_blog as content,\n\tbl.blog_datestamp as datestamp, us.user_id, us.user_name,\n\tus.user_status, bc.blog_cat_id as cat_id, bc.blog_cat_name as cat_name,\n\tbl.blog_image as image,\n\tbc.blog_cat_image as cat_image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_BLOG . " as bl\n\tLEFT JOIN " . DB_BLOG_CATS . " as bc ON bc.blog_cat_id = bl.blog_cat\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = bl.blog_id and c1.comment_type = 'BL')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = bl.blog_id AND r1.rating_type = 'BL')\n\tINNER JOIN " . DB_USERS . " as us ON bl.blog_name = us.user_id\n\tWHERE (" . time() . " > bl.blog_start OR bl.blog_start = 0)\n\tAND (" . time() . " < bl.blog_end OR bl.blog_end = 0)\n\tAND " . groupaccess('bl.blog_visibility') . " " . (multilang_table("BL") ? "AND blog_language='" . LANGUAGE . "'" : "") . "\n\tgroup by bl.blog_id\n\tORDER BY bl.blog_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0052'], 'blockTitle' => $locale['home_0002']), 'infSettings' => get_settings("blog"), 'categoryLinkPattern' => INFUSIONS . "blog/blog.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "blog/blog.php?readmore={id}");
$configs[DB_DOWNLOADS] = array('select' => "SELECT\n\tdl.download_id as id, dl.download_title as title, dl.download_description_short as content,\n\tdl.download_datestamp as datestamp, dc.download_cat_id as cat_id, dc.download_cat_name as cat_name,\n\tus.user_id, us.user_name, us.user_status,\n\tdl.download_image as image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_DOWNLOADS . " dl\n\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON dc.download_cat_id = dl.download_cat\n\tINNER JOIN " . DB_USERS . " us ON us.user_id = dl.download_user\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = dl.download_id and c1.comment_type = 'D')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = dl.download_id AND r1.rating_type = 'D')\n\tWHERE " . groupaccess('dl.download_visibility') . " " . (multilang_table("DL") ? "AND dc.download_cat_language='" . LANGUAGE . "'" : "") . "\n\tgroup by dl.download_id\n\tORDER BY dl.download_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0053'], 'blockTitle' => $locale['home_0003']), 'infSettings' => get_settings("downloads"), 'categoryLinkPattern' => DOWNLOADS . "downloads.php?cat_id={cat_id}", 'contentLinkPattern' => DOWNLOADS . "downloads.php?cat_id={cat_id}&download_id={id}");
$contents = array();
foreach ($configs as $table => $config) {
    if (!db_exists($table)) {
        continue;
    }
    $contents[$table] = array('data' => array(), 'colwidth' => 0, 'norecord' => $config['locale']['norecord'], 'blockTitle' => $config['locale']['blockTitle'], 'infSettings' => $config['infSettings']);
    $result = dbquery($config['select']);
    $items_count = dbrows($result);
    if (!$items_count) {
        continue;
    }
    $contents[$table]['colwidth'] = floor(12 / $items_count);
    $data = array();
    $count = 1;
    while ($row = dbarray($result)) {
Example #28
0
function getblogCatPath($item_id)
{
    $full_path = "";
    while ($item_id > 0) {
        $result = dbquery("SELECT blog_cat_id, blog_cat_name, blog_cat_parent FROM " . DB_BLOG_CATS . " WHERE blog_cat_id='{$item_id}'" . (multilang_table("BL") ? " AND blog_cat_language='" . LANGUAGE . "'" : ""));
        if (dbrows($result)) {
            $data = dbarray($result);
            if ($full_path) {
                $full_path = " / " . $full_path;
            }
            $full_path = $data['blog_cat_name'] . $full_path;
            $item_id = $data['blog_cat_parent'];
        }
    }
    return $full_path;
}
Example #29
0
    $result = dbquery("SELECT v.vote_user, v.vote_id, p.poll_opt_0, p.poll_opt_1, p.poll_opt_2, p.poll_opt_3, p.poll_opt_4, p.poll_opt_5, p.poll_opt_6, p.poll_opt_7, p.poll_opt_8, p.poll_opt_9, p.poll_started, p.poll_ended\n\t\tFROM " . DB_POLLS . " p \n\t\tLEFT JOIN " . DB_POLL_VOTES . " v ON p.poll_id = v.poll_id\n\t\tWHERE p.poll_id='" . $_POST['poll_id'] . "'\n\t\tORDER BY v.vote_id");
    if (dbrows($result)) {
        $voters = array();
        while ($pdata = dbarray($result)) {
            $voters[] = $pdata['vote_user'];
            $data = $pdata;
        }
        if ($data['poll_started'] < time() && $data['poll_ended'] == 0 && (empty($voters) || !in_array($userdata['user_id'], $voters)) && !empty($data["poll_opt_" . $_POST['voteoption']])) {
            // bug #1010
            $result = dbquery("INSERT INTO " . DB_POLL_VOTES . " (vote_user, vote_opt, poll_id) VALUES ('" . $userdata['user_id'] . "', '" . $_POST['voteoption'] . "', '" . $_POST['poll_id'] . "')");
        }
    }
    redirect(FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : ""));
}
openside($locale['global_130']);
$result = dbquery("SELECT poll_id, poll_title, poll_opt_0, poll_opt_1, poll_opt_2, poll_opt_3, poll_opt_4, poll_opt_5, poll_opt_6, poll_opt_7, poll_opt_8, poll_opt_9, poll_started, poll_ended, poll_language FROM " . DB_POLLS . " " . (multilang_table("PO") ? "WHERE poll_language='" . LANGUAGE . "'" : "") . " ORDER BY poll_started DESC LIMIT 1");
if (dbrows($result)) {
    $data = dbarray($result);
    $poll_title = $data['poll_title'];
    $poll_option = array();
    for ($i = 0; $i <= 9; $i++) {
        if ($data["poll_opt_" . $i]) {
            $poll_option[$i] = $data["poll_opt_" . $i];
        }
    }
    if (iMEMBER) {
        $result2 = dbquery("SELECT * FROM " . DB_POLL_VOTES . " WHERE vote_user='******'user_id'] . "' AND poll_id='" . $data['poll_id'] . "'");
    }
    if (iMEMBER && !dbrows($result2) && $data['poll_ended'] == 0) {
        $poll = "";
        $i = 0;
 $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);
 $extendedSettings = array();
 if (!fusion_get_settings("tinymce_enabled")) {
     $extendedSettings = array("preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "form_name" => "inputform");
 }
 echo form_textarea('article_article', $locale['articles_0203'], $callback_data['article_article'], $extendedSettings);
 echo "</div>\n";
 echo "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-4'>\n";
 openside("");
 echo form_select_tree("article_cat", $locale['articles_0201'], $callback_data['article_cat'], array("width" => "100%", "inline" => TRUE, "no_root" => TRUE, "query" => multilang_table("AR") ? "WHERE article_cat_language='" . LANGUAGE . "'" : ""), DB_ARTICLE_CATS, "article_cat_name", "article_cat_id", "article_cat_parent");
 echo form_select('article_visibility', $locale['articles_0211'], $callback_data['article_visibility'], array('options' => fusion_get_groups(), 'placeholder' => $locale['choose'], 'width' => '100%', "inline" => TRUE));
 if (multilang_table("AR")) {
     echo form_select('article_language', $locale['global_ML100'], $callback_data['article_language'], array('options' => fusion_get_enabled_languages(), 'width' => '100%', "inline" => TRUE));
 } else {
     echo form_hidden('article_language', '', $callback_data['article_language']);
 }
 echo form_hidden('article_datestamp', '', $callback_data['article_datestamp']);
 echo form_button('preview', $locale['articles_0240'], $locale['articles_0240'], array('class' => 'btn-default m-r-10'));
 echo form_button('publish', $locale['articles_0242'], $locale['articles_0242'], array('class' => 'btn-primary m-r-10'));
 closeside();
 openside("");
 echo "<label><input type='checkbox' name='article_draft' value='1'" . ($callback_data['article_draft'] ? "checked='checked'" : "") . " /> " . $locale['articles_0205'] . "</label><br />\n";
 if (fusion_get_settings("tinymce_enabled") != 1) {
     echo "<label><input type='checkbox' name='article_breaks' value='1'" . ($callback_data['article_breaks'] ? "checked='checked'" : "") . " /> " . $locale['articles_0206'] . "</label><br />\n";
 }
 closeside();
 echo "</div></div>\n";