Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#61 2005-11-06 16:44:11
- boblet
- Member
- Registered: 2005-08-08
- Posts: 53
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
Hey Wilshire,
Is there any chance that the category (or is it categories?) attribute from rss_suparchive
could be added to rss_suparchive_bycat
? (the plugin help for rss_suparchive
refers to the attribute as “category” but uses “categories” in the code example btw ;-) I’m looking to make a list of category links using showcatsonly="1"
, but there’s some I want to exclude (a couple of my categories are used for post language).
If there’s an obvious way to do this I’m missing please let me know
peace – boblet
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
Is there a way to change the sort order with rss_suparchive_bycat (as in make in ascending instead of descending)?
bludrop studios .::. Creative Expression
Offline
#63 2005-11-15 05:17:12
- boblet
- Member
- Registered: 2005-08-08
- Posts: 53
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
> blumie607 wrote:
> Is there a way to change the sort order with rss_suparchive_bycat (as in make in ascending instead of descending)?
try the methods discussed in sorting article lists – they are for txp:article_custom
but should work with this too
peace – boblet
PS try something like this: sortby="extract(day from Posted) ASC"
Last edited by boblet (2005-11-15 05:41:27)
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
I tried these sortby="Posted" sortdir="asc"
and they didnt work.
It works for rss_suparchive, I think, but not for rss_suparchive_bycat
Last edited by blumie607 (2005-11-15 05:31:06)
bludrop studios .::. Creative Expression
Offline
#65 2005-11-15 05:38:05
- boblet
- Member
- Registered: 2005-08-08
- Posts: 53
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
How to make a list of articles that match the current article’s Category1 AND Category2, eg for a “what’s related” list on an individual article, when using Cat1 for article category and Cat2 for article language.
I wanted to list ‘related’ articles that match both categories of the current article – anything that’s in the same category and has the same language. useartcat1/2
lists match only one category (ie will give both language versons), and useartcats
list articles matching either Category1 or Category2 (ie everything in the same language from any category in addition to the same Category1). Here’s what I changed (/hacked/butchered…)
from $rsc = getRows($q,"");
to
<code>$rsc = getRows($q,”“);
$rscCat2 = $rsc[‘0’]; // the array order is reversed, so the first object is actually Category2
$rscCat1 = $rsc[‘1’];</code>
and from $scsql = $noidsql. " (category1 = '" . doSlash($catname) . "' or category2 = '" . doSlash($catname) . "')" .$secsql. " AND status=4 $posted ORDER BY section, posted desc";
to
<code>$scsql = $noidsql. “ (category1 = ‘” . doSlash($rscCat2[‘name’]) . “’ AND category2 = ‘” . $category2 . “’)” .$secsql. “ AND status=4 $posted ORDER BY category1, posted desc”;</code>
I call it using useartcat1
which matches the article’s category, then added the article’s $category2
to restrict to articles in the same language:
<txp:rss_suparchive_bycat form="a-recent-articles" showcats="0" section="articles" useartcat1="1" wraptag="ul" />
no doubt ugly, but it’s working. Note that this might stuff up other plugin functions, as $catname
is used in some other places. Now I’ll need to hack in category attribute support for category lists I guess :-/
peace – boblet
PS Wilshire, there’s only extract($atts);
at the top of function rss_suparchive_bycat
, so initially I was getting lots of errors. Adding extract($pretext);
seemed to help things – it’s in function rss_suparchive_menu
, but not function rss_suparchive_bycat
.
Last edited by boblet (2005-11-15 05:47:08)
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
I’m trying to use this plugin to limit the number of sections in the list but everytime i enter section=“anything” it displays nothing. Anyone have an idea of why this could be happening? Thanks.
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
Wilshire — great plugin. It works like a charm.
The only thing I wish was implemented was the ability to sort posts (and categories too i guess) by alphabetical order. I’m suspecting a lot of people are using textpattern (and this plugin) for other stuff than simple blogs. An alphabetical list of articles by topic (category) would seem quite natural for such a plugin. Is there a way to easily hack this into it?
Anyways, keep up the good work. Happy holidays.
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
edemay – Find this line:
<code>$scsql = $noidsql. “ (category1 = ‘” . doSlash($catname) . “’ or category2 = ‘” . doSlash($catname) . “’)” .$secsql. “ AND status=4 $posted ORDER BY section, posted desc”;</code>
and change the order by clause. To order by title, use this:
<code>$scsql = $noidsql. “ (category1 = ‘” . doSlash($catname) . “’ or category2 = ‘” . doSlash($catname) . “’)” .$secsql. “ AND status=4 $posted ORDER BY section, title”;</code>
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
Thanks wilshire, just what I was missing. Works like a charm!
Offline
#70 2006-04-03 22:32:46
- Cowboy_X
- New Member
- Registered: 2004-10-27
- Posts: 4
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
Is there a way to use suparchive to show posts by a particular author? I tried…
txp:rss_suparchive author=“joe” /
…and didn’t get anywhere. Actually, I can’t figure out what that author attribute does at all.
Offline
Re: [plugin] [ORPHAN] rss_suparchive_bycat - related articles by category
HELP!
Suparchive_bycat is doing something real weird. On a certain section (events), it is only showing TWO categories. I do not understand why this is happening. It is fine with a different section (news), and it is fine with suparchive. But, for some reason, suparchive_bycat is restricting itself, on this particular section, to only 2 categories (instead of many more).
If you could let me know what’s wrong, that would be great. If you want to see the site, wilshire, you can email me…
THANKS!
bludrop studios .::. Creative Expression
Offline