Recent Topics

1 Nov 29, 2005 19:37    

Hey. I just upgraded to Dawn and there's a few things I was wondering if anyone knew how to do.

One is to list categories within posts. I poked around the "how to" section of the b2evo site and found something that makes the blog write the post author at the end as well as include a link that shows all posts written by that author. What I was wondering is if there is a function call that returns the category of the post so it can read something along the lines of "Posted by [name] under [category]".

The second was if there is a way to control how much of a post is showed. Some sites (like tvsquad.com, even though I know it's not b2evo powered) have it so there's an intro at the beginning and when they want to, it will be followed by a "read more" link that goes through to the full length post. But I also know that these sites can control how much lead text there is since it seems to stop just where they want it to, and some other posts on the same sites will not have that "read more" link at all but put the whole post on the front. Just wondering if b2evo has that kind of functionality.

The last thing I was looking for is if it's possible for b2evo to generate a static page that conforms to whatever skin I'm using. What I want to do is create an "about the writers" static page that I can link to from the sidebar, but I'm not positive I will keep the same skin forever so I wanted it to be able to adapt should I choose to change the skin to sometihng else.

Any help on any of these issues would be greatly appreciated.

Oh yeah, one more thing I remembered I wanted working.

It's been a while since I edited the code when I was using Amsterdam and I remembered I had this one snippet of code that also displayed how many times the permalink was clicked on. You know, one of those "this article has been read x many times" things. I dug through the _main.php file of my skin in my backup files and couldn't figure it out. If anyone knows how to fix this as well, that'd be awesome.

2 Nov 29, 2005 20:04

brian,

none of these things seem to be dawn-specific (as they could apply to amsterdam, paris, etc). NBD ... just thought I'd clarify.

1) AUTHOR/CATEGORY - The category thing should be easy just add

<?php echo "Posted by: ".$Item->Author->preferred_name()."under".$Item->categories()"; ?>

Untested, but both of those variables exist (hint ... you can control WHAT it shown, by adding things in between the (). Have a look at the technical documentation, to get fancy. Ours looks like

<small><?php echo T_('Filed in:') ?></small><span class="mCat"><strong><?php $Item->categories('#','','','hide','hide','hide','hide'); ?></strong></span><br />
      <small><?php $Item->categories('#','hide','hide','<span style="margin:0px -3px;">','</span>','','','&middot;');  ?></small>

to give you an idea. (I'm the only author, so don't use that, but as you can see ... you can grab the MAIN category ... or the sub-Categories.

2) HOW MUCH TO POST - If you use the "!M" tab in the write pane, it will add a <!--more--> text to your blog entry, with will control how much text is displayed before getting a "read more" . You can control where you put it, determining if you want a lot of text or a little, before you see that. Again, the behavior of the "read more" is controlled throught the _main.php file, using the $Item->content() function ours looks like

$Item->content('#','#','Read full story...','- -');

. You can check the behavior on [url=http://randsco.com]our site[/url] to compare the code -vs- behavior (and again, look at the technical doc for the specifics ... or search this forum ... as the question has been raised a LOT).

3) AUTHORS PROFILE - I'd recommend searching for an "about me" page in the forums, as I think the best method would be to make a PHP page for each author (doesn't have to be in your skin, as the method shows up IN YOUR SKIN ... like a blog article) ... but make a new display type ... and then switch the display if called by whatever author links you wish to use. (If I had more time, I'd find it for you, but I think EdB wrote the entry, which should help your search. We used the method for our "contact us" PHP form, which agian you can check out on [url=http://randsco.com]our page[/url].

4) PERMALINK CLICK COUNT - Sorry ... have no idea (though I know the new release - Phoenix, will have a "this page viewed X time" feature built in.

Hope this helps.

-stk

3 Nov 29, 2005 20:09

stk, I'll take a look at it in a few hours. I have to run off to class in a few minutes, but I'll give it a shot and let you know if I've figured it out.

And for anyone else who's reading, I found where I got the source code for the show post hits thing:

http://forums.b2evolution.net/viewtopic.php?t=2350

Got that taken care of, and hopefully another item on my wishlist as well.

4 Nov 29, 2005 20:43

A "page viewed" counter exists in phoenix, though it may not be in every skin available for phoenix. Check the code for the custom skin because I know it's in there. Can't say for sure what _exactly_ it counts either. Permalink clicks or full page views (such as from search engines) or something else???

5 Nov 30, 2005 00:51

So I incorporated the snippit of code that you gave me for the category. Here is the code for the posted by/category/hits that I have in my _main file:

<font size = 1>Posted by: <a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->Author->ID) ?>" title="<?php echo T_('Browse all posts by this author') ?>"><?php $Item->Author->prefered_name();?></a> <br>Category: <?php echo $Item->categories() ?><br><?php
post_stars( $Item->get("ID"), false );?></font>

It seems to work, but the one thing that I can't get rid of, nor do I know why it happens, is that the category link is bolded. The posted by link is not though. I want to get rid of the bold but I have no idea what's causing it. Any thoughts?

Also, I tried the !M thing and it does work. It also shortens it on my RSS feed which is exactly what I was looking for. Thanks for that!

6 Nov 30, 2005 01:03

Okay, so I realized that it bolds the main category. I realized that when I saw a post listed under multiple categories and it only bolded the primary category. That's fine. No need for help on that one.

7 Nov 30, 2005 01:04

Also, just a quick question, does anyone know what !NT and !NP does?

Another question I have is that I've now learned how to change the text around for the "read more" thing, and I got rid of that arrow it initially puts in there.

But which file do I poke around for to change it in an RSS feed? My feeds still have the -> Read More! and I was hoping someone could tell me where too look instead of me poking around the files and screwing something up.

Also, eJb, I wanted to stay away from Phoenix for the time being because as a rule of thumb, I tend to stray away from putting software that's alpha/beta on a production server. I'm just esp. careful about that.

8 Nov 30, 2005 06:35

Can't help with the "read more" getting into the feeds, but !NT is like !M only with No Teaser. That means the stuff above the !NT doesn't show up on the permalink page. !NP is for Next Page. You can make a post be multiple pages by adding an !NP every time you want a page break.

I'm going to guess you did like I did: deleted all your default installation posts without reading them. For the benefit of those who come along later I'll point out that lots of stuff is explained by example in those posts, like !N and !NT and !NP ;)


Form is loading...