Recent Topics

1 Apr 16, 2007 00:52    

My b2evolution Version: Not Entered

Can anybody help? I don't know the answers.

Pajamas media asked me these questions:

You are the first blogger I've had to deal with who is using b2evolution.
I need to learn more about it to get you the appropriate instructions.

Here are some questions:
1) Does b2evolution allow you to use different templates for you homepage
(pages without comments) and your individual posting pages (the "permalink"
pages with comments)?
2) If answer to #1 is No, does b2evolution have so-called Conditional Tags
that we can use to differentiate between the homepage, the permalink pages
and other page types (such as date archives and category archives)?

We use two different versions of code: one version for pages without
comments and one version for pages with comments.

If b2evolution cannot accomodate one of the 2 scenarios listed above (either
separate templates or conditional tags), then we will have to take a
different approach to the PJM coding on your blog.

2 Apr 16, 2007 03:01

HEY YABBA! Where is the thread where you hooked someone up with this type of thing?

1. No - it is the same "template" for each, though I believe it could be made to change. Then again I am thinking "skin" and the question is asking about "template" from their understanding of that term. The assumed definitions on each end are probably not aligned with the other end, so we have to make assumptions and figure it out.

2. Conditional Tags will fall under the same definition problem. php, by definition, is all about conditional this and that stuff. The same exact set of files can give you a page with many posts, or a page with one post that contains comments and the comment form. Somewhere Yabba came up with a way to have a permalink page NOT show the comments unless someone clicked on "show me the comments". Or something like that. Again this can easily be seen as a conditional tag, so we're back to definition dysfunction.

They use 2 different versions of code at the same time? Like "version 1 and version 2 of the same file", or like "this file in version 2 and that file in version 2"? A valid question I think. b2evolution uses multiple files to put together each page it generates. On the multipost page you don't use your _feedback.php file, but on a permalink page you do. Depending on how you structure your sidebar other files will come into play. Obviously they must all be from the same version (of the software) to work together.

Anyway I think it's best to ask them for some sample links of exactly what they like to be able to see. A multipage post, then where to click to see whatever is next, and so on until the method they like is known by example. The lack of clear definitions makes this hard to work with.

Oh and I *think* it's possible to tweak some of your skin files to make the answer to #1 be "yes", but that depends on Yabba coming along. I think. That's when I get in trouble is when I think.

3 Apr 16, 2007 03:45

Thanks. This is about the fifth time you've helped me. I greatly appreciate it. Anyways, I emailed the guy to see if he can figure it out.

4 Apr 16, 2007 05:18

OK here's what the guy sent back. Sorry if you wrote the docs.

The purpose of this is that we want place one version of the code on pages
which don't have visitor comments and another on pages which can have
visitor comments. We need to be able to exclude specific ads if the
advertiser does not want to be on a page which allows for visitor comments.
The two versions aren't displayed together, it's one or the other depending
on the page type.

Examples:
+++++++++
Example #1: Templates
In MovableType, the "Main Page Template" controls the homepage code and the
"Individual Archive Template" controls the permalink pages.

+++++++++
Example #2: Conditional Tags
In WordPress (and Blogger.com), there are conditional tags such as
"is_home()" for the homepage and "is_single()" for a permalink. See:
http://codex.wordpress.org/Conditional_Tags
Conditional tags are the best solution.
With conditional tags I can write some php like this:

<?php
// PJM Traffic Meter Code
if( is_home() or is_archive() ){
include_once("./pajamas.regular.inc.php");
} else {
include_once("./pajamas.comments.inc.php");
} // end if( is_home() or is_archive() )
?>

which tells wordpress to use the regular file if it is homepage or archive
page and the comments file if it is any other type of page.

+++++++++
B2evo documentation
<<snip to prevent offence>>I looked through the B2evo documentation and I see that this "Single Page
Title" stuff seems similar to conditional tags:
http://manual.b2evolution.net/Main.php_functions#Single_Page_Titles
but not exactly.

If we can't figure out how to place different version of the code on pages
with visitor comments, then we will have to just code all pages as if they
were comments pages.

5 Apr 16, 2007 06:03

