Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2004-07-02 17:26:31

mrpunkin
Member
Registered: 2004-06-13
Posts: 10
Website

Re: Browsing by date plugin

Works Great! Thanks a ton.


Bryan
.:Mrpunkin.coM:.

Offline

#50 2004-07-03 18:30:23

philippo
New Member
From: New Haven, CT
Registered: 2004-05-26
Posts: 7

Re: Browsing by date plugin

thekolonel,

I was wondering how you accomplish the date based navigation at the top of each post or excerpt. Ie. the “<< May 2004 | June 2004 >>” and “”<< old_title | new_title >>” thing.

Also, I can’t get proper permalinks to be generated in the akw_archive tag. If I use <txp:permlink> in the archiveform passed to akw_archive, it generates a permalink like “domain.tld/archive/the-post-title”, without the post id that seems to be required in my txp installation, ie “domain.tld/archive/id/the-post-title”.

Any help is appreciated!

Offline

#51 2004-07-03 19:50:22

philippo
New Member
From: New Haven, CT
Registered: 2004-05-26
Posts: 7

Re: Browsing by date plugin

UPDATE: Please disregard the first part of this post. Textdrive decided to change their server timing to UTC all of a sudden. It’s fixed now. The second question (categories / by date mix) is still relevant

Also, I’m getting some sort of bug with this.

akw_archive seems to list articles as belonging to a particular day when they don’t. Thus sometimes, when you click on a particular day that has articles according to akw_archive, it will show a blank page because there actually aren’t any articles published that day.

Vice versa, when you click on a particular day, along with the articles that were published that day, you sometimes get ones that are a day older.

See drunkenmonkeys.org/archive/ May 21st for an example of the former and May 18th for an example of the latter.

It’s kinda weird.

Oh, also, is there any elegant way to combine date and category based navidation? thekolonel, you seem to have a nice setup, but are using custom URLs. Could you perhaps describe how you accomplish that? I’d like to have something mixing categories and dates akin to http://1976design.com/blog/archive/

Cheerio!

Last edited by philippo (2004-07-03 20:05:33)

Offline

#52 2004-07-04 19:49:58

tkn
Member
From: New York
Registered: 2004-06-29
Posts: 39
Website

Re: Browsing by date plugin

One thing I’ve noted on my archive pages is that the conditional statements do not work correctly. For example

&lt;txp:if_individual_article&gt;
Previous &lt;txp:link_to_prev&gt;&lt;txp:prev_title /&gt;&lt;/txp:link_to_prev&gt; |
Next &lt;txp:link_to_next&gt;&lt;txp:next_title /&gt;&lt;/txp:link_to_next&gt;
&lt;/txp:if_individual_article&gt;
&lt;txp:if_article_list&gt;
&lt;txp:older>Prev Page&lt;/txp:older&gt; |
&lt;txp:newer>Next Page&lt;/txp:newer&gt;
&lt;/txp:if_article_list&gt;

Will still see the monthly archive as an individual article and display the words Previous and Next. Of course, what would be best is that the older and newer links worked along with next_title and prev_title, but not seeing it as an individual article is more important.

This is a great plugin otherwise…

Last edited by tkn (2004-07-04 19:59:54)

Offline

#53 2004-07-04 23:33:26

mrpunkin
Member
Registered: 2004-06-13
Posts: 10
Website

Re: Browsing by date plugin

Is there an easy way to designate which form the date plugin will export to? Like, on my main section that all my articles are posted to it is set to only display one at a time, but when I click on the date I would like it to use a different section to display the results. The stw_category_tree plugin does this very well, im just wondering if there is a way to do that with this plugin as well?


Bryan
.:Mrpunkin.coM:.

Offline

#54 2004-07-05 16:29:00

andruidica
New Member
From: Brooklyn
Registered: 2004-05-26
Posts: 5
Website

Re: Browsing by date plugin

update: Not sure why, but the problem with month being off has solved itself, probably was a server error. Please ignore that section.

The upgrade for without globals now has my date based archives now working, except it shows the previous month to the one indicated by the ?m= as generated by month_list function ([Can now ignore this, no longer a problem]). Thanks for the update, any idea why it might be one month off?

Some additional stuff I’d like to see:
1) I would like it to work with clean date urls /archive/2004/06 for June 2004, etc. Any ideas how this works? As Phillipo points out, it does work at http://1976design.com/blog/archive/, as well as at your own journal, Kolonel.

2) Also, I’d like for the if_article_list to work with this plug-in, so it shows “<< May 2004” when displaying June 2004. Rather than the blanks I’m getting now.

Thanks, again, for all the work and your help, Kolonel.

[Edit: added link to example]
[Further Edit: noted problem now solved, removed link]

Last edited by andruidica (2004-08-06 21:40:40)

Offline

#55 2004-07-07 21:13:40

ri0t
New Member
Registered: 2004-07-05
Posts: 2
Website

Re: Browsing by date plugin

Nice work!

I hope this hasnt been reported before. There is a little error in the documentation. It states that there is a function akw_article_custom, while in reality its called akw_article_custom_date_aware. Caused me some confusion.

Regards.

Offline

#56 2004-07-07 21:21:00

ri0t
New Member
Registered: 2004-07-05
Posts: 2
Website

