function bb_anon_unspoof_user()
{
    global $bb_current_user, $bb_roles;
    if ($bb_current_user->has_cap('anonymous')) {
        $bb_current_user = false;
    }
    if (is_forum() && bb_get_option('bb_anon_write_topics') != "Y") {
        echo '<p>';
        printf(__('You must <a href="%s">log in</a> to post.'), attribute_escape(bb_get_option('uri') . 'bb-login.php'));
        echo '</p>';
    }
}
Exemplo n.º 2
0
function bb_attachments_init()
{
    global $bbdb, $bb_attachments;
    if (isset($_GET['bb_attachments_diagnostic']) || isset($_GET['bb_attachments_debug'])) {
        include 'debug.php';
    }
    if (isset($_GET['bbat_delete'])) {
        bb_attachments_delete();
    }
    if (isset($_GET['bb_attachments'])) {
        if (isset($_GET['bbat'])) {
            if (isset($_GET['inline'])) {
                bb_attachments_inline();
            } else {
                bb_attachments_download();
            }
        } else {
            if (bb_attachments_location() != 'edit.php') {
                bb_repermalink();
                bb_send_headers();
                bb_get_header();
                bb_attachments($post_id);
                bb_get_footer();
                exit;
            }
        }
    }
    if ($bb_attachments['style']) {
        add_action('bb_head', 'bb_attachments_add_css');
    }
    // add css if present (including Kakumei  0.9.0.2 LI fix!)
    if ($bb_attachments['title'] && !is_topic() && !is_bb_feed()) {
        add_filter('topic_title', 'bb_attachments_title', 200);
    }
    if (isset($_GET["new"]) || is_topic() || is_forum()) {
        add_action('bb_topic.php', 'bb_attachments_cache');
        add_filter('post_text', 'bb_attachments_post_footer', 4);
        add_filter('post_edit_uri', 'bb_attachments_link');
        if (bb_current_user_can($bb_attachments['role']['upload'])) {
            add_action('post_edit_form', 'bb_attachments');
            // auto-insert on post edit form
            if ($bb_attachments['upload_on_new']) {
                add_action('post_form', 'bb_attachments_upload_form');
                // auto-insert on new post form
                add_action('pre_post_form', 'bb_attachments_enctype');
                // multipart workaround on new post form
                // insane bbPress workaround - adds multipart enctype to the new post form via uri patch
                function bb_attachments_enctype()
                {
                    global $topic, $forum;
                    if (is_topic() && bb_current_user_can('write_post', $topic->topic_id) || !is_topic() && bb_current_user_can('write_topic', $forum->forum_id)) {
                        add_filter('bb_get_uri', 'bb_attachments_uri_10', 999, 3);
                        add_filter('bb_get_option_uri', 'bb_attachments_uri', 999);
                        add_action('post_form', 'bb_attachments_remove_uri', 999);
                        add_action('post_post_form', 'bb_attachments_remove_uri', 999);
                    }
                }
                function bb_attachments_uri_10($uri, $resource = '', $context = '')
                {
                    if (strpos($uri, "bb-post.php") !== false && $context && defined('BB_URI_CONTEXT_FORM_ACTION') && $context == BB_URI_CONTEXT_FORM_ACTION) {
                        bb_attachments_remove_uri();
                        return $uri . '"  enctype="multipart/form-data" hack="';
                    }
                    return $uri;
                }
                function bb_attachments_uri($uri)
                {
                    // if (strpos($uri,'bb-post.php')===false) {return $uri;}
                    bb_attachments_remove_uri();
                    return $uri . 'bb-post.php"  enctype="multipart/form-data" hack="';
                }
                function bb_attachments_remove_uri($x = "")
                {
                    remove_filter('bb_get_option_uri', 'bb_attachments_uri', 999);
                    remove_filter('bb_get_uri', 'bb_attachments_uri_10', 999);
                }
            }
        }
    }
    // end else
}
Exemplo n.º 3
0
 function breadcrumbs()
 {
     $page = '';
     if (bb_get_location() == 'login-page') {
         $page = __('Log in', 'guangzhou');
     } elseif (is_forum()) {
         $page = get_forum_name();
     } elseif (is_bb_tags() && get_tag_name() != '') {
         $page = '<a href="' . bb_get_tag_page_link() . '">' . __('Tags') . '</a> &raquo; ' . get_tag_name();
     } elseif (is_topic()) {
         if (get_forum_name()) {
             $page = '<a href="' . get_forum_link() . '">' . get_forum_name() . '</a>';
         }
     }
     if ($page) {
         $page = '| ' . $page;
     }
     return '<a href="' . bb_get_option('uri') . '">' . bb_get_option('name') . '</a> ' . $page;
 }
Exemplo n.º 4
0
	<tr align="center" class="alt2border">
		<th class="alt1" align="left" colspan="3"><?php 
    echo $vbphrase['forum'];
    ?>
</th>
		<th class="alt2">SkimLinks</th>
		<th class="alt1">SkimWords</th>
	</tr>
	<?php 
    construct_hidden_code('skimlinks_disable_forums', '');
    construct_hidden_code('skimwords_disable_forums', '');
    foreach ($vbulletin->forumcache as $forumid => $forum) {
        echo '<tr align="center" class="alt2border">
			<td class="alt1" align="left" colspan="3">' . str_repeat('--', $forum['depth']) . ' ' . $forum['title'] . '</td>
			<td class="alt2">' . (is_forum($forum) ? getCheckbox('skimlinks_disable_forums', $forumid, !in_array($forumid, $slForumDisable)) : '-') . '</td>
			<td class="alt1">' . (is_forum($forum) ? getCheckbox('skimwords_disable_forums', $forumid, !in_array($forumid, $swForumDisable)) : '-') . '</td>
			</tr>';
    }
    print_colspan_fix();
    print_table_header($vbphrase['threads']);
    print_description_row('<span class="normal">' . $vbphrase['skimlinks_product_activation_based_on_age_of_thread'] . '</span>', false, 5, 'thead');
    ?>
	<tr align="left">
		<th class="alt1" width="50%"><?php 
    echo $vbphrase['skimlinks_activate_skimlinks_in'];
    ?>
</th>
		<th class="alt2" width="50%"><?php 
    echo $vbphrase['skimlinks_activate_skimwords_in'];
    ?>
</th>