MT 3.3.1 tags upgrade

With No Comments »

Had a spare moment so installed MT 3.3.. Seems fine overall, actually, i haven’t done much with it yet, not even sure what the new features are.

Apart from it now has proper tag support but I knew I would have issues with the old tags plugin I used before. Signs looked great at first, the upgrade routine converted my tags to the new system. But it didn’t half make a naff effort, all sorts of weird things went on. And weirdest all my entries were given the tag “0″ or “1″ or even “2″. Lucky them huh?

So, if like my you used to use the Tags.pl plugin by some fool called Brad Choate, I think that was the one, I’ve already deleted it lol. I’ve written some SQL to do a proper upgrade of the tags. The SQL is pretty easy and straight forward so I dunno why MT couldn’t do it.

So, go into phpMyAdmin or simiular, select the database and click on the SQL tab to execute stuff. Oh actually, before you do that, look inside the table “mt_category” and see if its full of categories with “<!–tag–>” as the description. If there is you have been using the same plugin, so go on and do the following…

Stage 1: BACKUP THE DATABASE

Stage 2: First 2 Operations are quite dangerous so be careful c+ping. These will completely delete all of the new tagging data that the upgrade procedure made, and any you’ve created since upgrading to 3.3.x. Oh, on all blogs as well.

DELETE FROM mt_objecttag;
DELETE FROM mt_tag;

Stage 3: Now to copy the tag names

INSERT INTO mt_tag (tag_name)
SELECT category_label FROM mt_category
WHERE category_description = “<!–tag–>”;

Stage 4: Now to pair the tags with the entries

INSERT INTO mt_objecttag (objecttag_blog_id, objecttag_object_datasource, objecttag_object_id, objecttag_tag_id)
SELECT placement_blog_id, “entry”, placement_entry_id, tag_id FROM mt_tag, mt_placement, mt_category
WHERE placement_category_id = category_id
AND tag_name = category_label;

Stage 5: Important, to finish we clean up (delete) all the old style tagging from the old tags plugin. Before you do this its probably best to check that the above actually worked.

DELETE mt_placement FROM mt_placement, mt_category
WHERE placement_category_id = category_id
AND category_description = “<!–tag–>”;

DELETE FROM mt_category
WHERE category_description = “<!–tag–>”;

All done. You know what though? I’m not actually sure what advantages the new tagging system offers, or how its going to work with ecto… if at all :-(

Mark Gilbert

With 1 Comment »

I’ve been messing with tags again today, removing the more pointless ones from entries and removing spaces from those with multiple words. Also, strangely it seems that MT-Tags does actually add keywords as a sub-catagory of “tags”, even though when I first installed it I ended up with a million and 1 primary catagories. So i’ve tidied that up now and I feel a lot better for it.

So yeah, I was playing with my tag cloud thing and randomly clicked on one of the technorati links, one that took me to http://www.technorati.com/tag/meadowhall and ooh, all of them but 1 are mine. No wait, I don’t remember ever calling my blog after my real name “Mark Gilbert”, so what’s this. OMG, what are the chances of that, a name-sake also blogging about meadowhall. Wait, even more OMG, he lives in sheffield, and he blogs about similar things as I do. Have I got a split personality? Am I running 2 blogs and neither personalities know of each others? I’m scared. Funnily enough my other blog isn’t half bad, think I’ll subscribe and keep up with what my split personality is getting up to. He must quite like my name, i mean his name, mine his um, the name to have bought the domain. Myself, I hate it, but that’s probably a low self-esteem thing. I wonder if we’ve ever bumped into each other.

Tags part II

With No Comments »

Been playing some more with my tag code of wonder. It’s now more scalable and customisable. Plus it seems to work on IE now.

FluffyTags.js is the main scriptures (right click and save target). Here’s a quick example…

<ul id="taglist" class="listoflinks">
   <MTTags>
      <li title="<$MTTagCount$>">
         <a class="tagtext" href="<MTTagArchiveLink>"><MTTagName></a>
         <a href="http://www.technorati.com/tag/<MTTagName>"
         rel="TAG" title="TAG:<MTTagName>"><img width=16 height=16
         src="/images/techiconsmall.png" /></a> </li>
   </MTTags>
</ul>
<script type="text/javascript" src="FluffyTags.js"></script>
<script  type="text/javascript">
   var oParent = document.getElementById("taglist");
   tagCloud(oParent, //Element to start crawling from
      100, 255, 100, //colours (R,G,B 0-255) for low tag counts
      20, 200, 20,   //colours for high tag counts
      10, 40,        //text size range pt (low, high)
      2,             //count below this is insignificant
      200, 200, 200, //colours for insignificant tags
      10);           //text size for insignificant tags
</script>

Note class=”tagtext” in the MT stuff, my code looks for an element with this class to change the colour and text size of. The tagCloud function is what you call from the page and it takes a fair number of arguments which i have commented upon in the above example. I’m sure there’s lots of bugs.

www.flickr.com
This is a Flickr badge showing public photos from the Basset Griffon Vendéen group pool. Make your own badge here.



Creative Commons License

Hello you!

Email & IM: MRKisThatKid@gmail.com