Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS Blog v1.4
#76
In function show_blog_navigation, why is the right arrow inside this if?

if ($index < $total && $count >= $Blog->getSettingsData("postperpage")) { ... }

I'm missing something?

thanks everybody,
Reply
#77
also, an empty <div class="blog_page_navigation"> is produced after each post, even if it is not the last in the page...
Reply
#78
studiosi Wrote:In function show_blog_navigation, why is the right arrow inside this if?

if ($index < $total && $count >= $Blog->getSettingsData("postperpage")) { ... }

I'm missing something?

thanks everybody,

I think you are referring to $Blog->getSettingsData("postperpage")
The $Blog-> represents an instance of the 'Blog' class. (you will see $Blog = new Blog at the top of the function). In that particular method call, we are returning the number of posts per page the user defined.

So if $index (the current blog page the user is on (page=x in the url)) is less then the total amount of blog pages and count (the number of posts on the current page) is less then the user defined amount of posts per page, then do what is in the conditional brackets.

I will look into this problem tomorrow when I have some more time.
Reply
#79
I have a solution for both problems. It was because of a faulty design of a couple of functions in the core. Please Mikeh, add this to the main distribution so others don't have to scratch their heads like me Big Grin. Here's the code of both functions I had to modify. I want to thankyou of course for this plugin!:

// show_posts_page

function show_posts_page($index=0)
{
$Blog = new Blog;
$posts = $Blog->listPosts(true, true);
if($Blog->getSettingsData("allpostsadtop") == 'Y')
{
?>
<div class="blog_all_posts_ad">
<?php echo $Blog->getSettingsData("addata"); ?>
</div>
<?php
}
if(!empty($posts))
{
$pages = array_chunk($posts, intval($Blog->getSettingsData("postperpage")), TRUE);
if (is_numeric($index) && $index >= 0 && $index < sizeof($pages))
{
$posts = $pages[$index];
}
else
{
$posts = array();
}
$count = 0;
$lastPostOfPage = false;
foreach ($posts as $file)
{
$count++;
show_blog_post($file['filename'], true);

if($count == sizeof($posts) && sizeof($posts) > 0)
{
$lastPostOfPage = true;
}

if (sizeof($pages) > 1)
{
// We know here that we have more than one page.
$maxPageIndex = sizeof($pages) - 1;
show_blog_navigation($index, $maxPageIndex, $count, $lastPostOfPage);
if($count == $Blog->getSettingsData("postsperpage"))
{
$count = 0;
}
}
}
}
else
{
echo '<p>' . i18n(BLOGFILE.'/NO_POSTS') . '</p>';
}
if($Blog->getSettingsData("allpostsadbottom") == 'Y')
{
?>
<div class="blog_all_posts_ad">
<?php echo $Blog->getSettingsData("addata"); ?>
</div>
<?php
}
}

// show_blog_navigation
function show_blog_navigation($index, $total, $count, $lastPostOfPage)
{

$Blog = new Blog;
$url = $Blog->get_blog_url('page');

if ($lastPostOfPage)
{
echo '<div class="blog_page_navigation">';
}

echo $needsNavigationDiv;

//if ($index < $total && $count >= $Blog->getSettingsData("postperpage"))
if($index < $total && $lastPostOfPage)
{
?>
<div class="left">
<a href="<?php echo $url . ($index+1); ?>">
&larr; <?php echo $Blog->getSettingsData("previouspage"); ?>
</a>
</div>
<?php
}
?>

<?php
//if ($index > 0 && $count >= $Blog->getSettingsData("postperpage"))
if ($index > 0 && $lastPostOfPage)
{
?>
<div class="right">
<a href="<?php echo ($index > 1) ? $url . ($index-1) : substr($url, 0, -6); ?>">
<?php echo $Blog->getSettingsData("nextpage"); ?> &rarr;
</a>
</div>
<?php
}
?>

<?php
if ($lastPostOfPage)
{
echo '</div>';
}

}
Reply
#80
It needs a little bit cleaning up... but I wanted to show the code to you as soon as possible!
Reply
#81
Also if it is somehow faulty... tell me!

