wrong order in event_linktoolbar

Discussion corner for Developers of Serendipity.
Post Reply
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

wrong order in event_linktoolbar

Post by stm999999999 »

hi!

we have event_entrypaging for give "next/prev article" on the page.

and we have event_linktoolbar to do the same but not visible for the user but for the browser as meta content:

Code: Select all

<link rel="up" href="http://example.com/" title="blog title" />
<link rel="prev" href="http://example.com/archives/4-bla.html" title="bla" />
<link rel="next" href="http://example.com/archives/15-foo.html" title="foo" />
the entrypaging gives next/prev in time-order and I think this is right.

linktoolbar gives it in an id-order, but so when I make:

written on 2007-01-01 article-id 1 for entry-date 2007-01-01
written on 2007-01-03 article-id 2 for entry-date 2007-01-03
written on 2007-01-10 article-id 3 for entry-date 2007-01-10
written on 2007-01-11 article-id 4 for entry-date 2007-01-04 (because I forgott something to write or so)

entrypaging gives me the order (article-id)

1,2,4,3 because 4 is on a time-line between 2 and 3.

but linktoolbar gives

1,2,3,4 :-(



Because this here is the forum for solutions ;-) I adapted the code from entrypaging for linktoolbar (timeOffset, makelink and showpaging)!

http://phpfi.com/253519
(i did not make a versions bump, please do it for me)

so, now linktoolbar gives the right order (by time-line) and we have support for multilingual title, too!

There is only one question:

entrypaging has an option to make an article-order for the whole blog or inside the actual category:

Code: Select all

            case 'use_category':
                $propbag->add('type',        'boolean');
                $propbag->add('name',        PLUGIN_ENTRYPAGING_USECATEGORY);
                $propbag->add('description', PLUGIN_ENTRYPAGING_USECATEGORY_BLAHBLAH);
                $propbag->add('default',     'false');
                break;

...

            if (serendipity_db_bool($this->get_config('use_category')) && !empty($currentTimeSQL['categoryid'])) {
                $cond['joins'] .= " JOIN {$serendipity['dbPrefix']}entrycat AS ec ON (ec.categoryid = " . (int)$currentTimeSQL['categoryid'] . " AND ec.entryid = e.id)";
            }

I included this to linktoolbar, too. But in the moment it has no effect, because this plugin has no options.

I think it would be a good idea to synchronize this to the user choosen option of entrypaging: the user and the browser should see the same prev and next, I think.


But I do not know, how to do so! :-(

idea 1: give linktoolbar an option, and the user has to config this manually (we have to hope, that he see this)

idea 2: can we access the choosen option of entrypaging for linktoolbar?
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: wrong order in event_linktoolbar

Post by garvinhicking »

Hi!

I'll look into this.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply