Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2004-11-08 04:00:22

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Thanks for the suggestions philipashlock, compooter and proph3t. I’ve released version 0.4 based on all of your comments.

Updated Docs

Download

Version 0.4
  • Added title to article URL
  • Use global category if set
  • Converted query to use getRows()

Offline

#32 2004-11-08 04:37:48

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Thanks, wilshire—you rock.

Offline

#33 2004-11-08 06:55:51

philipashlock
Member
From: Bellingham, Washington - USA
Registered: 2004-06-20
Posts: 58
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Another update for this plugin…..

This collaboration is wonderful. Thank you wilshire and others for continuing to make this much needed plugin a reality. I’m going to help you take it even further. This is a “superarchive” plugin, so we might as well add the ability to filter the archive by author.

I’ve made it so that the archives will only list entries by a particular author if that author’s AuthorID is specified with the author attribute OR if the AuthorID is in the URL.

For an example of this in action, you can click on the author names for each article on my website. Note: on the front page the author names are just below the article title.

www.auraluna.org
  
  
  
In order to get the AuthorID in a URL, I had to create a little plugin to grab the AuthorID for a particular article. I then used this to create a link for that author. So I used my pfa_author_id plugin to generate an author archive link in an article like this:

<code>
<a href=”/archives/?author=<txp:author_id />”><txp:author /></a>
</code>

So it points to the section where I am using rss_superarchive and specifies the author attribute through a GET variable.

The modified code for the rss_superarchive looks like this (an excerpt from near the top of the plugin):

<code>
$subdateformat = isset($subdateformat) ? $subdateformat : “d”;
$subdatesep= isset($subdatesep) ? $subdatesep: “: “;
$limit= isset($limit) ? $limit: “”;
$author = isset($author ) ? $author : gps(‘author’);

foreach (explode(‘,’, $section) as $section) { $sctsql[] = “ (section = ‘” . doSlash($section) . “’) “;
}
$sections = ‘ (’ . join(’ OR ‘, $sctsql) . ‘) ‘;

foreach (explode(‘,’, $category) as $category) {
if ($category) $catsql[] = “ (category1 = ‘” . doSlash($category) . “’) OR (category2 = ‘” . doSlash($category) . “’) “;
}
if ($catsql) $categories = ‘ AND (’ . join(’ OR ‘, $catsql) . ‘) ‘;
if ($author) $author = “AND AuthorID=’$author’”;

$where = “status=4 AND $sections $categories AND posted < now() $author ORDER BY posted desc”;
if ($limit) $where.= “ LIMIT $limit”;
$res = safe_rows(“id, title, unix_timestamp(posted) as posted, section, category1, category2, url_title”,“textpattern”, $where);
$lastd = date($dateformat, “0”);

$output[] = “<dl”;
$output[] = isset($class) ? “ class=\”$class\”“ : “”;
$output[] = isset($id) ? “ id=\”$id\”“ : “”;
$output[] = “>”;
</code>

Wilshire, I hope you can add this functionality as easily as you added the last modification I provided. I think you know php and textpattern a lot better than I do, so you might see some benefitial modifications needed. It should work fine though and it shouldn’t hinder anyone if they don’t plan to use it.

There still is room for refinement and additional flexibility. It would be nice to be able to use clean URL’s for one thing. I think it’s also pretty easy to use the method used in rss_superarchive to generate an archive listing by author rather than by date.

Any feedback would be most appreciated. Enjoy.

Last edited by philipashlock (2004-11-08 07:01:02)

Offline

#34 2004-11-08 07:36:49

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Thanks for this great plugin, and for the new version! I still use a hacked version of the first release on my archive but will update it soon.

But there is one hack that i still have made that might interest someone else, and that is displaying the month in swedish instead of english, this hack will work for all out there that want to display the mounth in your own language.

Here is what i did:

add this function to the plugin code
<code>
function glx_get_month($date)
{ $month = array(“Januari”,“Februari”,“Mars”,“April”,“Maj”,“Juni”,“Juli”,“Augusti”,“September”,“Oktober”,“November”,“December”); for($i=1; $i<=12; $i++) { if ($date[“mon”]==$i) { return $month[$i-1]; } }
}
</code>

comment out
<code>
$date = date($dateformat,$a2);
</code>

And replace it with this
<code>
$getDate = getdate($a2 + $timeoffset);
$date = glx_get_month($getDate).” “.date(‘Y’, $a2 + $timeoffset);
</code>

once again thanks for this plugin, this is what i have been looking for but been to lazy to do self :)

edit: textile just destroyd my code… if you are intrested in this then send me a email, later i will probably write something about it on my page…

Last edited by osei (2004-11-08 07:45:14)


Johan Nilsson

Offline

#35 2004-11-08 14:53:24

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Just an idea here, maybe it would be nice to add a switch to link it to the <code><txp:akw_article_date_aware/></code> plugin. That way your months and years would be linkable too. Of course it requires that the user put the date aware tag on the section page, but you could make that pretty explicit in the instructions. I was thinking of doing the same thing to my quick and dirty archive plugin, but this one is much nicer and feature-full.

