コード例 #1
0
function meso_fetch_random_groups($limit = '', $size = '', $type = '', $block_id = '')
{
    global $wpdb, $bp;
    $fetch_group = "SELECT * FROM " . $wpdb->base_prefix . "bp_groups WHERE status = 'public' ORDER BY rand() LIMIT {$limit}";
    $sql_fetch_group = $wpdb->get_results($fetch_group);
    ?>
<ul class="random-groups item-list group-in-<?php 
    echo $block_id;
    ?>
">
<?php 
    $no_avatar = 'http://www.gravatar.com/avatar';
    foreach ($sql_fetch_group as $group_fe) {
        $avatar_full = bp_core_fetch_avatar('item_id=' . $group_fe->id . '&class=avatar&object=group&type=' . $type . '&width=' . $size . '&height=' . $size);
        $group_description = stripslashes($group_fe->description);
        ?>
<li>
<div class="item-avatar"><?php 
        echo $avatar_full;
        ?>
</div>
<div class="item">
<div class="item-title">
<a title="<?php 
        echo $group_fe->name . ' - ' . dez_get_short_text($group_description, 150);
        ?>
" href="<?php 
        echo home_url() . '/' . bp_get_root_slug('groups') . '/' . $group_fe->slug;
        ?>
"><?php 
        echo $group_fe->name;
        ?>
</a>
</div>
<div class="item-meta">
<span class="activity">
<?php 
        echo groups_get_groupmeta($group_fe->id, $meta_key = 'total_member_count');
        ?>
 <?php 
        echo bp_get_root_slug('members');
        ?>
</span>
</div>
</div>
</li>
<?php 
    }
    ?>
</ul>
<?php 
}
コード例 #2
0
ファイル: class.php プロジェクト: shads196770/cbox-theme
 /**
  * Check user access and redirect if access denied
  */
 public function maybe_redirect()
 {
     // always allow access to blog, registration and activation pages
     if (bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page()) {
         return;
     }
     // grab toggle option from registry
     $opt_toggle = $this->get_suboption('toggle');
     // is option toggled on?
     if ($opt_toggle && true == $opt_toggle->get()) {
         // protection is enabled, is user logged in?
         if (!is_user_logged_in()) {
             // not logged in, redirect to registration page
             bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug('register'));
             // exit to avoid any accidental output
             exit;
         }
     }
 }
コード例 #3
0
ファイル: hooks-functions.php プロジェクト: jun200/wordpress
function meso_schema_breadcrumbs()
{
    global $post;
    $schema_on = '';
    $schema_link = '';
    $schema_prop_url = '';
    $schema_prop_title = '';
    $showOnHome = 1;
    // 1 - show breadcrumbs on the homepage, 0 - don't show
    $delimiter = ' &raquo; ';
    // delimiter between crumbs
    $home = __('Home', 'mesocolumn');
    // text for the 'Home' link
    $showCurrent = 1;
    // 1 - show current post/page title in breadcrumbs, 0 - don't show
    $before = '<span class="current">';
    // tag before the current crumb
    $after = '</span>';
    // tag after the current crumb
    $schema_breadcrumb_on = get_theme_mod('schema_breadcrumb_on');
    if ($schema_breadcrumb_on == 'enable') {
        $schema_link = ' itemscope itemtype="http://data-vocabulary.org/Breadcrumb"';
        $schema_prop_url = ' itemprop="url"';
        $schema_prop_title = ' itemprop="title"';
    }
    $homeLink = home_url();
    if (is_home() || is_front_page()) {
        if ($showOnHome == 1) {
            echo '<div id="breadcrumbs"><div class="innerwrap">';
            echo __('You are here: ', 'mesocolumn');
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $homeLink . '">' . '<span' . $schema_prop_title . '>' . $home . '</span>' . '</a></span>';
            echo '</div></div>';
        }
    } else {
        echo '<div id="breadcrumbs"><div class="innerwrap">';
        if (!is_single()) {
            echo __('You are here: ', 'mesocolumn');
        }
        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $homeLink . '">' . '<span' . $schema_prop_title . '>' . $home . '</span>' . '</a></span>' . $delimiter . ' ';
        if (is_category()) {
            $thisCat = get_category(get_query_var('cat'), false);
            if ($thisCat->parent != 0) {
                $category_link = get_category_link($thisCat->parent);
                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $category_link . '">' . '<span' . $schema_prop_title . '>' . get_cat_name($thisCat->parent) . '</span>' . '</a></span>' . $delimiter . ' ';
            }
            $category_id = get_cat_ID(single_cat_title('', false));
            $category_link = get_category_link($category_id);
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $category_link . '">' . '<span' . $schema_prop_title . '>' . single_cat_title('', false) . '</span>' . '</a></span>';
        } elseif (is_search()) {
            echo __('Search results for', 'mesocolumn') . ' "' . get_search_query() . '"';
        } elseif (is_day()) {
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_year_link(get_the_time('Y')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('Y') . '</span>' . '</a></span>' . $delimiter . ' ';
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('F') . '</span>' . '</a></span>' . $delimiter . ' ';
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('d') . '</span>' . '</a></span>';
        } elseif (is_month()) {
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_year_link(get_the_time('Y')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('Y') . '</span>' . '</a></span>' . $delimiter . ' ';
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('F') . '</span>' . '</a></span>';
        } elseif (is_year()) {
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_year_link(get_the_time('Y')) . '">' . '<span' . $schema_prop_title . '>' . get_the_time('Y') . '</span>' . '</a></span>';
        } elseif (is_single() && !is_attachment()) {
            if (get_post_type() != 'post') {
                $post_type = get_post_type_object(get_post_type());
                $slug = $post_type->rewrite;
                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $homeLink . '/' . $slug['slug'] . '">' . '<span' . $schema_prop_title . '>' . $post_type->labels->singular_name . '</span>' . '</a></span>';
                // get post type by post
                $post_type = $post->post_type;
                // get post type taxonomies
                $taxonomies = get_object_taxonomies($post_type, 'objects');
                if ($taxonomies) {
                    foreach ($taxonomies as $taxonomy_slug => $taxonomy) {
                        // get the terms related to post
                        $terms = get_the_terms($post->ID, $taxonomy_slug);
                        if (!empty($terms)) {
                            foreach ($terms as $term) {
                                $taxlist .= ' ' . $delimiter . ' ' . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_term_link($term->slug, $taxonomy_slug) . '">' . '<span' . $schema_prop_title . '>' . ucfirst($term->name) . '</span>' . '</a></span>';
                            }
                        }
                    }
                    if ($taxlist) {
                        echo $taxlist;
                    }
                }
                echo ' ' . $delimiter . ' ' . __('You are reading &raquo;', 'mesocolumn');
            } else {
                $category = get_the_category();
                if ($category) {
                    foreach ($category as $cat) {
                        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_category_link($cat->term_id) . '">' . '<span' . $schema_prop_title . '>' . $cat->name . '</span>' . '</a></span>' . $delimiter . ' ';
                    }
                }
                echo __('You are reading &raquo;', 'mesocolumn');
            }
        } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {
            $post_type = get_post_type_object(get_post_type());
            echo $before . $post_type->labels->singular_name . $after;
        } elseif (is_attachment()) {
            $parent = get_post($post->post_parent);
            $cat = get_the_category($parent->ID);
            $cat = $cat[0];
            if ($cat) {
                echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
            }
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($parent) . '">' . '<span' . $schema_prop_title . '>' . $parent->post_title . '</span>' . '</a></span>';
            if ($showCurrent == 1) {
                echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
            }
        } elseif (is_page() && !$post->post_parent) {
            if (class_exists('buddypress')) {
                global $bp;
                if (bp_is_groups_component()) {
                    echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('groups') . '</span>' . '</a></span>';
                    if (!bp_is_directory()) {
                        echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '">' . '<span' . $schema_prop_title . '>' . bp_current_item() . '</span>' . '</a></span>';
                        if (bp_current_action()) {
                            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '/' . bp_current_action() . '">' . '<span' . $schema_prop_title . '>' . bp_current_action() . '</span>' . '</a></span>';
                        }
                    }
                } else {
                    if (bp_is_members_directory()) {
                        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
                    } else {
                        if (bp_is_user()) {
                            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
                            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . '">' . '<span' . $schema_prop_title . '>' . bp_get_displayed_user_username() . '</span>' . '</a></span>';
                            if (bp_current_action()) {
                                echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . bp_current_component() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
                            }
                        } else {
                            if (bp_is_directory()) {
                                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
                            } else {
                                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
                            }
                        }
                    }
                }
            } else {
                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
            }
        } elseif (is_page() && $post->post_parent) {
            $parent_id = $post->post_parent;
            $breadcrumbs = array();
            while ($parent_id) {
                $page = get_page($parent_id);
                $breadcrumbs[] = '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($page->ID) . '">' . '<span' . $schema_prop_title . '>' . get_the_title($page->ID) . '</span>' . '</a></span>';
                $parent_id = $page->post_parent;
            }
            $breadcrumbs = array_reverse($breadcrumbs);
            for ($i = 0; $i < count($breadcrumbs); $i++) {
                echo $breadcrumbs[$i];
                if ($i != count($breadcrumbs) - 1) {
                    echo ' ' . $delimiter . ' ';
                }
            }
            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
        } elseif (is_tag()) {
            $tag_id = get_term_by('name', single_cat_title('', false), 'post_tag');
            if ($tag_id) {
                $tag_link = get_tag_link($tag_id->term_id);
            }
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . $tag_link . '">' . '<span' . $schema_prop_title . '>' . single_cat_title('', false) . '</span>' . '</a></span>';
        } elseif (is_author()) {
            global $author;
            $userdata = get_userdata($author);
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_author_posts_url($userdata->ID) . '">' . '<span' . $schema_prop_title . '>' . $userdata->display_name . '</span>' . '</a></span>';
        } elseif (is_404()) {
            echo ' ' . $delimiter . ' ' . __('Error 404', 'mesocolumn');
        }
        if (get_query_var('paged')) {
            if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
                echo ' (';
            }
            echo ' ' . $delimiter . ' ' . __('Page', 'mesocolumn') . ' ' . get_query_var('paged');
            if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
                echo ')';
            }
        }
        echo '</div></div>';
    }
}
コード例 #4
0
/**
 * Output the root slug for a given component.
 *
 * @since 1.5.0
 *
 * @param string $component The component name.
 */
