Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2004-11-07 07:09:19
- proph3t
- Member
- Registered: 2004-09-26
- Posts: 31
Re: [plugin] [ORPHAN] rss_suparchive - article archive list
Doesnt seem to inlude all of the categories i listed, check it out here:
http://www.holdem-strategy.net
It only shows the first one (holdem intro)..
Last edited by proph3t (2004-11-07 07:11:05)
Offline
#26 2004-11-07 07:20:52
- proph3t
- Member
- Registered: 2004-09-26
- Posts: 31
Re: [plugin] [ORPHAN] rss_suparchive - article archive list
Fixed it, cant have spaces after the commas.. silly me
EDIT: Is there a way for this to display the full article URL instead of the short version?
www.site.com/article/10/the-article
instead of:
www.site.com/article/10
Last edited by proph3t (2004-11-07 07:48:23)
Offline
Re: [plugin] [ORPHAN] rss_suparchive - article archive list
Ok, I’ve found a solution.
If you would like to use this plugin to display an archive of the articles for one particular section and have the list generated at the URL for this section, but also be able to properly display the specific articles in the section, this is what you need to do:
On the page that you have defined to be used for your section, place the following code:
<code>
<txp:if_article_list>
<txp:rss_suparchive section=“SECTIONNAME” dateformat=“F Y” showsection=“1” showcats=“1” showsubdate=“1” class=“aa” addbreak=“1” limit=“1000” />
</txp:if_article_list>
<txp:if_individual_article>
<txp:article />
</txp:if_individual_article>
</code>
You may want to replace
<code>
<txp:article />
</code>
with something like:
<code>
<txp:article form=“Archives” limit=“1000” />
</code>
If you display your archived articles differently than how they’re shown on the frontpage.
You can obviously edit the attributes for the rss_archive plugin to fit your needs. For that matter, you can alter anything to fit your needs, this is just to provide an example. Enjoy.
Last edited by philipashlock (2004-11-07 11:12:08)
Offline
#28 2004-11-07 22:33:48
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] rss_suparchive - article archive list
Killer plugin. Just a note, the URLs are not using the title or url_title in /clean/ mode. Might tweak it so that URLs appear as http://domain.foo/archive/id#/url-title/.
ex:
<code>$title = ($url_title) ? $url_title : stripSpace($title);</code>
You’d probably have to also alter your query to request the url_title as well, as now it’s not currently querying for it. I’m also checking out your query & you could probably simplify it a bit by using Dean’s prefab db accessing funcs in txplib_db.php.
ex:
<code>$res = getRows($query); </code> (pushes results thru mysql_fetch_array so you’ll have access to keys – making your code read easier)
Either way though, bravo. This plugin kicks all sorts of ass.
Last edited by compooter (2004-11-07 23:13:55)
Offline
#29 2004-11-07 22:43:37
- proph3t
- Member
- Registered: 2004-09-26
- Posts: 31
Re: [plugin] [ORPHAN] rss_suparchive - article archive list
Yeah compooter, I would like to have this too. Great work on the plugin though, its on my site now.
Offline
Re: [plugin] [ORPHAN] rss_suparchive - article archive list
Wilshire,
I have a simple improvement to your plugin. This will allow the browsing of a particular category to change the display of the plugin output (but only if a category isn’t specified in the plugin)
Here are the code changes:
<code>
global $path_from_root, $siteurl, $c;
extract($atts);
$section = isset($section) ? $section : “article”;
$category = isset($category) ? doSlash($category) : $c ;
</code>
This is just an excerpt from the top of the plugin. It adds the current category ($c) to the global variables needed and then uses that variable as the “else” condition for the specification of the category attribute.
This is a huge advantage for me because I am using your plugin to display the article list of the articles for a particular section. I also have my site set up to allow you to browse specific categories, but without this modification that does not work with your plugin.
I hope you implement this, it will offer a great benefit for people using your plugin as a section article list and shouldn’t affect any other uses of the plugin.
You can see an example of my usage at:
note: the category links are on the right side menu
Last edited by philipashlock (2004-11-07 23:11:48)
Offline
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.
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
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
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
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.
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