Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Plugin: ajw_technorati_tags

#13 2005-01-19 17:46:42

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Plugin: ajw_technorati_tags

Just a note of what’s in the works. It occurred to me that some users may already be using the custom keywords field for other purposes and that the keywords field may actually not be the correct place to be storing this information anyways. So next version will allow for using the keywords field or any custom field.

Offline

#14 2005-01-19 19:35:25

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Plugin: ajw_technorati_tags

Ok, version 0.5 now allows for use of the keywords field or a custom field.

Offline

#15 2005-01-20 00:40:01

setar
New Member
From: Cape Town, South Africa
Registered: 2004-12-10
Posts: 9
Website

Re: Plugin: ajw_technorati_tags

Works nicely now; still have to give the RSS tweaks a try.

Has anyone implemented a nice form or CSS tag to present those tags? Trying to make them unobtrusive while keeping them next to the articles. Next to the comment invitation and they blend in, right next to the headline and they look way too important.

Might use a different link colour and use a differnt hover effect to distinguish them from ‘regular’ links.

Offline

#16 2005-01-20 15:03:15

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,204
Website

Re: Plugin: ajw_technorati_tags

> setar wrote:

> Has anyone implemented a nice form or CSS tag to present those tags? Trying to make them unobtrusive while keeping them next to the articles. Next to the comment invitation and they blend in, right next to the headline and they look way too important.

I’ve yet to play with those, but I would put them together with other meta information about your article (published/posted by, date, etc.). I might use a little background image as an icon, or use the ::after pseudo-element to give a special look. Maybe a different touch of colour.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#17 2005-01-22 22:55:02

schussat
Plugin Author
Registered: 2004-02-24
Posts: 101
Website

Re: Plugin: ajw_technorati_tags

> compooter wrote:

> Kossatsch, yes this is true that it currently only works for individual articles and not article lists. I’m going to do a bit of research and try to find a method in which it can work under both contexts.

If I understand correctly, this is because the software at the technorati end of things can’t distinguish one entry from another — right? If that’s the case, it would seem that we just have to wait for something like a way to associate tags that come up in a list of articles with their appopriate permalink.

Edit: After poking around a bit, I do see sites that display multiple entries and tags, and when I click through to the technorati tag page, the link back is the correct permalink. So, how is this done? On further thinking, it’s probably because I was looking at a wordpress blog that could ping technorati, therefore giving it the appropriate URL. Will that be the solution for Txp, too?

Last edited by schussat (2005-01-23 15:14:32)


-Alan

Offline

#18 2005-01-24 02:54:32

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Plugin: ajw_technorati_tags

schussat, the individual article / article list issues were solved with v0.4.

Offline

#19 2005-01-24 04:35:46

schussat
Plugin Author
Registered: 2004-02-24
Posts: 101
Website

Re: Plugin: ajw_technorati_tags

> compooter wrote:

> schussat, the individual article / article list issues were solved with v0.4.

So I overthought the whole thing, anyway? Good to know.

Still, I remain kind of curious. Say I assign tags to the ten articles currently shown on my main page, and I modify my forms to display the tags next to the posted date. When the main page is viewed, ten articles, together with all of their tags, show up. So what’s to prevent technorati from associating all of those tags with my root URL rather than associating just the appropriate tags with the permalinks of individual articles?


-Alan

Offline

#20 2005-01-24 18:22:08

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Plugin: ajw_technorati_tags

The problem here exists on several levels.

Ideally, the category tags should be passed via RSS/Atom. I’m not referring to hacking rss.php & atom.php so that they parse plugins and sticking the rel="tag" link in the body of your article. What I’m referring to is actually including the tags in the feeds.

Technorati tags should ideally be attached to textpattern categories in theory, but Txp currently only allows for two categories. Additionally, category support in RSS/Atom is currently broken IMO. Category tags aren’t output at all in Txp’s RSS feed, and the Atom feed only outputs one dc:subject, no matter how many categories your article has.

RSS has supported <code><category></code> since the 0.92 spec & Atom has support for multiple <code><dc:subject>Textpattern</dc:subject></code> tags, so ideally there should be no limit to the amount of categories you could have and both rss.php & atom.php would just loop thru your list of categories and output category/dc:subject tags for as many as you’ve got.

But since this is not the world we live in, we’ve got to make adjustments. Current status, you’ve got a couple options.

  1. Add technorati rel="tag" to your article pages. I will most likely expand the functionality a bit so that you can conditionally use the “Main Page” tag for the homepage of your site. I’m not quite sure how this’d work exactly, and it’s mainly a kludge, but I’m willing to look into it.
  2. Hack rss.php & atom.php so that multiple (max 2 as limited by Txp) category tags will be output with your feed. (I’ll write that up soon)
  3. Sit and punch yourself in the head while you sit in a tub full of pudding, constantly repeating the phrase “textpattern technorati textpattern technorati textorati technattern…

Offline

#21 2005-01-24 18:42:51

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Plugin: ajw_technorati_tags

Here’s the small hacks to allow for your categories (max of 2 – as per Txp limit) to be output properly in your RSS/Atom feeds.

RSS category tags

Find this:

<blockquote> <pre> $item = tag(strip_tags($Title),‘title’).n. tag($Body,‘description’).n. tag($link,‘link’).n; $out[] = tag($item,‘item’);</pre> </blockquote>

Edit to this:

<blockquote> <pre> $item = tag(strip_tags($Title),‘title’).n. tag($Body,‘description’).n. tag($link,‘link’).n; $item .= ($Category1) ? tag(htmlspecialchars($Category1),‘category’).n : ‘’; $item .= ($Category2) ? tag(htmlspecialchars($Category2),‘category’).n : ‘’; $out[] = tag($item,‘item’);</pre> </blockquote>

