本文整理汇总了PHP中makepagenav函数的典型用法代码示例。如果您正苦于以下问题:PHP makepagenav函数的具体用法?PHP makepagenav怎么用?PHP makepagenav使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makepagenav函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_tag_thread
/**
* 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='" . $userdata['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 = '" . $userdata['user_id'] . "'\n WHERE " . in_group('t.thread_tags', intval($tag_id), '.') . " AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n " . (multilang_table("FO") ? "AND tf.forum_language='" . LANGUAGE . "'" : '') . "\n GROUP BY t.thread_id\n " . (isset($filter['order']) ? $filter['order'] : '') . "\n LIMIT " . intval($_GET['thread_rowstart']) . ", " . $forum_settings['threads_per_page'];
$cthread_result = dbquery($thread_query);
if (dbrows($cthread_result) > 0) {
while ($threads = dbarray($cthread_result)) {
$icon = "";
$match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
if ($threads['thread_lastpost'] > $lastVisited) {
if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
$icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
} else {
$icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
}
}
$author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
$lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
$threads += array("thread_link" => array("link" => FORUM . "viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . self::get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . self::get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . self::get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . self::get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . self::get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . self::get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . self::get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['first_post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"));
if ($threads['thread_sticky']) {
$info['threads']['sticky'][$threads['thread_id']] = $threads;
} else {
$info['threads']['item'][$threads['thread_id']] = $threads;
}
}
}
if ($info['thread_max_rows'] > $forum_settings['threads_per_page']) {
$info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&", "thread_rowstart");
$info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&", "thread_rowstart", TRUE);
}
}
return (array) $info;
}
示例2: explode
$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'] . "&") . "</div>\n";
}
require_once THEMES . "templates/footer.php";
示例3: elseif
$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'] . "&") . "\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: dbquery
// 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=" . $userdata['user_id'] . " 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=" . $userdata['user_id'] . " AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'\n GROUP BY tn.thread_id\n ORDER BY tn.notify_datestamp DESC\n LIMIT " . $_GET['rowstart'] . ",16\n ");
$i = 0;
while ($threads = dbarray($result)) {
// opt for moderators.
$this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']);
$icon = "";
$match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) {
if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
$icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
} else {
$icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
}
}
$author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
$lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
$threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"), "track_button" => array('link' => FORUM . "index.php?section=tracked&delete=" . $threads['thread_id'], 'title' => $locale['global_058']));
// push
$this->forum_info['item'][$threads['thread_id']] = $threads;
}
}
示例5: add_to_title
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'] . "&") . "\n</div>\n";
}
} else {
echo $locale['411'] . "\n";
echo "<!--sub_faq_cat-->";
closetable();
}
} else {
redirect(FUSION_SELF);
}
}
require_once THEMES . "templates/footer.php";
示例6: showdate
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 . "&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 . "&") . "\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: while
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&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;"> </td>
</tr>
';
}
echo '</table>';
}
echo makepagenav($_GET['rowstart'], 20, $bloglist2, 3, FUSION_SELF . "?list=" . $list . "&") . "\n";
closetable();
require_once THEMES . "templates/footer.php";
示例8: showcomments
function showcomments($ctype, $cdb, $ccol, $cid, $clink)
{
global $settings, $locale, $userdata, $aidlink;
$link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : "");
$link = preg_replace("^(&|\\?)c_action=(edit|delete)&comment_id=\\d*^", "", $link);
$cpp = $settings['comments_per_page'];
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
$result = dbquery("DELETE FROM " . DB_COMMENTS . "\r\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\r\n\t\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'"));
}
redirect($clink . ($settings['comments_sorting'] == "ASC" ? "" : "&c_start=0"));
}
if ($settings['comments_enabled'] == "1") {
if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) {
if (iMEMBER) {
$comment_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
if (!isset($_POST['comment_name'])) {
redirect($link);
}
$comment_name = trim(stripinput($_POST['comment_name']));
$comment_name = preg_replace("(^[+0-9\\s]*)", "", $comment_name);
if (isnum($comment_name)) {
$comment_name = "";
}
$_CAPTCHA_IS_VALID = FALSE;
include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
if (!isset($_POST['captcha_code']) || $_CAPTCHA_IS_VALID == FALSE) {
redirect($link);
}
}
$comment_message = trim(stripinput(censorwords($_POST['comment_message'])));
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
$comment_updated = FALSE;
if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_name='" . $userdata['user_id'] . "'\r\n\t\t\t\t\t\tAND comment_hidden='0'")) {
if ($comment_message) {
$result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='" . $comment_message . "'\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\r\n\t\t\t\t\t\t\t\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'"));
$comment_updated = TRUE;
}
}
if ($comment_updated) {
if ($settings['comments_sorting'] == "ASC") {
$c_operator = "<=";
} else {
$c_operator = ">=";
}
$c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_id" . $c_operator . "'" . $_GET['comment_id'] . "'\r\n\t\t\t\t\t\t\t\tAND comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\t\tAND comment_type='" . $ctype . "'");
$c_start = (ceil($c_count / $cpp) - 1) * $cpp;
}
redirect($clink . "&c_start=" . (isset($c_start) && isnum($c_start) ? $c_start : ""));
} else {
if (!dbcount("(" . $ccol . ")", $cdb, $ccol . "='" . $cid . "'")) {
redirect(BASEDIR . "index.php");
}
if ($comment_name && $comment_message) {
require_once INCLUDES . "flood_include.php";
if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) {
$result = dbquery("INSERT INTO " . DB_COMMENTS . " (\r\n\t\t\t\t\t\t\t\tcomment_item_id, comment_type, comment_name, comment_message, comment_datestamp,\r\n\t\t\t\t\t\t\t\tcomment_ip, comment_ip_type, comment_hidden\r\n\t\t\t\t\t\t\t) VALUES (\r\n\t\t\t\t\t\t\t\t'" . $cid . "', '" . $ctype . "', '" . $comment_name . "', '" . $comment_message . "', '" . time() . "',\r\n\t\t\t\t\t\t\t\t'" . USER_IP . "', '" . USER_IP_TYPE . "', '0'\r\n\t\t\t\t\t\t\t)");
}
}
if ($settings['comments_sorting'] == "ASC") {
$c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\t\t\t\tAND comment_type='" . $ctype . "'");
$c_start = (ceil($c_count / $cpp) - 1) * $cpp;
} else {
$c_start = 0;
}
redirect($clink . "&c_start=" . $c_start);
}
}
$c_arr = array("c_con" => array(), "c_info" => array("c_makepagenav" => FALSE, "admin_link" => FALSE));
$c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "'\r\n\t\t\t\t\t\t\tAND comment_type='" . $ctype . "' AND comment_hidden='0'");
if (!isset($_GET['c_start']) && $c_rows > $cpp) {
$_GET['c_start'] = (ceil($c_rows / $cpp) - 1) * $cpp;
}
if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
$_GET['c_start'] = 0;
}
$result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp,\r\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\r\n\t\t\tFROM " . DB_COMMENTS . " tcm\r\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\r\n\t\t\tWHERE comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "' AND comment_hidden='0'\r\n\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp);
if (dbrows($result)) {
$i = $settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start'];
if ($c_rows > $cpp) {
$c_arr['c_info']['c_makepagenav'] = makepagenav($_GET['c_start'], $cpp, $c_rows, 3, $clink . "&", "c_start");
}
while ($data = dbarray($result)) {
$c_arr['c_con'][$i]['comment_id'] = $data['comment_id'];
$c_arr['c_con'][$i]['edit_dell'] = FALSE;
$c_arr['c_con'][$i]['i'] = $i;
if ($data['user_name']) {
$c_arr['c_con'][$i]['comment_name'] = profile_link($data['comment_name'], $data['user_name'], $data['user_status']);
} else {
$c_arr['c_con'][$i]['comment_name'] = $data['comment_name'];
}
//Add user avatar in comments new feature in v7.02.04
$c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '80px');
$c_arr['c_con'][$i]['comment_datestamp'] = $locale['global_071'] . showdate("longdate", $data['comment_datestamp']);
$c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message'])));
if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
$c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n";
$c_arr['c_con'][$i]['edit_dell'] .= "<a href='" . FUSION_REQUEST . "&c_action=edit&comment_id=" . $data['comment_id'] . "#edit_comment'>";
$c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a> |\n";
//.........这里部分代码省略.........
示例9: array
$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'] . "&") : 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'] . "&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: photo_subalbums
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: makepagenav
$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: isset
$_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'] . "&";
} elseif (!empty($_GET['author']) && isnum($_GET['author'])) {
$page_nav_link = INFUSIONS . "downloads/downloads.php?author=" . $_GET['author'] . "&";
}
$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: render_participated
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: render_shop
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&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&id=" . $data['id'] . "&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: while
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";