<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress support forums Topic: Check if a user is logged in?</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Topic: Check if a user is logged in?</description>
<language>en</language>
<pubDate>Wed, 03 Dec 2008 03:16:49 +0000</pubDate>

<item>
<title>Shagalaga on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-19956</link>
<pubDate>Wed, 15 Oct 2008 22:14:10 +0000</pubDate>
<dc:creator>Shagalaga</dc:creator>
<guid isPermaLink="false">19956@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;thx! it works!
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-19953</link>
<pubDate>Wed, 15 Oct 2008 19:33:10 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">19953@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;The code above handles both cases, you're logged in or you're logged out.  There is no in between.  If one is true, the other is false. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
	if ( bb_is_user_logged_in() ) {
		echo &#38;quot;No ads for you!\n&#38;quot;;
	}
	else {
		echo &#38;quot;Here is an ad, buy now!\n&#38;quot;;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#38;nbsp;&#60;/p&#62;
&#60;p&#62;You could also just check to see if they're not logged in like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
	if ( !bb_is_user_logged_in() ) {
		echo &#38;quot;Here is an ad, buy now!\n&#38;quot;;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#38;nbsp;&#60;/p&#62;
&#60;p&#62;The exclamation in front of the function says &#34;if this is NOT true, then the if statement is true; continue.)
&#60;/p&#62;</description>
</item>
<item>
<title>Shagalaga on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-19951</link>
<pubDate>Wed, 15 Oct 2008 18:25:06 +0000</pubDate>
<dc:creator>Shagalaga</dc:creator>
<guid isPermaLink="false">19951@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;And How to check if a user is logged out?&#60;/p&#62;
&#60;p&#62;eg i want to turn off Ads, if somebody is logged in and show it, when they are not logged in
&#60;/p&#62;</description>
</item>
<item>
<title>parthatel on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-17317</link>
<pubDate>Tue, 15 Jul 2008 20:22:27 +0000</pubDate>
<dc:creator>parthatel</dc:creator>
<guid isPermaLink="false">17317@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;chrishajer, the code you gave me worked. (I barely saw the &#34;Y&#34; in the &#34;You are logged in&#34; hiding behind my main content). So I guess that the code I tried before worked, only that it was hidden behind my main content so I didn't see it.&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-17314</link>
<pubDate>Tue, 15 Jul 2008 20:01:25 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">17314@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;&#60;strong&#62;parthatel&#60;/strong&#62; can you post your code here?&#60;/p&#62;
&#60;p&#62;What function are you using to check if the user is logged in?  Does it error out or does it just not display any content (if it does not error, then the function is probably a valid function.)&#60;/p&#62;
&#60;p&#62;And showing one content for logged in members and other content for other members is pretty basic PHP:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
	if (bb_is_user_logged_in() ) {
		echo &#38;quot;You are logged in.\n&#38;quot;;
	}
	else {
		echo &#38;quot;You are not logged in.\n&#38;quot;;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#38;nbsp;&#60;br /&#62;
I'm 99% certain that is the proper function name, and the code will work.
&#60;/p&#62;</description>
</item>
<item>
<title>parthatel on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-17309</link>
<pubDate>Tue, 15 Jul 2008 19:21:16 +0000</pubDate>
<dc:creator>parthatel</dc:creator>
<guid isPermaLink="false">17309@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;That doesn't work when I add that to my Wordpress (it has integrated functions). Nothing appears when I added the code. Also, what is the code to display content if user is logged in, else (if not logged in) display some other content.
&#60;/p&#62;</description>
</item>
<item>
<title>Trent on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-5187</link>
<pubDate>Mon, 05 Mar 2007 23:13:11 +0000</pubDate>
<dc:creator>Trent</dc:creator>
<guid isPermaLink="false">5187@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I am personally tired of having information up to Bozo's, so I like to use:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php if (bb_current_user_can(&#38;#39;write_posts&#38;#39;)) : ?&#38;gt;
		DO SOMETHING
	&#38;lt;?php endif; ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That way, the users who are members see the content and spammers cannot!   (At least I think not....not going to mark myself as BOZO to find out)&#60;/p&#62;
&#60;p&#62;Trent
&#60;/p&#62;</description>
</item>
<item>
<title>Mirce on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-5178</link>
<pubDate>Mon, 05 Mar 2007 22:46:24 +0000</pubDate>
<dc:creator>Mirce</dc:creator>
<guid isPermaLink="false">5178@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Yes, macwise gave a better solution. I was thinking that FofR wants to show something when a specific user is logged.&#60;/p&#62;
&#60;p&#62;I am new to and I think that your solution is better.
&#60;/p&#62;</description>
</item>
<item>
<title>macwise on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-5176</link>
<pubDate>Mon, 05 Mar 2007 22:27:18 +0000</pubDate>
<dc:creator>macwise</dc:creator>
<guid isPermaLink="false">5176@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;In regards to Mirce's solution, I would think a more global (and simpler) solution would be this if statement:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php if ( bb_is_user_logged_in() ) { ?&#38;gt;;
--PUT WHATEVER YOU WANT THEM TO SEE HERE--
&#38;lt;?php } ? &#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;
This way you don't need to find out WHO the user is (user_id), but simply whether or not they're logged in. &#60;/p&#62;
&#60;p&#62;I'm pretty new to this, though, so maybe Mirce knows something I don't?
&#60;/p&#62;</description>
</item>
<item>
<title>macwise on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-5175</link>
<pubDate>Mon, 05 Mar 2007 22:21:09 +0000</pubDate>
<dc:creator>macwise</dc:creator>
<guid isPermaLink="false">5175@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;are you running integration with wordpress?
&#60;/p&#62;</description>
</item>
<item>
<title>Mirce on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-5170</link>
<pubDate>Mon, 05 Mar 2007 20:39:56 +0000</pubDate>
<dc:creator>Mirce</dc:creator>
<guid isPermaLink="false">5170@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;It can do done with IF and User ID.&#60;/p&#62;
&#60;p&#62;I do not know the file that deals with user login but something like this should work:&#60;/p&#62;
&#60;p&#62;If  $user_id = 4;&#60;br /&#62;
echo &#34;what ever you want to show to user #4&#34;
&#60;/p&#62;</description>
</item>
<item>
<title>FofR on "Check if a user is logged in?"</title>
<link>http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-5169</link>
<pubDate>Mon, 05 Mar 2007 20:19:36 +0000</pubDate>
<dc:creator>FofR</dc:creator>
<guid isPermaLink="false">5169@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I would like to display some content only when a user is logged into the forums, how can I do this in the template?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
