<?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: renaming index.php messes up lay-out?</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Topic: renaming index.php messes up lay-out?</description>
<language>en</language>
<pubDate>Tue, 02 Dec 2008 12:35:14 +0000</pubDate>

<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2279</link>
<pubDate>Thu, 14 Dec 2006 18:33:37 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2279@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Don't ever change a core file ever.&#60;/p&#62;
&#60;p&#62;Put it in a new file in your my-plugins directory.
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2278</link>
<pubDate>Thu, 14 Dec 2006 17:47:36 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2278@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;ardentfrost, I do this in template-functions.php I presume?
&#60;/p&#62;</description>
</item>
<item>
<title>ear1grey on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2276</link>
<pubDate>Thu, 14 Dec 2006 17:34:09 +0000</pubDate>
<dc:creator>ear1grey</dc:creator>
<guid isPermaLink="false">2276@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;&#60;code&#62;&#38;lt;li&#38;lt;?php&#60;br /&#62;
if ( is_front())&#60;br /&#62;
{&#60;br /&#62;
echo &#38;quot; id=\&#38;quot;current\&#38;quot;&#38;gt;&#38;quot;;&#60;br /&#62;
?&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;BTW the list item would be better described as being something like &#60;code&#62;class=&#38;quot;current&#38;quot;&#60;/code&#62; then add an appropriate &#60;code&#62;.current {}&#60;/code&#62; to your css.&#60;/p&#62;
&#60;p&#62;See also: &#60;a href=&#34;http://bbpress.org/forums/topic/250&#34; rel=&#34;nofollow&#34;&#62;http://bbpress.org/forums/topic/250&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2275</link>
<pubDate>Thu, 14 Dec 2006 16:32:48 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2275@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;It sounds like what you need is to overload the bb_get_location function.  This is easy to do in bbpress.  You need to make a set of functions like this:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;is_home() {&#60;br /&#62;
if( &#38;#39;home-page&#38;#39; == get_bb_location() )&#60;br /&#62;
return true;&#60;br /&#62;
else&#60;br /&#62;
return false;&#60;br /&#62;
}&#60;br /&#62;
get_home_location() {&#60;br /&#62;
if ( bb_find_filename($_SERVER[&#38;#39;PHP_SELF&#38;#39;]) == &#38;#39;home.php&#38;#39; )&#60;br /&#62;
return &#38;#39;home-page&#38;#39;;&#60;br /&#62;
}&#60;br /&#62;
apply_filter( &#38;#39;get_bb_location&#38;#39;, &#38;#39;get_home_location&#38;#39; );&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;That's untested, but I think that should work.  Basically what you want to do is add in your locational test when bb_location is called.  Then you can just call is_home() and it'll do what you want.  Of course, if you don't want any other part of the forum to care if it's on the home or not, you can take out all that stuff at the end that integrates it with get_bb_location, and just do this:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;is_home() {&#60;br /&#62;
if( &#38;#39;home-page&#38;#39; == get_home_location() )&#60;br /&#62;
return true;&#60;br /&#62;
else&#60;br /&#62;
return false;&#60;br /&#62;
}&#60;br /&#62;
get_home_location() {&#60;br /&#62;
if ( bb_find_filename($_SERVER[&#38;#39;PHP_SELF&#38;#39;]) == &#38;#39;home.php&#38;#39; )&#60;br /&#62;
return &#38;#39;home-page&#38;#39;;&#60;br /&#62;
}&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Whichever you want to do.  The second is easier, the first is more versatile.
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2273</link>
<pubDate>Thu, 14 Dec 2006 12:26:09 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2273@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Quote:&#60;br /&#62;
What does it matter that what bbpress sees at &#34;front-page&#34; isn't the actual front page of your site? It's just a moniker used throughout the program, it doesn't have to mean anything to you.&#60;/p&#62;
&#60;p&#62;Well wrong, I am working on a menu for the forum and it defeniatily is important that the call back is accurate.&#60;/p&#62;
&#60;p&#62;Some excample code menu:&#60;br /&#62;
&#60;code&#62;&#38;lt;li&#38;lt;?php &#60;br /&#62;
if ( is_front()) &#60;br /&#62;
{ &#60;br /&#62;
echo &#38;quot; id=\&#38;quot;current\&#38;quot;&#38;gt;&#38;quot;;&#60;br /&#62;
?&#38;gt;&#60;br /&#62;
&#38;lt;a href=&#38;quot;&#38;lt;?php option(&#38;#39;uri&#38;#39;); ?&#38;gt;&#38;quot;&#38;gt;Forums&#38;lt;/a&#38;gt;&#60;br /&#62;
&#38;lt;?php &#60;br /&#62;
} &#60;br /&#62;
?&#38;gt;&#38;lt;/li&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Here you can see is_front and we also have is_forum so I need to add is_home aswell in order to make the menu work :)&#60;/p&#62;
&#60;p&#62;Well I understand your explaination of how things work. I started home.php from index.php and edited/deleted things i didn't need to make my own startpage. I also wanted to keep the normal index file, thats why I renamed them. Unfortunally the addons i did in the template functions don't work unless i keep it like this:&#60;br /&#62;
&#60;code&#62;case &#38;#39;home.php&#38;#39; :&#60;br /&#62;
return &#38;#39;front-page&#38;#39;;&#60;br /&#62;
break;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;And then the id won't work too, cause &#60;code&#62;is_front()&#60;/code&#62; is called  (and not is_home) so it gets the front-page id.&#60;/p&#62;
&#60;p&#62;Well going to release my project very soon (as soon as I found a solution for my DIV problem), perhaps you can help me better then.&#60;/p&#62;
&#60;p&#62;Really appreciate the time helping me out!!&#60;/p&#62;
&#60;p&#62;Null
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2272</link>
<pubDate>Thu, 14 Dec 2006 12:04:43 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2272@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;What does it matter that what bbpress sees at &#34;front-page&#34; isn't the actual front page of your site?  It's just a moniker used throughout the program, it doesn't have to mean anything to you.&#60;/p&#62;
&#60;p&#62;Not a lot needs to change when adding a new page.  Make a file in your forums root directory call it whatever, like null.php.  set it up like this:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;?php&#60;br /&#62;
require_once(&#38;#39;./bb-load.php&#38;#39;);&#60;br /&#62;
***[if you need any code, put it here]***&#60;br /&#62;
if ( file_exists(BBPATH . &#38;#39;my-templates/nullsfile.php&#38;#39;) ) {&#60;br /&#62;
	require( BBPATH . &#38;#39;my-templates/nullsfile.php&#38;#39; );&#60;br /&#62;
} else {&#60;br /&#62;
        echo &#38;quot;File does not exist in my-templates folder&#38;quot;;&#60;br /&#62;
}&#60;br /&#62;
?&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Then make a file in your my-templates folder called nullsfile.php and make it look like an html file, but be sure to set it up like this:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;?php bb_get_header(); ?&#38;gt;&#60;br /&#62;
***[put all your html code here with calls to php functions]***&#60;br /&#62;
&#38;lt;?php bb_get_footer(); ?&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;At that point, you have a page integrated into bbpress.  What you do in those two files is up to you.  To access the file, you just go to forumsroot/null.php (if you have pretty links turned on, you don't need the .php part).  If you need called functions, standard is to put them into a file in the my-plugins folder.&#60;/p&#62;
&#60;p&#62;In some of the plugins I've made, my main file does stuff like detects if something is set in the address line by checking the $_GET[] variable, or it pulls information needed by the required my-templates file by running a database query...&#60;/p&#62;
&#60;p&#62;That all make sense?
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2270</link>
<pubDate>Thu, 14 Dec 2006 09:39:51 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2270@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;...... but then it would be identified as front-page as well. I am just curious of how this all works.. just wanna learn/understand.... Personally I find it strange so much needs to be changed to add a new page to the forum (even when renaming 1)
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2266</link>
<pubDate>Thu, 14 Dec 2006 03:54:48 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2266@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;what do you think calls &#34;is_home()&#34;?&#60;/p&#62;
&#60;p&#62;Look, do what I told you originally. Change everything back to how it was, and JUST change home.php in the function bb_get_location() in template-functions.php.
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2264</link>
<pubDate>Wed, 13 Dec 2006 23:20:12 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2264@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I also added is_home () same result...
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2262</link>
<pubDate>Wed, 13 Dec 2006 22:11:29 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2262@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;because of the function &#60;code&#62;is_front()&#60;/code&#62;.  It returns true if &#60;code&#62;bb_get_location&#60;/code&#62; returns &#60;code&#62;front-page.php&#60;/code&#62;.
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2258</link>
<pubDate>Wed, 13 Dec 2006 20:00:37 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2258@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Why doesnt this work? Re-checked the functionsfile 3 times now, but no where else in the file it asks for this.&#60;/p&#62;
&#60;p&#62;I am experimenting with this new home.php page and adding these new functions to the file and renaming front-page.php aint solving the problem. &#60;/p&#62;
&#60;p&#62;What files more need to be changed in order to make home.php and home-page.php work just like index.php and front-page.php (which I renamed)?&#60;/p&#62;
&#60;p&#62;Thx&#60;/p&#62;
&#60;p&#62;edit:&#60;/p&#62;
&#60;p&#62;Changing:&#60;br /&#62;
&#60;code&#62;case &#38;#39;home.php&#38;#39; :&#60;br /&#62;
return &#38;#39;home-page&#38;#39;;&#60;br /&#62;
break;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;p&#62;&#60;code&#62;case &#38;#39;home.php&#38;#39; :&#60;br /&#62;
return &#38;#39;front-page&#38;#39;;&#60;br /&#62;
break;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Fixes the lay-out mess up, but still... WHY? Why doesn't the renamed file home-page.php (front-page.php) work when the return is changed too?
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2256</link>
<pubDate>Wed, 13 Dec 2006 19:47:28 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2256@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;why would you have it return &#60;code&#62;home-page&#60;/code&#62; when everything is expecting &#60;code&#62;front-page&#60;/code&#62;?
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2254</link>
<pubDate>Wed, 13 Dec 2006 18:06:14 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2254@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;well I found the function and added this one:&#60;br /&#62;
&#60;code&#62;	case &#38;#39;home.php&#38;#39; :&#60;br /&#62;
		return &#38;#39;home-page&#38;#39;;&#60;br /&#62;
		break;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Where home-page is the front-page renamed aswell but this aint working either, it's still messed up
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2253</link>
<pubDate>Wed, 13 Dec 2006 15:38:01 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">2253@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;because of the function &#60;code&#62;bb_get_location()&#60;/code&#62; in &#60;code&#62;template-functions.php&#60;/code&#62; it returns &#60;code&#62;front-page&#60;/code&#62; if &#60;code&#62;$_SERVER[&#38;#39;PHP_SELF&#38;#39;]&#60;/code&#62; is &#60;code&#62;index.php&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Null on "renaming index.php messes up lay-out?"</title>
<link>http://bbpress.org/forums/topic/renaming-indexphp-messes-up-lay-out#post-2241</link>
<pubDate>Tue, 12 Dec 2006 21:59:21 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">2241@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Was just playing around and renamed index.php to home.php. The funny thing is, this simple rename effects the lay-out. Why is that? I mean no coding is touched, the file is just renamed!&#60;/p&#62;
&#60;p&#62;Also &#60;code&#62;&#38;lt;?php new_topic(); ?&#38;gt;&#60;/code&#62; doesn't display anymore and the underlining of the &#38;lt;h2&#38;gt; tags is gone as well.&#60;/p&#62;
&#60;p&#62;I am kinda noob, so why does this happen? no css or template is touched, it should work even if index.php is renamed..... not?&#60;/p&#62;
&#60;p&#62;What do I need to change so the lay-out and &#60;code&#62;&#38;lt;?php new_topic(); ?&#38;gt;&#60;/code&#62; will NOT be effected when renaming index.php to home.php?&#60;/p&#62;
&#60;p&#62;Thx
&#60;/p&#62;</description>
</item>

</channel>
</rss>