(and thankyou again for your work!)
Reply
#82
studiosi Wrote:I have a solution for both problems. It was because of a faulty design of a couple of functions in the core. Please Mikeh, add this to the main distribution so others don't have to scratch their heads like me Big Grin. Here's the code of both functions I had to modify. I want to thankyou of course for this plugin!:

// show_posts_page

function show_posts_page($index=0)
{
$Blog = new Blog;
$posts = $Blog->listPosts(true, true);
if($Blog->getSettingsData("allpostsadtop") == 'Y')
{
?>
<div class="blog_all_posts_ad">
<?php echo $Blog->getSettingsData("addata"); ?>
</div>
<?php
}
if(!empty($posts))
{
$pages = array_chunk($posts, intval($Blog->getSettingsData("postperpage")), TRUE);
if (is_numeric($index) && $index >= 0 && $index < sizeof($pages))
{
$posts = $pages[$index];
}
else
{
$posts = array();
}
$count = 0;
$lastPostOfPage = false;
foreach ($posts as $file)
{
$count++;
show_blog_post($file['filename'], true);

if($count == sizeof($posts) && sizeof($posts) > 0)
{
$lastPostOfPage = true;
}

if (sizeof($pages) > 1)
{
// We know here that we have more than one page.
$maxPageIndex = sizeof($pages) - 1;
show_blog_navigation($index, $maxPageIndex, $count, $lastPostOfPage);
if($count == $Blog->getSettingsData("postsperpage"))
{
$count = 0;
}
}
}
}
else
{
echo '<p>' . i18n(BLOGFILE.'/NO_POSTS') . '</p>';
}
if($Blog->getSettingsData("allpostsadbottom") == 'Y')
{
?>
<div class="blog_all_posts_ad">
<?php echo $Blog->getSettingsData("addata"); ?>
</div>
<?php
}
}

// show_blog_navigation
function show_blog_navigation($index, $total, $count, $lastPostOfPage)
{

$Blog = new Blog;
$url = $Blog->get_blog_url('page');

if ($lastPostOfPage)
{
echo '<div class="blog_page_navigation">';
}

echo $needsNavigationDiv;

//if ($index < $total && $count >= $Blog->getSettingsData("postperpage"))
if($index < $total && $lastPostOfPage)
{
?>
<div class="left">
<a href="<?php echo $url . ($index+1); ?>">
&larr; <?php echo $Blog->getSettingsData("previouspage"); ?>
</a>
</div>
<?php
}
?>

<?php
//if ($index > 0 && $count >= $Blog->getSettingsData("postperpage"))
if ($index > 0 && $lastPostOfPage)
{
?>
<div class="right">
<a href="<?php echo ($index > 1) ? $url . ($index-1) : substr($url, 0, -6); ?>">
<?php echo $Blog->getSettingsData("nextpage"); ?> &rarr;
</a>
</div>
<?php
}
?>

<?php
if ($lastPostOfPage)
{
echo '</div>';
}

}

Thanks for the update. It would be great if you could update the github repository with your new methods so we can compare the before and after! You can find it here.
Reply
#83
Of course... I will upload it as soon as i get to know how that works... Big Grin
Reply
#84
studiosi Wrote:Of course... I will upload it as soon as i get to know how that works... Big Grin

okeii... you have a pull request... check it if you like.

thankyou all...
Reply
#85
Took a while for me to get out of my settled ways with I18N Special Pages and try this thing out properly. Surprised to see that it is doing most of the right things and ticking the right boxes, so very good stuff mikeh :-)

Ups
  • Incredibly simple to set up (principle philosophy of GS!) - it actually shocked me how easily features were to enable
  • Good integration of external comments system Disqus among other features
  • Decent degree of customisation for early stages
  • Lots of potential, especially with the possibility of custom-fields in the next iteration 1.2


Downs / areas to improve/be careful of...
  • The pretty url system needs to be pretty solid when it is complete, especially regarding the Disqus comments system. If it doesn't treat the separate news articles separately enough in their URL location then the commenting system could face some ugly problems in the long run with comments running into the wrong article(s)
  • Databases - if you are going to do this, please consider n00dle's Matrix plugin which uses an XML database instead (but provides all of the features of a MySQL database; all within the confines of the GS admin panel!). One considerable appeal of GS is its flatfile nature, so it'd be good if the (potentially) most complete blogging system of GS conformed to that ideal
  • May want to proof-read a few pages - under 'Post Option' on the post's creation page for example, the label 'Slug/URL' can be seen where it should say 'Creation Date', and on the same page 'separate' has been spelt with two 'a's - cleaning up minor mistakes like these will just make it look more professional
  • This may be an inevitability with the coming of custom-fields, but just to be sure: will there be a 'template' feature wherein the output/css of the blog can be configured to the user's liking?
  • I don't think that placeholders work - so any content that users previously had within (% %) tags will not be viewed correctly.

Don't let this list get in the way of the pieces you are already tackling. You're doing an awesome and very appreciated job already mikeh, so I hope this completed module receives its accolades. :-)
Reply
#86
Hi Mike,

I am poking around GS Blog and love it so far and can see that and your Items Manager becoming my essential web site tools!

I do have 2 questions:

1: The Previous Blog Post and Next Blog Post links are not showing up. Is there a known issue with that? I couldn't find it in the forum.

2: When is version 1.2 with the custom fields coming out??? I am really looking forward to that!

Thanks again for all your contributions to the GS community.
-Dominic

P.S. I agree with AngryBoy's wish in the previous post that you stick with a purely XML database. The only reason I am on Get Simple is to avoid MySql. If you start using that, I might as well just go back to wordpress!
Reply
#87
I did a fork at github to solve some problems with the links... i don't know if the pull request is done, but... check it in my fork if it is not integrated. Check the generated HTML and tweak blog.php if needed... i think that a template system would be a great add on to this project... which is really good work anyways...
Reply
#88
Dominic Wrote:Hi Mike,

I am poking around GS Blog and love it so far and can see that and your Items Manager becoming my essential web site tools!

I do have 2 questions:

1: The Previous Blog Post and Next Blog Post links are not showing up. Is there a known issue with that? I couldn't find it in the forum.

2: When is version 1.2 with the custom fields coming out??? I am really looking forward to that!

Thanks again for all your contributions to the GS community.
-Dominic

P.S. I agree with AngryBoy's wish in the previous post that you stick with a purely XML database. The only reason I am on Get Simple is to avoid MySql. If you start using that, I might as well just go back to wordpress!

I am working on 1.1.4 now. 1.2 should be out within the next week or so. In relation to the database, if I did offer the option for a database it would be completely optional (like the front end user login plugin). I don't know how well the Matrix plugin will scale if someone has a large blog, but I will look into it.

The previous and next button fixes will be released today (provided by studiosi) and the page components breaking bug fix is also included (provided by Angryboy
Reply
#89
Version 1.1.4 Added To Extend
  • Fixed Pretty URL bug Pretty URLs are now working!
  • Fixed some bugs in relation to "Previous Blog Post" & "Next Blog Post" links
  • Added text area and checkbox in settings page to display CSS. Also added list of available ids and classes and an example of the html behind a post.
  • Added a few more css classes to elements
  • Fixed labels
Reply
#90
Angryboy Wrote:Took a while for me to get out of my settled ways with I18N Special Pages and try this thing out properly. Surprised to see that it is doing most of the right things and ticking the right boxes, so very good stuff mikeh :-)

Ups
  • Incredibly simple to set up (principle philosophy of GS!) - it actually shocked me how easily features were to enable
  • Good integration of external comments system Disqus among other features
  • Decent degree of customisation for early stages
  • Lots of potential, especially with the possibility of custom-fields in the next iteration 1.2


Downs / areas to improve/be careful of...
  • The pretty url system needs to be pretty solid when it is complete, especially regarding the Disqus comments system. If it doesn't treat the separate news articles separately enough in their URL location then the commenting system could face some ugly problems in the long run with comments running into the wrong article(s)
  • Databases - if you are going to do this, please consider n00dle's Matrix plugin which uses an XML database instead (but provides all of the features of a MySQL database; all within the confines of the GS admin panel!). One considerable appeal of GS is its flatfile nature, so it'd be good if the (potentially) most complete blogging system of GS conformed to that ideal
  • May want to proof-read a few pages - under 'Post Option' on the post's creation page for example, the label 'Slug/URL' can be seen where it should say 'Creation Date', and on the same page 'separate' has been spelt with two 'a's - cleaning up minor mistakes like these will just make it look more professional
  • This may be an inevitability with the coming of custom-fields, but just to be sure: will there be a 'template' feature wherein the output/css of the blog can be configured to the user's liking?
  • I don't think that placeholders work - so any content that users previously had within (% %) tags will not be viewed correctly.