No worries. I wrote some of the stuff in the manual (not much - a few pages) but it wouldn't be like upsetting or anything cuz this guy's a moron. Morons put fancy titles on simple things to sound smart. For example refering to a "function" as a "conditional tag". derrrr.... It seems to me that what this person seeks to do with functions (conditional tags!) is handled in b2evolution with parameters. So instead of saying something like "if this_function()" where this_function() will return either a true or a false, b2evolution will ask "if $disp == 'something'" where 'something' is about the page being generated.

Real useful actual example: The value of $disp is 'single' when someone is visiting a permalink page. Other factors come into play, but if $disp equals 'single' then you're only going to see the one specific post and you're probably going to see comments and the comment form. So let's say we have an advertiser who doesn't want their bit showing up on a page with comments. We would do something like this:

<?php if( $disp != 'single' ) {
echo 'advertisement'; // or whatever the code for the ad would be
} else {
echo 'different advertisement'; // or maybe nothing would be here!
} ?>

BTW I'm only guessing that those "conditional tags" return a true or false based on the example given. I don't know WP from a hole in the ground. Someone who knows WP will think and speak in WPs format. Someone who knows b2evo will do the same. Both apps probably reach the same relative place, but do it differently. Your contact is asking from a WP perspective, which is cool, but it's not going to translate to anything. So actual real world links showing what they need is gonna help a lot.

For example show them http://b2evolution.net/news.php and point out how it is a main page and does not display comments. Ever. It will not have the same content when Francois posts something else, but that's what all blogs do so that should be no problem. That blog is set up to show 10 posts per page, and each post has a permalink and displays how many comments there are. Next step would be to visit a permalink page like http://b2evolution.net/news/2007/03/27/new_design_new_logo for example. Obviously comments are present, so you would want to use the little snippet of code above to not show ads from an advertiser who chooses to not be on pages with comments. It also shows the comment form, and by the way that page will always have that URL because it's a permalink page. WPs permalink pages will, I've no doubt, be equally permanent. That's what the name is all about right?

As near as I can tell by poking around some links in their blogroll bit it looks to me like that is what they need. Therefore to go way back to question one: YES, but not with the method or code used by WP.

The thing that Yabba came up with that was way cool was a way to have a permalink page that initially didn't show comments. So like the visitor would have to the permalink page then click again to see (and add to) the comments. I forget why that was. Something about google. Google is evil by the way, but I digress. Home Depot was closed 4 minutes before I got there, so now what am I to do?

6 Apr 16, 2007 06:04

Hey show me a link to your web. Much better to work with yours to show them what's easily done eh?

8 Apr 16, 2007 07:13

Okay so it's a fairly straightforward installation. Ask the PJM person what type of pages they need to see that they don't see (for example permalinks without comments - not a standard part of any blog app AFAIK), and tell them you can easily distinguish in your code if a page will be displaying comments.

That's really the meat of the matter right? How can they figure out what code to write to make your blog match the structure of what they like. No problem, except they have got to get over their obsession with silly make believe terms that only have value in the world of WP.

It's all doable. The advertiser thing is easy. Finding out if a page is an archive page or not is also easy but I don't know how off the top of my head. I'm still upset about Home Depot. GRRRR!

Hey check it out. You've done some tweaking on your blog so add this to the bottom of your sidebar - like right above the bit that makes the b2evolution badge show up:

<?php if( is_logged_in() ) {
echo '<p>$disp is: '.$disp.'</p>';
} ?>

I'm guessing you're comfortable with some code stuff but I'll say it anyway: you may or may not need the <?php and ?> bits, depending on exactly where you stick that code. Whatever: only logged in people will see what $disp equals for each and every page load. After you see that you get info there set up an account for your contact at PJM to log in with so they too can see that $disp has a value that they can make conditional statements about. Groovy eh?

10 Apr 19, 2007 18:47

nelsonguirado have you made any progress on this issue?

11 Apr 22, 2007 06:03

The guys at Pajamas Media seem to be satisfied. I told them what you said and haven't heard anything else.

Hey, thanks a bunch.

www.nelsonguirado.com

12 Apr 22, 2007 06:38

Yeah cool. I saw where your blog had the "farting pajama" logo on it, so I figured it was all worked out. Thanks for updating though. It's nice, for me, to know the effort paid off. Now if another b2evolution user wants to join that group they're not going to have to break new ground. Instead you'll be the expert. Cool!


Form is loading...