<?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>Luftslottet &#187; kod</title>
	<atom:link href="http://luftslott.jobjorn.se/tagg/kod/feed/" rel="self" type="application/rss+xml" />
	<link>http://luftslott.jobjorn.se</link>
	<description></description>
	<lastBuildDate>Thu, 08 Dec 2011 22:08:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BuddyPress option to limit or remove the possibility to mail out notifications of wire updates</title>
		<link>http://luftslott.jobjorn.se/2009/06/buddypress-option-to-limit-or-remove-the-possibility-to-mail-out-notifications-of-wire-updates/</link>
		<comments>http://luftslott.jobjorn.se/2009/06/buddypress-option-to-limit-or-remove-the-possibility-to-mail-out-notifications-of-wire-updates/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 10:41:31 +0000</pubDate>
		<dc:creator>Plrk</dc:creator>
				<category><![CDATA[Okategoriserad]]></category>
		<category><![CDATA[fri mjukvara]]></category>
		<category><![CDATA[kod]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://luftslott.org/?p=966</guid>
		<description><![CDATA[Det här är inte ett inlägg som hör till Luftslottets vanliga agenda, utan är ett stycke kod som lägger till en inställningsmeny till BuddyPress. Om man inte är intresserad av PHP och/eller BuddyPress/WordPress kan man med fördel bortse från det. Det är också därför det är avklippt i RSS-flödet.


&#60;?php
&#160;
/* * * * * * * [...]]]></description>
			<content:encoded><![CDATA[<p><em>Det här är inte ett inlägg som hör till Luftslottets vanliga agenda, utan är ett stycke kod som lägger till en inställningsmeny till <a href="http://buddypress.org/">BuddyPress</a>. Om man inte är intresserad av PHP och/eller BuddyPress/WordPress kan man med fördel bortse från det. Det är också därför det är avklippt i RSS-flödet.</em></p>
<p><span id="more-966"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* * * * * * * * * * * * * * * * * * * * * * * *
 * Description:
 * BuddyPress option to limit or remove the
 * possibility to mail out notifications of
 * wire updates.
 *
 * Author: Jobjörn Folkesson
 *
 * License:
 * I, the copyright holder of this work, hereby
 * release it into the public domain. This
 * applies worldwide. In case this is not
 * legally possible: I grant anyone the right
 * to use this work for any purpose, without
 * any conditions, unless such conditions are
 * required by law.
 * (Public Domain)
 *
 * Installation instructions:
 * Put code in a &quot;tweaks.php&quot; or similar in your
 * mu-plugins folder. Et voila!
 * * * * * * * * * * * * * * * * * * * * * * * */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> tweaks_add_admin_menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_site_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Add the administration tab under the &quot;Site Admin&quot; tab for site administrators</span>
		add_submenu_page<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wpmu-admin.php'</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Additional settings&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Ytterligare inst&amp;auml;llningar&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp-tweaks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;tweaks_admin_settings&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;tweaks_admin_settings&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks_add_admin_menu'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>get_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	add_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> tweaks_admin_settings<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bp-tweaks-submit'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bp-tweaks'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> check_admin_referer<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bp-tweaks'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Settings form submitted, now save the settings.</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bp-tweaks'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				update_site_option<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Settings were successfully saved.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;updated&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Something went wrong, please try again.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;error&quot;</span><span style="color: #339933;">;</span>			
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$message</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;div id=&quot;message&quot; class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$type</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> fade&quot;&gt;
			&lt;p&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$message</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
		&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;div class=&quot;wrap&quot;&gt;
		&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Additional BuddyPress settings'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;
		&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; method=&quot;post&quot; id=&quot;bp-admin-form&quot;&gt;
			&lt;table class=&quot;form-table&quot;&gt;
				&lt;tbody&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bp_wire_install'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
						&lt;tr&gt;
							&lt;th scope=&quot;row&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Allow e-mail notifying of wire posts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>:&lt;/th&gt;
							&lt;td&gt;
								&lt;input type=&quot;radio&quot; name=&quot;bp-tweaks[wire-email-notifying]&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> checked=&quot;checked&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> id=&quot;bp-tweaks-wire-email-notifying&quot; value=&quot;0&quot; /&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Not at all'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &amp;nbsp;
								&lt;input type=&quot;radio&quot; name=&quot;bp-tweaks[wire-email-notifying]&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> checked=&quot;checked&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> id=&quot;bp-tweaks-wire-email-notifying&quot; value=&quot;1&quot; /&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Admins only'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &amp;nbsp;
								&lt;input type=&quot;radio&quot; name=&quot;bp-tweaks[wire-email-notifying]&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> checked=&quot;checked&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> id=&quot;bp-tweaks-wire-email-notifying&quot; value=&quot;2&quot; /&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Admins and mods only'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &amp;nbsp;
								&lt;input type=&quot;radio&quot; name=&quot;bp-tweaks[wire-email-notifying]&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> checked=&quot;checked&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> id=&quot;bp-tweaks-wire-email-notifying&quot; value=&quot;3&quot; /&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Everyone'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &amp;nbsp;
							&lt;/td&gt;			
						&lt;/tr&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/tbody&gt;
			&lt;/table&gt;
			&lt;p class=&quot;submit&quot;&gt;
				&lt;input type=&quot;submit&quot; name=&quot;bp-tweaks-submit&quot; id=&quot;bp-admin-submit&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Save Tweaks'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaks'</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
			&lt;/p&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_nonce_field<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'bp-tweaks'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/form&gt;
	&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> do_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'additional_bp_settings'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> limit_wire_email_notifying<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$bp</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$setting</span> <span style="color: #339933;">=</span> get_site_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wire-email-notifying'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$setting</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// Not at all</span>
			<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// Admins only</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_item_admin</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">return</span> <span style="color: #000088;">$var</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// Admins and mods only</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_item_admin</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$bp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_item_mod</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">return</span> <span style="color: #000088;">$var</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// Everyone</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$var</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'bp_wire_show_email_notify'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'limit_wire_email_notifying'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://luftslott.jobjorn.se/2009/06/buddypress-option-to-limit-or-remove-the-possibility-to-mail-out-notifications-of-wire-updates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Svensk översättning av bbPress</title>
		<link>http://luftslott.jobjorn.se/2008/11/svensk-oversattning-av-bbpress/</link>
		<comments>http://luftslott.jobjorn.se/2008/11/svensk-oversattning-av-bbpress/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 00:12:55 +0000</pubDate>
		<dc:creator>Plrk</dc:creator>
				<category><![CDATA[Okategoriserad]]></category>
		<category><![CDATA[bbpress]]></category>
		<category><![CDATA[fri mjukvara]]></category>
		<category><![CDATA[kod]]></category>

		<guid isPermaLink="false">http://jobjorn.se/?p=218</guid>
		<description><![CDATA[Jag har byggt en ny språkfil och, eftersom de ovan är utdaterade, skrivit nya instruktioner. De finns i det här inlägget. Gå dit istället.

Gillar man WordPress som bloggplattform gillar man förmodligen bbPress som forumplattform. Precis som WordPress har bbPress stöd för plugins, teman, och språklokalisering &#8211; men eftersom det är ett betydligt mindre projekt, betydligt [...]]]></description>
			<content:encoded><![CDATA[<p>Jag har byggt en ny språkfil och, eftersom de ovan är utdaterade, skrivit nya instruktioner. De finns i <a href="http://luftslott.org/2009/06/ny-svensk-oversattning-av-bbpress/">det här inlägget</a>. Gå dit istället.</p>
<p><s><a href="http://jobjorn.se/wordpress/wp-content/uploads/2008/11/bblogo-swedish.png"><img class="size-medium wp-image-224 alignright" title="bblogo-swedish" src="http://jobjorn.se/wordpress/wp-content/uploads/2008/11/bblogo-swedish.png" alt="" width="131" height="131" /></a></p>
<p>Gillar man WordPress som bloggplattform gillar man förmodligen <a href="http://bbpress.org/">bbPress</a> som forumplattform. Precis som WordPress har bbPress stöd för plugins, teman, och språklokalisering &#8211; men eftersom det är ett betydligt mindre projekt, betydligt mindre dokumentation (och av någon underlig anledning ingen wiki). Men letar man information om hur man trollar så att ens bbPress-installation blir på svenska har man hittat rätt:</p>
<h3>1. Ladda ner språkfilen, sv_SE.mo.</h3>
<p><a href="http://gurka.se/">En gurka bland morötter</a> har vänligt nog <a href="http://gurka.se/2007/03/04/svensk-bbpress-oversattning/">skapat en svensk språkfil</a>. Ladda ner den. Den verkar inte vara helt komplett, men det är den enda jag har hittat. Jag kommer med största sannolikhet att modifiera den senare, denna post kommer att uppdateras då (prenumerera på kommentarer så får ni ett mail då).</p>
<h3>2. Ladda upp språkfilen.</h3>
<p>Språkfilen, sv_SE.mo, skall nu läggas in i din bbPress-installation. Gå in i mappen &#034;bb-includes&#034; (den finns vid roten av din bbPress-installation) och skapa där en ny mapp vid namn &#034;languages&#034;. Lägg språkfilen (sv_SE.mo) där.</p>
<h3>3. Justera bb_config.php.</h3>
<p>I bb_config.php, som finns i roten av din bbPress-installation, finns det en rad som ser ut såhär:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BB_LANG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Ändra det till:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BB_LANG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sv_SE'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Så! Det var allt! Uppdatera ditt bbPress-forum och du skall se att det ser jättestiligt ut.</s></p>
]]></content:encoded>
			<wfw:commentRss>http://luftslott.jobjorn.se/2008/11/svensk-oversattning-av-bbpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

