Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#433 2007-06-18 14:17:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

Daniel/dbulli, you can do that query a lot faster if you let MySQL do the counting, remove ordering by time and replace the left join with an inner join (not tested):

if($showcount)
{
	$count = getThing("SELECT COUNT(*) FROM ".PFX."textpattern as t INNER JOIN ".PFX."textpattern_category as c ON t.ID = c.article_id WHERE ".$sections." c.category_id = '".$b['id']."' and t.Status = 4 ".$time);
	$path  = hu.$linktosection."/".strtolower($b['name']);
	$count = ($showcount) ? " (".$count.") " : "";
	$row[] = ($countlinked) ?
		tag(htmlspecialchars($b['title'].$count),'a',' href="'.$path.'" title="'.htmlspecialchars($b['title']).'"') :
		tag(htmlspecialchars($b['title']),'a',' href="' . $path . '" title="' . htmlspecialchars($b['title']) . '"') . $count;
}

And I wouldn’t be surprised if it’s possible to get all those counts in the same query that retrieves the list of categories.

Last edited by ruud (2007-06-18 14:20:12)

Offline

#434 2007-06-18 14:53:03

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

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

ruud … absolutely brilliant … the original query wasn’t mine, but my tweak was if i didn’t want (mainly because it took so long) “showcount=1” why bother do all the queries …

i tested your tweak … NICE !!

before
<!— Runtime: 5.1751 —>
<!— Query time: 4.295116 —>
<!— Queries: 69 —>

after
<!— Runtime: 1.0464 —>
<!— Query time: 0.879479 —>
<!— Queries: 68 —>

THANKS … i put back showcount !!

Last edited by dbulli (2007-06-18 14:53:16)


nuff-respec ::: dannyb

Offline

#435 2007-06-18 14:59:26

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

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

And for extra credit … the line before can also use an INNER join too … for an added .2 seconds !


nuff-respec ::: dannyb

Offline

#436 2007-07-02 05:46:57

simmerdesign
Member
From: Eden Prairie, MN
Registered: 2006-01-03
Posts: 19
Website

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

minimal design wrote:

Great plugin but I keep on getting strange extra HTML whatever I do. For example: I get a “return” in my code behind each category link when using (nothing in the “break” tag…:

I’ve had the same issue now on two separate Txp 4.0.4-driven sites when using rss_unlimited_categories_filedunder (version 0.7.4 of the plugin) … here’s the latest example of the problem.

Observe the “Varieties” list of links for each client: notice the spaces before the commas? If you view source you’ll see that there are line returns in the HTML that are causing this effect. No matter what I put in the break=”“ attribute (including altering the default break in the plugin code), the rogue spaces persist.

I’ve also attempted to add the trim() function around the title and break attributes in the plugin code on the hypothesis that there was an extra space or line return coming from the database. No success there. Any other ideas?

Offline

#437 2007-07-02 10:02:51

Stimpson
New Member
Registered: 2007-07-02
Posts: 3

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

Hi, I am having a little problem getting the <txp:rss_unlimited_categories_article_list/> working.

I am not sure the hacks in this post still apply because of the current rss_unlimited_categories version ( v0.7.4), so perhaps I am doing something wrong. Here is is what is on my default template right now:

<txp:rss_unlimited_categories_article_list category=“design”/>

Am I doing something wrong perhaps, should I link it to a specific form to get it working?

<txp:rss_unlimited_categories_list /> seems to be working.

Last edited by Stimpson (2007-07-02 11:35:11)

Offline

#438 2007-07-05 11:05:47

Stimpson
New Member
Registered: 2007-07-02
Posts: 3

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

Does anyone know what I am doing wrong perhaps?

I really can not get it to work :)

Offline

#439 2007-07-06 04:49:28

azuntik
New Member
From: Texas, USA
Registered: 2007-07-06
Posts: 3

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

I hope this is the right place to ask this question. I’ve gone through this whole thread and haven’t found anything on this topic.

I also want to say that I love textpattern and I really appreciate everyone who has contributed. I just started not long ago, but I’m hoping to be able to contribute in a major way in the near future.

So, here’s my conundrum:

I’m building a multilingual site using MLP (English and Russian). I’ve got rss_unlimited_categories working, but there are two problems:

1. Even though I’ve translated the categories, rss_unlimited_categories isn’t picking up the translation on the Russian side (it displays in English).
2. The category count shows the total for both languages (it shows 12 for both English and Russian, instead of 5 for English and 7 for Russian).

Is anyone else having these problems? I don’t know what it would take to make rss_unlimited_categories MLP aware (I tried looking at the underlying code, but got lost pretty quickly), but any input or assistance would be greatly appreciated.

Thanks,

Azuntik

Offline

#440 2007-07-06 04:56:44

azuntik
New Member
From: Texas, USA
Registered: 2007-07-06
Posts: 3

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

Stimpson wrote:

<txp:rss_unlimited_categories_article_list category=“design”/>

I think the problem is probably that category is not a valid attribute for rss_unlimited_categories_article_list. You can do section, but not category. I’m guessing that this particular tag uses the global category and you can’t override it.

Hope this helps!

Azuntik

Last edited by azuntik (2007-07-06 04:58:05)

Offline

#441 2007-07-09 14:46:46

Stimpson
New Member
Registered: 2007-07-02
Posts: 3

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

Hi, that would be kind of odd perhaps seeing the rss_unlimited_categories_article_list description:

http://www.wilshireone.com/textpattern-plugins/rss-unlimited-categories#rss_unlimited_categories_article_list

Perhaps there is something else I am doing wrong, or perhaps it just does not work :)

Offline

#442 2007-07-09 14:52:43

azuntik
New Member
From: Texas, USA
Registered: 2007-07-06
Posts: 3

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

Stimpson wrote:

Hi, that would be kind of odd perhaps seeing the rss_unlimited_categories_article_list description:

You’re right. I must’ve been looking at the wrong place. I was looking in the plugin help and I must have just skipped right over it. Sorry for that.

I guess the answer is: I don’t have a clue.

Azuntik

Offline

#443 2007-07-09 23:41:01

ericawatanabe
New Member
From: Sao Paulo, Brazil
Registered: 2007-07-09
Posts: 1
Website

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

Has anyone tested it with the new TXP version (4.0.5)?

I don’t know if I’m doing something wrong, but it doesn’t seem to work here.

Offline

#444 2007-07-11 03:49:19

Ramen Angel
New Member
Registered: 2007-07-11
Posts: 8

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

The spaces that show up in inline category lists are caused by Textpattern.

In the textpattern directory, in the file taghandlers.php, find the function doWrap. See how “n” (newline, defined in lib/txplib_html.php) is being inserted at various points. If your separator is a comma or similar, here is the culprit:

return ($wraptag) ? tag(join($break.n, $list), $wraptag, $atts) : join(n.$break, $list);

If you haven’t set a wraptag, the newline goes before your separator, which results in the mysterious space. So, either set a wraptag, or delete the second newline (“n” plus the adjacent period). The newline is only there to format the HTML source, it isn’t needed otherwise.

You’ll have to modify the code further down if you are using enclosing break-tags, like <li>. The same principle applies: delete the newline that is adding an unwanted space in your rendered HTML.

Offline

Board footer

Powered by FluxBB