function bp_root_slug($component = '')
{
    echo bp_get_root_slug($component);
}
コード例 #5
0
ファイル: bpt-admin.php プロジェクト: picassentviu/AMMPro
/**
 * Output the BPT admin page
 */
function bp_tpack_theme_menu()
{
    if (!empty($_GET['finish'])) {
        update_option('bp_tpack_configured', 1);
    }
    if (!empty($_GET['reset'])) {
        delete_option('bp_tpack_configured');
    }
    if (!file_exists(get_query_template('bp-tpack', array('activity', 'blogs', 'forums', 'groups', 'members', 'registration')))) {
        $step = 1;
        if (!empty($_GET['move'])) {
            $step = 2;
            $error = false;
            /* Attempt to move the directories */
            if (!bp_tpack_move_templates()) {
                $error = true;
            }
        }
        /* Make sure we reset if template files have been deleted. */
        delete_option('bp_tpack_configured');
    } else {
        $step = 3;
    }
    if (!empty($_POST['bp_tpack_save'])) {
        /* Save options */
        if (!empty($_POST['bp_tpack_disable_css'])) {
            update_option('bp_tpack_disable_css', 1);
        } else {
            delete_option('bp_tpack_disable_css');
        }
        if (!empty($_POST['bp_tpack_disable_js'])) {
            update_option('bp_tpack_disable_js', 1);
        } else {
            delete_option('bp_tpack_disable_js');
        }
    }
    if (!(int) get_option('bp_tpack_configured')) {
        ?>
	<div class="wrap">
		<h2><?php 
        _e('Making Your Theme BuddyPress Compatible', 'bp-tpack');
        ?>
</h2>

		<p><?php 
        _e('Adding support for BuddyPress to your existing WordPress theme is a straightforward process. Follow the setup instructions on this page.', 'bp-tpack');
        ?>
</p>

		<?php 
        switch ($step) {
            case 1:
                ?>

				<h2><?php 
                _e('Step One: Moving template files automatically', 'bp-tpack');
                ?>
</h2>

				<p><?php 
                _e('BuddyPress needs some extra template files in order to display its pages correctly. This plugin will attempt to automatically move the necessary files into your current theme.', 'bp-tpack');
                ?>
</p>

				<p><?php 
                _e('Click the button below to start the process.', 'bp-tpack');
                ?>
</p>

				<p><a class="button" href="?page=bp-tpack-options&move=1"><?php 
                _e('Move Template Files', 'bp-tpack');
                ?>
</a></p>

			<?php 
                break;
                ?>

		<?php 
            case 2:
                ?>

				<?php 
                if ($error) {
                    ?>

					<h2><?php 
                    _e('Step Two: Moving templates manually', 'bp-tpack');
                    ?>
</h2>

					<p><?php 
                    _e("<strong>Moving templates failed.</strong> There was an error when trying to move the templates automatically. This probably means that we don't have the correct permissions. That's all right - it just means you'll have to move the template files manually.", 'bp-tpack');
                    ?>
</p>

					<p><?php 
                    _e('You will need to connect to your WordPress files using FTP. When you are connected browse to the following directory:', 'bp-tpack');
                    ?>
<p>

					<p><code><?php 
                    echo BP_PLUGIN_DIR . '/bp-themes/bp-default/';
                    ?>
</code></p>

					<p><?php 
                    _e('In this directory you will find six folders (/activity/, /blogs/, /forums/, /groups/, /members/, /registration/). If you want to use all of the features of BuddyPress then you must move these six directories to the following folder:', 'bp-tpack');
                    ?>
</p>

					<p><code><?php 
                    echo get_stylesheet_directory() . '/';
                    ?>
</code></p>

					<p><?php 
                    _e("If you decide that you don't want to use a feature of BuddyPress, then you can actually ignore the template folders for these features. For example, if you don't want to use the groups and forums features, you can simply avoid copying the /groups/ and /forums/ template folders to your active theme. (If you're not sure what to do, just copy all six folders over to your theme directory.)", 'bp-tpack');
                    ?>
</p>

					<p><?php 
                    _e('Once you have correctly copied the folders into your active theme, please use the button below to move onto step three.', 'bp-tpack');
                    ?>
</p>

					<p><a href="?page=bp-tpack-options" class="button"><?php 
                    _e("I've finished moving template folders", 'bp-tpack');
                    ?>
</a></p>

				<?php 
                } else {
                    ?>

					<h2><?php 
                    _e('Templates moved successfully!', 'bp-tpack');
                    ?>
</h2>

					<p><?php 
                    _e('Great news! BuddyPress templates are now in the correct position in your theme, which means that we can skip Step Two: Moving Templates Manually, and move directly to Step Three. Cool!', 'bp-tpack');
                    ?>
</p>

					<p><a class="button" href="?page=bp-tpack-options"><?php 
                    _e('Continue to Step Three', 'bp-tpack');
                    ?>
</a></p>

				<?php 
                }
                ?>

		<?php 
                break;
                ?>
		<?php 
            case 3:
                ?>
			<h2><?php 
                _e('Step Three: Tweaking your layout', 'bp-tpack');
                ?>
</h2>

			<p><?php 
                printf(__('Now that the template files are in the correct location, <a href="%s" target="_blank">check out your site</a>. (You can come back to the current page at any time, by visiting Dashboard > Appearance > BP Compatibility.) You should see a BuddyPress admin bar at the top of the page. Try visiting some of the links in the "My Account" menu. If everything has gone right up to this point, you should be able to see your BuddyPress content.', 'bp-tpack'), get_bloginfo('url'));
                ?>
</p>

			<p><?php 
                _e('If you find that the pages are not quite aligned correctly, or the content is overlapping the sidebar, you may need to tweak the template HTML. Please follow the "fixing alignment" instructions below. If the content in your pages is aligned to your satisfaction, then you can skip to the "Finishing Up" section at the bottom of this page.', 'bp-tpack');
                ?>
</p>

			<h3><?php 
                _e('Fixing Alignment', 'bp-tpack');
                ?>
</h3>

			<p><?php 
                _e('By default BuddyPress templates use this HTML structure:', 'bp-tpack');
                ?>
</p>

<p><pre><code style="display: block; width: 40%; padding-left: 15px;">
[HEADER]

&lt;div id="container"&gt;
	&lt;div id="content"&gt;
		[PAGE CONTENT]
	&lt;/div&gt;

	&lt;div id="sidebar"&gt;
		[SIDEBAR CONTENT]
	&lt;/div&gt;
&lt;/div&gt;

[FOOTER]

</code></pre></p>

			<p><?php 
                _e("If BuddyPress pages are not aligned correctly, then you may need to modify some of the templates to match your theme's HTML structure. The best way to do this is to access your theme's files, via FTP, at:", 'bp-tpack');
                ?>
</p>

			<p><code><?php 
                echo get_stylesheet_directory() . '/';
                ?>
</code></p>

			<p><?php 
                _e('Open up the <code>page.php</code> file (if this does not exist, use <code>index.php</code>). Make note of the HTML template structure of the file, specifically the <code>&lt;div&gt;</code> tags that surround the content and sidebar.', 'bp-tpack');
                ?>
</p>

			<p><?php 
                _e('You will need to change the HTML structure in the BuddyPress templates that you copied into your theme to match the structure in your <code>page.php</code> or <code>index.php</code> file.', 'bp-tpack');
                ?>
</p>

			<?php 
                if (version_compare(BP_VERSION, '1.3') > 0) {
                    ?>
				<p><?php 
                    _e("There are two methods for making the necessary template changes.", 'bp-tpack');
                    ?>
</p>

				<ol>
					<li>
						<?php 
                    _e("The first method is to locate the following templates (leave out any folders that you didn't copy over in Step Two):", 'bp-tpack');
                    ?>

			<?php 
                } else {
                    ?>
				<p><?php 
                    _e('The files that you need to edit are as follows (leave out any folders you have not copied over in step two):', 'bp-tpack');
                    ?>
</p>
			<?php 
                }
                ?>

			<ul style="list-style: disc; margin-left: 40px;">
				<li><code><?php 
                echo '/activity/index.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/blogs/index.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/forums/index.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/groups/index.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/groups/create.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/groups/single/home.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/groups/single/plugins.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/members/index.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/members/single/home.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/members/single/plugins.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/members/single/settings/delete-account.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/members/single/settings/notifications.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/members/single/settings/general.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/registration/register.php';
                ?>
</code></li>
				<li><code><?php 
                echo '/registration/activate.php';
                ?>
</code></li>

				<?php 
                if (is_multisite()) {
                    ?>
					<li><code><?php 
                    echo '/blogs/create.php';
                    ?>
</code></li>
				<?php 
                }
                ?>
			</ul>

			<?php 
                if (version_compare(BP_VERSION, '1.3') > 0) {
                    ?>
					</li>

					<li>
						<p><?php 
                    _e("Alternatively, you may find it easier to make copies of your theme's <code>header.php</code>, <code>sidebar.php</code> and <code>footer.php</code> and rename them to <code>header-buddypress.php</code>, <code>sidebar-buddypress.php</code>, and <code>footer-buddypress.php</code>.", 'bp-tpack');
                    ?>
</p>

						<p><?php 
                    _e("Then you can alter the structure of these new template files (<code>header-buddypress.php</code>, <code>sidebar-buddypress.php</code>, and <code>footer-buddypress.php</code>) to resemble your theme's <code>page.php</code> (or <code>index.php</code>).", 'bp-tpack');
                    ?>
</p>
					</li>
				</ol>
			<?php 
                }
                ?>

			<p><?php 
                _e('Once you are done matching up the HTML structure of your theme in these template files, please take another look through your site. You should find that BuddyPress pages now fit inside the content structure of your theme.', 'bp-tpack');
                ?>
</p>

			<h3><?php 
                _e('Finishing Up', 'bp-tpack');
                ?>
</h3>

			<p><?php 
                _e("You're now all done with the conversion process. Your WordPress theme will now happily provide BuddyPress compatibility support. Once you hit the finish button you will be presented with a new permanent theme options page, which will allow you to tweak some settings.", 'bp-tpack');
                ?>
</p>

			<p><a href="?page=bp-tpack-options&finish=1" class="button-primary"><?php 
                _e('Finish', 'bp-tpack');
                ?>
</a></p>
			<p>&nbsp;</p>

		<?php 
                break;
                ?>

		<?php 
        }
        ?>
	</div>

<?php 
    } else {
        // The theme steps have been completed, just show the permanent page
        ?>

	<div class="wrap">

		<h2><?php 
        _e('BuddyPress Theme Compatibility', 'bp-tpack');
        ?>
</h2>

		<?php 
        if (!empty($_GET['finish'])) {
            ?>
			<div id="message">
				<p><strong><?php 
            _e('Congratulations, you have completed the BuddyPress theme compatibility setup procedure!', 'bp-tpack');
            ?>
</strong></p>
			</div>
		<?php 
        }
        ?>

		<form action="" name="bp-tpack-settings" method="post" style="width: 60%; float: left; margin-right: 3%;">

			<p><strong><input type="checkbox" name="bp_tpack_disable_css" value="1"<?php 
        if ((int) get_option('bp_tpack_disable_css')) {
            ?>
 checked="checked"<?php 
        }
        ?>
 /> <?php 
        _e('Disable BP Template Pack CSS', 'bp-tpack');
        ?>
</strong></p>
			<p>
				<small style="display: block; margin-left:18px; font-size: 11px"><?php 
        _e("The BuddyPress template pack comes with basic wireframe CSS styles that will format the layout of BuddyPress pages. You can extend upon these styles in your theme's CSS file, or simply turn them off and build your own styles.", 'bp-tpack');
        ?>
</small>
			</p>

			<p style="margin-top: 20px;"><strong><input type="checkbox" name="bp_tpack_disable_js" value="1"<?php 
        if ((int) get_option('bp_tpack_disable_js')) {
            ?>
 checked="checked"<?php 
        }
        ?>
 /> <?php 
        _e('Disable BP Template Pack JS / AJAX', 'bp-tpack');
        ?>
</strong></p>
				<small style="display: block; margin-left:18px; font-size: 11px"><?php 
        _e('The BuddyPress template pack will automatically integrate the BuddyPress default theme javascript and AJAX functionality into your theme. You can switch this off, however the experience will be somewhat degraded.', 'bp-tpack');
        ?>
</small>

			<p class="submit">
				<input type="submit" name="bp_tpack_save" value="<?php 
        _e('Save Settings', 'bp-tpack');
        ?>
" class="button" />
			</p>
		</form>

		<div style="float: left; width: 37%;">

			<?php 
        /* In BP 1.5+, we remove the "BuddyPress is ready" message dynamically */
        ?>
			<?php 
        if (version_compare(BP_VERSION, '1.3') <= 0) {
            ?>
				<p style="line-height: 180%; border: 1px solid #eee; background: #fff; padding: 5px 10px;"><?php 
            _e('<strong>NOTE:</strong> To remove the "BuddyPress is ready" message you will need to add a "buddypress" tag to your theme. You can do this by editing the <code>style.css</code> file of your active theme and adding the tag to the "Tags:" line in the comment header.', 'bp-tpack');
            ?>
</p>
			<?php 
        }
        ?>

			<h4><?php 
        _e('Navigation Links', 'bp-tpack');
        ?>
</h4>

			<p><?php 
        _e('You may want to add new navigation tabs or links to your theme to link to BuddyPress directory pages. The default set of links are:', 'bp-tpack');
        ?>
</p>
				<ul>
					<?php 
        if (bp_is_active('activity')) {
            ?>
						<li><?php 
            _e('Activity', 'bp-tpack');
            ?>
: <a href="<?php 
            echo get_option('home') . '/' . bp_get_root_slug(BP_ACTIVITY_SLUG) . '/';
            ?>
"><?php 
            echo get_option('home') . '/' . BP_ACTIVITY_SLUG . '/';
            ?>
</a></li>
					<?php 
        }
        ?>

					<li><?php 
        _e('Members', 'bp-tpack');
        ?>
: <a href="<?php 
        echo get_option('home') . '/' . bp_get_root_slug(BP_MEMBERS_SLUG) . '/';
        ?>
"><?php 
        echo get_option('home') . '/' . BP_MEMBERS_SLUG . '/';
        ?>
</a></li>

					<?php 
        if (bp_is_active('groups')) {
            ?>
						<li><?php 
            _e('Groups', 'bp-tpack');
            ?>
: <a href="<?php 
            echo get_option('home') . '/' . bp_get_root_slug(BP_GROUPS_SLUG) . '/';
            ?>
"><?php 
            echo get_option('home') . '/' . BP_GROUPS_SLUG . '/';
            ?>
</a></li>
					<?php 
        }
        ?>

					<?php 
        if (bp_is_active('forums')) {
            ?>
						<li><?php 
            _e('Forums', 'bp-tpack');
            ?>
: <a href="<?php 
            echo get_option('home') . '/' . bp_get_root_slug(BP_FORUMS_SLUG) . '/';
            ?>
"><?php 
            echo get_option('home') . '/' . BP_FORUMS_SLUG . '/';
            ?>
</a></li>
					<?php 
        }
        ?>

					<li><?php 
        _e('Register', 'bp-tpack');
        ?>
: <a href="<?php 
        echo get_option('home') . '/' . bp_get_root_slug(BP_REGISTER_SLUG) . '/';
        ?>
"><?php 
        echo get_option('home') . '/' . BP_REGISTER_SLUG . '/';
        ?>
</a> <?php 
        _e('(registration must be enabled)', 'bp-tpack');
        ?>
</li>

					<?php 
        if (is_multisite() && bp_is_active('blogs')) {
            ?>
						<li><?php 
            _e('Blogs', 'bp-tpack');
            ?>
: <a href="<?php 
            echo get_option('home') . '/' . bp_get_root_slug(BP_BLOGS_SLUG) . '/';
            ?>
"><?php 
            echo get_option('home') . '/' . BP_BLOGS_SLUG . '/';
            ?>
</a></li>
					<?php 
        }
        ?>
				</ul>

			<h4><?php 
        _e('Reset Setup', 'bp-tpack');
        ?>
</h4>
			<p><?php 
        _e("If you would like to run through the setup process again please use the reset button (you will start at step three if you haven't removed the template files):", 'bp-tpack');
        ?>
</p>
			<p><a class="button" href="?page=bp-tpack-options&reset=1"><?php 
        _e('Reset', 'bp-tpack');
        ?>
</a></p>
		</div>

<?php 
    }
}
コード例 #6
0
/**
 * Filter the page title for BuddyPress pages
 *
 * @global object $bp BuddyPress global settings
 * @param string $title Original page title
 * @param string $sep How to separate the various items within the page title.
 * @param string $seplocation Direction to display title
 * @return string new page title
 * @see wp_title()
 * @since BuddyPress (1.5)
 */
