wrong selection when generating RSS feeds for categories/aut
wrong selection when generating RSS feeds for categories/aut
Hello experts,
new to this forum and using S9Y for while now but recently I faced an issue I got stuck with:
I use 2 types of selections of entries in a sidebar and both types are used for frontend visitors as well as for the RSS feed offer.
These types are
a) entries by categories
b) entries by authors
Both work fine for people just clicking on the sidebar links to get an entry selection in the middle column, but also both fail with the selection when they try to get the selected content as an RSS feed.
Example:
Clicking on the frontend link for category "cat1" delivers only the entries assigned to "cat1". Correct, works nice. But when clicking on the the RSS feed icon for "cat1" the feed contains ALL entries of the blog (no selection done).
Both links for one category look okay, but only the frontend selection link works while always the RSS feed link delivers the whole content of all entries. Selection by categories and by authors works/fails likewise.
Here are the links for the category based selection as generated (pattern):
frontend selection link: http://www.domain.org/string1-categories/1-catname
rss feed selection link: http://www.domain.org/feeds/categories/1-catname.rss
Here are the links for the author based selection as generated (pattern):
frontend selection link: http://www.domain.org/string1-authors/2-realname
rss feed selection link: http://www.domain.org/feeds/authors/2-realname.rss
These get generated following the settings in configuration. No prob at this point.
Just the selection for RSS Links doesn't work.
What could be wrong ?
Thanks in advance !
new to this forum and using S9Y for while now but recently I faced an issue I got stuck with:
I use 2 types of selections of entries in a sidebar and both types are used for frontend visitors as well as for the RSS feed offer.
These types are
a) entries by categories
b) entries by authors
Both work fine for people just clicking on the sidebar links to get an entry selection in the middle column, but also both fail with the selection when they try to get the selected content as an RSS feed.
Example:
Clicking on the frontend link for category "cat1" delivers only the entries assigned to "cat1". Correct, works nice. But when clicking on the the RSS feed icon for "cat1" the feed contains ALL entries of the blog (no selection done).
Both links for one category look okay, but only the frontend selection link works while always the RSS feed link delivers the whole content of all entries. Selection by categories and by authors works/fails likewise.
Here are the links for the category based selection as generated (pattern):
frontend selection link: http://www.domain.org/string1-categories/1-catname
rss feed selection link: http://www.domain.org/feeds/categories/1-catname.rss
Here are the links for the author based selection as generated (pattern):
frontend selection link: http://www.domain.org/string1-authors/2-realname
rss feed selection link: http://www.domain.org/feeds/authors/2-realname.rss
These get generated following the settings in configuration. No prob at this point.
Just the selection for RSS Links doesn't work.
What could be wrong ?
Thanks in advance !
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: wrong selection when generating RSS feeds for categories/aut
Hi!
Yes! The RSS-Feed sidebar plugin is "content unaware". It always points to the central RSS feed. Chances would be that people read a specific category of your blog but want to subscribe to your blog, and maybe wouldn't recognize that they would then only subscribe to the category's rss feed.
What I suggest you to do is to use both the "Authors" and "Categories" sidebar plugins, which all offer RSS-Feed links to each specific author and category.
HTH,
Garvin
Yes! The RSS-Feed sidebar plugin is "content unaware". It always points to the central RSS feed. Chances would be that people read a specific category of your blog but want to subscribe to your blog, and maybe wouldn't recognize that they would then only subscribe to the category's rss feed.
What I suggest you to do is to use both the "Authors" and "Categories" sidebar plugins, which all offer RSS-Feed links to each specific author and category.
HTH,
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/
# 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/
Re: wrong selection when generating RSS feeds for categories/aut
Good morning Garvin,garvinhicking wrote:What I suggest you to do is to use both the "Authors" and "Categories" sidebar plugins, which all offer RSS-Feed links to each specific author and category.
thank you very much for helping, but you got me wrong.
I already use the sidebar plugins you mentioned and the issue is with the RSS links displayed there (within those sidebar boxes). These RSS links are the ones, not working how they probably should.
To clarify: All links (the URIs) get generated according to configuration settings but only the links to browse the frontend deliver selected entries. All RSS links instead look like they were generated right but nonetheless they always deliver unselected content (all entries).
I already digged into everything I could find regarding this but still got no clue what could be wrong there.
Thanks in advance again
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: wrong selection when generating RSS feeds for categories/aut
Hi!
Please give me the actual URL, so I can have a look.
It might be related to your permalinks/URL rewriting.
Regards,
Garvin
Please give me the actual URL, so I can have a look.
It might be related to your permalinks/URL rewriting.
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/
# 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/
Re: wrong selection when generating RSS feeds for categories/aut
Garvin,
I use these event plugins:
- HTML META-Tags
- Sitemap Generator (XML Sitemaps)
- Microblogging
- User Profiles
- My Mood
- Karma
- Polls
- Static Pages
... but the issue with the RSS Links already occured before most of these plugins were installed.
And yes, I use mod_rewrite.
Thanks again for helping
and btw, I really love Serendipity !
I use these event plugins:
- HTML META-Tags
- Sitemap Generator (XML Sitemaps)
- Microblogging
- User Profiles
- My Mood
- Karma
- Polls
- Static Pages
... but the issue with the RSS Links already occured before most of these plugins were installed.
And yes, I use mod_rewrite.
Thanks again for helping
and btw, I really love Serendipity !
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: wrong selection when generating RSS feeds for categories/aut
Hi!
Hm, that's really odd. None of those plugins should actually interfere here, you are right.
Tomorrow I'l try to post you a code that will help us in debugging. It seems the $serendipity['GET']['category'] variable is not properly evaluated inside the rss.php file, and we'll need to see why this could happen.
In some cases, the URL parsing might not work when mod_rewrite does not properly forward all elements to $_SERVER['REQUEST_URI'].
Best regards,
Garvin
Hm, that's really odd. None of those plugins should actually interfere here, you are right.
Tomorrow I'l try to post you a code that will help us in debugging. It seems the $serendipity['GET']['category'] variable is not properly evaluated inside the rss.php file, and we'll need to see why this could happen.
In some cases, the URL parsing might not work when mod_rewrite does not properly forward all elements to $_SERVER['REQUEST_URI'].
Best 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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: wrong selection when generating RSS feeds for categories/aut
Hi!
Okay, so here we go.
Inside your .htaccess you should have a line like this:
This is the rule that should match due to your permalink setup. To check if that rule works, you could modify it to:
then create a test.php file with a simple "Hello world", and then try to call your RSS feed to see if it redirects there.
If that properly works, revert the change and we'll take on the index.php file next. Inside that file at around line 325 you should see:
to test if the RSS feed properly leads there, you can modify it to:
and then save, test the RSS feed URL again and see.
If that also shows the proper output, the next step is to see why the category is not shown. For that, this code exists:
change that to:
This should give us some debug code with which to contiue.
Regards,
Garvin
Okay, so here we go.
Inside your .htaccess you should have a line like this:
Code: Select all
RewriteRule ^(feeds/categories/[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
Code: Select all
RewriteRule ^(feeds/categories/[0-9a-z\.\_!;,\+\-\%]+\.rss) test.php?/$1 [NC,L,QSA]
If that properly works, revert the change and we'll take on the index.php file next. Inside that file at around line 325 you should see:
Code: Select all
} elseif (preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches) || preg_match(PAT_PERMALINK_FEEDAUTHORS, $uri, $matches) || preg_match(PAT_FEEDS, $uri)) {
Code: Select all
} elseif (preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches) || preg_match(PAT_PERMALINK_FEEDAUTHORS, $uri, $matches) || preg_match(PAT_FEEDS, $uri)) {
die('Hello world - RSS feed contents here');
If that also shows the proper output, the next step is to see why the category is not shown. For that, this code exists:
Code: Select all
if (is_array($matches)) {
if (preg_match('@(/?' . preg_quote(PATH_FEEDS, '@') . '/)(.+)\.rss@i', $uri, $uriparts)) {
if (strpos($uriparts[2], $serendipity['permalinkCategoriesPath']) === 0) {
$catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uriparts[2], $matches[1], 'category');
if (is_numeric($catid) && $catid > 0) {
$_GET['category'] = $catid;
}
} elseif (strpos($uriparts[2], $serendipity['permalinkAuthorsPath']) === 0) {
$authorid = serendipity_searchPermalink($serendipity['permalinkFeedAuthorStructure'], $uriparts[2], $matches[1], 'author');
if (is_numeric($authorid) && $authorid > 0) {
$_GET['viewAuthor'] = $authorid;
}
}
}
}
Code: Select all
print_r($matches);
echo "PATTERN: " . PATH_FEEDS . "<br />\n";
echo "URI: " . $uri . "<br />\n";
echo "PAT: " . $serendipity['permalinkCategoriesPath'] . "<br />\n";
echo "PAT2: " . $serendipity['permalinkFeedCategoryStructure'] . "<br />\n";
if (is_array($matches)) {
if (preg_match('@(/?' . preg_quote(PATH_FEEDS, '@') . '/)(.+)\.rss@i', $uri, $uriparts)) {
print_r($uriparts);
if (strpos($uriparts[2], $serendipity['permalinkCategoriesPath']) === 0) {
$catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uriparts[2], $matches[1], 'category');
print_r($catid);
if (is_numeric($catid) && $catid > 0) {
$_GET['category'] = $catid;
}
} elseif (strpos($uriparts[2], $serendipity['permalinkAuthorsPath']) === 0) {
$authorid = serendipity_searchPermalink($serendipity['permalinkFeedAuthorStructure'], $uriparts[2], $matches[1], 'author');
if (is_numeric($authorid) && $authorid > 0) {
$_GET['viewAuthor'] = $authorid;
}
}
}
}
die('Params shown');
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/
# 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/
Re: wrong selection when generating RSS feeds for categories/aut
Thanks a lot, Garvin.
You did much work here.
I'll dig into that this weekend and then post the results.
You did much work here.
I'll dig into that this weekend and then post the results.
Re: wrong selection when generating RSS feeds for categories/aut
Hello Garvin,
I'm awfully sorry for the delay. To be honest, I just was rather overloaded with a complicated migration job the last two weeks. However, thanks a lot for your help. Just right now I went through the steps you propsed.
Here are the results:
I still have the modified lines active in case you might want to test anything using the frontend.

