• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP forum_number_format函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中forum_number_format函数的典型用法代码示例。如果您正苦于以下问题:PHP forum_number_format函数的具体用法?PHP forum_number_format怎么用?PHP forum_number_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了forum_number_format函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: check_errors_before_edit

 public function check_errors_before_edit($id, $can_edit_subject, $errors)
 {
     global $lang_post, $pd;
     // If it's a topic it must contain a subject
     if ($can_edit_subject) {
         $subject = feather_trim($this->request->post('req_subject'));
         if ($this->config['o_censoring'] == '1') {
             $censored_subject = feather_trim(censor_words($subject));
         }
         if ($subject == '') {
             $errors[] = $lang_post['No subject'];
         } elseif ($this->config['o_censoring'] == '1' && $censored_subject == '') {
             $errors[] = $lang_post['No subject after censoring'];
         } elseif (feather_strlen($subject) > 70) {
             $errors[] = $lang_post['Too long subject'];
         } elseif ($this->config['p_subject_all_caps'] == '0' && is_all_uppercase($subject) && !$this->user->is_admmod) {
             $errors[] = $lang_post['All caps subject'];
         }
     }
     // Clean up message from POST
     $message = feather_linebreaks(feather_trim($this->request->post('req_message')));
     // Here we use strlen() not feather_strlen() as we want to limit the post to FEATHER_MAX_POSTSIZE bytes, not characters
     if (strlen($message) > FEATHER_MAX_POSTSIZE) {
         $errors[] = sprintf($lang_post['Too long message'], forum_number_format(FEATHER_MAX_POSTSIZE));
     } elseif ($this->config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$this->user->is_admmod) {
         $errors[] = $lang_post['All caps message'];
     }
     // Validate BBCode syntax
     if ($this->config['p_message_bbcode'] == '1') {
         require FEATHER_ROOT . 'include/parser.php';
         $message = preparse_bbcode($message, $errors);
     }
     if (empty($errors)) {
         if ($message == '') {
             $errors[] = $lang_post['No message'];
         } elseif ($this->config['o_censoring'] == '1') {
             // Censor message to see if that causes problems
             $censored_message = feather_trim(censor_words($message));
             if ($censored_message == '') {
                 $errors[] = $lang_post['No message after censoring'];
             }
         }
     }
     return $errors;
 }
开发者ID:beaver-dev,项目名称:featherbb,代码行数:45,代码来源:edit.php