function bp_modify_page_title($title, $sep, $seplocation)
{
    global $bp;
    // If this is not a BP page, just return the title produced by WP
    if (bp_is_blog_page()) {
        return $title;
    }
    // If this is the front page of the site, return WP's title
    if (is_front_page() || is_home()) {
        return $title;
    }
    $title = '';
    // Displayed user
    if (bp_get_displayed_user_fullname() && !is_404()) {
        // Get the component's ID to try and get it's name
        $component_id = $component_name = bp_current_component();
        // Use the actual component name
        if (!empty($bp->{$component_id}->name)) {
            $component_name = $bp->{$component_id}->name;
            // Fall back on the component ID (probably same as current_component)
        } elseif (!empty($bp->{$component_id}->id)) {
            $component_name = $bp->{$component_id}->id;
        }
        // translators: "displayed user's name | canonicalised component name"
        $title = strip_tags(sprintf(__('%1$s | %2$s', 'buddypress'), bp_get_displayed_user_fullname(), ucwords($component_name)));
        // A single group
    } elseif (bp_is_active('groups') && !empty($bp->groups->current_group) && !empty($bp->bp_options_nav[$bp->groups->current_group->slug])) {
        $subnav = isset($bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name']) ? $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] : '';
        // translators: "group name | group nav section name"
        $title = sprintf(__('%1$s | %2$s', 'buddypress'), $bp->bp_options_title, $subnav);
        // A single item from a component other than groups
    } elseif (bp_is_single_item()) {
        // translators: "component item name | component nav section name | root component name"
        $title = sprintf(__('%1$s | %2$s | %3$s', 'buddypress'), $bp->bp_options_title, $bp->bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug(bp_get_root_slug()));
        // An index or directory
    } elseif (bp_is_directory()) {
        if (!bp_current_component()) {
            $title = sprintf(__('%s Directory', 'buddypress'), bp_get_name_from_root_slug());
        } else {
            $title = sprintf(__('%s Directory', 'buddypress'), bp_get_name_from_root_slug());
        }
        // Sign up page
    } elseif (bp_is_register_page()) {
        $title = __('Create an Account', 'buddypress');
        // Activation page
    } elseif (bp_is_activation_page()) {
        $title = __('Activate your Account', 'buddypress');
        // Group creation page
    } elseif (bp_is_group_create()) {
        $title = __('Create a Group', 'buddypress');
        // Blog creation page
    } elseif (bp_is_create_blog()) {
        $title = __('Create a Site', 'buddypress');
    }
    // Some BP nav items contain item counts. Remove them
    $title = preg_replace('|<span>[0-9]+</span>|', '', $title);
    return apply_filters('bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation);
}
コード例 #7
0
    function fetch_random_notfriend($limit = 6, $size = 120)
    {
        global $wpdb, $bp, $friendList, $initiatorList;
        $current_loggedin_user = $bp->loggedin_user->id;
        $fetch_friend = "SELECT * FROM " . $wpdb->base_prefix . "bp_friends WHERE friend_user_id = '" . $current_loggedin_user . "' AND is_confirmed = '1' ORDER BY rand() LIMIT {$limit}";
        $sql_fetch_friend = $wpdb->get_results($fetch_friend);
        $fetch_initiator = "SELECT * FROM " . $wpdb->base_prefix . "bp_friends WHERE initiator_user_id = '" . $current_loggedin_user . "' AND is_confirmed = '1' ORDER BY rand() LIMIT {$limit}";
        $sql_fetch_initiator = $wpdb->get_results($fetch_initiator);
        ?>
<ul id="random-groups">
<?php 
        if ($sql_fetch_friend) {
            foreach ($sql_fetch_friend as $friend) {
                $array_friend[] = $friend->initiator_user_id;
                $friendList = implode(",", $array_friend);
            }
        }
        if ($sql_fetch_initiator) {
            foreach ($sql_fetch_initiator as $initiator) {
                $array_initiator[] = $initiator->friend_user_id;
                $initiatorList = implode(",", $array_initiator);
            }
        }
        if ($sql_fetch_friend && $sql_fetch_initiator) {
            $listallfriend = $current_loggedin_user . ',' . $friendList . ',' . $initiatorList;
        } else {
            if (!$sql_fetch_friend) {
                $listallfriend = $current_loggedin_user . ',' . $initiatorList;
            } else {
                if (!$sql_fetch_initiator) {
                    $listallfriend = $current_loggedin_user . ',' . $friendList;
                } else {
                    if (!$sql_fetch_friend && !$sql_fetch_initiator) {
                        $listallfriend = $current_loggedin_user . ',9999999999999,99999999999999999999';
                    }
                }
            }
        }
        // echo $friendList;
        $fetch_friend_step2 = "SELECT * FROM " . $wpdb->base_prefix . "users WHERE ID NOT IN ( " . $listallfriend . ") ORDER BY rand() LIMIT {$limit}";
        $sql_fetch_friend_step2 = $wpdb->get_results($fetch_friend_step2);
        foreach ($sql_fetch_friend_step2 as $fof) {
            $avatar_full = bp_core_fetch_avatar('item_id=' . $fof->ID . '&class=av-border&object=user&type=full&width=' . $size . '&height=' . $size);
            ?>
<li><a title="<?php 
            _e("add", TEMPLATE_DOMAIN);
            ?>
 <?php 
            echo $fof->user_nicename;
            ?>
 <?php 
            _e("as friend", TEMPLATE_DOMAIN);
            ?>
" href="<?php 
            echo $bp->root_domain . '/' . bp_get_root_slug('members') . '/' . strtolower($fof->user_nicename) . '/';
            ?>
">
<?php 
            echo $avatar_full;
            ?>
</a></li>
<?php 
        }
        ?>
</ul>
<?php 
    }
コード例 #8
0
/**
 * Returns the link of an Achievement's activity stream RSS feed.
 *
 * @since 2.0
 * @global object $bp BuddyPress global settings
 * @return string
 */
function dpa_get_achievement_activity_feed_link()
{
    global $bp;
    return apply_filters('dpa_get_achievement_activity_feed_link', trailingslashit(bp_get_root_domain()) . bp_get_root_slug($bp->achievements->slug) . '/' . apply_filters('dpa_get_achievement_slug', $bp->achievements->current_achievement->slug) . '/' . DPA_SLUG_ACHIEVEMENT_ACTIVITY_RSS . '/');
}
コード例 #9
0
<?php

/**
 * RSS2 feed template for displaying an Achievement's activity stream
 *
 * @author Paul Gibbs <*****@*****.**>
 * @version 2.0
 * @package Achievements 
 * @subpackage feed
 *
 * $Id$
 */
global $bp;
$slug = function_exists('bp_get_root_slug') ? bp_get_root_slug($bp->achievements->slug) : $bp->achievements->slug;
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
header('Status: 200 OK');
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?>';
?>

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	<?php 
do_action('dpa_myachievements_feed');
?>
>

<channel>
	<title><?php 
コード例 #10
0
<input type="hidden" name="redirect_to" value="<?php 
                echo bp_root_domain();
                ?>
"/>
<input type="hidden" name="testcookie" value="1" />

<small><a href="<?php 
                echo bp_root_domain();
                ?>
/wp-login.php?action=lostpassword"><?php 
                _e('Lost your password?', TEMPLATE_DOMAIN);
                ?>
</a>&nbsp;|&nbsp;
<a href="<?php 
                echo bp_root_domain() . '/' . bp_get_root_slug('register') . '/';
                ?>
"><?php 
                _e('Create a new account', TEMPLATE_DOMAIN);
                ?>
</a></small>
<?php 
                do_action('bp_sidebar_login_form');
                ?>
</form>
<?php 
                do_action('bp_after_sidebar_login_form');
                ?>


<?php 
コード例 #11
0
ファイル: class.front.php プロジェクト: hscale/webento
 function directory_before_content()
 {
     if (!preg_match('|^bp_before_directory_([^\\_]+)_content$|', current_filter(), $match)) {
         return;
     }
     $component = $match[1];
     $defaults = array('before_title' => '<h3>', 'after_title' => '</h3>', 'show_create' => is_user_logged_in());
     switch ($component) {
         case 'groups':
             $defaults['directory_title'] = __('Groups Directory', 'buddypress');
             $defaults['create_html'] = ' &nbsp;<a class="button" href="' . bp_get_root_domain() . '/' . bp_get_root_slug('groups') . '/create/">' . __('Create a Group', 'buddypress') . '</a>';
             break;
         case 'forums':
             $defaults['directory_title'] = __('Group Forums Directory', 'buddypress');
             $defaults['create_html'] = ' &nbsp;<a class="button" href="#new-topic" id="new-topic-button">' . __('New Topic', 'buddypress') . '</a>';
             break;
         case 'blogs':
             $defaults['show_create'] &= bp_blog_signup_enabled();
             $defaults['directory_title'] = __('Blogs Directory', 'buddypress');
             $defaults['create_html'] = ' &nbsp;<a class="button" href="' . bp_get_root_domain() . '/' . bp_get_root_slug('blogs') . '/create/">' . __('Create a Blog', 'buddypress') . '</a>';
             break;
     }
     $args = apply_filters('gconnect_directory_title', $defaults, $component);
     extract($args, EXTR_SKIP);
     echo $before_title . $directory_title;
     if ($show_create) {
         echo $create_html;
     }
     echo $after_title;
 }
コード例 #12
0
ファイル: widgets-functions.php プロジェクト: hscale/webento
        function fetch_random_groups($limit = '', $size = '', $type = '', $block_id = '')
        {
            global $wpdb, $bp;
            $fetch_group = "SELECT * FROM " . $wpdb->base_prefix . "bp_groups WHERE status = 'public' ORDER BY rand() LIMIT {$limit}";
            $sql_fetch_group = $wpdb->get_results($fetch_group);
            ?>

<div id="<?php 
            echo $block_id;
            ?>
" class="avatar-block">
<?php 
            $no_avatar = get_template_directory_uri() . '/_inc/images/default.png';
            foreach ($sql_fetch_group as $group) {
                $avatar_full = bp_core_fetch_avatar('item_id=' . $group->id . '&class=avatar&object=group&type=' . $type . '&width=' . $size . '&height=' . $size);
                $group_description = stripslashes($group->description);
                ?>
<div style="margin: 0px 5px 5px 0px; float: left;" class="item-avatar"><a title="<?php 
                echo $group->name . ' - ' . short_text($group_description, 150);
                ?>
" href="<?php 
                echo home_url() . '/' . bp_get_root_slug('groups') . '/' . $group->slug;
                ?>
">
<?php 
                echo $avatar_full;
                ?>
</a></div>
<?php 
            }
            ?>
</div>
<?php 
        }
コード例 #13
0
$tpl_dir = get_template_directory_uri();
$tpl_url = get_site_url();
$mywp_version = get_bloginfo('version');
if (file_exists(WP_CONTENT_DIR . '/themes/wpmu-nelo/style.css')) {
    $theme_data = wp_get_theme('wpmu-nelo', WP_CONTENT_DIR . '/themes');
} else {
    $theme_data = wp_get_theme();
}
$theme_version = $theme_data->get('Version');
if (function_exists('bp_get_root_domain')) {
    $the_privacy_root = bp_get_root_domain();
} else {
    $the_privacy_root = site_url();
}
if (function_exists('bp_get_root_slug')) {
    $member_reg_slug = bp_get_root_slug('register');
}
$wp_dropdown_rd_admin = get_categories('hide_empty=0');
$wp_getcat = array();
foreach ($wp_dropdown_rd_admin as $category_list) {
    $wp_getcat[$category_list->cat_ID] = $category_list->cat_name;
}
$category_bulk_list = array_unshift($wp_getcat, "Choose a category");
$choose_count = array("Select a number", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");
$options = array(array("name" => __("Do you want to enable <strong>privacy</strong> on all members profile for not logged in user<br /><em>* only logged in user can view members profile and members directory. 'disable' by default</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "privacy_status", "box" => "1", "header-title" => __("Global Privacy Setting", TEMPLATE_DOMAIN), "inblock" => "buddypress", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("if you enable the <strong>privacy</strong> on all members profile for none logged in user, insert the full url link they will be redirect to for non logged in users<br /><em>*optional - leave empty for default<br />default are buddypress register link<br /> " . site_url() . '/' . (isset($member_reg_slug) ? $member_reg_slug : '') . '/' . "</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "privacy_redirect", "box" => "1", "inblock" => "buddypress", "type" => "text", "std" => ""), array("name" => __("Do you want to enable <strong>friend only privacy</strong> for user profile<br /><em>* only friend can view friend profile. network/super admin were exclude from this condition. 'disable' by default</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "friend_privacy_status", "header-title" => __("Users Privacy Setting", TEMPLATE_DOMAIN), "box" => "1", "bp-only" => $bp_existed, "inblock" => "buddypress", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("if you enable the <strong>friend privacy</strong> for user profile, insert the full url link they will be redirect when viewing a none friend user<br /><em>*optional - leave empty for default<br />default are buddypress homepage link<br /> " . site_url() . '/' . "</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "friend_privacy_redirect", "box" => "1", "inblock" => "buddypress", "type" => "text", "std" => ""), array("name" => __("Do you want to allowed only <strong>admin and moderators</strong> to create group? <em>* if yes, normal users cannot create group and can only join groups created by admin and moderators. 'no' by default</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "create_group_status", "header-title" => __("Groups Privacy Setting", TEMPLATE_DOMAIN), "box" => "1", "inblock" => "buddypress", "type" => "select", "std" => "no", "options" => array("no", "yes")), array("name" => __("if you enable for the only <strong>admins and editors</strong> to create group, insert the full url link they will be redirect to for non admins and editors users when they click <strong>create group</strong> button<br /><em>*optional - leave empty for default<br />default are buddypress root domain<br /> " . $the_privacy_root . '/' . "</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "create_group_redirect", "box" => "1", "inblock" => "buddypress", "type" => "text", "std" => ""), array("name" => __("Do you want to enable facebook like it in Activity Stream", TEMPLATE_DOMAIN), "description" => __("you can enable facebook like in stream but this is a bandwith hog features 'disable' by default", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "stream_facebook_like_status", "inblock" => "buddypress", "type" => "select", "box" => "1", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("Do you want to enable post author and meta info like post date etc in posts?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_postmeta_status", "inblock" => "post", "box" => "1", "type" => "select", "std" => "enable", "options" => array("enable", "disable")), array("name" => __("Choose your content background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_container_colour", "inblock" => "layout", "custom" => "colourpicker", "box" => "1", "std" => "", "type" => "text"), array("name" => __("Choose your body <strong>line</strong> colour? *grid lines and separate lines", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_content_line_colour", "inblock" => "layout", "custom" => "colourpicker", "box" => "1", "std" => "", "type" => "text"), array("name" => __("Choose your global body font?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_body_font", "type" => "select", "box" => "2", "inblock" => "font", "std" => "Helvetica, Arial, sans-serif", "options" => array("Helvetica, Arial, sans-serif", "Lucida Grande, Lucida Sans, sans-serif", "Arial, sans-serif", "Cantarell, arial, serif", "Cardo, arial, serif", "Courier New, Courier, monospace", "Crimson Text, arial, serif", "Droid Sans, arial, serif", "Droid Serif, arial, serif", "Garamond, Georgia, serif", "Georgia, arial, serif", "IM Fell DW Pica, arial, serif", "Josefin Sans Std Light, arial, serif", "Lobster, arial, serif", "Lucida Sans Unicode, Lucinda Grande, sans-serif", "Molengo, arial, serif", "Neuton, arial, serif", "Nobile, arial, serif", "OFL Sorts Mill Goudy TT, arial, serif", "Old Standard TT, arial, serif", "Reenie Beanie, arial, serif", "Tahoma, sans-serif", "Tangerine, arial, serif", "Trebuchet MS, sans-serif", "Verdana, sans-serif", "Vollkorn, arial, serif", "Yanone Kaffeesatz, arial, serif", "Just Another Hand, arial, serif", "Terminal Dosis Light, arial, serif", "Ubuntu, arial, serif")), array("name" => __("Choose your global headline font", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_headline_font", "type" => "select", "box" => "2", "inblock" => "font", "std" => "Helvetica, Arial, sans-serif", "options" => array("Helvetica, Arial, sans-serif", "Lucida Grande, Lucida Sans, sans-serif", "Arial, sans-serif", "Cantarell, arial, serif", "Cardo, arial, serif", "Courier New, Courier, monospace", "Crimson Text, arial, serif", "Droid Sans, arial, serif", "Droid Serif, arial, serif", "Garamond, Georgia, serif", "Georgia, arial, serif", "IM Fell DW Pica, arial, serif", "Josefin Sans Std Light, arial, serif", "Lobster, arial, serif", "Lucida Sans Unicode, Lucinda Grande, sans-serif", "Molengo, arial, serif", "Neuton, arial, serif", "Nobile, arial, serif", "OFL Sorts Mill Goudy TT, arial, serif", "Old Standard TT, arial, serif", "Reenie Beanie, arial, serif", "Tahoma, sans-serif", "Tangerine, arial, serif", "Trebuchet MS, sans-serif", "Verdana, sans-serif", "Vollkorn, arial, serif", "Yanone Kaffeesatz, arial, serif", "Just Another Hand, arial, serif", "Terminal Dosis Light, arial, serif", "Ubuntu, arial, serif")), array("name" => __("Choose your font size here?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_font_size", "box" => "2", "inblock" => "font", "type" => "select", "std" => "normal", "options" => array("normal", "small", "bigger", "largest")), array("name" => __("Change your global body font colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_body_font_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "#1a1a1a", "type" => "text"), array("name" => __("Choose your prefered links colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_content_link_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "", "type" => "text"), array("name" => __("Choose your prefered links <strong>hover</strong> colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_content_link_hover_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "", "type" => "text"), array("name" => __("Choose your prefered <strong>post title</strong> links colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_post_title_link_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation and footer colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_footer_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your navigation font", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nav_font", "type" => "select", "box" => "3", "inblock" => "nav", "std" => "Helvetica, Arial, sans-serif", "options" => array("Helvetica, Arial, sans-serif", "Lucida Grande, Lucida Sans, sans-serif", "Arial, sans-serif", "Cantarell, arial, serif", "Cardo, arial, serif", "Courier New, Courier, monospace", "Crimson Text, arial, serif", "Droid Sans, arial, serif", "Droid Serif, arial, serif", "Garamond, Georgia, serif", "Georgia, arial, serif", "IM Fell DW Pica, arial, serif", "Josefin Sans Std Light, arial, serif", "Lobster, arial, serif", "Lucida Sans Unicode, Lucinda Grande, sans-serif", "Molengo, arial, serif", "Neuton, arial, serif", "Nobile, arial, serif", "OFL Sorts Mill Goudy TT, arial, serif", "Old Standard TT, arial, serif", "Reenie Beanie, arial, serif", "Tahoma, sans-serif", "Tangerine, arial, serif", "Trebuchet MS, sans-serif", "Verdana, sans-serif", "Vollkorn, arial, serif", "Yanone Kaffeesatz, arial, serif", "Just Another Hand, arial, serif", "Terminal Dosis Light, arial, serif", "Ubuntu, arial, serif")), array("name" => __("Choose your prefered navigation hover background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_bg_hover_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation dropdown background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_dropdown_bg_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation dropdown <strong>hover</strong> background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_dropdown_bg_hover_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation dropdown <strong>separate line</strong> colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_dropdown_line_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation link text colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_link_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation link text hover colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_link_hover_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Do you want to used breadcrumb navigation in posts and pages<br />*default: disable", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_breadcrumb_on", "box" => "3", "inblock" => "nav", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => sprintf(__("If you want to use an logo image in header:<br />upload your logo <a target=\"_blank\" href=\"%s\">here</a> and copy paste the full image url<br /><br /><em>*this will replace the site title text with logo image</em>", TEMPLATE_DOMAIN), admin_url("upload.php")), "id" => $shortname . $shortprefix . "header_logo_img", "inblock" => "custom-header", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Do you want to used the custom image header *default: disabled", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_header_on", "box" => "3", "inblock" => "custom-header", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("Insert your desired custom header height?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_image_height", "inblock" => "custom-header", "box" => "3", "std" => "150", "type" => "text"), array("name" => __("Enter a link for your custom image header<br />*default: link to homepage", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_header_link", "box" => "3", "inblock" => "custom-header", "type" => "text", "std" => ""), array("name" => __("Show a login panel and logged in users profile?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_show_profile", "inblock" => "profile", "box" => "2", "type" => "select", "std" => "no", "options" => array("no", "yes")), array("name" => __("Enter some information about yourself or the site (only displayed if the login panel is enabled)", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_profile_text", "inblock" => "profile", "box" => "2", "std" => "", "type" => "textarea"));
function mytheme_wpmu_admin()
{
    global $bp_existed, $themename, $shortname, $options, $shortprefix;
    if (isset($_REQUEST['saved']) && $_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . __(' settings saved.', TEMPLATE_DOMAIN) . '</strong></p></div>';
    }
コード例 #14
0
ファイル: panel-home.php プロジェクト: hscale/webento
</p>


<?php 
if (!is_user_logged_in()) {
    ?>
<div class="submit-button">
<?php 
    if ($tn_blogsmu_featured_intro_button_text == '') {
        ?>
<a href='<?php 
        echo site_url();
        ?>
/<?php 
        if ($bp_existed == 'true') {
            echo bp_get_root_slug('register') . '/';
        } else {
            ?>
wp-login.php?action=register<?php 
        }
        ?>
'><?php 
        echo stripslashes($tn_blogsmu_featured_intro_button_text);
        ?>
</a>
<?php 
    } else {
        ?>
<a href="<?php 
        echo do_shortcode(stripslashes($tn_blogsmu_featured_intro_button_link));
        ?>
コード例 #15
0
/**
 * Adds a navigation item to the main navigation array used in BuddyPress themes.
 *
 * @package BuddyPress Core
 * @global object $bp Global BuddyPress settings object
 */
function bp_core_new_nav_item($args = '')
{
    global $bp;
    $defaults = array('name' => false, 'slug' => false, 'item_css_id' => false, 'show_for_displayed_user' => true, 'site_admin_only' => false, 'position' => 99, 'screen_function' => false, 'default_subnav_slug' => false);
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    // If we don't have the required info we need, don't create this subnav item
    if (empty($name) || empty($slug)) {
        return false;
    }
    // If this is for site admins only and the user is not one, don't create the subnav item
    if ($site_admin_only && !bp_current_user_can('bp_moderate')) {
        return false;
    }
    if (empty($item_css_id)) {
        $item_css_id = $slug;
    }
    $bp->bp_nav[$slug] = array('name' => $name, 'slug' => $slug, 'link' => $bp->loggedin_user->domain . $slug . '/', 'css_id' => $item_css_id, 'show_for_displayed_user' => $show_for_displayed_user, 'position' => $position, 'screen_function' => &$screen_function);
    /***
     * If this nav item is hidden for the displayed user, and
     * the logged in user is not the displayed user
     * looking at their own profile, don't create the nav item.
     */
    if (!$show_for_displayed_user && !bp_user_has_access()) {
        return false;
    }
    /***
     * If the nav item is visible, we are not viewing a user, and this is a root
     * component, don't attach the default subnav function so we can display a
     * directory or something else.
     */
    if (-1 != $position && bp_is_root_component($slug) && !bp_displayed_user_id()) {
        return;
    }
    // Look for current component
    if (bp_is_current_component($slug) && !bp_current_action()) {
        if (!is_object($screen_function[0])) {
            add_action('bp_screens', $screen_function);
        } else {
            add_action('bp_screens', array(&$screen_function[0], $screen_function[1]), 3);
        }
        if (!empty($default_subnav_slug)) {
            /**
             * BuddyPress will attempt to resolve to the most specific URL possible,
             * to avoid search-engine-unfriendly content reduplication. Filter
             * bp_guarantee_unique_uris (and return false) to avoid this behavior
             */
            if (apply_filters('bp_guarantee_unique_uris', true)) {
                bp_core_redirect(bp_displayed_user_domain() . $slug . '/' . apply_filters('bp_default_component_subnav', $default_subnav_slug, $r));
            } else {
                $bp->current_action = apply_filters('bp_default_component_subnav', $default_subnav_slug, $r);
            }
        }
        // Look for current item
    } elseif (bp_is_current_item($slug) && !bp_current_action()) {
        if (!is_object($screen_function[0])) {
            add_action('bp_screens', $screen_function);
        } else {
            add_action('bp_screens', array(&$screen_function[0], $screen_function[1]), 3);
        }
        if (!empty($default_subnav_slug)) {
            /**
             * BuddyPress will attempt to resolve to the most specific URL possible,
             * to avoid search-engine-unfriendly content reduplication. Filter
             * bp_guarantee_unique_uris (and return false) to avoid this behavior
             */
            if (apply_filters('bp_guarantee_unique_uris', true)) {
                bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug(bp_current_component()) . '/' . $slug . '/' . apply_filters('bp_default_component_subnav', $default_subnav_slug, $r));
            } else {
                $bp->current_action = apply_filters('bp_default_component_subnav', $default_subnav_slug, $r);
            }
        }
    }
    do_action('bp_core_new_nav_item', $r, $args, $defaults);
}