Recent Topics

1 Jan 04, 2008 14:05    

My b2evolution Version: Not Entered

Hi,
first of all, thanks for great blog script :)

I have two questions about main blog page layout:
- could you, please, tell me where to find piece of code that formats size and style of font in post publication date, post title and author name?
- how to link author's name with special page on my website? also I would like to remove link to email the author (this small envelope on the right upper corner of author's name).
- I would like to have posts displayed on the main blog page just as a list of post titles, with dates and maybe one or two first lines of post body, and only clicking on post title would open the page with whole post message. Is there any plugin to do so?
Now, I have the whole messages displayed one under another.

I know enough to follow simple guide from this site, and I created my own layout, but I do not know enough about php to find answers for that questions simply browsing the code.

Thanks for any help!

2 Jan 04, 2008 14:34

Welcome to the forum.

I have two questions about main blog page layout:

We need to know what skin are you using. Tell the name and I'll help you :)

- I would like to have posts displayed on the main blog page just as a list of post titles

You can do it with <!--more--> (!M button in extended view mode when you composing the post)

4 Jan 04, 2008 16:21

Open /skins/ewol/_main.php and add some classes, you can then define it in style.css

Date:

<div class="PostDate"><?php $MainList->date_if_changed(); ?></div> 


Title:

<div class="PostName"><?php $Item->title(); ?></div> 


Author:

$Item->author( '<strong>', '</strong>' );


And to remove message form comment this string

$Item->msgform_link( $Blog->get('msgformurl') );

Try this ;)

5 Jan 04, 2008 16:57

ok, I did the simplest part - deleted envelope, and also "word count". :)
Yet, I am not sure what to do with the rest. Could you, please, define "add classes"? :) I mean, where exactly should I add it? in which
I tried some wild guesses, but everything it ruins the script (I gathered a nice collection of various error messages).
I know how to define classes' properties in .css, I just do not know php well enough to add class into right place of the document.

6 Jan 04, 2008 17:12

Did you put class="PostDate" and class="PostName" in _main.php?
You can be sure it won't break layout if these classes ain't defined yet in .css files

Then just put something like this in style.css

.PostName {
color: #78a;
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-align:center;
}

.PostDate {
color: #78a;
font-size: 14px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}

7 Jan 04, 2008 20:41

thank you :D
It's almost working.
I changed everything what I wanted, and almost everything looks good, except the date: only the first post date changed! why can it be?
Here is the fragment of code that I changed:


<div class="PostDate">
<?php
        // ------------------------------------ START OF POSTS ----------------------------------------
        if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

        if( isset($MainList) ) while( $Item = $MainList->get_item() )
        {
                $MainList->date_if_changed();
        ?> </div> 

why only date of one most recent post is changed, and rest is still unformatted? :roll:

8 Jan 04, 2008 20:52

<?php
        // ------------------------------------ START OF POSTS ----------------------------------------
        if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

        if( isset($MainList) ) while( $Item = $MainList->get_item() )
        {
?>

<div class="PostDate"><?php $MainList->date_if_changed(); ?></div>

9 Jan 04, 2008 20:56

That's not the best way to do that. You really want your div ONLY around the bit that makes "date_if_changed". Like this:

<?php
        // ------------------------------------ START OF POSTS ----------------------------------------
        if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

        if( isset($MainList) ) while( $Item = $MainList->get_item() )
        { ?>
                <div class="PostDate"><?php $MainList->date_if_changed(); ?></div>

As to why, well the answer is that you are styling "date_if_changed". That means if you have 3 posts on one day then another post on a previous day you will see "date_if_changed" only twice.

DATE_IF_CHANGED
post on today
post on today
post on today
DATE_IF_CHANGED
post on yesterday

Make sense?

So now you want to style the actual post date. For example where I see a permalink icon then "02:00:13 pm, by admin, No views" you want something different for the time of day you posted. Am I correct?

If so look at your _main.php file a bit further down than where you were just working. You will see either

<?php $Item->issue_date() ?>

or

<?php $Item->issue_time() ?>

Those bits can be styled and shaped and structured in all sorts of ways, but let's make sure this is what you want before I try and figure out how ;)

10 Jan 04, 2008 20:58

Hey! sam2kb beat me by 4 minutes with the same "improved" php bit. Great minds think alike yah? :D

11 Jan 04, 2008 21:02

But that description, you just wrote, is really helpful :)

12 Jan 04, 2008 21:09

yes, I see issue_time, but I figured out that this is to format an hour, minutes and seconds of post...

That's picture showing what exactly I want to do:
http://www.blog.ewolucja.org/blog.jpg

a) what changed when I inserted the piece of code that I cited in my previous post
b) what has not changed, and I want it to change - to look exactly like a)
c) what changes when I format issue_time

There is nothing like "issue_date" in my main_php (I copied exactly everything from tutotial about creating my own style ;) )

and again, my [URL=http://www.blog.ewolucja.org/]blog url[/URL]

13 Jan 04, 2008 21:28

Can you PM me your _main.php ?

And you should delete <link HREF="style.css" REL="STYLESHEET"> from head section

14 Jan 04, 2008 21:29

$MainList->date_if_changed( '<div class="PostDate"><h2>', '</h2></div>' );

;)

¥

15 Jan 04, 2008 21:34

¥åßßå, ayou are genius! :D

you all are, but Mr/Ms ¥åßßå gave me full satisfaction. :>>

Now it's looking exactly like I need it to look.

thanks to everyone!
and have a nice day. or evening, or whatever time zone you are.


Form is loading...