RSS links category tags

Find this:

<blockquote> <pre> extract($a); $item = tag(doSpecial($linkname),‘title’).n. tag(doSpecial($description),‘description’).n. tag($url,‘link’); $out[] = tag($item,‘item’);</pre> </blockquote>

Edit to this: (link feeds really should be expanded to accept multiple categories)

<blockquote> <pre>extract($a); $item = tag(doSpecial($linkname),‘title’).n. tag(doSpecial($description),‘description’).n. tag($url,‘link’).n. tag(htmlspecialchars($category),‘category’); $out[] = tag($item,‘item’);</pre> </blockquote>

Atom category tags

Find this:

<blockquote> <pre> $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$elink.’” />’; $e[‘id’] = tag(‘tag:’.$siteurl.’,’.date(“Y-m-d”,$uPosted).’:’.$ID,‘id’); $e[‘subject’] = tag(htmlspecialchars($Category1),‘dc:subject’);</pre> </blockquote>

Edit to this (this also fixes empty dc:subject tag bug for non-categorized entries):

<blockquote> <pre> $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$elink.’” />’; $e[‘id’] = tag(‘tag:’.$siteurl.’,’.date(“Y-m-d”,$uPosted).’:’.$ID,‘id’); $e[‘subject1’] = ($Category1) ? tag(htmlspecialchars($Category1),‘dc:subject’) : ‘’; $e[‘subject2’] = ($Category2) ? tag(htmlspecialchars($Category2),‘dc:subject’) : ‘’;</pre> </blockquote>

Atom links category tags

Find this:

<blockquote> <pre> $e[‘title’] = tag(doSpecial($linkname),‘title’); $content = utf8_encode(htmlspecialchars($description)); $e[‘content’] = tag(n.$description.n,‘content’,’ type=“text/html” mode=“escaped” xml:lang=“en”’); $url = (preg_replace(“/^\/(.*)/”,“http://$siteurl/$1”,$url)); $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$url.’” />’; $out[] = tag(n.t.t.join(n.t.t,$e).n,‘entry’);</pre> </blockquote>

Edit to this:

<blockquote> <pre> $e[‘title’] = tag(doSpecial($linkname),‘title’); $content = utf8_encode(htmlspecialchars($description)); $e[‘content’] = tag(n.$description.n,‘content’,’ type=“text/html” mode=“escaped” xml:lang=“en”’); $url = (preg_replace(“/^\/(.*)/”,“http://$siteurl/$1”,$url)); $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$url.’” />’; $e[‘subject’] = ($category) ? tag(htmlspecialchars($category),‘dc:subject’) : ‘’; $out[] = tag(n.t.t.join(n.t.t,$e).n,‘entry’);</pre> </blockquote>

Last edited by compooter (2005-01-24 19:20:10)

Offline

#22 2005-01-24 23:44:05

technoweenie
New Member
Registered: 2004-03-07
Posts: 4
Website

Re: Plugin: ajw_technorati_tags

I made a quick modification to add a label attribute:

<pre>
<code> function ajw_technorati_tags($atts) { global $thisarticle; if (is_array($atts)) extract($atts); $wrap = (empty($wrap)) ? ‘’ : $wrap; $break = (empty($break)) ? br : $break; $label = ((empty($label)) ? ‘’ : $label . (($break 'li') ? '' : $break)); $class = (empty($class)) ? '' : ' class="'.$class.'"'; $field = (empty($field)) ? '' : $field; $keywords = (empty($field)) ? $thisarticle['keywords'] : fetch("custom_$field", 'textpattern', 'ID', $thisarticle['thisid']); if (!empty($keywords)) { $keywords = explode(',',$keywords); foreach ($keywords as $keyword) { $keyword = trim($keyword); $out[] = ($break’li’) ? tag(tag($keyword,‘a’, ‘ href=“http://technorati.com/tag/’.$keyword.’” rel=“tag”’.$class),$break) : tag($keyword,‘a’, ‘ href=“http://technorati.com/tag/’.$keyword.’” rel=“tag”’.$class).$break; } return ($wraptag) ? tag($label . join(n,$out),$wraptag) : join(n,$out); } return; }</code></pre>

It would be nice if you could modify a plugin and get the new base64 string for it.

Last edited by technoweenie (2005-01-25 15:17:36)


rick
http://techno-weenie.com

Offline

#23 2005-01-24 23:52:53

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: Plugin: ajw_technorati_tags

can you code-ify that a little better? also, label? can you show me an example of the output you’re going for?

Offline

#24 2005-01-25 15:21:50

technoweenie
New Member
Registered: 2004-03-07
Posts: 4
Website

Re: Plugin: ajw_technorati_tags

Well I took out all empty line breaks and played with the pre/code tags and still no luck with the formatting.

I just wanted a label above the tags. I tried to match the pattern of the other txp tags that have a label:

<pre><code>
<txp:related_articles label=”<strong>related articles</strong>” limit=“10” break=”<br />” wraptag=“p” />
<txp:ajw_technorati_tags label=”<strong>tags</strong>” break=”<br />” wraptag=“p” />
</code></pre>

Both render to something like:
<pre><code>
<p><strong>related articles</strong><br><a href=”/1/first-post”>First Post</a></p>
<p><strong>tags</strong><br><a href=“http://technorati.com/tag/test” rel=“tag”>test</a><br></p>
</code></pre>

Last edited by technoweenie (2005-01-25 15:22:17)


rick
http://techno-weenie.com

Offline

  1. Index
  2. » Archives
  3. » Plugin: ajw_technorati_tags

Board footer

Powered by FluxBB