<?xml version="1.0" encoding="UTF-8"?>
<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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Teleogistic &#187; admin bar</title>
	<atom:link href="http://teleogistic.net/tag/admin-bar/feed/" rel="self" type="application/rss+xml" />
	<link>http://teleogistic.net</link>
	<description></description>
	<lastBuildDate>Thu, 03 May 2012 16:24:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Displaying the BuddyPress admin bar in other applications</title>
		<link>http://teleogistic.net/2009/10/displaying-the-buddypress-admin-bar-in-other-applications/</link>
		<comments>http://teleogistic.net/2009/10/displaying-the-buddypress-admin-bar-in-other-applications/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 01:08:44 +0000</pubDate>
		<dc:creator>Boone Gorges</dc:creator>
				<category><![CDATA[dev.wpmued]]></category>
		<category><![CDATA[edtech]]></category>
		<category><![CDATA[admin bar]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[mediawiki]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://teleogistic.net/?p=320</guid>
		<description><![CDATA[Cross-posted at the CUNY Academic Commons Dev Blog By popular demand, here&#8217;s the method we used at the CUNY Academic Commons to get the BuddyPress admin bar to appear on the non-WP/BP portions of our site. In our case, that means MediaWiki and bbPress, but theoretically this method could work for any kind of software [...]]]></description>
			<content:encoded><![CDATA[<p><em>Cross-posted at the <a href="http://dev.commons.gc.cuny.edu">CUNY Academic Commons Dev Blog</a></em></p>
<p>By popular demand, here&#8217;s the method we used at the CUNY Academic Commons to get the BuddyPress admin bar to appear on the non-WP/BP portions of our site. In our case, that means MediaWiki and bbPress, but theoretically this method could work for any kind of software out there.</p>
<p>I should note that I did not devise this method. It was invented by the inimitable Zach and Lucas of <a href="http://castironcoding.com/">Cast Iron Coding</a>.</p>
<p>The concept is as follows. A bit of jQuery looks for a div of a certain ID on a page and, when it finds it, opens a dummy WP page that contains essentially nothing but the BP admin bar loader, which then appears on your page. Download the zip file containing the necessary files (<a href='http://teleogistic.net/wp-content/uploads/2009/10/admin-bar-integration.zip'>admin-bar-integration</a>) and follow these steps to make it happen.</p>
<ol>
<li>Upload the file <code>page-component.php</code> to your WP theme directory.</li>
<li>Create a new page in WordPress. The page should be blank. In the Attributes box, select the Template called &#8220;Component (do not use)&#8221;. Name the page <code>bpnavslug</code> and publish it, making sure that you take note of the permalink. You&#8217;ll need that URL (relative to your site&#8217;s webroot) in step 4.</li>
<li>If any part of your site creates a menu or a list of your WordPress pages, you&#8217;ll want to exclude this empty page from those listings. Find the function call wp_list_pages in your theme (often in header.php or index.php) and add an exclude argument. For example, if the page number of bpnavslug is 4, make sure all references to wp_list_pages read <code>wp_list_pages('exclude=4')</code>.</li>
<li>Open the file <code>bp-bar-integration.js</code>. On line 3, you&#8217;ll see the path <code>/bpnavslug/</code>. Replace it with the path to the bpnavslug post you created in step 2.</li>
<li>Upload <code>bp-bar-integration.js</code> to your server. For the sake of argument, I&#8217;ll put mine at /wp-content/js/bp-bar-integration.js.</li>
<li>Now let&#8217;s turn to the application where you want the admin bar to appear. Open the theme file that contains the &lt;/body&gt; tag. In bbPress, for example, this is usually footer.php.</li>
<li>Immediately before the body close tag, paste the following code:<br />
	<code>&lt;div id="bpContainer"&gt;<br />
	&lt;/div&gt;</code>
	</li>
<li>Next, open the template file that contains the document head (header.php in bbPress, for instance). Make sure that jQuery is also called somewhere in the head. If it&#8217;s not, the following code will call up jQuery on a standard installation of WP:<br />
    <code> &lt;script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.3.2'&gt;&lt;/script&gt;</code><br />
      Now paste the following line somewhere in the head (make sure it comes after the call to jQuery):<br />
	<code>&lt;script type="text/javascript" src="/wp-content/js/bp-bar-integration.js"&gt;&lt;/script&gt;</code><br />
    Be sure to replace the src attribute with path from your upload in step 5.<br />
    Finally, you&#8217;ll have to include the CSS for the admin bar. On a default installation of BuddyPress 1.0.3 or less, the following code will work:<br />
    <code>&lt;link rel='stylesheet' id='bp-admin-bar-css'  href='/wp-content/plugins/buddypress/bp-core/css/admin-bar.css' type='text/css' media='screen' /&gt;</code><br />
On a more recent version of BP (1.1+), the admin bar stylesheet has been rolled in with the rest of the styles. Either create your own stylesheet containing just the admin bar code, or import the entire stylesheet:<br />
<code>&lt;link rel='stylesheet' id='bp-admin-bar-css'  href='/wp-content/themes/bp-default/style.css' type='text/css' media='screen' /&gt;</code></li>
</ol>
<p>A note: This method appears to be incompatible with the Google Analytics WP plugin (which appends Google&#8217;s JS to the footer of every WP page, and thus into bpnavslug, and ends up gumming up the works). You could probably get around this with some creative if-statements in the GA plugin itself.</p>
<p>Good luck. Because of the diversity of people&#8217;s setups, I can&#8217;t guarantee that this method will work for everyone, nor can I provide support to everyone who tries it. But I do encourage you to post whether you&#8217;ve been successful in the comments, and to help each other figure things out.</p>
<p>Related posts:<ol>
<li><a href='http://teleogistic.net/2009/09/new-buddypress-bbpress-plugin-group-forum-subscription/' rel='bookmark' title='New BuddyPress / bbPress plugin: Group Forum Subscription'>New BuddyPress / bbPress plugin: Group Forum Subscription</a></li>
<li><a href='http://teleogistic.net/2011/05/invite-anyone-0-9-admin-management-and-stats/' rel='bookmark' title='Invite Anyone 0.9: Admin management and stats'>Invite Anyone 0.9: Admin management and stats</a></li>
<li><a href='http://teleogistic.net/2009/10/forum-attachments-for-buddypress/' rel='bookmark' title='Forum Attachments for BuddyPress'>Forum Attachments for BuddyPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://teleogistic.net/2009/10/displaying-the-buddypress-admin-bar-in-other-applications/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

