Ticket #3 (enhancement)

Opened 2 years ago

Last modified 2 years ago

individual tags (user only sees his tags)

Status: assigned

Reported by: kai Assigned to: aking (accepted)
Priority: minor Milestone: 1.0
Component: component1 Version:
Keywords: Cc:

for non-social blogging it would be great to have tag(name)<->user assignments, so that each user only sees his own tags. tag names would then be redundantly stored in DB and would have a userID.

Change History

11/05/06 07:18:50: Modified by aking

  • owner changed from somebody to aking.
  • status changed from new to assigned.

The data is already there for this (user column for tags). All you need to do is customize your SQL calls to use this, and make sure you pass in the user value to the methods that accept it.

It would probably be worth having some examples of this in the core code too.

11/05/06 23:47:56: Modified by kai

sorry, I did not express this very well...

what I meant is, that a user should (optionally) not get/see the autocompletion values of other users, which means that to the function get_all_tags() a user(id) parameter has to be added (the function then only returns the users tags).

I have already tweaked the code for that purpose.

also, I added the functionality that you can have multiple tagname-scopes, meaning that for example in TABLE A and TABLE B you get the tagnames in scope 1, while in TABLE C you only get tagnames in scope 2. (don't know if this is clear enough, sorry for my possibly inscrutable English). This comes handy for me because I have certain tables where you would not possibly want to use any of your "normal" tagnames (e.g. you would have different tagnames for bookmarks and for persons)

your code is very nice and makes enhancements quite easy! if you are interested in what I changed, I am happy to send you my tweaked version, but maybe the mentioned functions are very case-specific and only in my interest.

11/10/06 06:42:35: Modified by aking

Ahh, I understand now. Thank you for the clarification.

As for the multiple tables, this is what I intended the 'type' property/column to be used for in the tags table. Do you think it could be used in this manner?

11/10/06 09:09:27: Modified by kai

Yes, that's exactly what I used the 'type' column for (glad that I used it the right way). I've left the pte_tags table as it was, but made changes to pte_tag_names:

I added a 'scope' column, to make it possible that multiple tables can still use the same tag names, also I added a 'user' column to populate the auto completion array only with the users tag names.

Just for clarity, this is the scheme now:

CREATE TABLE `pte_tag_names` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `user` varchar(255) NOT NULL default '1',
  `scope` varchar(255) NOT NULL default 'default',
  PRIMARY KEY  (`id`),
  KEY `name` (`name`)
) TYPE=MyISAM ;

It works quite nicely!