Is there anything I furtheron could do ?
Kind regards
Tom
I'm awfully sorry for the delay. To be honest, I just was rather overloaded with a complicated migration job the last two weeks. However, thanks a lot for your help. Just right now I went through the steps you propsed.
Here are the results:
That worked.garvinhicking wrote: Inside your .htaccess you should have a line like this:
This is the rule that should match due to your permalink setup. To check if that rule works, you could modify it to:Code: Select all
RewriteRule ^(feeds/categories/[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
then create a test.php file with a simple "Hello world", and then try to call your RSS feed to see if it redirects there.Code: Select all
RewriteRule ^(feeds/categories/[0-9a-z\.\_!;,\+\-\%]+\.rss) test.php?/$1 [NC,L,QSA]
If that properly works,
Positiv too.garvinhicking wrote: revert the change and we'll take on the index.php file next. Inside that file at around line 325 you should see:
to test if the RSS feed properly leads there, you can modify it to:Code: Select all
} elseif (preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches) || preg_match(PAT_PERMALINK_FEEDAUTHORS, $uri, $matches) || preg_match(PAT_FEEDS, $uri)) {
and then save, test the RSS feed URL again and see.Code: Select all
} elseif (preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches) || preg_match(PAT_PERMALINK_FEEDAUTHORS, $uri, $matches) || preg_match(PAT_FEEDS, $uri)) { die('Hello world - RSS feed contents here');
Inserting the debug code you provided lead to the following output:garvinhicking wrote: If that also shows the proper output, the next step is to see why the category is not shown. For that, this code exists:
Code: Select all
if (is_array($matches)) {
Code: Select all
Array ( [0] => feeds/categories/2-Mix-Proxy-Malfunctions.rss [1] => 2 ) PATTERN: feeds
URI: /feeds/categories/2-Mix-Proxy-Malfunctions.rss
PAT: mix-proxy-servers-categories
PAT2: feeds/categories/%id%-%name%.rss
Array ( [0] => /feeds/categories/2-Mix-Proxy-Malfunctions.rss [1] => /feeds/ [2] => categories/2-Mix-Proxy-Malfunctions ) Params shown
As I'm no PHP type at all this does not really enlighten me, but almost probably you can get some useful information from this. Hope so howevergarvinhicking wrote: This should give us some debug code with which to contiue.
Is there anything I furtheron could do ?
Kind regards
Tom
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: wrong selection when generating RSS feeds for categories/aut
Hi!
I believe the problem is actually with the categories.
Ypu have feeds/categories/ as permalink path for categories, but /mix-proxy-servers-categories/ as your category path. What I wasn't aware of is that those two have dependencies, so you should try to configure your RSS feed category path as:
feeds/mix-proxy-servers-categories/%id%-%name%.rss
HTH,
Garvin
I believe the problem is actually with the categories.
Ypu have feeds/categories/ as permalink path for categories, but /mix-proxy-servers-categories/ as your category path. What I wasn't aware of is that those two have dependencies, so you should try to configure your RSS feed category path as:
feeds/mix-proxy-servers-categories/%id%-%name%.rss
HTH,
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/
# 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/
Re: wrong selection when generating RSS feeds for categories/aut
Ha !
that did it
And also that works likewise for the authors RSS feed now.
Thanks a lot once more.
Am on my way to http://wishes ...
Tom
that did it
And also that works likewise for the authors RSS feed now.
Thanks a lot once more.
Am on my way to http://wishes ...
Tom
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: wrong selection when generating RSS feeds for categories/aut
Hi!
Great to hear it works! I received your donation - that's very kind of you, I'm gonna spend it in some entertaining stuff.
Best regards,
Garvin
Great to hear it works! I received your donation - that's very kind of you, I'm gonna spend it in some entertaining stuff.
Best 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/
# 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/