示例2: isset

         // Check if it's a banned email address
         // we should only check guests because members' addresses are already verified
         if ($panther_user['is_guest'] && $mailer->is_banned_email($email)) {
             if ($panther_config['p_allow_banned_email'] == '0') {
                 $errors[] = $lang_prof_reg['Banned email'];
             }
             $banned_email = true;
             // Used later when we send an alert email
         }
     }
 }
 // Clean up message from POST
 $orig_message = $message = isset($_POST['req_message']) ? panther_linebreaks(panther_trim($_POST['req_message'])) : '';
 // Here we use strlen() not panther_strlen() as we want to limit the post to PANTHER_MAX_POSTSIZE bytes, not characters
 if (strlen($message) > PANTHER_MAX_POSTSIZE) {
     $errors[] = sprintf($lang_post['Too long message'], forum_number_format(PANTHER_MAX_POSTSIZE));
 } else {
     if ($panther_config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$panther_user['is_admmod']) {
         $errors[] = $lang_post['All caps message'];
     }
 }
 // Validate BBCode syntax
 if ($panther_config['p_message_bbcode'] == '1') {
     require PANTHER_ROOT . 'include/parser.php';
     $message = $parser->preparse_bbcode($message, $errors);
 }
 if (empty($errors)) {
     if ($message == '') {
         $errors[] = $lang_post['No message'];
     } else {
         if ($panther_config['o_censoring'] == '1') {
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:post.php


示例3: forum_number_format

?>
</a></span></span></h2>
<div class="box">
	<div class="inbox">
		<div class="postbody">
			<div class="postleft">
				<dl>
					<dt><?php 
echo $cur_search['pposter_disp'];
?>
</dt>
<?php 
if ($cur_search['pid'] == $cur_search['first_post_id']) {
    ?>
						<dd><span><?php 
    echo $lang_topic['Replies'] . ' ' . forum_number_format($cur_search['num_replies']);
    ?>
</span></dd>
<?php 
}
?>
					<dd><div class="<?php 
echo $cur_search['icon_type'];
?>
"><div class="nosize"><?php 
echo $cur_search['icon_text'];
?>
</div></div></dd>
				</dl>
			</div>
			<div class="postright">
开发者ID:beaver-dev,项目名称:featherbb,代码行数:31,代码来源:posts.php


示例4: message

        $ps = $db->select('forums', 'forum_name', $select, 'id=:id');
        $forum = $ps->fetchColumn();
    } else {
        $forum = $lang_admin_maintenance['All forums'];
    }
    $ps = $db->run($sql, $data);
    $num_topics = $ps->fetchColumn();
    if (!$num_topics) {
        message(sprintf($lang_admin_maintenance['No old topics message'], $prune_days));
    }
    $page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Prune']);
    define('PANTHER_ACTIVE_PAGE', 'admin');
    require PANTHER_ROOT . 'header.php';
    generate_admin_menu('maintenance');
    $tpl = load_template('confirm_prune.tpl');
    echo $tpl->render(array('lang_admin_maintenance' => $lang_admin_maintenance, 'lang_admin_common' => $lang_admin_common, 'link' => panther_link($panther_url['admin_maintenance']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/maintenance.php'), 'prune_days' => $prune_days, 'prune_sticky' => $prune_sticky, 'prune_from' => $prune_from, 'forum' => $forum, 'num_topics' => forum_number_format($num_topics)));
    require PANTHER_ROOT . 'footer.php';
}
if ($action == 'add_user') {
    $errors = array();
    $username = isset($_POST['username']) ? panther_trim($_POST['username']) : '';
    $random_pass = isset($_POST['random_pass']) && $_POST['random_pass'] == '1' ? 1 : 0;
    $email = isset($_POST['email']) ? strtolower(panther_trim($_POST['email'])) : '';
    $password_salt = random_pass(16);
    if ($random_pass == '1') {
        $password1 = random_pass(12);
        $password2 = $password1;
    } else {
        $password1 = isset($_POST['password1']) ? panther_trim($_POST['password1']) : '';
        $password2 = isset($_POST['password2']) ? panther_trim($_POST['password2']) : '';
    }
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:maintenance.php


示例5: sprintf

    } else {
        echo sprintf(__('Users online', 'luna'), forum_number_format($num_users)) . '<br />' . "\n";
    }
    exit;
} elseif ($action == 'stats') {
    // Collect some statistics from the database
    if (file_exists(LUNA_CACHE_DIR . 'cache_users_info.php')) {
        include LUNA_CACHE_DIR . 'cache_users_info.php';
    }
    if (!defined('LUNA_USERS_INFO_LOADED')) {
        if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) {
            require LUNA_ROOT . 'include/cache.php';
        }
        generate_users_info_cache();
        require LUNA_CACHE_DIR . 'cache_users_info.php';
    }
    $result = $db->query('SELECT SUM(num_threads), SUM(num_comments) FROM ' . $db->prefix . 'forums') or error('Unable to fetch thread/comment count', __FILE__, __LINE__, $db->error());
    list($stats['total_threads'], $stats['total_comments']) = $db->fetch_row($result);
    // Send the Content-type header in case the web server is setup to send something else
    header('Content-type: text/html; charset=utf-8');
    header('Expires: ' . date('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo sprintf(__('Users', 'luna'), forum_number_format($stats['total_users'])) . '<br />' . "\n";
    echo sprintf(__('Newest user', 'luna'), $luna_user['g_view_users'] == '1' ? '<a href="' . luna_htmlspecialchars(get_base_url(true)) . '/profile.php?id=' . $stats['last_user']['id'] . '">' . luna_htmlspecialchars($stats['last_user']['username']) . '</a>' : luna_htmlspecialchars($stats['last_user']['username'])) . '<br />' . "\n";
    echo sprintf(__('Threads', 'luna'), forum_number_format($stats['total_threads'])) . '<br />' . "\n";
    echo sprintf(__('Comments', 'luna'), forum_number_format($stats['total_comments'])) . '<br />' . "\n";
    exit;
}
// If we end up here, the script was called with some wacky parameters
exit(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'));
开发者ID:BlitzFirePlayz,项目名称:Luna,代码行数:31,代码来源:extern.php


示例6: forum_number_format

                ?>
</div></div>
						<div class="tclcon">
							<div>
								<?php 
                echo $subject . "\n";
                ?>
							</div>
						</div>
					</td>
					<td class="tc2"><?php 
                echo $forum;
                ?>
</td>
					<td class="tc3"><?php 
                echo forum_number_format($cur_search['num_replies']);
                ?>
</td>
					<td class="tcr"><?php 
                echo '<a href="viewtopic.php?pid=' . $cur_search['last_post_id'] . '#p' . $cur_search['last_post_id'] . '">' . format_time($cur_search['last_post']) . '</a> <span class="byuser">' . $lang_common['by'] . ' ' . pun_htmlspecialchars($cur_search['last_poster']);
                ?>
</span></td>
				</tr>
<?php 
            }
        }
        if ($show_as == 'topics') {
            echo "\t\t\t" . '</tbody>' . "\n\t\t\t" . '</table>' . "\n\t\t" . '</div>' . "\n\t" . '</div>' . "\n" . '</div>' . "\n\n";
        }
        ?>
<div class="<?php 
开发者ID:HawesDomingue,项目名称:mechanic-watson,代码行数:31,代码来源:search.php


示例7: draw_response_list

function draw_response_list()
{
    global $result, $db, $luna_config, $id, $comment_ids, $is_admmod, $start_from, $comment_count, $admin_ids, $luna_user, $inbox;
    while ($cur_comment = $db->fetch_assoc($result)) {
        $comment_count++;
        $user_avatar = '';
        $user_info = array();
        $user_contacts = array();
        $comment_actions = array();
        $is_online = '';
        $signature = '';
        // If the commenter is a registered user
        if ($cur_comment['id']) {
            if ($luna_user['g_view_users'] == '1') {
                $username = '<a href="profile.php?id=' . $cur_comment['sender_id'] . '">' . luna_htmlspecialchars($cur_comment['sender']) . '</a>';
            } else {
                $username = luna_htmlspecialchars($cur_comment['sender']);
            }
            $user_title = get_title($cur_comment);
            if ($luna_config['o_censoring'] == '1') {
                $user_title = censor_words($user_title);
            }
            // Format the online indicator
            $is_online = $cur_comment['is_online'] == $cur_comment['sender_id'] ? '<strong>' . __('Online:', 'luna') . '</strong>' : '<span>' . __('Offline', 'luna') . '</span>';
            if ($luna_config['o_avatars'] == '1' && $luna_user['show_avatars'] != '0') {
                if (isset($user_avatar_cache[$cur_comment['sender_id']])) {
                    $user_avatar = $user_avatar_cache[$cur_comment['sender_id']];
                } else {
                    $user_avatar = $user_avatar_cache[$cur_comment['sender_id']] = generate_avatar_markup($cur_comment['sender_id']);
                }
            }
            // We only show location, register date, comment count and the contact links if "Show user info" is enabled
            if ($luna_config['o_show_user_info'] == '1') {
                if ($cur_comment['location'] != '') {
                    if ($luna_config['o_censoring'] == '1') {
                        $cur_comment['location'] = censor_words($cur_comment['location']);
                    }
                    $user_info[] = '<dd><span>' . __('From:', 'luna') . ' ' . luna_htmlspecialchars($cur_comment['location']) . '</span></dd>';
                }
                $user_info[] = '<dd><span>' . __('Registered since', 'luna') . ' ' . format_time($cur_comment['registered'], true) . '</span></dd>';
                if ($luna_config['o_show_comment_count'] == '1' || $luna_user['is_admmod']) {
                    $user_info[] = '<dd><span>' . __('Comments:', 'luna') . ' ' . forum_number_format($cur_comment['num_comments']) . '</span></dd>';
                }
                // Now let's deal with the contact links (Email and URL)
                if (($cur_comment['email_setting'] == '0' && !$luna_user['is_guest'] || $luna_user['is_admmod']) && $luna_user['g_send_email'] == '1') {
                    $user_contacts[] = '<span class="email"><a href="mailto:' . $cur_comment['email'] . '">' . __('Email', 'luna') . '</a></span>';
                } elseif ($cur_comment['email_setting'] == '1' && !$luna_user['is_guest'] && $luna_user['g_send_email'] == '1') {
                    $user_contacts[] = '<span class="email"><a href="misc.php?email=' . $cur_comment['sender_id'] . '">' . __('Email', 'luna') . '</a></span>';
                }
                if ($luna_config['o_enable_inbox'] == '1' && !$luna_user['is_guest'] && $luna_user['g_inbox'] == '1' && $luna_user['use_inbox'] == '1' && $cur_comment['use_inbox'] == '1') {
                    $pid = isset($cur_comment['sender_id']) ? $cur_comment['sender_id'] : $cur_comment['sender_id'];
                    $user_contacts[] = '<span class="email"><a href="new_inbox.php?uid=' . $pid . '">' . __('PM', 'luna') . '</a></span>';
                }
                if ($cur_comment['url'] != '') {
                    $user_contacts[] = '<span class="website"><a href="' . luna_htmlspecialchars($cur_comment['url']) . '">' . __('Website', 'luna') . '</a></span>';
                }
            }
            if ($luna_user['is_admmod']) {
                $user_info[] = '<dd><span><a href="backstage/moderate.php?get_host=' . $cur_comment['sender_ip'] . '" title="' . $cur_comment['sender_ip'] . '">' . __('IP log', 'luna') . '</a></span></dd>';
                if ($cur_comment['admin_note'] != '') {
                    $user_info[] = '<dd><span>' . __('Note:', 'luna') . ' <strong>' . luna_htmlspecialchars($cur_comment['admin_note']) . '</strong></span></dd>';
                }
            }
        } else {
            // If the commenter is a guest (or a user that has been deleted)
            $username = luna_htmlspecialchars($cur_comment['username']);
            $user_title = get_title($cur_comment);
            if ($luna_user['is_admmod']) {
                $user_info[] = '<dd><span><a href="backstage/moderate.php?get_host=' . $cur_comment['sender_id'] . '" title="' . $cur_comment['sender_ip'] . '">' . __('IP log', 'luna') . '</a></span></dd>';
            }
            if ($luna_config['o_show_user_info'] == '1' && $cur_comment['commenter_email'] != '' && !$luna_user['is_guest'] && $luna_user['g_send_email'] == '1') {
                $user_contacts[] = '<span class="email"><a href="mailto:' . $cur_comment['commenter_email'] . '">' . __('Email', 'luna') . '</a></span>';
            }
        }
        $username_quickreply = luna_htmlspecialchars($cur_comment['username']);
        $comment_actions[] = '<a href="new_inbox.php?reply=' . $cur_comment['shared_id'] . '&amp;quote=' . $cur_comment['mid'] . '">' . __('Quote', 'luna') . '</a>';
        // Perform the main parsing of the message (BBCode, smilies, censor words etc)
        $cur_comment['message'] = parse_message($cur_comment['message']);
        // Do signature parsing/caching
        if ($luna_config['o_signatures'] == '1' && $cur_comment['signature'] != '' && $luna_user['show_sig'] != '0') {
            if (isset($signature_cache[$cur_comment['id']])) {
                $signature = $signature_cache[$cur_comment['id']];
            } else {
                $signature = parse_signature($cur_comment['signature']);
                $signature_cache[$cur_comment['id']] = $signature;
            }
        }
        require get_view_path('comment.php');
    }
}
开发者ID:BlitzFirePlayz,项目名称:Luna,代码行数:90,代码来源:draw_functions.php


示例8: forum_number_format

							<div>
								<?php 
    echo $topic['subject_disp'] . "\n";
    ?>
							</div>
						</div>
					</td>
					<td class="tc2"><?php 
    echo !$topic['ghost_topic'] ? forum_number_format($topic['num_replies']) : '-';
    ?>
</td>
<?php 
    if ($feather_config['o_topic_views'] == '1') {
        ?>
					<td class="tc3"><?php 
        echo !$topic['ghost_topic'] ? forum_number_format($topic['num_views']) : '-';
        ?>
</td>
<?php 
    }
    ?>
					<td class="tcr"><?php 
    echo $topic['last_post_disp'];
    ?>
</td>
					<td class="tcmod"><input type="checkbox" name="topics[<?php 
    echo $topic['id'];
    ?>
]" value="1" /></td>
				</tr>
			<?php 
开发者ID:beaver-dev,项目名称:featherbb,代码行数:31,代码来源:moderator_forum.php


示例9: forum_link

                    } else {
                        // Setup the title and link to the forum
                        $forum_page['item_title']['title'] = '<a href="' . forum_link($forum_url['forum'], array($cur_set['fid'], sef_friendly($cur_set['forum_name']))) . '"><span>' . forum_htmlencode($cur_set['forum_name']) . '</span></a>';
                        ($hook = get_hook('se_results_forums_row_redirect_pre_item_title_merge')) ? eval($hook) : null;
                        $forum_page['item_body']['subject']['title'] = '<h3 class="hn">' . implode(' ', $forum_page['item_title']) . '</h3>';
                        // Setup the forum description and mod list
                        if ($cur_set['forum_desc'] != '') {
                            $forum_page['item_subject']['desc'] = $cur_set['forum_desc'];
                        }
                        ($hook = get_hook('se_results_forums_row_normal_pre_item_subject_merge')) ? eval($hook) : null;
                        if (!empty($forum_page['item_subject'])) {
                            $forum_page['item_body']['subject']['desc'] = '<p>' . implode(' ', $forum_page['item_subject']) . '</p>';
                        }
                        // Setup forum topics, post count and last post
                        $forum_page['item_body']['info']['topics'] = '<li class="info-topics"><strong>' . forum_number_format($cur_set['num_topics']) . '</strong> <span class="label">' . ($cur_set['num_topics'] == 1 ? $lang_index['topic'] : $lang_index['topics']) . '</span></li>';
                        $forum_page['item_body']['info']['posts'] = '<li class="info-posts"><strong>' . forum_number_format($cur_set['num_posts']) . '</strong> <span class="label">' . ($cur_set['num_posts'] == 1 ? $lang_index['post'] : $lang_index['posts']) . '</span></li>';
                        if ($cur_set['last_post'] != '') {
                            $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">' . $lang_index['Last post'] . '</span> <strong><a href="' . forum_link($forum_url['post'], $cur_set['last_post_id']) . '">' . format_time($cur_set['last_post']) . '</a></strong> <cite>' . sprintf($lang_index['Last poster'], forum_htmlencode($cur_set['last_poster'])) . '</cite></li>';
                        } else {
                            $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><strong>' . $lang_common['Never'] . '</strong></li>';
                        }
                        ($hook = get_hook('se_results_forums_row_normal_pre_display')) ? eval($hook) : null;
                    }
                    // Generate classes for this forum depending on its status
                    $forum_page['item_style'] = ($forum_page['item_count'] % 2 != 0 ? ' odd' : ' even') . ($forum_page['item_count'] == 1 ? ' main-first-item' : '') . (!empty($forum_page['item_status']) ? ' ' . implode(' ', $forum_page['item_status']) : '');
                    ($hook = get_hook('se_results_forums_row_pre_display')) ? eval($hook) : null;
                    ?>
			<div id="forum<?php 
                    echo $cur_set['fid'];
                    ?>
" class="main-item<?php 
开发者ID:torepublicStartpageCode,项目名称:torepublic2,代码行数:31,代码来源:search.php


示例10: __

        ?>
<div class="panel panel-default">
	<div class="panel-heading">
		<h3 class="panel-title"><?php 
        echo __('Delete group', 'luna');
        ?>
</h3>
	</div>
	<div class="panel-body">
		<form id="groups" method="post" action="groups.php?del_group=<?php 
        echo $group_id;
        ?>
">
			<fieldset>
				<p><?php 
        printf(__('The group <strong>%s</strong> currently has <strong>%s</strong> members. Please select a group to which these members will be assigned upon deletion.', 'luna'), luna_htmlspecialchars($group_title), forum_number_format($group_members));
        ?>
</p>
				<label><?php 
        echo __('Move users to', 'luna');
        ?>
					<select class="form-control" name="move_to_group">
<?php 
        $result = $db->query('SELECT g_id, g_title FROM ' . $db->prefix . 'groups WHERE g_id!=' . FORUM_GUEST . ' AND g_id!=' . $group_id . ' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
        while ($cur_group = $db->fetch_assoc($result)) {
            if ($cur_group['g_id'] == FORUM_MEMBER) {
                // Pre-select the pre-defined Members group
                echo "\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '" selected>' . luna_htmlspecialchars($cur_group['g_title']) . '</option>' . "\n";
            } else {
                echo "\t\t\t\t\t\t\t\t\t\t" . '<option value="' . $cur_group['g_id'] . '">' . luna_htmlspecialchars($cur_group['g_title']) . '</option>' . "\n";
            }
开发者ID:istrwei,项目名称:Luna,代码行数:31,代码来源:groups.php


示例11: get_saved_queries

function get_saved_queries()
{
    global $forum_db, $lang_common;
    // Get the queries so that we can print them out
    $saved_queries = $forum_db->get_saved_queries();
    ob_start();
    ?>
<div id="brd-debug" class="main">
	<div class="debug">
		<table>
			<caption><?php 
    echo $lang_common['Debug summary'];
    ?>
</caption>
			<thead>
				<tr>
					<th class="tcl" scope="col"><?php 
    echo $lang_common['Query times'];
    ?>
</th>
					<th class="tcr" scope="col"><?php 
    echo $lang_common['Query'];
    ?>
</th>
				</tr>
			</thead>
			<tbody>
<?php 
    $query_time_total = 0.0;
    foreach ($saved_queries as $cur_query) {
        $query_time_total += $cur_query[1];
        ?>
				<tr>
					<td class="tcl"><?php 
        echo $cur_query[1] != 0 ? forum_number_format($cur_query[1], 5) : '&#160;';
        ?>
</td>
					<td class="tcr"><?php 
        echo forum_htmlencode($cur_query[0]);
        ?>
</td>
				</tr>
<?php 
    }
    ?>
				<tr>
					<td class="tcl border-less"><?php 
    echo forum_number_format($query_time_total, 5);
    ?>
</td>
					<td class="tcr border-less"><?php 
    echo $lang_common['Total query time'];
    ?>
</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>
<?php 
    return ob_get_clean();
}
开发者ID:torepublicStartpageCode,项目名称:torepublic2,代码行数:62,代码来源:functions.php


示例12: __

         // Check if it's a banned email address
         // we should only check guests because members' addresses are already verified
         if ($luna_user['is_guest'] && is_banned_email($email)) {
             if ($luna_config['p_allow_banned_email'] == '0') {
                 $errors[] = __('The email address you entered is banned in this forum. Please choose another email address.', 'luna');
             }
             $banned_email = true;
             // Used later when we send an alert email
         }
     }
 }
 // Clean up message from POST
 $orig_message = $message = luna_linebreaks(luna_trim($_POST['req_message']));
 // Here we use strlen() not luna_strlen() as we want to limit the comment to FORUM_MAX_POSTSIZE bytes, not characters
 if (strlen($message) > FORUM_MAX_POSTSIZE) {
     $errors[] = sprintf(__('Comments cannot be longer than %s bytes.', 'luna'), forum_number_format(FORUM_MAX_POSTSIZE));
 } elseif ($luna_config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$luna_user['is_admmod']) {
     $errors[] = __('Comments cannot contain only capital letters.', 'luna');
 }
 // Validate BBCode syntax
 require FORUM_ROOT . 'include/parser.php';
 $message = preparse_bbcode($message, $errors);
 if (empty($errors)) {
     if ($message == '') {
         $errors[] = __('You must enter a message.', 'luna');
     } elseif ($luna_config['o_censoring'] == '1') {
         // Censor message to see if that causes problems
         $censored_message = luna_trim(censor_words($message));
         if ($censored_message == '') {
             $errors[] = __('You must enter a message. After applying censoring filters, your message was empty.', 'luna');
         }
开发者ID:istrwei,项目名称:Luna,代码行数:31,代码来源:post.php


示例13: luna_trim

 // Check subject
 $p_subject = luna_trim($_POST['req_subject']);
 if ($p_subject == '' && $edit == '0') {
     $errors[] = __('Threads must contain a subject.', 'luna');
 } elseif (luna_strlen($p_subject) > '70') {
     $errors[] = __('Subjects cannot be longer than 70 characters.', 'luna');
 } elseif ($luna_config['p_subject_all_caps'] == '0' && strtoupper($p_subject) == $p_subject && $luna_user['is_admmod']) {
     $p_subject = ucwords(strtolower($p_subject));
 }
 // Clean up message from POST
 $p_message = luna_linebreaks(luna_trim($_POST['req_message']));
 // Check message
 if ($p_message == '') {
     $errors[] = __('You must enter a message.', 'luna');
 } elseif (strlen($p_message) > LUNA_MAX_COMMENT_SIZE) {
     $errors[] = sprintf(__('Comments cannot be longer than %s bytes.', 'luna'), forum_number_format(LUNA_MAX_COMMENT_SIZE));
 } elseif ($luna_config['p_message_all_caps'] == '0' && strtoupper($p_message) == $p_message && $luna_user['is_admmod']) {
     $p_message = ucwords(strtolower($p_message));
 }
 // Validate BBCode syntax
 require LUNA_ROOT . 'include/parser.php';
 $p_message = preparse_bbcode($p_message, $errors);
 if (empty($errors) && !isset($_POST['preview'])) {
     // Send message(s)
     $_SESSION['last_session_request'] = $now = time();
     // Send message(s)
     if (empty($errors) && !isset($_POST['preview'])) {
         $_SESSION['last_session_request'] = $now = time();
         if ($luna_config['o_inbox_notification'] == '1') {
             require_once LUNA_ROOT . 'include/email.php';
             // Load the new_inbox templates
开发者ID:BlitzFirePlayz,项目名称:Luna,代码行数:31,代码来源:new_inbox.php


示例14: array

    $num_guests = 0;
    $users = array();
    $result = $db->query('SELECT user_id, ident FROM ' . $db->prefix . 'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
    while ($pun_user_online = $db->fetch_assoc($result)) {
        if ($pun_user_online['user_id'] > 1) {
            if ($pun_user['g_view_users'] == '1') {
                $users[] = "\n\t\t\t\t" . '<dd><a href="profile.php?id=' . $pun_user_online['user_id'] . '">' . pun_htmlspecialchars($pun_user_online['ident']) . '</a>';
            } else {
                $users[] = "\n\t\t\t\t" . '<dd>' . pun_htmlspecialchars($pun_user_online['ident']);
            }
        } else {
            ++$num_guests;
        }
    }
    $num_users = count($users);
    echo "\t\t\t\t" . '<dd><span>' . sprintf($lang_index['Users online'], '<strong>' . forum_number_format($num_users) . '</strong>') . '</span></dd>' . "\n\t\t\t\t" . '<dd><span>' . sprintf($lang_index['Guests online'], '<strong>' . forum_number_format($num_guests) . '</strong>') . '</span></dd>' . "\n\t\t\t" . '</dl>' . "\n";
    if ($num_users > 0) {
        echo "\t\t\t" . '<dl id="onlinelist" class="clearb">' . "\n\t\t\t\t" . '<dt><strong>' . $lang_index['Online'] . ' </strong></dt>' . "\t\t\t\t" . implode(',</dd> ', $users) . '</dd>' . "\n\t\t\t" . '</dl>' . "\n";
    } else {
        echo "\t\t\t" . '<div class="clearer"></div>' . "\n";
    }
} else {
    echo "\t\t\t" . '</dl>' . "\n\t\t\t" . '<div class="clearer"></div>' . "\n";
}
?>
		</div>
	</div>
</div> -->
<?php 
$footer_style = 'index';
require PUN_ROOT . 'footer.php';
开发者ID:davidboy,项目名称:fluxbb,代码行数:31,代码来源:index.php


示例15: forum_link

                 $forum_page['post_actions']['quote'] = '<span class="quote-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['quote'], array($id, $cur_post['id'])) . '">' . $lang_topic['Quote'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>';
             }
         }
     } else {
         if ($forum_page['start_from'] + $forum_page['item_count'] == 1) {
             $forum_page['post_actions']['delete'] = '<span class="delete-topic' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['delete'], $cur_topic['first_post_id']) . '">' . $lang_topic['Delete topic'] . '</a></span>';
         } else {
             $forum_page['post_actions']['delete'] = '<span class="delete-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['delete'], $cur_post['id']) . '">' . $lang_topic['Delete'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>';
         }
         $forum_page['post_actions']['edit'] = '<span class="edit-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['edit'], $cur_post['id']) . '">' . $lang_topic['Edit'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>';
         $forum_page['post_actions']['quote'] = '<span class="quote-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['quote'], array($id, $cur_post['id'])) . '">' . $lang_topic['Quote'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>';
     }
 } else {
     if ($cur_topic['closed'] == '0') {
         if ($cur_topic['post_replies'] == '' && $forum_user['g_post_replies'] == '1' || $cur_topic['post_replies'] == '1') {
             $forum_page['post_actions']['quote'] = '<span class="report-post' . (empty($forum_page['post_actions']) ? ' first-item' : '') . '"><a href="' . forum_link($forum_url['quote'], array($id, $cur_post['id'])) . '">' . $lang_topic['Quote'] . '<span> ' . $lang_topic['Post'] . ' ' . forum_number_format($forum_page['start_from'] + $forum_page['item_count']) . '</span></a></span>';
         }
     }
 }
 ($hook = get_hook('vt_row_pre_post_actions_merge')) ? eval($hook) : null;
 if (!empty($forum_page['post_actions'])) {
     $forum_page['post_options']['actions'] = '<p class="post-actions">' . implode(' ', $forum_page['post_actions']) . '</p>';
 }
 // Give the post some class
 $forum_page['item_status'] = array('post', $forum_page['item_count'] % 2 != 0 ? 'odd' : 'even');
 if ($forum_page['item_count'] == 1) {
     $forum_page['item_status']['firstpost'] = 'firstpost';
 }
 if ($forum_page['start_from'] + $forum_page['item_count'] == $forum_page['finish_at']) {
     $forum_page['item_status']['lastpost'] = 'lastpost';
 }
开发者ID:vebnz,项目名称:lifelitup,代码行数:31,代码来源:viewtopic.php


示例16: print_posts

 public function print_posts($topic_id, $start_from, $cur_topic, $is_admmod)
 {
     global $lang_topic, $lang_common, $pd;
     $post_data = array();
     $post_count = 0;
     // Keep track of post numbers
     // Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
     $result = DB::for_table('posts')->select('id')->where('topic_id', $topic_id)->order_by('id')->limit($this->user->disp_topics)->offset($start_from)->find_many();
     $post_ids = array();
     foreach ($result as $cur_post_id) {
         $post_ids[] = $cur_post_id['id'];
     }
     if (empty($post_ids)) {
         error('The post table and topic table seem to be out of sync!', __FILE__, __LINE__);
     }
     // Retrieve the posts (and their respective poster/online status)
     $select_print_posts = array('u.email', 'u.title', 'u.url', 'u.location', 'u.signature', 'u.email_setting', 'u.num_posts', 'u.registered', 'u.admin_note', 'p.id', 'username' => 'p.poster', 'p.poster_id', 'p.poster_ip', 'p.poster_email', 'p.message', 'p.hide_smilies', 'p.posted', 'p.edited', 'p.edited_by', 'g.g_id', 'g.g_user_title', 'g.g_promote_next_group', 'is_online' => 'o.user_id');
     $result = DB::for_table('posts')->table_alias('p')->select_many($select_print_posts)->inner_join('users', array('u.id', '=', 'p.poster_id'), 'u')->inner_join('groups', array('g.g_id', '=', 'u.group_id'), 'g')->raw_join('LEFT OUTER JOIN ' . $this->feather->prefix . 'online', "o.user_id!=1 AND o.idle=0 AND o.user_id=u.id", 'o')->where_in('p.id', $post_ids)->order_by('p.id')->find_array();
     foreach ($result as $cur_post) {
         $post_count++;
         $cur_post['user_avatar'] = '';
         $cur_post['user_info'] = array();
         $cur_post['user_contacts'] = array();
         $cur_post['post_actions'] = array();
         $cur_post['is_online_formatted'] = '';
         $cur_post['signature_formatted'] = '';
         // If the poster is a registered user
         if ($cur_post['poster_id'] > 1) {
             if ($this->user->g_view_users == '1') {
                 $cur_post['username_formatted'] = '<a href="' . get_base_url() . '/user/' . $cur_post['poster_id'] . '/">' . feather_escape($cur_post['username']) . '</a>';
             } else {
                 $cur_post['username_formatted'] = feather_escape($cur_post['username']);
             }
             $cur_post['user_title_formatted'] = get_title($cur_post);
             if ($this->config['o_censoring'] == '1') {
                 $cur_post['user_title_formatted'] = censor_words($cur_post['user_title_formatted']);
             }
             // Format the online indicator
             $cur_post['is_online_formatted'] = $cur_post['is_online'] == $cur_post['poster_id'] ? '<strong>' . $lang_topic['Online'] . '</strong>' : '<span>' . $lang_topic['Offline'] . '</span>';
             if ($this->config['o_avatars'] == '1' && $this->user->show_avatars != '0') {
                 if (isset($avatar_cache[$cur_post['poster_id']])) {
                     $cur_post['user_avatar'] = $avatar_cache[$cur_post['poster_id']];
                 } else {
                     $cur_post['user_avatar'] = $avatar_cache[$cur_post['poster_id']] = generate_avatar_markup($cur_post['poster_id']);
                 }
             }
             // We only show location, register date, post count and the contact links if "Show user info" is enabled
             if ($this->config['o_show_user_info'] == '1') {
                 if ($cur_post['location'] != '') {
                     if ($this->config['o_censoring'] == '1') {
                         $cur_post['location'] = censor_words($cur_post['location']);
                     }
                     $cur_post['user_info'][] = '<dd><span>' . $lang_topic['From'] . ' ' . feather_escape($cur_post['location']) . '</span></dd>';
                 }
                 $cur_post['user_info'][] = '<dd><span>' . $lang_topic['Registered'] . ' ' . format_time($cur_post['registered'], true) . '</span></dd>';
                 if ($this->config['o_show_post_count'] == '1' || $this->user->is_admmod) {
                     $cur_post['user_info'][] = '<dd><span>' . $lang_topic['Posts'] . ' ' . forum_number_format($cur_post['num_posts']) . '</span></dd>';
                 }
                 // Now let's deal with the contact links (Email and URL)
                 if (($cur_post['email_setting'] == '0' && !$this->user->is_guest || $this->user->is_admmod) && $this->user->g_send_email == '1') {
                     $cur_post['user_contacts'][] = '<span class="email"><a href="mailto:' . feather_escape($cur_post['email']) . '">' . $lang_common['Email'] . '</a></span>';
                 } elseif ($cur_post['email_setting'] == '1' && !$this->user->is_guest && $this->user->g_send_email == '1') {
                     $cur_post['user_contacts'][] = '<span class="email"><a href="' . get_link('mail/' . $cur_post['poster_id'] . '/') . '">' . $lang_common['Email'] . '</a></span>';
                 }
                 if ($cur_post['url'] != '') {
                     if ($this->config['o_censoring'] == '1') {
                         $cur_post['url'] = censor_words($cur_post['url']);
                     }
                     $cur_post['user_contacts'][] = '<span class="website"><a href="' . feather_escape($cur_post['url']) . '" rel="nofollow">' . $lang_topic['Website'] . '</a></span>';
                 }
             }
             if ($this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && $this->user->g_mod_promote_users == '1') {
                 if ($cur_post['g_promote_next_group']) {
                     $cur_post['user_info'][] = '<dd><span><a href="' . get_base_url() . '/user/' . $cur_post['poster_id'] . '/action/promote/pid/' . $cur_post['id'] . '">' . $lang_topic['Promote user'] . '</a></span></dd>';
                 }
             }
             if ($this->user->is_admmod) {
                 $cur_post['user_info'][] = '<dd><span><a href="' . get_link('moderate/get-host/post/' . $cur_post['id'] . '/') . '" title="' . feather_escape($cur_post['poster_ip']) . '">' . $lang_topic['IP address logged'] . '</a></span></dd>';
                 if ($cur_post['admin_note'] != '') {
                     $cur_post['user_info'][] = '<dd><span>' . $lang_topic['Note'] . ' <strong>' . feather_escape($cur_post['admin_note']) . '</strong></span></dd>';
                 }
             }
         } else {
             $cur_post['username_formatted'] = feather_escape($cur_post['username']);
             $cur_post['user_title_formatted'] = get_title($cur_post);
             if ($this->user->is_admmod) {
                 $cur_post['user_info'][] = '<dd><span><a href="moderate.php?get_host=' . $cur_post['id'] . '" title="' . feather_escape($cur_post['poster_ip']) . '">' . $lang_topic['IP address logged'] . '</a></span></dd>';
             }
             if ($this->config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$this->user->is_guest && $this->user->g_send_email == '1') {
                 $cur_post['user_contacts'][] = '<span class="email"><a href="mailto:' . feather_escape($cur_post['poster_email']) . '">' . $lang_common['Email'] . '</a></span>';
             }
         }
         // Generation post action array (quote, edit, delete etc.)
         if (!$is_admmod) {
             if (!$this->user->is_guest) {
                 $cur_post['post_actions'][] = '<li class="postreport"><span><a href="' . get_link('report/' . $cur_post['id'] . '/') . '">' . $lang_topic['Report'] . '</a></span></li>';
             }
             if ($cur_topic['closed'] == '0') {
                 if ($cur_post['poster_id'] == $this->user->id) {
          

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP forum_opt函数代码示例发布时间:2022-05-15
下一篇:
PHP forum_move_attachments函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap