Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#286 2006-09-10 07:46:37

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

ankar wrote:

after I upgraded to 0.5 from 0.3 the rss_unlimited_categories_related tag does not work. I get the most recent articles instead. My textpattern version is 4.0.3. <br><br>I use the tag inside a <txp:if_individual_article> section like this: <txp:rss_unlimited_categories_related form="related_article_links" label="My Label:" limit="10" offset="1" /><br><br>Anyone with a similar problem?

I had the same problem as long as I put the rss_unlimited_categories_related on the page (i.e. where the chh_related_articles tag I was replacing had always functioned perfectly).
In debugging mode, I got this error message:

<code>
tag_error <txp:rss_unlimited_categories_related sortby=“title” section=“mysection” form=“myform” /> -> Textpattern Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 3
SELECT c.title, c.name FROM textpattern_category as tc LEFT JOIN txp_category as c ON tc.category_id = c.id WHERE article_id= on line 61
</code><br/>

It works fine now that I’ve moved rss_unlimited_categories_related to the form instead (the form that turns out the article it’s relating to). But of course that won’t work in every layout.

PS:

If it helps, this is the process as shown in the source code:

<code> <txp:rss_unlimited_categories_related sortby=“title” section=“mysection” form=“myform” /> [SQL (0.002049): SELECT c.title, c.name FROM textpattern_category as tc LEFT JOIN txp_category as c ON tc.category_id = c.id WHERE article_id=] [SQL (0.004145): SELECT DISTINCT t.ID FROM textpattern as t LEFT JOIN textpattern_category as tc ON t.ID = tc.article_id LEFT JOIN txp_category as cat ON cat.id = tc.category_id WHERE Status=4 and Posted <= now() AND ( (section = ‘mysection’) ) ]
</code><br>

With rss_unlimited_categories in the form, it turns out this:

<code>
<txp:rss_unlimited_categories_related sortby=“title” section=“mysection” form=“myform” /> [SQL (0.000186): SELECT c.title, c.name FROM textpattern_category as tc LEFT JOIN txp_category as c ON tc.category_id = c.id WHERE article_id=5] [SQL (0.000373): SELECT DISTINCT t.ID FROM textpattern as t LEFT JOIN textpattern_category as tc ON t.ID = tc.article_id LEFT JOIN txp_category as cat ON cat.id = tc.category_id WHERE Status=4 and Posted <= now() AND ( (section = ‘mysection’) ) AND ( cat.name = ‘mycategory’ ) ]
</code><br>

Sooo… when I use rss_unlimited_categories_related on a page, it doesn’t seem to pick up on the category of the article, and causes a syntax error. It shows this on my local installation as well as on my hosted site. I first thought I had somehow missed the instruction that this tag is only to be used in forms, and not on pages like you can do with related_articles (and chh_related_articles), but if used to be possible in 0.3, then there might be a bug here…

Last edited by M_i (2006-09-10 08:15:26)

Offline

#287 2006-09-10 08:26:27

ankar
Member
From: Larissa, Greece
Registered: 2005-10-02
Posts: 29
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

@guitarman
Thanks for your response.

@M_i
I tried the debugging mode and I get the same error. I will try to do something similar. Thanks a lot!

The 0.3 version worked fine when I used the tag outside a form, directly in the page layout. The new behaviour could be a bug of the 0.5 version.

Last edited by ankar (2006-09-10 08:34:53)

Offline

#288 2006-09-15 18:59:17

RafaNevarez
New Member
From: Guayaquil - Ecuador
Registered: 2006-08-24
Posts: 3
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

This is another Custom Mod i made to the plugin :

I added this when You want to create a “Popup List” and then use Javascript to change the page location, lets say:
<code>
<select onChange=“location.replace(this.value)”>
<option value=”/path/to/category”>Category Name</option>
<option value=”/path/to/category2”>Category 2 Name</option>
</select>
</code>

I edited the rss_unlimited_categories_list function (to use: Edit this part of the Plugin and replace)

Hope this helps someone :)

