コード例 #1
0
ファイル: tags.php プロジェクト: php-fusion/PHP-Fusion
 /**
  * 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'] . "&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;
 }
コード例 #2
0
ファイル: members.php プロジェクト: dioda/phpfusion
            $user_groups = explode(".", $data['user_groups']);
            $j = 0;
            foreach ($user_groups as $key => $value) {
                if ($value) {
                    $groups .= "<a href='profile.php?group_id=" . $value . "'>" . getgroupname($value) . "</a>" . ($j < count($user_groups) - 1 ? ", " : "");
                }
                $j++;
            }
            echo "<td class='{$cell_color}'>\n" . ($groups ? $groups : ($data['user_level'] == 103 ? $locale['407'] : $locale['406'])) . "</td>\n";
            echo "<td align='center' width='1%' class='{$cell_color}' style='white-space:nowrap'>" . getuserlevel($data['user_level']) . "</td>\n</tr>";
        }
        echo "</table>\n";
    } else {
        echo "<div style='text-align:center'><br />\n" . $locale['403'] . $_GET['sortby'] . "<br /><br />\n</div>\n";
    }
    $search = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
    echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
    echo "<td rowspan='2' class='tbl2'><a href='" . FUSION_SELF . "?sortby=all'>" . $locale['404'] . "</a></td>";
    for ($i = 0; $i < 36 != ""; $i++) {
        echo "<td align='center' class='tbl1'><div class='small'><a href='" . FUSION_SELF . "?sortby=" . $search[$i] . "'>" . $search[$i] . "</a></div></td>";
        echo $i == 17 ? "<td rowspan='2' class='tbl2'><a href='" . FUSION_SELF . "?sortby=all'>" . $locale['404'] . "</a></td>\n</tr>\n<tr>\n" : "\n";
    }
    echo "</tr>\n</table>\n";
} else {
    redirect("index.php");
}
closetable();
if ($rows > 20) {
    echo "<div align='center' style='margin-top:5px;'>" . makepagenav($_GET['rowstart'], 20, $rows, 3, FUSION_SELF . "?sortby=" . $_GET['sortby'] . "&amp;") . "</div>\n";
}
require_once THEMES . "templates/footer.php";
コード例 #3
0
ファイル: news.php プロジェクト: dioda/phpfusion
            $data['news_reads']++;
        }
        $news_cat_image = "";
        $news_subject = $data['news_subject'];
        if ($data['news_image_t1'] && $settings['news_image_readmore'] == "0") {
            $img_size = @getimagesize(IMAGES_N . $data['news_image']);
            $news_cat_image = "<a href=\"javascript:;\" onclick=\"window.open('" . IMAGES_N . $data['news_image'] . "','','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=" . ($img_size[0] + 20) . ",height=" . ($img_size[1] + 20) . "')\"><img src='" . IMAGES_N_T . $data['news_image_t1'] . "' alt='" . $data['news_subject'] . "' class='news-category' /></a>";
        } elseif ($data['news_cat_image']) {
            $news_cat_image = "<a href='news_cats.php?cat_id=" . $data['news_cat'] . "'><img src='" . get_image("nc_" . $data['news_cat_name']) . "' alt='" . $data['news_cat_name'] . "' class='news-category' /></a>";
        }
        $news_news = preg_split("/<!?--\\s*pagebreak\\s*-->/i", $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news'])) : stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']));
        $pagecount = count($news_news);
        $news_info = array("news_id" => $data['news_id'], "user_id" => $data['user_id'], "user_name" => $data['user_name'], "user_status" => $data['user_status'], "news_date" => $data['news_datestamp'], "cat_id" => $data['news_cat'], "cat_name" => $data['news_cat_name'], "cat_image" => $news_cat_image, "news_subject" => $data['news_subject'], "news_ext" => "n", "news_reads" => $data['news_reads'], "news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='" . $data['news_id'] . "' AND comment_hidden='0'"), "news_allow_comments" => $data['news_allow_comments'], "news_sticky" => $data['news_sticky']);
        add_to_title($locale['global_201'] . $news_subject);
        echo "<!--news_pre_readmore-->";
        render_news($news_subject, $news_news[$_GET['rowstart']], $news_info);
        echo "<!--news_sub_readmore-->";
        if ($pagecount > 1) {
            echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 1, $pagecount, 3, FUSION_SELF . "?readmore=" . $_GET['readmore'] . "&amp;") . "\n</div>\n";
        }
        if ($data['news_allow_comments']) {
            showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], FUSION_SELF . "?readmore=" . $_GET['readmore']);
        }
        if ($data['news_allow_ratings']) {
            showratings("N", $_GET['readmore'], FUSION_SELF . "?readmore=" . $_GET['readmore']);
        }
    } else {
        redirect(FUSION_SELF);
    }
}
require_once THEMES . "templates/footer.php";
コード例 #4
0
ファイル: tracked.php プロジェクト: php-fusion/PHP-Fusion
// 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'] . "&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>"), "track_button" => array('link' => FORUM . "index.php?section=tracked&amp;delete=" . $threads['thread_id'], 'title' => $locale['global_058']));
        // push
        $this->forum_info['item'][$threads['thread_id']] = $threads;
    }
}
コード例 #5
0
ファイル: faq.php プロジェクト: roniwahyu/AKEUDA
        add_to_title($locale['global_201'] . $data['faq_cat_name']);
        opentable($locale['401'] . ": " . $data['faq_cat_name']);
        echo "<!--pre_faq_cat-->";
        $rows = dbcount("(faq_id)", DB_FAQS, "faq_cat_id='" . $_GET['cat_id'] . "'");
        if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
            $_GET['rowstart'] = 0;
        }
        if ($rows != 0) {
            $result = dbquery("SELECT * FROM " . DB_FAQS . " WHERE faq_cat_id='" . $_GET['cat_id'] . "' ORDER BY faq_id LIMIT " . $_GET['rowstart'] . ",15");
            $numrows = dbrows($result);
            $i = 1;
            while ($data = dbarray($result)) {
                echo "<strong>" . $data['faq_question'] . "</strong><br />\n" . nl2br(stripslashes($data['faq_answer']));
                echo $i != $numrows ? "<br /><br />\n" : "\n";
                $i++;
            }
            echo "<!--sub_faq_cat-->";
            closetable();
            if ($rows != 0) {
                echo "<div align='center' style='margin-top:5px;'>" . makepagenav($_GET['rowstart'], 15, $rows, 3, FUSION_SELF . "?cat_id=" . $_GET['cat_id'] . "&amp;") . "\n</div>\n";
            }
        } else {
            echo $locale['411'] . "\n";
            echo "<!--sub_faq_cat-->";
            closetable();
        }
    } else {
        redirect(FUSION_SELF);
    }
}
require_once THEMES . "templates/footer.php";
コード例 #6
0
ファイル: user_log.php プロジェクト: necrophcodr/Muks
        echo "<tr>\n";
        echo "<td class='" . $class . "'>" . showdate("shortdate", $data['userlog_timestamp']) . "</td>\n";
        echo "<td class='" . $class . "'>" . profile_link($data['userlog_user_id'], $data['user_name'], $data['user_status']) . "</td>\n";
        echo "<td class='" . $class . "'>" . $data['userlog_field'] . "</td>\n";
        echo "<td class='" . $class . "'>" . trimlink($data['userlog_value_old'], 100) . "</td>\n";
        echo "<td class='" . $class . "'>" . trimlink($data['userlog_value_new'], 100) . "</td>\n";
        echo "<td class='" . $class . "'><a href='" . FUSION_SELF . $getString . "&amp;delete=" . $data['userlog_id'] . "'>" . $locale['116'] . "</a></td>\n";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
} else {
    echo "<center>" . $locale['112'] . "</center>\n";
}
if ($rows > 20) {
    echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 20, $rows, 3, FUSION_SELF . $getString . "&amp;") . "\n</div>\n";
}
echo "<br />";
echo "<form action='" . FUSION_SELF . $aidlink . "' method='post'>\n";
echo "<table cellpadding='0' cellspacing='1' class='tbl-border center' style='width: 400px;'>\n";
echo "<tr>\n";
echo "<td class='tbl' width='50%'>" . $locale['110'] . ":</td>\n";
echo "<td class='tbl1' align='right'>\n";
echo "<input type='text' name='delete' value='90' maxlength='3' class='textbox' style='width:35px;' /> " . $locale['111'];
echo " <input type='submit' value='" . $locale['109'] . "' class='button' />";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
closetable();
require_once THEMES . "templates/footer.php";
コード例 #7
0
ファイル: liste.php プロジェクト: necrophcodr/Muks
if ($list !== 'blogs') {
    echo '<table style="width: 100%;" class="tbl-border forum_thread_table">';
    while ($blogarr = dbarray($bloglist)) {
        echo '
<tr>
<td style="width: 25%;" class="tbl2 forum-caption">' . showdate('forumdate', $blogarr['bp_timestamp']) . '</td>
<td style="width: 75%;" class="tbl2 forum-caption">' . $blogarr['bp_title'] . '</td>
</tr>
<tr>
<td style="width: 25%;" class="tbl2 forum-caption">
' . profile_link($blogarr['bp_author'], $blogarr['user_name'], $blogarr['user_status']) . '<br />';
        if ($blogarr['user_avatar'] && file_exists(IMAGES . "avatars/" . $blogarr['user_avatar']) && $blogarr['user_status'] != 6 && $blogarr['user_status'] != 5) {
            echo "<img src='" . IMAGES . "avatars/" . $blogarr['user_avatar'] . "' alt='Avatar' /><br /><br />\n";
        }
        echo 'Antal blogindlæg: ' . $blogarr['user_blog'] . '<br />
<a href="/blog/liste.php?list=' . $blogarr['user_id'] . '">Se blog</a>
' . (iADMIN || $blogarr['user_id'] == $userdata['user_id'] ? '<br /><a href="/blog/slet.php?id=' . $blogarr['bp_id'] . '" onclick="return confirm(\'Er du sikker på, du vil slette dette indlæg?\')">Slet indlæg</a>' : '') . '
<br /><a href="/report.php?action=new&amp;bp_id=' . $blogarr['bp_id'] . '">Anmeld</a>
</td>
<td style="width: 75%;" class="tbl1">' . nl2br(parseubb(preg_replace('/\\[(\\/){0,1}img\\]/', '[$1url]', phpentities($blogarr['bp_content'])))) . '</td>
</tr>
<tr>
<td colSpan="2" style="width: 5px;">&nbsp;</td>
</tr>
';
    }
    echo '</table>';
}
echo makepagenav($_GET['rowstart'], 20, $bloglist2, 3, FUSION_SELF . "?list=" . $list . "&amp;") . "\n";
closetable();
require_once THEMES . "templates/footer.php";
コード例 #8
0
function showcomments($ctype, $cdb, $ccol, $cid, $clink)
{
    global $settings, $locale, $userdata, $aidlink;
    $link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : "");
    $link = preg_replace("^(&amp;|\\?)c_action=(edit|delete)&amp;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" ? "" : "&amp;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 . "&amp;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 . "&amp;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 . "&amp;", "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 . "&amp;c_action=edit&amp;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 . "&amp;c_action=delete&amp;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 . "&amp;ctype=" . $ctype . "&amp;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 .= "&amp;c_action=edit&amp;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();
    }
}
コード例 #9
0
ファイル: weblinks.php プロジェクト: php-fusion/PHP-Fusion
    $info = array();
    $info['item'] = array();
    $result = dbquery("SELECT weblink_cat_name, weblink_cat_sorting FROM\n\t" . DB_WEBLINK_CATS . " " . (multilang_table("WL") ? "WHERE weblink_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " weblink_cat_id='" . intval($_GET['cat_id']) . "'");
    if (dbrows($result) != 0) {
        $cdata = dbarray($result);
        $info = $cdata;
        add_to_title($locale['global_201'] . $cdata['weblink_cat_name']);
        weblink_cat_breadcrumbs($weblink_cat_index);
        add_to_meta("description", $cdata['weblink_cat_name']);
        $max_rows = dbcount("(weblink_id)", DB_WEBLINKS, "weblink_cat='" . $_GET['cat_id'] . "' AND " . groupaccess('weblink_visibility'));
        $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $max_rows ? $_GET['rowstart'] : 0;
        if ($max_rows != 0) {
            $result = dbquery("SELECT weblink_id, weblink_name, weblink_description, weblink_datestamp, weblink_count\n            FROM " . DB_WEBLINKS . " WHERE " . groupaccess('weblink_visibility') . " AND weblink_cat='" . intval($_GET['cat_id']) . "' ORDER BY " . $cdata['weblink_cat_sorting'] . " LIMIT " . $_GET['rowstart'] . "," . $wl_settings['links_per_page']);
            $numrows = dbrows($result);
            $info['weblink_rows'] = $numrows;
            $info['page_nav'] = $max_rows > $wl_settings['links_per_page'] ? makepagenav($_GET['rowstart'], $wl_settings['links_per_page'], $max_rows, 3, INFUSIONS . "weblinks/weblinks.php?cat_id=" . $_GET['cat_id'] . "&amp;") : 0;
            if (dbrows($result) > 0) {
                while ($data = dbarray($result)) {
                    $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
コード例 #10
0
function photo_subalbums($id)
{
    global $settings, $locale;
    $list = "";
    $subs = dbcount("(album_id)", DB_PHOTO_ALBUMS, groupaccess('album_access') . " AND album_parent='" . (int) $id . "'");
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    if ($subs > 0) {
        opentable($locale['407']);
        $s_result = dbquery("SELECT ta.album_id, album_title, album_thumb, album_datestamp, tu.user_id,user_name FROM " . DB_PHOTO_ALBUMS . " ta\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ta.album_user=tu.user_id\r\n\t\t\tWHERE " . groupaccess('album_access') . " AND album_parent='" . (int) $id . "' ORDER BY album_order\r\n\t\t\tLIMIT " . (int) $_GET['rowstart'] . "," . (int) $settings['thumbs_per_page']);
        $counter = 0;
        $r = 0;
        $k = 1;
        if ($subs > $settings['thumbs_per_page']) {
            echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3) . "\n</div>\n";
        }
        echo "<table cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n";
        while ($s_data = dbarray($s_result)) {
            if ($counter != 0 && $counter % $settings['thumbs_per_row'] == 0) {
                echo "</tr>\n<tr>\n";
            }
            echo "<td align='center' valign='top' class='tbl'>\n";
            echo "<strong>" . $s_data['album_title'] . "</strong><br /><br />\n<a href='" . FUSION_SELF . "?album_id=" . $s_data['album_id'] . "'>";
            if ($s_data['album_thumb'] && file_exists(PHOTOS . $s_data['album_thumb'])) {
                echo "<img src='" . PHOTOS . $s_data['album_thumb'] . "' alt='" . $s_data['album_thumb'] . "' title='" . $locale['401'] . "' style='border:0px' />";
            } else {
                echo "<img src='" . PHOTOS . "nophoto.jpg' alt='' title='" . $locale['401'] . "' style='border:0px' />";
            }
            echo "</a><br /><br />\n<span class='small'>\n";
            echo $locale['405'] . dbcount("(photo_id)", DB_PHOTOS, "album_id='" . $s_data['album_id'] . "'") . "</span><br />\n";
            echo "</td>\n";
            $counter++;
            $k++;
        }
        echo "</tr>\n</table>\n";
        closetable();
        if ($subs > $settings['thumbs_per_page']) {
            echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3) . "\n</div>\n";
        }
    }
    return $list;
}
コード例 #11
0
ファイル: index.php プロジェクト: php-fusion/PHP-Fusion
    $global_ratings['ratings_nav'] = makepagenav($_GET['r_rowstart'], $settings['comments_per_page'], $global_ratings['rows'], 2);
}
// Latest Submissions
$global_submissions['rows'] = dbcount("('submit_id')", DB_SUBMISSIONS);
$_GET['s_rowstart'] = isset($_GET['s_rowstart']) && $_GET['s_rowstart'] <= $global_submissions['rows'] ? $_GET['s_rowstart'] : 0;
$result = dbquery("SELECT s.*, u.user_id, u.user_name, u.user_status, u.user_avatar\n\t\t\t\tFROM " . DB_SUBMISSIONS . " s LEFT JOIN " . DB_USERS . " u on u.user_id=s.submit_user\n\t\t\t\tORDER BY submit_datestamp DESC LIMIT " . $_GET['s_rowstart'] . ", " . $settings['comments_per_page'] . "\n\t\t\t\t");
$global_submissions['data'] = array();
if (dbrows($result) > 0 && checkrights('SU')) {
    while ($_subdata = dbarray($result)) {
        $global_submissions['data'][] = $_subdata;
    }
} else {
    $global_submissions['nodata'] = $locale['254a'];
}
if ($global_submissions['rows'] > $settings['comments_per_page']) {
    $global_submissions['submissions_nav'] = "<span class='pull-right text-smaller'>" . makepagenav($_GET['s_rowstart'], $settings['comments_per_page'], $global_submissions['rows'], 2) . "</span>\n";
}
// Icon Grid
if (isset($_GET['pagenum']) && isnum($_GET['pagenum'])) {
    $result = dbquery("SELECT * FROM " . DB_ADMIN . " WHERE admin_page='" . $_GET['pagenum'] . "' ORDER BY admin_title");
    $admin_icons['rows'] = dbrows($result);
    $admin_icons['data'] = array();
    if (dbrows($result)) {
        while ($_idata = dbarray($result)) {
            if (checkrights($_idata['admin_rights']) && $_idata['admin_link'] != "reserved") {
                // Current locale file have the admin title definitions paired by admin_rights.
                if ($_idata['admin_page'] !== 5) {
                    $_idata['admin_title'] = isset($locale[$_idata['admin_rights']]) ? $locale[$_idata['admin_rights']] : $_idata['admin_title'];
                }
                $admin_icons['data'][] = $_idata;
            }
コード例 #12
0
ファイル: downloads.php プロジェクト: php-fusion/PHP-Fusion
        $_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'])) {
    while ($data = dbarray($result)) {
        $data = array_merge($data, parseInfo($data));
        $info['download_item'][$data['download_id']] = $data;
    }
}
$author_result = dbquery("SELECT b.download_title, b.download_user, count(b.download_id) as download_count, u.user_id, u.user_name, u.user_status\n\t\t\t\tFROM " . DB_DOWNLOADS . " b\n\t\t\t\tINNER JOIN " . DB_USERS . " u on (b.download_user = u.user_id)\n\t\t\t\tGROUP BY b.download_user ORDER BY b.download_user ASC\n\t\t\t\t");
if (dbrows($author_result)) {
    while ($at_data = dbarray($author_result)) {
        $active = isset($_GET['author']) && $_GET['author'] == $at_data['download_user'] ? 1 : 0;
        $info['download_author'][$at_data['download_user']] = array('title' => $at_data['user_name'], 'link' => INFUSIONS . "downloads/downloads.php?author=" . $at_data['download_user'], 'count' => $at_data['download_count'], 'active' => $active);
    }
}
render_downloads($info);
コード例 #13
0
ファイル: forum_main.php プロジェクト: knapnet/PHP-Fusion
 function render_participated($info)
 {
     global $locale;
     echo render_breadcrumbs();
     if (!empty($info['item'])) {
         // sort by date.
         $last_date = '';
         foreach ($info['item'] as $data) {
             $cur_date = date('M d, Y', $data['post_datestamp']);
             if ($cur_date != $last_date) {
                 $last_date = $cur_date;
                 $title = "<div class='post_title m-b-10'>Posts on " . $last_date . "</div>\n";
                 echo $title;
             }
             render_thread_item($data);
         }
         echo "</div>\n";
         // addition of a div the first time which did not close where $i = 0;
         if ($info['post_rows'] > 20) {
             echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 20, $info['post_rows'], 3, FUSION_REQUEST, "rowstart") . "\n</div>\n";
         }
     } else {
         echo "<div class='well text-center'>" . $locale['global_054'] . "</div>\n";
     }
 }
コード例 #14
0
ファイル: template.php プロジェクト: simplyianm/clububer
function render_shop($field, $table, $conditions, $sortQuery, $sortDirQuery, $rowstart)
{
    global $aidlink, $locale, $settings, $golddata, $_REQUEST, $_POST, $_GET;
    if (!isset($rowstart) || !isnum($rowstart)) {
        $rowstart = 0;
    }
    $limit = 8;
    $result = dbquery("SELECT {$field} FROM {$table} WHERE {$conditions} ORDER BY {$sortQuery} {$sortDirQuery} LIMIT {$rowstart},{$limit}");
    $rows = dbrows($result);
    if ($rows != 0) {
        $counter = 0;
        $columns = 2;
        $width = round(100 / $columns);
        $i = 1;
        $start = 1;
        $align = "left";
        echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>\n<tr>\n";
        while ($data = dbarray($result)) {
            if ($counter != 0 && $counter % $columns == 0) {
                if ($start == 1) {
                    $i = 2;
                    $start = 2;
                } else {
                    $i = 1;
                    $start = 1;
                }
                echo "</tr>\n<tr>\n";
            }
            echo "<td align='{$align}' valign='top' width='{$width}%' height='100%' class='tbl{$i}'>\n";
            echo "<table>\n<tr>\n";
            echo "<td rowspan='5' valign='top' align='left' width='1%'>\n";
            echo "<img border='0' width='" . UGLD_IMAGE_WIDTH . "' height='" . UGLD_IMAGE_HEIGHT . "' src='" . GOLD_IMAGE_ITEM . $data['image'] . "' /></td>\n";
            echo "<td><strong><a href='" . FUSION_SELF . "?op=shop_item&amp;id=" . $data['id'] . "'>" . $data['name'] . "</a></strong></td>\n";
            echo "</tr>\n<tr>\n";
            echo "<td>" . $data['description'] . "</td>\n";
            echo "</tr>\n<tr>\n";
            echo "<td><u>" . $locale['urg_shop_109'] . "</u> " . formatMoney($data['cost']) . "</td>\n";
            echo "</tr>\n<tr>\n";
            echo "<td><u>" . $locale['urg_shop_117'] . "</u> " . $data['stock'] . "</td>\n";
            echo "</tr>\n<tr>\n";
            echo "<td>\n";
            if ($golddata['cash'] >= $data['cost']) {
                echo "<a href='index.php?op=shop_finalise&amp;id=" . $data['id'] . "&amp;return=" . urlencode(FUSION_SELF . "?op=shop_start&sort=" . $_REQUEST['sort'] . "&sortDir=" . $_REQUEST['sortDir'] . "&category=" . $_REQUEST['category'] . "&rowstart={$rowstart}") . "'>" . $locale['urg_shop_119'] . "</a>\n";
            } elseif ($data['stock'] == 0) {
                echo "<strong>" . $locale['urg_shop_120'] . "</strong>\n";
            } else {
                echo "<span style='color:red;'>" . sprintf($locale['urg_shop_121'] . " %s", formatMoney($data['cost'] - $golddata['cash'])) . "</span>\n";
            }
            echo "</td>\n</tr>\n</table>\n";
            echo "</td>\n";
            if ($i == 1) {
                $i++;
            } else {
                $i = 1;
            }
            $counter++;
        }
        echo "</tr>\n</table>\n";
        $rows = dbcount("(*)", $table, $conditions);
        if ($rows > $limit) {
            echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($rowstart, $limit, $rows, 3, FUSION_SELF . "?op=shop_start&sort=" . $_REQUEST['sort'] . "&sortDir=" . $_REQUEST['sortDir'] . "&category=" . $_REQUEST['category'] . "&") . "\n</div>\n";
        }
    } else {
        echo "<table cellpadding='5' cellspacing='5' width='100%' class='tbl-border'>\n<tr>\n<td align='left'><strong>" . $locale['urg_shop_120'] . "</strong></td>\n</tr>\n</table>\n";
    }
}
コード例 #15
0
ファイル: photogallery.php プロジェクト: dioda/phpfusion
        echo "<table cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n";
        while ($data = dbarray($result)) {
            if ($counter != 0 && $counter % $settings['thumbs_per_row'] == 0) {
                echo "</tr>\n<tr>\n";
            }
            echo "<td align='center' valign='top' class='tbl'>\n";
            echo "<strong>" . $data['album_title'] . "</strong><br /><br />\n<a href='" . FUSION_SELF . "?album_id=" . $data['album_id'] . "'>";
            if ($data['album_thumb'] && file_exists(PHOTOS . $data['album_thumb'])) {
                echo "<img src='" . PHOTOS . $data['album_thumb'] . "' alt='" . $data['album_thumb'] . "' title='" . $locale['401'] . "' style='border:0px' />";
            } else {
                echo $locale['402'];
            }
            echo "</a><br /><br />\n<span class='small'>\n";
            echo $locale['403'] . showdate("shortdate", $data['album_datestamp']) . "<br />\n";
            echo $locale['404'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br />\n";
            echo $locale['405'] . dbcount("(photo_id)", DB_PHOTOS, "album_id='" . $data['album_id'] . "'") . "</span><br />\n";
            echo "</td>\n";
            $counter++;
            $k++;
        }
        echo "</tr>\n</table>\n";
        closetable();
        if ($rows > $settings['thumbs_per_page']) {
            echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3) . "\n</div>\n";
        }
    } else {
        echo "<div style='text-align:center'><br />" . $locale['406'] . "<br /><br /></div>\n";
        closetable();
    }
}
require_once THEMES . "templates/footer.php";
コード例 #16
0
ファイル: viewthread.php プロジェクト: keddyboys/kmods
        $edit_reason_js .= ".bind('click',function(){";
        $edit_reason_js .= "jQuery('#reason_div_pid_'+this.rel).stop().slideToggle('fast');";
        $edit_reason_js .= "});";
    }
}
echo "</table><!--sub_forum_thread_table-->\n";
if (iMOD) {
    echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n<td style='padding-top:5px'>";
    echo "<a href='#' onclick=\"javascript:setChecked('mod_form','delete_post[]',1);return false;\">" . $locale['460'] . "</a> ::\n";
    echo "<a href='#' onclick=\"javascript:setChecked('mod_form','delete_post[]',0);return false;\">" . $locale['461'] . "</a></td>\n";
    echo "<td align='right' style='padding-top:5px'><input type='submit' name='move_posts' value='" . $locale['517a'] . "' class='button' onclick=\"return confirm('" . $locale['518a'] . "');\" />\n<input type='submit' name='delete_posts' value='" . $locale['517'] . "' class='button' onclick=\"return confirm('" . $locale['518'] . "');\" /></td>\n";
    echo "</tr>\n</table>\n</form>\n";
}
if ($rows > $posts_per_page) {
    echo "<div align='center' style='padding-top:5px'>\n";
    echo makepagenav($_GET['rowstart'], $posts_per_page, $rows, 3, FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . (isset($_GET['highlight']) ? "&amp;highlight=" . urlencode($_GET['highlight']) : "") . "&amp;") . "\n";
    echo "</div>\n";
}
$forum_list = "";
$current_cat = "";
$result = dbquery("SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name\n\tFROM " . DB_FORUMS . " f\n\tINNER JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\n\tWHERE " . groupaccess('f.forum_access') . " AND f.forum_cat!='0' AND f.forum_parent='0'\n\tORDER BY f2.forum_order ASC, f.forum_order ASC");
while ($data = dbarray($result)) {
    if ($data['forum_cat_name'] != $current_cat) {
        if ($current_cat != "") {
            $forum_list .= "</optgroup>\n";
        }
        $current_cat = $data['forum_cat_name'];
        $forum_list .= "<optgroup label='" . $data['forum_cat_name'] . "'>\n";
        $forum_list .= forum_jump_to($data['forum_id']);
        //subforums
    }
コード例 #17
0
ファイル: messages.php プロジェクト: caveman4572/PHP-Fusion
        echo "<input type='submit' name='delete_msg' value='" . $locale['416'] . "' class='button' />\n";
        echo "</td>\n</tr>\n</table>\n</form>\n";
    } else {
        echo "<div style='text-align:center'><br />" . $locale['461'] . "<br /><br /></div>";
    }
    echo "<script type='text/javascript'>\n";
    echo "/* <![CDATA[ */\n";
    echo "function setChecked(frmName,chkName,val) {" . "\n";
    echo "dml=document.forms[frmName];" . "\n" . "len=dml.elements.length;" . "\n" . "for(i=0;i < len;i++) {" . "\n";
    echo "if(dml.elements[i].name == chkName) {" . "\n" . "dml.elements[i].checked = val;" . "\n";
    echo "}\n}\n}\n";
    echo "/* ]]> */\n";
    echo "</script>\n";
    closetable();
    if ($total_rows > 20) {
        echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 20, $total_rows, 3, FUSION_SELF . "?folder=" . $_GET['folder'] . "&amp;") . "\n</div>\n";
    }
} elseif ($_GET['folder'] == "options") {
    $result = dbquery("SELECT * FROM " . DB_MESSAGES_OPTIONS . " WHERE user_id='" . $userdata['user_id'] . "'");
    if (dbrows($result)) {
        $my_settings = dbarray($result);
        $update_type = "update";
    } else {
        $options = dbarray(dbquery("SELECT pm_save_sent, pm_email_notify FROM " . DB_MESSAGES_OPTIONS . " WHERE user_id='0' LIMIT 1"));
        $my_settings['pm_save_sent'] = $options['pm_save_sent'];
        $my_settings['pm_email_notify'] = $options['pm_email_notify'];
        $update_type = "insert";
    }
    $bdata = dbarray(dbquery("SELECT COUNT(IF(message_folder=0, 1, null)) inbox_total,\n\t\tCOUNT(IF(message_folder=1, 1, null)) outbox_total, COUNT(IF(message_folder=2, 1, null)) archive_total\n\t\tFROM " . DB_MESSAGES . " WHERE message_to='" . $userdata['user_id'] . "' GROUP BY message_to"));
    $bdata['inbox_total'] = isset($bdata['inbox_total']) ? $bdata['inbox_total'] : "0";
    $bdata['outbox_total'] = isset($bdata['outbox_total']) ? $bdata['outbox_total'] : "0";
コード例 #18
0
ファイル: view.php プロジェクト: php-fusion/PHP-Fusion
 /**
  * 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();
 }
コード例 #19
0
<?php

defined("IN_FUSION") or die;
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
    $_GET['rowstart'] = 0;
}
$total_posts = dbcount("(alb_post_id)", DB_AL_BLOG_POSTS, "alb_post_status='1'");
$result = dbquery("SELECT p.*,pc.*,u.user_name,u.user_avatar FROM " . DB_AL_BLOG_POSTS . " p LEFT JOIN " . DB_AL_BLOG_CATEGORIES . " pc ON pc.alb_cat_id=p.alb_post_cat LEFT JOIN " . DB_USERS . " u ON u.user_id=p.alb_post_user WHERE alb_post_status='1' ORDER BY alb_post_datestamp DESC LIMIT " . $_GET['rowstart'] . ",10");
if (dbrows($result)) {
    while ($data = dbarray($result)) {
        $data['comments'] = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $data['alb_post_id'] . "' AND comment_type='BL'");
        pre_render_post($data);
    }
    if ($total_posts > 10) {
        echo "<div align='center' style=';margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 10, $total_posts, 3, FUSION_SELF) . "</div>";
    }
} else {
    opentable("!?...");
    echo "<div style='width:100%;text-align:center;'>" . $locale['alb7'] . "</div>";
    closetable();
}
コード例 #20
0
    echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_046'] . "</strong></td>\n";
    if (IF_MULTI_LANGUAGE_FORUM) {
        echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_061'] . "</strong></td>\n";
    }
    echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_057'] . "</strong></td>\n";
    echo "</tr>\n";
    $i = 0;
    while ($data = dbarray($result)) {
        $row_color = $i % 2 == 0 ? "tbl1" : "tbl2";
        echo "<tr>\n<td class='" . $row_color . "'><a href='" . make_url(FORUM . "viewthread.php?thread_id=" . $data['thread_id'], BASEDIR . "forum-thread-" . $data['thread_id'] . "-", $data['thread_subject'], ".html") . "'>" . $data['thread_subject'] . "</a></td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . profile_link($data['user_id1'], $data['user_name1'], $data['user_status1']) . "</td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . profile_link($data['user_id2'], $data['user_name2'], $data['user_status2']) . "<br />\r\n\t\t" . showdate("forumdate", $data['thread_lastpost']) . "</td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . ($data['thread_postcount'] - 1) . "</td>\n";
        if (IF_MULTI_LANGUAGE_FORUM) {
            echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . get_image($data['forum_language'], $data['forum_language'], "", $data['forum_language'], "", true) . "</td>\n";
        }
        // Pimped
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'><a href='" . FUSION_SELF . "?delete=" . $data['thread_id'] . "' onclick=\"return confirm('" . $locale['global_060'] . "');\">" . $locale['global_058'] . "</a></td>\n";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
    require_once INFUSIONS . "forum_threads_list_panel/threads_list_navigation.php";
    closetable();
    echo "<div align='center' style='margin-top:5px;'>" . makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF . "?") . "</div>\n";
} else {
    echo "<div style='text-align:center;'><br />" . $locale['global_059'] . "<br /><br /></div>\n";
    require_once INFUSIONS . "forum_threads_list_panel/threads_list_navigation.php";
    closetable();
}
require_once TEMPLATES . "footer.php";
コード例 #21
0
ファイル: Viewthread.php プロジェクト: knapnet/PHP-Fusion
 /**
  * Get thread posts info
  */
 private function get_thread_post()
 {
     global $forum_settings, $locale, $userdata;
     $user_sig_module = \PHPFusion\UserFields::check_user_field('user_sig');
     $user_web_module = \PHPFusion\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, u.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) {
         /* 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, INFUSIONS . "forum/viewthread.php?thread_id=" . $this->thread_info['thread']['thread_id'] . (isset($_GET['highlight']) ? "&amp;highlight=" . urlencode($_GET['highlight']) : '') . "&amp;") . "</div>";
         }
         $i = 1;
         while ($pdata = dbarray($result)) {
             // Format Post Message
             $post_message = $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='" . FUSION_SELF . "?thread_id=" . $pdata['thread_id'] . "&amp;getfile=" . $attachData['attach_id'] . "'>" . $attachData['attach_name'] . "</a>&nbsp;";
                                 $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 += 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, '40px', FALSE, FALSE, 'img-rounded'), "user_ip" => $forum_settings['forum_ips'] && iMOD ? $locale['forum_0268'] . ' ' . $pdata['post_ip'] : '', "user_post_count" => format_word($pdata['user_posts'], $locale['fmt_post']), "print" => array('link' => BASEDIR . "print.php?type=F&amp;item_id=" . $_GET['thread_id'] . "&amp;post=" . $pdata['post_id'] . "&amp;nr=" . ($i + $_GET['rowstart']), 'title' => $locale['forum_0179']), "post_marker" => $post_marker, "marker" => $marker, "post_attachments" => $post_attachments);
             $pdata['post_message'] = $post_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&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'] . "&amp;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&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], 'title' => $locale['forum_0265']);
                     }
                     $pdata['post_reply'] = array('link' => INFUSIONS . "forum/viewthread.php?action=reply&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], 'title' => $locale['forum_0509']);
                 } elseif (iMOD) {
                     $pdata['post_edit'] = array('link' => INFUSIONS . "forum/viewthread.php?action=edit&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;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_prefix = !preg_match("@^http(s)?\\:\\/\\/@i", $pdata['user_web']) ? "http://" . $pdata['user_web'] : $pdata['user_web'];
                 $pdata['user_web'] = array('link' => $user_web_url_prefix . $pdata['user_web'], '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&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], "title" => $locale['forum_0265']);
                     $pdata['vote_down'] = array('link' => INFUSIONS . "forum/postify.php?post=votedown&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;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";
                 }
             }
             // Edit Reason - NOT WORKING?
             $pdata['post_edit_reason'] = '';
             if ($pdata['post_edittime']) {
                 $edit_reason = "<div class='edit_reason m-t-10'><small>" . $locale['forum_0164'] . profile_link($pdata['post_edituser'], $pdata['edit_name'], $pdata['edit_status']) . $locale['forum_0167'] . showdate("forumdate", $pdata['post_edittime']) . "</small>\n";
                 if ($pdata['post_editreason'] && iMEMBER) {
                     $edit_reason .= "<br /><a id='reason_pid_" . $pdata['post_id'] . "' rel='" . $pdata['post_id'] . "' class='reason_button small' data-target='reason_div_pid_" . $pdata['post_id'] . "'>";
                     $edit_reason .= "<strong>" . $locale['forum_0165'] . "</strong>";
                     $edit_reason .= "</a>\n";
                     $edit_reason .= "<div id='reason_div_pid_" . $pdata['post_id'] . "' class='reason_div small'>" . $pdata['post_editreason'] . "</div>\n";
                 }
                 $edit_reason .= "</div>\n";
                 $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++;
         }
     }
 }
コード例 #22
0
ファイル: weblinks.php プロジェクト: necrophcodr/Muks
                        $new = " <span class='small'>" . $locale['410'] . "</span>";
                    } else {
                        $new = "";
                    }
                    echo "<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'>\n";
                    echo "<tr>\n<td colspan='2' class='tbl2'><a href='" . FUSION_SELF . "?cat_id=" . $_GET['cat_id'] . "&amp;weblink_id=" . $data['weblink_id'] . "' target='_blank'>" . $data['weblink_name'] . "</a>{$new}</td>\n</tr>\n";
                    if ($data['weblink_description'] != "") {
                        echo "<tr>\n<td colspan='2' class='tbl1'>" . nl2br(stripslashes($data['weblink_description'])) . "</td>\n</tr>\n";
                    }
                    echo "<tr>\n<td width='30%' class='tbl2'><strong>" . $locale['411'] . "</strong> " . showdate("shortdate", $data['weblink_datestamp']) . "</td>\n";
                    echo "<td width='70%' class='tbl1'><strong>" . $locale['412'] . "</strong> " . $data['weblink_count'] . "</td>\n</tr>\n</table>\n";
                    if ($i != $numrows) {
                        echo "<div align='center'><img src='" . get_image("blank") . "' alt='' height='15' width='1' /></div>\n";
                        $i++;
                    }
                }
                closetable();
                if ($rows > $settings['links_per_page']) {
                    echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $settings['links_per_page'], $rows, 3, FUSION_SELF . "?cat_id=" . $_GET['cat_id'] . "&amp;") . "\n</div>\n";
                }
            } else {
                echo $locale['431'] . "\n";
                closetable();
            }
        }
    }
    if ($res == 0) {
        redirect(FUSION_SELF);
    }
}
require_once THEMES . "templates/footer.php";
コード例 #23
0
ファイル: usage.php プロジェクト: simplyianm/clububer
         echo "<td align='right' valign='top'>\n";
         echo "<a href='" . FUSION_SELF . $aidlink . "&amp;op=useage&amp;step=c_delete&amp;id=" . $data["cat_id"] . "'>\n";
         echo "<img src='../images/delete.png' title='" . $locale['urg_a_usage_142'] . "' alt='" . $locale['urg_a_usage_142'] . "' style='border: 0;' /></a>\n";
         echo "&nbsp;&nbsp;<a href='" . FUSION_SELF . $aidlink . "&amp;op=useage&amp;step=c_edit&amp;id=" . $data["cat_id"] . "'>\n";
         echo "<img src='../images/edit.png' title='" . $locale['urg_a_usage_143'] . "' alt='" . $locale['urg_a_usage_143'] . "' style='border: 0;' /></a></td>\n";
         echo "</tr>\n<tr class='" . $row_color . "'>\n";
         echo "<td colspan='6'><i>" . $data["cat_description"] . "</i></td>\n";
         echo "</tr>\n<tr>\n";
         echo "<td colspan='6'><hr /></td>\n";
         echo "</tr>\n";
         $i++;
     }
     echo "</table>\n";
     $total_rows = dbcount("(*)", DB_UG3_CATEGORIES);
     if ($total_rows > 10) {
         echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav(c_rowstart, 10, $total_rows, 3, FUSION_SELF . $aidlink . "&amp;op=useage&amp;") . "\n</div>\n";
     }
 } else {
     echo "<table align='center' width='100%' cellspacing='3' cellpadding='3' class='center'><tr><td align='center'>" . $locale['urg_a_usage_144'] . "</td></tr></table>\n";
 }
 closetable();
 //Permanent Items
 opentable($locale['urg_a_usage_126']);
 echo "<table align='center' width='100%' cellspacing='0' cellpadding='0' class='tbl'>\n<tr>\n";
 echo "<td class='tbl2'><strong>" . $locale["urg_a_usage_134"] . "</strong></td>\n";
 echo "<td class='tbl2'><strong>" . $locale["urg_a_usage_119"] . "</strong></td>\n";
 echo "<td class='tbl2'><strong>" . $locale["urg_a_usage_121"] . "</strong></td>\n";
 echo "<td class='tbl2'><strong>" . $locale["urg_a_usage_122"] . "</strong></td>\n";
 echo "<td align='right' class='tbl2'><strong>" . $locale["urg_a_usage_123"] . "</strong></td>\n";
 echo "</tr>\n<tr class='tbl1'>\n";
 echo "<td>" . $locale["urg_a_usage_127"] . "</td>\n";
コード例 #24
0
ファイル: photos.php プロジェクト: roniwahyu/AKEUDA
            echo "<option value=''>-- " . $locale['473'] . " --</option>\n";
            while ($data = dbarray($result)) {
                echo "<option value='" . $data['album_id'] . "'>" . $data['album_title'] . "</option>\n";
            }
            echo "</select><br />\n<input class='button' type='submit' name='move_sel_photos' value='" . $locale['474'] . "' onclick=\"javascript:return ConfirmMove(0);\" />\n";
            echo "<input class='button' type='submit' name='move_all_photos' value='" . $locale['475'] . "' onclick=\"javascript:return ConfirmMove(1);\" />\n";
        }
        echo "<input class='button' type='button' value='" . $locale['476'] . "' onclick=\"location.href='photoalbums.php" . $aidlink . "';\" />\n";
        echo "</td>\n</tr>\n</table>\n</form>\n";
        if (dbrows($result)) {
            echo "<script type='text/javascript'>\n" . "function setChecked(frmName,chkName,val) {\n";
            echo "dml=document.forms[frmName];\n" . "len=dml.elements.length;" . "\n" . "for(i=0;i < len;i++) {\n";
            echo "if(dml.elements[i].name == chkName) {" . "\n" . "dml.elements[i].checked = val;\n";
            echo "}\n}\n}\n" . "function ConfirmMove(moveType) {\n";
            echo "if(moveType==0) {" . "\n" . "return confirm('" . $locale['481'] . "')\n";
            echo "}else{\n" . "return confirm('" . $locale['482'] . "')\n";
            echo "}\n}\n</script>\n";
        }
        if ($rows > $settings['thumbs_per_page']) {
            echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3, FUSION_SELF . $aidlink . "&amp;album_id=" . $_GET['album_id'] . "&amp;") . "\n</div>\n";
        }
    } else {
        echo "<div style='text-align:center'>" . $locale['480'] . "</div>\n";
    }
    closetable();
} else {
    opentable($locale['403']);
    echo "<div class='admin-message'>" . $locale['420'] . "</div>\n";
    closetable();
}
require_once THEMES . "templates/footer.php";
コード例 #25
0
ファイル: custom_news.php プロジェクト: php-fusion/PHP-Fusion
    /**
     * News Item Page Template
     * @param $info
     */
    function render_news_item($info)
    {
        global $aidlink;
        $locale = fusion_get_locale();
        $news_settings = get_settings('news');
        $data = $info['news_item'];
        add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "news/templates/css/news.css' type='text/css'>");
        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_footer('<script type="text/javascript">
			$(document).ready(function() {
				$(".news-image-overlay").colorbox({
					transition: "elasic",
					height:"100%",
					width:"100%",
					maxWidth:"98%",
					maxHeight:"98%",
					scrolling:false,
					overlayClose:true,
					close:false,
					photo:true,
					onComplete: function(result) {
						$("#colorbox").live("click", function(){
						$(this).unbind("click");
						$.fn.colorbox.close();
						});
					},
					onLoad: function () {
					}
			   });
			});
			</script>');
        opentable($locale['news_0004']);
        echo render_breadcrumbs();
        echo "<!--news_pre_readmore-->";
        echo "<article class='news-item' style='display:block; width:100%; overflow:hidden;'>\n";
        echo "<h2 class='text-center'>" . $data['news_subject'] . "</h2>\n";
        echo "<div class='news_news text-dark m-t-20 m-b-20'>\n";
        if ($data['news_image_src']) {
            echo "<a class='" . $data['news_ialign'] . " news-image-overlay' href='" . $data['news_image_src'] . "'>\n            <img class='img-responsive' src='" . $data['news_image_src'] . "' alt='" . $data['news_subject'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; overflow:hidden;' /></a>";
        } elseif (!empty($data['news_image']) && !empty($data['news_cat_image_src'])) {
            echo "<a class='" . $data['news_ialign'] . "' href='" . INFUSIONS . "news/news.php?cat_id=" . $data['news_cat_id'] . "'>\n            <img class='img-responsive' src='" . IMAGES_NC . $data['news_cat_image_src'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; alt='" . $data['news_cat_name'] . "' />\n            </a>";
        }
        echo $data['news_news'];
        echo "</div>\n";
        echo "<div class='news_extended text-dark m-t-20 m-b-20'>" . $data['news_extended'] . "</div>\n";
        echo "<div style='clear:both;'></div>\n";
        echo "<div class='well m-t-5 text-center'>\n";
        echo "<span class='news-action m-r-10'><i class='fa fa-user'></i>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>\n";
        echo "<span class='news-action m-r-10'><i class='fa fa-calendar'></i>" . showdate("newsdate", $data['news_datestamp']) . "</span>\n";
        echo "<span class='news-action'><i class='fa fa-eye'></i><span class='text-dark m-r-10'>" . number_format($data['news_reads']) . "</span>\n</span>";
        echo $data['news_allow_comments'] ? display_comments($data['news_comments'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#comments") : '';
        echo $data['news_allow_ratings'] ? "<span class='m-r-10'>" . display_ratings($data['news_sum_rating'], $data['news_count_votes'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#ratings") . " </span>" : '';
        echo "<a class='m-r-10' title='" . $locale['news_0002'] . "' href='" . BASEDIR . "print.php?type=N&amp;item_id=" . $data['news_id'] . "'><i class='fa fa-print'></i></a>";
        echo iADMIN && checkrights("N") ? "<a title='" . $locale['news_0003'] . "' href='" . INFUSIONS . "news/news_admin.php" . $aidlink . "&amp;action=edit&amp;section=news_form&amp;news_id=" . $data['news_id'] . "' title='" . $locale['news_0003'] . "' />" . $locale['news_0003'] . "</a>\n" : "";
        echo "</div>";
        echo "<!--news_sub_readmore-->";
        echo !isset($_GET['readmore']) && $data['news_ext'] == "y" ? "<div class='m-t-20'>\n<a href='" . INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "' class='button'>" . $locale['news_0001'] . "</a>\n</div>\n" : "";
        if ($data['page_count'] > 0) {
            echo "<div class='text-center m-t-10'>\n" . makepagenav($_GET['rowstart'], 1, $data['page_count'], 3, INFUSIONS . "news/news.php?readmore=" . $_GET['readmore'] . "&amp;") . "\n</div>\n";
        }
        if ($data['news_allow_comments']) {
            echo "<hr />" . showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n";
        }
        if ($data['news_allow_ratings']) {
            echo "<hr />" . showratings("N", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n";
        }
        echo "</article>\n";
        closetable();
    }
コード例 #26
0
/**
 * @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("^(&amp;|\\?)c_action=(edit|delete)&amp;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" ? "" : "&amp;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 . "&amp;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 . "&amp;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 . "&amp;", "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 . "&amp;ctype=" . $comment_type . "&amp;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 .= "&amp;c_action=edit&amp;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']);
    }
}
コード例 #27
0
ファイル: faq_admin.php プロジェクト: php-fusion/PHP-Fusion
function show_faq($faq_cat_id, $total_faq_count)
{
    global $locale, $aidlink, $show_faqs;
    // xss
    $_GET['faq_start'] = isset($_GET['faq_start']) && isnum($_GET['faq_start']) && $_GET['faq_start'] <= $total_faq_count ? $_GET['faq_start'] : 0;
    echo "<tr id='faq_" . $faq_cat_id . "' class='faq_list'>\n<td colspan='4'>\n";
    echo "<div class='panel panel-default'>\n";
    echo "<div class='panel-body'>\n";
    // need to improve a faq ordering .. it's hard manage content
    $result2 = dbquery("SELECT faq_id, faq_question, faq_answer\n\t\t\tFROM " . DB_FAQS . " WHERE faq_cat_id='" . intval($faq_cat_id) . "'\n\t\t\tORDER BY faq_id\n\t\t\tlimit " . intval($_GET['faq_start']) . ", " . intval($show_faqs) . "\n\t\t\t");
    $faq_rows = dbrows($result2);
    if ($faq_rows) {
        echo "<table class='table table-responsive table-hover table-striped'>\n";
        echo "<tr><th colspan='2' style='border-top:0;'>\n";
        echo "<div class='pull-right'>" . sprintf($locale['faq_0114'], $faq_rows, $total_faq_count) . "</div>\n";
        if ($total_faq_count > $faq_rows) {
            echo makepagenav($_GET['faq_start'], $show_faqs, $total_faq_count, 3, FUSION_SELF . $aidlink . "&amp;show_faq=" . $faq_cat_id . "&amp;", "faq_start");
        }
        echo "</td></th>\n";
        echo "<tbody>\n";
        while ($data2 = dbarray($result2)) {
            echo "<tr>\n<td>\n\n\t\t\t\t\t<strong>" . $locale['faq_0110'] . " " . $data2['faq_question'] . "</strong><br/>\n\n\t\t\t\t\t<strong>" . $locale['faq_0111'] . "</strong>" . trim_text(parse_textarea($data2['faq_answer']), 60) . "<br/>\n\n\t\t\t\t\t</td>\n";
            echo "<td align='right'>\n<a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;faq_cat_id=" . $faq_cat_id . "&amp;faq_id=" . $data2['faq_id'] . "&amp;section=faqs'>" . $locale['faq_0107'] . "</a> -\n";
            echo "<a href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;faq_cat_id=" . $faq_cat_id . "&amp;faq_id=" . $data2['faq_id'] . "&amp;section=faqs' onclick=\"return confirm('" . $locale['faq_0112'] . "');\">" . $locale['faq_0108'] . "</a></td>\n";
            echo "</tr>\n";
        }
        echo "</tbody>\n</table>\n";
    } else {
        echo $locale['faq_0113'];
    }
    echo "</div>\n</div></td></tr>";
}
コード例 #28
0
ファイル: errors.php プロジェクト: dioda/phpfusion
        echo "<input type='hidden' name='error_id' value='" . $data['error_id'] . "' />";
        echo "<select name='error_status' class='textbox' onchange='this.form.submit();'>";
        echo "<option value='0'" . ($data['error_status'] == 0 ? " selected='selected'" : "") . ">" . $locale['450'] . "</option>\n";
        echo "<option value='1'" . ($data['error_status'] == 1 ? " selected='selected'" : "") . ">" . $locale['451'] . "</option>\n";
        echo "<option value='2'" . ($data['error_status'] == 2 ? " selected='selected'" : "") . ">" . $locale['452'] . "</option>\n";
        echo "</select>\n<input type='submit' class='button change_status' value='" . $locale['453'] . "' style='margin-left:5px;' /></form>\n";
        echo "</td>\n";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
} else {
    echo "<div style='text-align:center'><br />\n" . $locale['418'] . "<br /><br />\n</div>\n";
}
if ($rows > 20) {
    echo "<div style=';margin-top:5px;text-align:center;'>\n" . makepagenav($_GET['rowstart'], 20, $rows, 3, FUSION_SELF . $aidlink . "&amp;") . "\n</div>\n";
}
closetable();
if (isset($_GET['error_id']) && isnum($_GET['error_id'])) {
    $result = dbquery("SELECT * FROM " . DB_ERRORS . " WHERE error_id='" . $_GET['error_id'] . "' LIMIT 1");
    if (dbrows($result) == 0) {
        redirect(FUSION_SELF . $aidlink);
    }
    $data = dbarray($result);
    $thisFileContent = file($data['error_file']);
    $line_start = "";
    $line_end = "";
    if (isset($data['error_line']) && isnum($data['error_line'])) {
        $line_start = $data['error_line'] - 10;
    } else {
        $line_start = 1;
コード例 #29
0
ファイル: my_posts.php プロジェクト: simplyianm/clububer
    $i = 0;
    opentable($locale['global_042']);
    echo "<table cellpadding='0' cellspacing='0' 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 width='100%' class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_049'] . "</strong></td>\n";
    echo "</tr>\n";
    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'>" . trimlink($data['forum_name'], 30) . "</td>\n";
        echo "<td width='100%' class='" . $row_color . "'><a href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;pid=" . $data['post_id'] . "#post_" . $data['post_id'] . "' title='" . $data['thread_subject'] . "'>" . trimlink($data['thread_subject'], 40) . "</a></td>\n";
        echo "<td align='center' width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . showdate("forumdate", $data['post_datestamp']) . "</td>\n";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
    closetable();
    if ($rows > 20) {
        echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 20, $rows, 3) . "\n</div>\n";
    }
} else {
    opentable($locale['global_042']);
    echo "<div style='text-align:center'><br />\n" . $locale['global_054'] . "<br /><br />\n</div>\n";
    closetable();
}
require_once THEMES . "templates/footer.php";
コード例 #30
0
function pdp_render_downs(&$downs, $rowstart, $per_page, $count, $link)
{
    global $locale;
    echo '<hr />';
    if ($count > $per_page) {
        $navi = makepagenav($rowstart, $per_page, $count, 3, $link);
    } else {
        $navi = '';
    }
    echo $navi;
    //	<td class='tbl1' valign='top'>".$data['desc']."</td>
    echo '
<table cellspacing="1" class="tbl-border" width="100%">
<colgroup>
	<col width="75%" />
	<col width="25%" />
</colgroup>
<tbody>';
    foreach ($downs as $data) {
        if ($data['is_new']) {
            $new = ' <img src="icons/new.gif"' . ' alt="' . $locale['pdp_new'] . '" />';
        } else {
            $new = '';
        }
        if ($data['votes']) {
            $rating = $locale['PDP205'][intval($data['avg_vote'])] . " (" . $data['votes'] . " " . $locale['PDP213'] . ")";
        } else {
            $rating = "-";
        }
        $info = '
<table border="0" width="100%">
<colgroup>
	<col width="1%" />
	<col width="99%" />
</colgroup>
<tbody>';
        if ($data['user_id']) {
            $info .= '
<tr>
	<td><strong>' . $locale['PDP882'] . ':</strong></td>
	<td><a href="profile.php?id=' . $data['user_id'] . '">' . $data['user_name'] . '</a></td>
</tr>';
        }
        $info .= '
<tr>
	<td><strong>' . $locale['PDP013'] . ':</strong></td>
	<td>' . showdate('shortdate', $data['mtime']) . '</td>
</tr>
<tr>
	<td><strong>' . $locale['pdp_downloads'] . ':</strong></td>
	<td>' . $data['downloads'] . '</td>
</tr>
<tr>
	<td><strong>' . $locale['PDP021'] . ':</strong></td>
	<td>' . $data['comments'] . '</td>
</tr>
<tr>
	<td><strong>' . $locale['PDP224'] . ':</strong></td>
	<td>' . $rating . '</td>
</tr>
</tbody>
</table>';
        echo '
<tr>
	<th colspan="2"><strong><a href="' . $data['href'] . '">' . $data['name'] . '</a></strong>' . $new . '</th>
</tr>
<tr class="tbl1">
	<td valign="top">' . $data['desc'] . '</td>
	<td valign="top">' . $info . '</td>
</tr>';
    }
    echo '
</tbody>
</table>';
    echo $navi;
}