Re: Browsing by date plugin

Just wanted to request a akw_if_date and possibly akw_if_no_date tag working like the known if_category and if_section tags to be included in the plugin.

I’ve hacked together my own version of these, but I guess there might be more people needing these functions.

These are my modifications..

function akw_if_date($atts, $thing) //MOD
{ return (gps(‘y’) || ps(‘m’) || gps(‘d’)) ? parse($thing) : ‘’;
}

function akw_if_no_date($atts, $thing) //MOD
{ return (gps(‘y’) || ps(‘m’) || gps(‘d’)) ? ‘’ : parse($thing);
}

Thanks allot.

Last edited by ri0t (2004-07-07 22:38:19)

Offline

#57 2004-07-11 05:59:53

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: Browsing by date plugin

I was having problems with txp:older and txp:newer with respect to this plugin. Specifically, they did not properly retain the date information when used with a month and year setting.

In other words, selecting the archive date (ex: July 2004) would give you a list of 10 articles (default limit) from July. If you then choose the older articles link, it would take you to /articles/?pg=2 instead of /articles/?pg=2?m=06?y=2004. To fix this, I hacked the plugin to include two additional functions: akw_older and akw_newer.

I hope that this is useful to someone. Please make sure you have backups before using this, since I don’t want a bug of mine to break something of your’s.

In the function akw_doArticles_da, look for a series of lines that say:

<pre>
<code>
// send paging info to txp:newer and txp:older $pageout[‘pg’] = $pg; $pageout[‘numPages’] = $numPages; $pageout[‘s’] = $s; $pageout[‘c’] = $c;
</code>
</pre>

Add the following two lines after the above lines:

<pre>
<code> $pageout[‘y’] = gps(‘y’); $pageout[‘m’] = gps(‘m’);
</code>
</pre>

At the end of the plugin, now add the following two functions:

<pre>
<code>
function akw_older($atts, $thing, $match=’‘)
{ global $thispage,$url_mode; if (is_array($atts)) extract($atts); if (is_array($thispage)) { extract($thispage); } else { return $match; }

ob_start(); if ($pg != $numPages) { $out = array( ‘<a href=”?pg=’.($pg + 1), ($y) ? a.‘y=’.urlencode($y) : ‘’, ($m) ? a.‘m=’.urlencode($m) : ‘’, ($c) ? a.‘c=’.urlencode($c) : ‘’, ($s && !$url_mode) ? a.‘s=’.urlencode($s) : ‘’, ‘”’, (empty($title)) ? ‘’ : ‘ title=”’.$title.’”’, ‘>’, $thing, ‘</a>’); return join(‘’,$out); } else return; }

function akw_newer($atts, $thing, $match=’‘)
{ global $thispage,$url_mode; if (is_array($atts)) extract($atts); if (is_array($thispage)) { extract($thispage); } else { return $match; }

ob_start(); if ($pg > 1) { $out = array( ‘<a href=”?pg=’.($pg – 1), ($y) ? a.‘y=’.urlencode($y) : ‘’, ($m) ? a.‘m=’.urlencode($m) : ‘’, ($c) ? a.‘c=’.urlencode($c) : ‘’, ($s && !$url_mode) ? a.‘s=’.urlencode($s) : ‘’, ‘”’, (empty($title)) ? ‘’ : ‘ title=”’.$title.’”’, ‘>’, $thing, ‘</a>’); return join(‘’,$out); } else return; } </code> </pre>

Last edited by spchampion (2004-07-11 06:02:39)

Offline

#58 2004-07-16 11:01:27

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: Browsing by date plugin

This same thing is happening when I try to use
<code>
<txp:akw_article_custom_date_aware year=“2004” month=“july” day=“16” form=“titleonly” />
</code>
It’s listing the last 10 articles, not just the one(s) on July 16, 2004.

I tried spchampion’s mod and it didn’t help.

Any ideas anyone?

Thanks.


90+ Textpattern installs and still going…

Offline

#59 2004-07-16 15:04:56

philippo
New Member
From: New Haven, CT
Registered: 2004-05-26
Posts: 7

Re: Browsing by date plugin

There seems to be a bug in akw:archive. Is it possible that it actually reads the date the SQL entry was recorded and uses that to decide what date the article should be published under, instead of the time of posting stored in txp?

I’m on textdrive, which uses UTC internally, but I am EST. I have a post posted at 22:04 on the 13th. In the lists output by akw:archive, it is displayed under the 13th. However, if I click on the 13th, I get an empty page. If, however, I change the post time to 19:04, it does show up correctly.

Any ideas?

Offline

#60 2004-07-16 18:12:40

spchampion
Archived Plugin Author
Registered: 2004-06-10
Posts: 62

Re: Browsing by date plugin

> starzabove wrote:

> I tried spchampion’s mod and it didn’t help.

starzabove, I’m not sure what my mod would have done for you, actually. It just adds two tags called txp:akw_older and txp:akw_newer. I will say that the plugin code for awk_article_custom_date_aware is different from akw_article_date_aware. Unfortunately, I’m not sure why. I also just discovered that the mod I made will not work with article_custom, either (I don’t use the custom tag on my site). I’m a little in over my head on this and I’m not sure I quite understand why it was written this way.

Offline

Board footer

Powered by FluxBB