Don't let this list get in the way of the pieces you are already tackling. You're doing an awesome and very appreciated job already mikeh, so I hope this completed module receives its accolades. :-)

Thank you for your input. I have incorporated some of your changes into the newest version (pretty urls and label fixes).

In terms of the commenting system. Disqus identifies a blog post by the post's slug. That way it doesn't matter what URL structure the user has or if they change it.

For now I added a text box in the settings panel (as well as on/off switch) to display css for the blog.
Reply
#91
studiosi Wrote:I did a fork at github to solve some problems with the links... i don't know if the pull request is done, but... check it in my fork if it is not integrated. Check the generated HTML and tweak blog.php if needed... i think that a template system would be a great add on to this project... which is really good work anyways...

I have incorporated your changes into version 1.1.4. Thank you for your contribution.
Reply
#92
mikeh Wrote:
studiosi Wrote:I did a fork at github to solve some problems with the links... i don't know if the pull request is done, but... check it in my fork if it is not integrated. Check the generated HTML and tweak blog.php if needed... i think that a template system would be a great add on to this project... which is really good work anyways...

I have incorporated your changes into version 1.1.4. Thank you for your contribution.

Does this version have a fix for the content filters issue/pull request I sent you? I haven't checked git lately.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#93
shawn_a Wrote:
mikeh Wrote:
studiosi Wrote:I did a fork at github to solve some problems with the links... i don't know if the pull request is done, but... check it in my fork if it is not integrated. Check the generated HTML and tweak blog.php if needed... i think that a template system would be a great add on to this project... which is really good work anyways...

I have incorporated your changes into version 1.1.4. Thank you for your contribution.

Does this version have a fix for the content filters issue/pull request I sent you? I haven't checked git lately.
Yes.
Reply
#94
mikeh Wrote:
shawn_a Wrote:
mikeh Wrote:I have incorporated your changes into version 1.1.4. Thank you for your contribution.

Does this version have a fix for the content filters issue/pull request I sent you? I haven't checked git lately.
Yes.

Thanks!
yay, now I can play around with it more. Havent been able to use it.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#95
1. reason categories in Russian language in the admin are shown as # # # # # # #
2. Archives in the sidebar looks like this ��� 2012
Reply
#96
Check out the German language file at:

https://github.com/kidata/getsimple-blog.../de_DE.php

Any improvements welcome.
Reply
#97
kidata Wrote:Check out the German language file at:

https://github.com/kidata/getsimple-blog.../de_DE.php

Any improvements welcome.
I have added it to the extend. Thanks!
Reply
#98
mikeh Wrote:Thank you for your input. I have incorporated some of your changes into the newest version (pretty urls and label fixes).

In terms of the commenting system. Disqus identifies a blog post by the post's slug. That way it doesn't matter what URL structure the user has or if they change it.

For now I added a text box in the settings panel (as well as on/off switch) to display css for the blog.
Thank you for considering the points :-) Hope you do fantastically and provide support for this blogging system when it is fully released!
Reply
#99
I do the translation into Russian. in case of a category choice instead of letters #####
http://postimage.org/image/ho4yhkerj/
Reply
Version 1.1.5 Added To Extend
  • Added field to control how many posts are in RSS feed
  • Added CDATA to category xml file to fix special characters bug

Version 1.1.7 will include a "written by authorname" under each post (displayed optionally). If chosen to be displayed it will either place the username of the admin who wrote the post, or if the newest version of the multi-user plugin is installed, you can choose a name for each admin.

It will also include "Authors" page (only will exist if newest version of multiuser is installed), which will display all authors (and their bios) who have written posts for the blog.
Reply




Users browsing this thread: 14 Guest(s)