Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#676 2009-10-09 19:22:54

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

Everything is working perfectly with the andcategory attribute.

If I use:

<txp:rss_uc_article_list section="some_section" andcategory="1,2,3" form="some_form" />

I get article that have all categories: 1,2, and 3. Hurray!

I’m now looking into building a navigation system that will allow me to to choose the andcategories on the fly. I need way to call on any combination of categories and then have those dynamically inserted in as values of the andcategory attribute. I’m looking at jquery but have not got very far with that. Something along the lines of passing the css class of a category attribute in as values of andcategory and with the option to also remove them. This would happen per session as I don’t want to alter the form in the DB.

Something like this:

<txp:rss_uc_article_list section="some_section" andcategory="[Container that has values added/removed]" form="some_form" />

Any thoughts?


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#677 2009-10-09 19:34:42

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

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

whaleen wrote:

<txp:rss_uc_article_list section="some_section" andcategory="[Container that has values added/removed]" form="some_form" />

use it:

<txp:rss_uc_article_list section="some_section" andcategory='<txp:any_txp_tags />' form="some_form" />

for sample

<txp:rss_uc_article_list section="some_section" andcategory='<txp:variable name="some_var" />' form="some_form" />

or

<txp:rss_uc_article_list section="some_section" andcategory='<txp:rss_uc_filedunder linked="2" break="," />' form="some_form" />


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#678 2009-10-09 22:37:51

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

I will try:

<txp:rss_uc_article_list section="some_section" andcategory='<txp:rss_uc_filedunder linked="2" break="," />' form="some_form" />

Now if I can pass multiple categories in a URL, like ‘clicking’ two or three categories at the same time so that rss_uc_article_list can show articles that have those two or three andcategorys.

This seems like a concept outside the scope of this plugin. I’d appreciate an recommendations. It my be worth adding the ability to this plugin to pass multiple categories in a URL

I apologize if my approach way off.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#679 2009-10-09 23:25:25

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

It seems that smd_if might be a good plugin to help with changing the values of the andcategory attribute. I hope using that (in some unknown way) brings some success. I fear my head may explode.

Last edited by whaleen (2009-10-09 23:25:53)


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#680 2009-10-10 07:10:15

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

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

whaleen wrote:

Now if I can pass multiple categories in a URL, like ‘clicking’ two or three categories at the same time so that rss_uc_article_list can show articles that have those two or three andcategorys.

Use php code or some plugins for get parametr from URL.

Simple code:

Your URL http://www.domain.com/somepath/page?multi=cat1,cat2,cat3

==<txp:php>$GLOBALS['variable']['multi-category']=$_GET['multi'];</txp:php>==
<txp:rss_uc_article_list section="some_section" andcategory='<txp:variable name="multi-category" />' form="some_form" />

Warning, possible need filtering URL parametrs. This is only sample.

This seems like a concept outside the scope of this plugin. I’d appreciate an recommendations. It my be worth adding the ability to this plugin to pass multiple categories in a URL

It’s a not true way. :)

Last edited by makss (2009-10-10 07:14:29)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#681 2009-10-10 07:43:27

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

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

whaleen wrote:

Now if I can pass multiple categories in a URL, like ‘clicking’ two or three categories at the same time so that rss_uc_article_list can show articles that have those two or three andcategorys.

If your use checkbox and post method.

html form:

<form method="post">
<input type="checkbox" name="v[]" value="cat1" />
<input type="checkbox" name="v[]" value="cat2" />
...
<input type="submit" value="Submit" />
</form>

article code:

==<txp:php>
if($_POST['v']){
	$GLOBALS['variable']['multi-category']=implode(',',$_POST['v']);
}
</txp:php>==
<txp:rss_uc_article_list section="some_section" andcategory='<txp:variable name="multi-category" />' form="some_form" />

aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#682 2009-10-10 09:59:42

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

It’s a not true way. :)

And it is too complicated and verbose I found. I did learn a lot about variable in the last day or two. :)

The following is a great solution:

<form method="post">
<input type="checkbox" name="v[]" value="cat1" />
<input type="checkbox" name="v[]" value="cat2" />
...
<input type="submit" value="Submit" />
</form>

to

==<txp:php>
if($_POST['v']){
	$GLOBALS['variable']['multi-category']=implode(',',$_POST['v']);
}
</txp:php>==
<txp:rss_uc_article_list section="some_section" andcategory='<txp:variable name="multi-category" />' form="some_form" />

Thanks!


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#683 2009-10-22 22:27:53

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

I have headings whose text are generated from the categories to which it’s article belongs. If an article belongs to 2 of 3 available categories then those category names build the heading text. Often times, depending on what articles you are looking at, there are several of the same headings – as some of the articles in the list share the same heading (“title”).

I’d like to remove all but the first occurrence.

So that:

<h2>CategoryA CategoryB</h2>
<p>stuff</p>
<h2>CategoryA CategoryB</h2>
<p>stuff</p>

becomes:

<h2>CategoryA CategoryB</h2>
<p>stuff</p>
<p>stuff</p>

I’m looking into making the <h2>CategoryA CategoryB</h2> block a function which kills itself after one time. This would potentially run a hundred times per page load.

Any thoughts on this?


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#684 2009-10-22 22:49:04

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Take a look at txp:if_different


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#685 2009-10-22 22:55:18

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

MattD wrote:

Take a look at txp:if_different

Thank you Matt. I had just written up a whole mess of code and figured on another hour before I could get it working.

It can be so simple sometimes. :)


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#686 2009-11-09 06:11:00

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

I’m using sortby on a custom_field to order my article lists. The custom field contains a number. For the following 7 articles I get this order:

10
3
4
41
5
6
9

It is obviously order by the first digit. Is their a way to get:

3
4
5
6
9
10
41

Beyond that, I sometimes have alphanumeric input like:

1a
1b
3e
3f

Ideally a fix for the first issues would also allow for these alphanumeric bits too.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#687 2009-11-09 06:20:31

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

whaleen wrote:

I’m using sortby on a custom_field to order my article lists.

sort="custom_1+0" sorts it as integer. Tho, u use it to store strings also.

Offline

#688 2009-11-09 06:27:15

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

sort="custom_1+0"

Yes! Thank you.

Tho, u use it to store strings also.

Oh, such as: 1a, 1b, 3e, 3f?

I wonder if there is a way to do both? Seems not. :(

Edit: When using custom_1+0 It appears to also respect letters. BUT, I fear that it is only falling back on using LastMod to sort when letters are present. I don’t know if that is how it works but it seems that it does.

Last edited by whaleen (2009-11-09 06:32:57)


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#689 2009-11-11 03:55:02

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

categorylogic="AND" appears to not be working. I’m up to the most recent patch. 0.7.4p13b

I use a series of these (one per each city / ‘bee-cave’ in this instance):

<txp:rss_uc_article_list
section=“centraltexas”
andcategory=“bee-cave,planning-zoning-commission”
category=“architecture”
categorylogic=“AND
form=“report_item_centraltexas”
time=“any”
sortby=“custom_12+0”
sortdir=“asc”
filter=“1”
filterfield=“custom_13”
filtername=“pubdate”
/>

etc… (up to 20 or 30 of these listed consecutively in a page, one for each city)

  1. category is loaded from a posted variable and matches an existing rss_unlimited_cat. architecture in this case.
  2. The filter is a date stored in custom_13 so in the URL you’ll have site_name.com/pubdate/eq/2009-11-09 and all articles that have 2009-11-09 in custom_13 are shown. This appears to always work.

Problems:

  1. Upon posting a category, some cities will show all articles that belong to that selected category even when the andcategory categories are not matched. The filter is still adhered to.
  2. Upon posting a category, some cities display articles which do not belong to that category.

It’s difficult to isolate the problem because some work and some don’t and there is nothing different about each one except the category that gets posted.

Question:

categorylogic="AND" appears to not be working. Is this true?

Tag trace for previously posted code:

<txp:rss_uc_article_list
section=“centraltexas”
andcategory=“bee-cave,planning-zoning-commission”
category=“architecture”
categorylogic=“AND
form=“report_item_centraltexas”
time=“any”
sortby=“custom_12+0”
sortdir=“asc”
filter=“1”
filterfield=“custom_13”
filtername=“pubdate”
/> [SQL (0.00024604797363281): 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 1=1 AND ( (section = ‘centraltexas’) ) AND Status=4 AND ( cat.name = ‘architecture’ ) AND custom_13 = ’2009-11-09’ ] [SQL (7.0810317993164E-5): 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 1=1 AND ( (section = ‘centraltexas’) ) AND Status=4 AND ( cat.name = ‘bee-cave’ OR cat.name = ‘planning-zoning-commission’ ) AND custom_13 = ’2009-11-09’ GROUP BY t.ID HAVING count(*)=2] [SQL (0.00022196769714355): select count(*) from textpattern where 1=1 AND ID in(899,898,900,901,902,903,904,907,908,909,910,911,912,913,914,915,922,923) AND ID<>’‘] [SQL (0.00081181526184082): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 AND ID in(899,898,900,901,902,903,904,907,908,909,910,911,912,913,914,915,922,923) AND ID<>’‘ ORDER BY custom_12+0 asc limit 0, 999]


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#690 2009-11-25 21:20:30

hal.subs
New Member
Registered: 2009-11-12
Posts: 4

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

I am getting an error when trying to download this plugin? Not sure if this is the place to post this?
“Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ‘)’ in /home/wilshone/public_html/stats/var/last.php on line 91”

Offline

Board footer

Powered by FluxBB