Recent Topics

1 Jan 08, 2008 19:35    

I'm using b2evo 2.30 on IIS6, PHP 5.20.

I want to change some functionality only for the blog homepage. Is there any B2Evo method to detect if the blog is currently displaying the homepage or something else (a specific post, a category, etc)?

Also, is there any way on IIS to make the PHP distinguish between "mydomain.com/" and "mydomain.com/index.php"? All URL $_SERVER variables return "/index.php" in both cases... and I can't install any mod_rewrite for IIS.

2 Jan 11, 2008 16:55

Nothing? Nobody? Where are all the gurus? Heeeelp :-)

3 Jan 11, 2008 17:13

gaspy wrote:

Nothing? Nobody? Where are all the gurus? Heeeelp :-)

The're not at the Helpdesk Centre. Taking a day off I guess.

Pick a skin and crack open it's index.main.php (some skins are displayed through posts.main.php and add this code at the yop of the main area. e.g. in asevo under <div class="evo_main_area">

<h4>$disp = <?php echo ( $disp ); ?></h4>
<br /><br />


Now watch $disp in action.

You can regulate your blog through this variable. It takes ¥åßßå to do it the OO style.

Good luck

4 Jan 13, 2008 13:55

Thanks for replying.

Apparently $disp can contain either "posts" (when a list of posts is displayed) or "single" (when one post is displayed). I also saw mentioned a possible "page" value but I don't know what it means or when it's set.

The problem is that I still can't differentiate between the posts displayed in the homepage and the list displayed in a category (in both cases $disp='posts').

I have some ideas I could use to 'hack' the thing for my needs, but I'd rather use the blog framework to do so.

5 Jan 13, 2008 17:33

echo out "cat" and you'll see that you can use some fancy-pants logic to figure stuff out. At least I think 'cat' is what you'll want to play with. Check your URL on a category-specific multi-post page and you'll probably see the param there.

So like "if disp is posts and cat is not nothing then { this is a list of posts in a category }". Minor hacking, all doable in your skin.

A "page" is a special type of post that doesn't stay with the normal flow of posts in the main body of the blog. Instead it gets to be linked in the sidebar (or header or footer or wherever) via a widget. For example you might want an "about me" page or "before you comment" page or whatever. So you post it as a "page" and poof it's a page instead of a post.

6 Jan 13, 2008 17:42

If memory serves me right you need something like :

if( $disp == 'posts' && empty( $cat ) && empty( $s ) && ( empty( $paged ) || $paged == 1 ) )

¥

7 Jan 14, 2008 08:59

Hurray!

Thanks everyone so much - Afwas for the initial help with $disp, EdB for clarifications and ¥åßßå for the details.

I didn't know $cat and others were already available, I was thinking about using something like if (empty($_SERVER['QUERY_STRING']))...

Anyway, I took ¥åßßå's code and added testing for empty($tag) -- so that it works with the new tags features.

It works very well now.


Form is loading...