Topic Closed

Hi All,

I'm using Simple_Blog1, and I can't get my head around the php to work out how to fix this.

On the individual blog posts, both on Blog-Home and the Gadget the blogs show as follows...

Date & Sub-title
Title

The comments links also show on the Sub-title line on the Blog-home page. The gadget shows the leader text, but there is no Blog text on the Blog-Home page.

What I want to do is change the format to:

Title
Date & Sub-title

I'd also like to have the Blog-home showing the blog text.

Anyone have an idea on how I can do this?

Thanks,

Richard

11 years ago#2492

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

Hi Richard,

I just did a quick research in that plugin. You're right, that order "Title>Date+Subtitle" looks much better. That listing is generated in SimpleBlog1.php in function ShowPostContent., so just move the "h2 lines" to the beginning of the function:

    function ShowPostContent(&$post,&$post_index,$showcontent=true){

        global $langmessage;

        echo '<h2 id="blog_post_'.$post_index.'">';

        $label = str_replace('_',' ',$post['title']);

        echo common::Link('Special_Blog1',$label,'cmd=post&id='.$post_index);

        echo '</h2>';       

        echo '<div class="simple_blog_info">';

        echo '<span>';

        echo date($this->blogData['date_format'],$post['time']);

        $subtitle=$post['subtitle'];

        .......

"I'd also like to have the Blog-home showing the blog text."  That "Blog Home label" displaying code is currently located on lines 399-420, I am not sure what there could be. Simply write there what you want.

Btw., now I noticed also one bug in configuration, recaptcha cannot be saved as unchecked.

11 years ago#2493

Thanks Stanno,

What I mean by blog text on the homepage is is I want the actual text of the blog post to appear under the subtitle.

You can see the current layout on my website http://www.renfence.com.au/Special_Blog1

All you see is sub-title & title information.

I think it's pretty useless without the text, as it forces the reader to click each link. For instance, the atom feed will give you the first 1200 characters or so, and I wanted to do something similar on the home page for the blog.

Richard

- I am so not a php programmer, so I really appreciate the help.

11 years ago#2494

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

Thanks Richard, now I understand. This is also very useful listing for the blog and would be good to be present in the next release of the plugin. You can insert the following 8 lines at the end of ShowPostContent function:

        .......

 

        if( $showcontent ){
            echo $post['content'];
            echo '<br/>';
        }
        else{
          $preview=strip_tags($post['content']);
          $cut=1200;
          while (
$cut<strlen($preview) && $preview[$cut]!=' ' && $preview[$cut]!='&')
            $cut++;
          echo '<br/><i>'.mb_substr($preview,0,$cut,'UTF-8').'</i>... ';
          echo common::Link('Special_Blog1','More...','cmd=post&id='.$post_index).'<br/>';
        }

        //echo showArray($post);
        echo '<div class="clear"></div>';
    } // here ends the ShowPostContent function

Now this seems to work finally well and also the page is validated.

Stano

Edited: 11 years ago#2495

Thanks Stano,

Works a treat.

I tried to fix the gadget feed in the side bar the same way, but it doesn't appear to be updating.

I thought the right bit to change was in SimpleBlog1Common.php at
function GenGadget($blog_config){

Using what we did for the page changes didn't work for me so I'm open to ideas.

I want to also make the gadget echo

title
date - sub-title
content

(the title currently appears after sub-title)

Richard

11 years ago#2504

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

O.k. yet I updated the code (look at my updated previous post), now it cuts the words correctly.

I looked at the gadget, it's working only must be updated. Just move that emphasized "h2 lines" in GenGadget function to this place:

            echo '<div class="simple_blog_info">';
            echo '<h2 class="simple_blog_title">';
            $label = str_replace('_',' ',$post['title']);
            echo common::Link('Special_Blog1',$label,'cmd=post&id='.$post_index);
            echo '</h2>';
            echo date($blog_config['date_format'],$post['time']);

and then regenerate the gadget file by using this url address:

...../Special_Blog1?cmd=regen

and it will do it.

Good luck, Richard.

Edited: 11 years ago#2505

Beautiful work Stano - that's done the trick exactly as I wanted.

Thanks for all your help, I truly appreciate it.

Now to write up the documentation for the Plugin as pay back...

Richard

- not a programmer, but I do make my living as a Technical Writer.

11 years ago#2512

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

Hi Richard,
thank you for appreciation, but I am not a developer of this plugin, maybe I was only a bit more eager or asidious than I should to be :) I dunno who maintain the SimpleBlog1 plugin. Anyway, the author of original SimpleBlog is Josh, and so I suppose, that also he'll put his answer to you here soon.

Edited: 11 years ago#2513

Josh S.
2K Posts
304K Downloads
16 Themes
18 Plugins

Hi guys. Sorry I didn't take part in your troubleshooting process.

Some documentation about the Simple Blog plugins would be great! It could easy fit within the documentation wiki...  There should probably be a section of the wiki dedicated to plugin documentation.

The Simple Blog and Simple Blog1 plugin definitely need to be combined, I unfortunately haven't had the time. Stano, I don't want to ask too much of you, but since you've already invested some time, if you'd like to work some more on Simple Blog, I'd be happy to hand it over to you.

11 years ago#2514

Putting the doco on the wiki was the plan. I've got a lot of support from this community, and it's my way to give back since I'm not a programmer.

OK, I'll write the SimpleBlog user guide as if it's just SimpleBlog. We can revise it if a new version comes out.

Richard

11 years ago#2515

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

Thanks for your offer Josh, better not, I also won"t have much time next days. I know just some basics of php, I used in those plugins. Don't know nothing about RSS and this fix was just about an one hour quick research :-) I must give all those php programs a rest now.

Best regards Stano

Edited: 11 years ago#2516

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Ennetb├╝rgen (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Websi...

Find out more about our Provider Spotlight

Log In

  Register