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