function rss_unlimited_categories_list($atts) { extract(lAtts(array( ‘section’ => ‘’, ‘time’ => ‘past’, ‘parent’ => ‘’, ‘showcount’ => 1, ‘countlinked’ => 1, ‘linktosection’ => ‘article’, ‘listwraptag’ => ‘’, ‘break’ => ‘li’, ‘wraptag’ => ‘ul’, ‘label’ => ‘’, ‘labeltag’ => ‘’, ‘class’ => ‘’, ‘breakclass’ => ‘’, ‘sortdir’ => ‘asc’, ‘activeclass’ => ‘’ ),$atts));

$sections=rssBuildSctSql($section); $time = rssBuildTimeSql($time);

$prnt = ($parent) ? “ WHERE parent = ‘$parent’ “ : “”; $rsc = getRows(“SELECT distinct c.id, c.name, c.title FROM “.PFX.“textpattern_category as tc LEFT JOIN “.PFX.“txp_category as c ON tc.category_id = c.id “.$prnt.“ORDER BY c.name “ .$sortdir);

if ($rsc) { global $c; // Custom Mods by Rafael Nevarez

$row = array(); foreach ($rsc as $a=>$b) { $aq= “SELECT *, unix_timestamp(Posted) as uPosted FROM “.PFX.“textpattern as t LEFT JOIN “.PFX.“textpattern_category as c ON t.ID = c.article_id WHERE “.$sections.” c.category_id = ‘“.$b[‘id’].”’ and t.Status = 4 “.$time.” ORDER BY t.title”; $rsa = getRows($aq); if ($rsa) { $path = hu.$linktosection.”/”.strtolower($b[‘name’]); $count = ($showcount) ? “ (“.count($rsa).”) ” : “”;

// Rafael Nevarez: Added condition for “option” break (PopupList list) if ( $break==“option” ) { $row[] = tag(htmlspecialchars($b[‘title’]),‘option’,’ class=”’. ($c $b['name'] ? $activeclass : '') .'" value="' . $path . '" title="' . htmlspecialchars($b['title']) . '"'); } else{ $row[]=($countlinked) ? tag(htmlspecialchars($b['title'].$count),'a',' class="'. ($c$b[‘name’] ? $activeclass : ‘’) .’” href=”’.$path.’” title=”’.htmlspecialchars($b[‘title’]).’”’) : tag(htmlspecialchars($b[‘title’]),‘a’,’ class=”’. ($c==$b[‘name’] ? $activeclass : ‘’) .’” href=”’ . $path . ‘” title=”’ . htmlspecialchars($b[‘title’]) . ‘”’) . $count; } } }

$break = ( $break == “option” ? ‘’ : $break ); // PopupList CleanUp return doTag(doLabel($label, $labeltag).doWrap($row, $wraptag, $break, $class, $breakclass), $listwraptag).n; } return ‘’; }

Last edited by RafaNevarez (2006-09-15 20:02:30)

Offline

#289 2006-09-20 03:42:21

DaveR
Member
From: Dunedin, New Zealand
Registered: 2004-04-20
Posts: 13

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

Hi,

I’m using rss_unlimited_categories_list quite successfully, but I’d like to know if there is a way to alter the fuctionality to list categories that have no linked articles. That is, I’m using the showcount attribute to display the number of articles tagged with each category, but categories with no articles don’t appear in the list. I would like them to appear as:

myCategory (0)

I have played with the php code but haven’t yet found an easy way to this. Is it possible?

And as an aside, what does the countlinked attribute do?

Thanks
Dave

Last edited by DaveR (2006-09-20 10:15:49)

Offline

#290 2006-09-25 23:09:09

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

am i overlooking something obvious or how are you guys dealing with previous/next-article navigation? normally <code><txp:link_to_next></code> is context sensitive, so that it stays inside the current category, but as rss_unlimited_categories uses a different table for the categories this seems not to do the job. so again, i would like to click on a category /section/foobar, see an overview of articles in foobar, then select one and being able to browse automatically to the next/previous article that is in the category foobar. any ideas?

Offline

#291 2006-09-29 19:08:40

leohart
Member
Registered: 2006-02-09
Posts: 22

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

I can’t get /section/categories URL to work. My textpattern installation is in sub-folder -> /~myname/cms

Other functionalities seem to work: I can output categories that each article belongs to, permlink to those, but no go with clean URL.

Help please anyone?

Offline

#292 2006-09-29 21:21:13

leohart
Member
Registered: 2006-02-09
Posts: 22

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

Nevermind my previous post. After some debugging on a clean installation, it is now clear to me that I need to use txp:rss_unlimited_categories_article_list instead of txp:article_custom.

I wish that tags can somehow be shorted _.

I have also found another issue. rss_sct_permlink doesn’t seem to output the link correctly since I 404 on all those links.

Link is of format: /section/categories/url_title

Could this be an issue with .htaccess?

Also, when listing all article in a section (without specifying a category), I get the permlink (from rss_sct_permlink) as /section//url_title

Is this a bug in the plugin or am I missing something?

Last edited by leohart (2006-09-29 22:25:21)

Offline

#293 2006-09-30 13:41:08

leohart
Member
Registered: 2006-02-09
Posts: 22

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

Here is my .htaccess file
<code>
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
RewriteBase /textpattern/

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule>

#php_value register_globals 0

</code>

a small part of “news” page
<code>
<div id=“navigation”>
<h2>Categories (available)</h2>
<txp:rss_unlimited_categories_list section=“news” linktosection=“news” />
</div>
<div id=“content”>
<txp:rss_unlimited_categories_article_list section=“news” limit=“100” form=“news_listing” />
</div>
</code>

Form “news_listing”

<code>
<h1><txp:title /></h1>
<txp:body />
<p>Categories: <txp:rss_unlimited_categories_filedunder linktosection=“news” /></p>
<p><txp:rss_sct_permlink>Link to this article</txp:rss_sct_permlink></p>
</code>

Offline

#294 2006-10-01 14:15:36

davej
Member
From: Ireland
Registered: 2005-11-01
Posts: 27
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

I am having problems linking to category pages, When I click on the category link I simply get a blank template whereas I would expect all articles filed under that category to be listed where my <txp:article> tag is

Have a look at my archives page and try clicking on any of the categories. Has anybody got any ideas as to what may be wrong?

Offline

#295 2006-10-01 14:17:58

leohart
Member
Registered: 2006-02-09
Posts: 22

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

Hi davej,

Have you tried using txp:rss_unlimited_categories_article_list instead of normal txp:article_custom / txp:article.

Offline

#296 2006-10-01 14:24:48

davej
Member
From: Ireland
Registered: 2005-11-01
Posts: 27
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

Yeah, I’ve tried that but it outputs all of my journal entries and not just the ones filed under the specific category.

Offline

#297 2006-10-01 19:26:02

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

I’m having an extremely odd problem with this plugin – when I click on an article (which just happens to be a journal entry), it lists all articles (in single article form, one after another) except the one I click.

For example, if there are three articles named AAA, BBB and CCC, if I click BBB I get articles AAA and CCC displayed on the same page.

Journal ‘page’ code, to replace normal article tag – uses ‘article-journal’ form.
<code>
<div id=“sidebar”>
<h2>Journal Categories</h2>
<txp:rss_unlimited_categories_list section=“journal” linktosection=“journal” showcount=“0” />
</div>
<div id=“content”>
<txp:rss_unlimited_categories_article_list form=“article-journal” />
</div>
</code>

And the ‘article-journal’ form:
<code>
<txp:if_individual_article>
<h2><txp:title /></h2>
<p>Tags: <txp:rss_unlimited_categories_filedunder linktosection=“journal” /></p>
<txp:body />
</txp:if_individual_article>
<txp:if_article_list>
<h2><txp:permlink><txp:title /></txp:permlink></h2>
</txp:if_article_list>
</code>

The listings for each category work fine, it’s just when I click on an article that things start to get weird.

I use the latest pre 4.0.4 release (r1788), and plugin version 0.5. Help would be very much appreciated!

EDIT: Fixed

I changed the above page code (inside the content div) to this:

<code>
<txp:if_article_list>
<txp:rss_unlimited_categories_article_list form=“article-journal” />
</txp:if_article_list>
<txp:if_individual_article>
<txp:article />
</txp:if_individual_article>
</code>

Last edited by rossharvey (2006-10-01 19:35:17)

Offline

#298 2006-10-05 00:37:55

brian.zollinhofer
Member
From: Virginia
Registered: 2006-07-10
Posts: 24
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

I may have just missed this while skimming through this thread, but I don’t understand how to get the article’s body to actually show up. For instance, one of my categories is “frontpage”. If I give that category to an article, I want that article’s body to show up on the frontpage. All the tags I have seen are for lists, not for actual body content.

I’m sure this is quite simple, I just can’t find it…


Zollinhofer.com

“It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt.”
- Mark Twain

Offline

#299 2006-10-05 04:17:31

leohart
Member
Registered: 2006-02-09
Posts: 22

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

Hi Brian,

You would use txp:rss_unlimited_categories_article_list to list all article that belongs to your specified category (‘frontpage’ in your case)

Usage is similar to this: (please see rss_unlimited_categories plugin documentation for syntax)
<code>
<txp:rss_unlimited_categories_article_list category=“frontpage” form=“your_form_name” />
</code>

Then in ‘your_form_name’ form, you would use
<code>
<txp:body />
</code>

to list the article body each time the top article list code iterate through the list. Does this answer your question?

Offline

#300 2006-10-05 04:34:42

brian.zollinhofer
Member
From: Virginia
Registered: 2006-07-10
Posts: 24
Website

Re: [plugin] [ORPHAN] rss_unlimited_categories - Unltd. Article Categories

yeah, that makes sense. Thanks.


Zollinhofer.com

“It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt.”
- Mark Twain

Offline

Board footer

Powered by FluxBB