It’d be primarily used for the mode where this is a month and year and then a list of date : article_title permalink. I think anyway. That’s how I would use it.

A few more features and you’ll end up with the emacs of plugins :).

Offline

#36 2004-11-09 01:49:20

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Another day, another list of suggestions, another version. FYI – the file size is getting big so the download is now in zip format.

Updated Docs

Download

Version 0.5
  • Added support for messy URLs on article, section and category links
  • Added author, showauthor and authorsep attributes based on philipaslock’s author filter

Great suggestions Philip. I took what you did and enhanced it a little.

  • The author attribute accepts a comma separated list of author ids. The author id in the query string overrides this as in philip’s enhancement.
  • The showauthor attribute when set to true will generate a link based on the article author. The link will filter the archive by the author that is clicked.
  • The authorsep attribute appears before the author name.
  • The messy URL support was added based on a request on my site from Holger.

I don’t actually use messy URLs but I tested things out. If anyone trys to use it extensively let me know how it works.

I’m also still planning to take a look at forms support, Remillard’s suggested integration with akw_date_aware and Johan’s internationalized date addition.

Keep that feedback coming in…

Offline

#37 2004-11-09 02:58:47

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Nice plugin;

One question: is it possible that have the output spread over multiple pages ? Let’s say I set a limit=“50”, but I have 300 articles in a specific section or category. As it is now, the plugin will only list the 50 most recent articles; is it possible to have a ‘next page’ link to list the subsequent 50 articles, and so on.
I tried using the [txp:newer /] and [txp:older /] tags, but that didn’t seem to do it.

Also, would it be possible to include an exerpt from the article, ie
article title
article exerpt
filed under….


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#38 2004-11-09 15:18:08

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

phiw13 – As of now, neither is possible. If I can get forms support integrated into the plugin then you would be able to use paging and define your own form where you could display the excerpt.

Offline

#39 2004-11-09 16:32:11

Tae
Member
From: nyc
Registered: 2004-08-25
Posts: 20

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

great plugin.. question tho (btw, i’m kinda new to txp so forgive my ignorance)..

i don’t see much difference in terms of functionality between an article list (that’s used on homepages and section pages) and archive pages – to me its mostly just a matter of formatting. i’d love to be able to use one tag (with a plugin like this) for both my article lists and archive lists. so if you add forms support and added the features that phiw13 asked about (i would like pagination too), i think it could be used for both. so it wouldn’t just be a superarchive lister, but a super lister period. maybe i’m way off base, dunno.

Offline

#40 2004-11-09 17:11:21

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

I think you’re exactly right Tae. When I started this it was really intended to be an archive plugin. It has evolved into much more.

One of the things that always concerned me was the fact that I needed to install different plugins for different types of lists. I too would like to be able to use this for all article lists whether current, archive, related, recent, etc.

Hopefully I’ll be able to add the forms support soon.

Offline

#41 2004-11-12 18:49:12

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

phiw13, Tae, Manfre, gonzo, et al.,

The rss_suparchive now supports the use of forms and paging.

Here’s a quick run through. When using the “form” attribute the only other valid options are section, category, author and limit. When in forms mode, limit refers to the number of articles that show on a page. The <code><txp:older></code> and <code><txp:newer></code> tags can be used for paging.

Enjoy!

Updated Docs

Example 5 in the lab

Download

Version 0.6
  • Added support for forms using the form attribute.

Last edited by wilshire (2004-11-12 18:49:55)

Offline

#42 2004-11-12 19:16:46

Remillard
Plugin Author
From: Lenexa, KS
Registered: 2004-05-16
Posts: 169

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

This is very cool. I would suggest one ‘feature’ though. Sometimes TXP displays a little status line on the very first line (Page default saved, Article saved as Pending, etc.) I think these are getting blocked. Is there any way to have them still show up in the header?

Whups, this is actually in the wrong thread! So sorry.

Last edited by Remillard (2004-11-12 20:00:04)

Offline

#43 2004-11-12 20:01:24

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Phew, you had me quite confused there for a minute. I was just getting ready to respond with a huh?

I figure you’re headed to the QuikPik thread. I’m right behind you.

Offline

#44 2004-11-13 00:01:46

proph3t
Member
Registered: 2004-09-26
Posts: 31

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

Thanks! Awesome job. It’s used in two places on <a href=“http://www.holdem-strategy.net”>Holdem-Strategy</a> now, in the recent articles on the right and in the archives link from the bottom.

Last edited by proph3t (2004-11-13 00:02:39)

Offline

#45 2004-11-13 01:26:43

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

Re: [plugin] [ORPHAN] rss_suparchive - article archive list

wilshire,
your samples look darn good. I’ll have to play a bit know :-)

Thanks, P.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

Board footer

Powered by FluxBB