boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

0.6 - next_posts, etc. not working for me
Goto page 1, 2  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
nessahead



Joined: 12 Mar 2002
Posts: 312
Location: Los Angeles, CA

PostPosted: Mon Sep 30, 2002 7:39 am    Post subject: 0.6 - next_posts, etc. not working for me Reply with quote

Just downloaded 0.6 (yay!) and next_posts(), previous_posts(), next_posts_link(), and previous_posts_link() are not working for me.

I apologize if this is a known bug -- I remember seeing various threads about it but never reading them and I did a search to see if it had been talked about but couldn't get any real resolution on the thing =)

Anyway, when I pop in <?php next_posts() ?> (and the like), nothing shows up at all (in the code or on the page). Any clues?
_________________
raar!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Mon Sep 30, 2002 8:07 am    Post subject: Reply with quote

Wierd, for pre5 <?php previous_posts_link();?> and <?php next_posts_link();?> works for me, go back i will upgrade in 0.6 and try again.
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Mon Sep 30, 2002 2:29 pm    Post subject: Reply with quote

ya it is not working tried it
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Mon Sep 30, 2002 5:15 pm    Post subject: Reply with quote

Hi nessahead and all,

A little history. A number of users asked for a way to "page" through their main template output. In answer to that request we introduced the next_posts, previous_posts, and *_posts_link series of functions. Some of which were based on previous contributions.

The solution which was in the first pre6 release did have some short-comings. When the options were set to display "days", the query build displayed "n" number of days at a time consecutively. Thus if there were a few days without post, the result was no posts displayed. In addition, determining how many were really there (days or posts) was not doable without another query.

At this same time, a number of users also wanted this functionality for categories, archives, searches, etc. This contradicted previous expressions of some users that wanted all the categories, archives, searches, etc displayed without a limit applied.


So we revisited the problem from a general "paged output" view. The result was a change in this functionality and the introduction of a new "post option" value, "paged posts".

With this new feature selected, the behavior is similar to "posts" but the output is displayed in "n" posts per page. "n" being the value supplied with the options selection. This is true for the main page as will as categories, archives(m=, w=), searched, etc.

With Michel's latest pre6 build, some to the changes required to make the above was included. I will ask Michel to built a new pre6 with all the changes if we can or revert to the first pre6 build functions for next_post.... etc.
Back to top
View user's profile Send private message Send e-mail
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Mon Sep 30, 2002 5:55 pm    Post subject: Reply with quote

we can also copy the code from pre5 functions.template and past it in 0.6 template?
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Mon Sep 30, 2002 7:22 pm    Post subject: Reply with quote

GamerZ,

Yes you could. I think I miss-spoke above in the "history" post, I should have said that it was first in the pre5 release.

michael e
Back to top
View user's profile Send private message Send e-mail
michel v
Site Admin


Joined: 25 Jan 2002
Posts: 799
Location: Corsica

PostPosted: Mon Sep 30, 2002 7:23 pm    Post subject: Reply with quote

Ah yes, I forgot to use the CVS's b2options.php in the release... bad michel bad !
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
nessahead



Joined: 12 Mar 2002
Posts: 312
Location: Los Angeles, CA

PostPosted: Tue Oct 01, 2002 4:50 am    Post subject: Reply with quote

Yum, thanks =)
_________________
raar!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Tue Oct 01, 2002 1:00 pm    Post subject: Reply with quote

michel v wrote:
Ah yes, I forgot to use the CVS's b2options.php in the release... bad michel bad !
hmm so we dl b2options.php from the cvs?
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Tue Oct 01, 2002 3:00 pm    Post subject: Reply with quote

GamerZ,

You will also need blog.header.php


michael e
Back to top
View user's profile Send private message Send e-mail
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Tue Oct 01, 2002 4:55 pm    Post subject: Reply with quote

okie thanks
blog.header.php and b2options.php
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Tue Oct 01, 2002 9:48 pm    Post subject: Reply with quote

Hmmm.
I've just got those two files from cvs (via cvsview on sourceforge):

blog.header.php revision 1.21
and
b2options.php revision 1.4

And now unless I have xx 'posts paged' in my options I get every post displayed in b2edit.php.

If I select xxx days or xxx posts I get every one. If I select xx 'posts paged' I just get xx displayed.

Displaying my posts in index.php is fine which ever option is selected.

If I get chance I'll look into it. The changes (in blog.header.php) look like they are doing the right thing with the limits caclulation, but something is going wrong!

Mike
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Wed Oct 02, 2002 2:04 am    Post subject: Reply with quote

Hi Mike,

Thank you for the report and sorry that I caused all this. Sad
Read through the following and if you could, pull the updated files from cvs and give them a try. I did take each of these files and replaced each in my copy of 0.6 (zip off of SF). And TESTED them with days/posts/posts paged/ in both the index.php template and b2edit.

====

First I could have sworn I tested all the b2edit stuff with this change. I went back to cvs and retested it again. And it is broke in cvs as well

One issue is the test at about line 204 of blog.header. Got bit by the !empty($poststart). When were in the b2edit, the poststart and postend get set in the b2edit.showposts.php script to control what is displayed, and thus can get set to '0'. The !empty($poststart) test will return false and thus we don't build the 'limit' constraint.


So, about line 204

if ((!empty($poststart)) && (!empty($postend)) && ($postend > $poststart)) {

Change it to:

if ( !empty($postend) && ($postend > $poststart)) {

And at 205 additional test added to handle paged mode with only poststart/postend set/
if ($what_to_show == 'posts') {

change to ;
if ($what_to_show == 'posts' || ($what_to_show == 'paged' && (!$page))) {


That will take care of the "run-a-way" lists in "posts" and "days" mode while in b2edit.


But that is not all that is wrong.

[How could I have missed all of this????? Bummer! Sad ]

b2edit needed to add 'postend' to the $b2varstoreset array;

b2edit.showposts.php needs a few tweaks:

offsets of +1 and -1 are not needed; they throw the count off.
(lines 26 - 30 area)

I've tested these with the b2 0.6 release - [really I did]
and have committed these changes to cvs.

from cvs take:
1.4 b2options.php (you have this already)
1.16 b2edit.php
1.7 b2edit.showposts.php
1.22 blog.header.php

[boy o boy o boy... how could I have missed all this ]

Michael e
Back to top
View user's profile Send private message Send e-mail
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Wed Oct 02, 2002 11:56 pm    Post subject: Reply with quote

Hi,

I have made one more change to prevent a link from being created in "posts paged" mode when the number of posts are a multiple of the number of posts displayed (options show value). This is the "new" functionality that will be in the next build.

These are the files from cvs:
Code:

1.45    b2template.functions.php   
1.7     b2edit.showposts.php
1.16    b2edit.php
1.22    blog.header.php


Michael e
Back to top
View user's profile Send private message Send e-mail
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Thu Oct 03, 2002 2:09 pm    Post subject: Reply with quote

Michael,

It is all working great for me now.

Thanks you.

Mike
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Bugs All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group