Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Tags as Terms
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rick c  
View profile  
 More options Nov 25 2009, 1:33 am
From: rick c <rickcock...@gmail.com>
Date: Tue, 24 Nov 2009 22:33:54 -0800 (PST)
Local: Wed, Nov 25 2009 1:33 am
Subject: Tags as Terms
As you all know, one of the goals for Habari 0.7 is to implement
taxonomy. One aspect of this is implementing tags as terms in a tags
vocabulary. We've been working on this in a branch. It now seems to be
at a usable state, so the changes were merged into trunk in r3829 and
r3830. The code needs some love yet, but maybe with it in trunk, it
will get more.

As with all major updates, I'd recommend backing up your db before
doing svn up. The update should be seamless, moving your tags and
tag2post tables into the terms and object_terms tables respectively.
The tags and tag2posts tables are *not* deleted. They are still in
your database, but they are no longer registered.

One unavoidable side effect of this change is that any plugins or
themes that use direct access to the database to get tags will need to
be updated to use the new table structure. In other words, until they
are updated they will break. If the plugin or theme uses the api
rather than direct database access, it should be okay. One possible
common instance is

$tags = DB::get_results( 'SELECT * FROM ' . DB::table('tags') );

This will no longer work. Instead use

$tags = Tags::get();

More complex SQL will still require SQL. The new SQL will be more
complex than what you are using now. General changes to look for are:

{tags} should be {terms}
{tag2post} should be {object_terms}

Tags are now a vocabulary among many possible vocabularies, a
vocabulary that is usually associated with the object type of 'post',
so SQL will need to contain a WHERE clause that limits the output to
terms associated with the vocabulary id for tags and associations
limited to the object type id for post objects. If you look at the
code in Posts::get() for retrieving posts based on tags, you'll see an
example.

Another point to keep in mind is that the terms equivalent for
'tag_text' is 'term_display', and the equivalent for 'tag_slug' is
'term', so unless you want to change your api, you'll need to return
those fields with the old names. For example:

SELECT term as tag_slug from {terms}

One other change, we tried to make tags something that isn't limited
to posts, so in the future, if this was done right, plugin authors
will be able to tag other object types that may be added.

Rick


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
drzax  
View profile  
 More options Nov 25 2009, 10:57 pm
From: drzax <elvery....@gmail.com>
Date: Wed, 25 Nov 2009 19:57:08 -0800 (PST)
Local: Wed, Nov 25 2009 10:57 pm
Subject: Re: Tags as Terms
Great news. Thanks for all your hard work Rick.

I'm very eager to try this out...now where did I put my bag of spare
time?

S.

On Nov 25, 4:33 pm, rick c <rickcock...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google