Page 1 of 1

Freetag Issue

Posted: Sat Apr 23, 2005 9:36 pm
by mjxg
I am using Postgres, the latest version of Serendipity, and I just installed the Freetag event and sidebar plugin. The sidebar plugin is showing on my blog, and the entries have the ability to type in tags, but there is no place in the database to hold them. I noticed the latest revision now uses a seperate table to hold the tags, and I can't find that table anywhere. I also noticed that it used to be held in the entryproperties table, but there is no place in there for the tags.

I installed from the available plugins, then I installed from CVS when those didn't work. It still is not working.

Has anyone else seen this? Or does anyone know what to do to get this to install correctly? I just spent 2 hours tagging entries until I noticed that it didn't work :(

Re: Freetag Issue

Posted: Mon Apr 25, 2005 11:16 am
by garvinhicking
The freetag plugin recently got edited by another developer, and he only put the upgrade code into the "sidebar" plugin. Trouble is, if you didn't have that plugin, conversion did not take place. So please try to install the sidebar plugin and then see if everything works out for you?

If not, the code found in the sidebar plugin for DB creation is this:

Code: Select all

            $q = "create table {$serendipity['dbPrefix']}entrytags (" . 
                    "entryid int not null, " .
                    "tag varchar(50), " .
                    "index entryindex (entryid), " .
                    "index tagIndex (tag), " .
                    "primary key (entryid, tag)" .
                ")";

postgres issue

Posted: Mon Apr 25, 2005 4:50 pm
by mjxg
Based on the code snippet you gave me, I was able to find it in the sidebar plugin. I don't think that that code will work with postgres. I attempted to manually add it "as is" (changing the variables to what they should be and removing the quotes and concatenating "."s) and postgres didn't like it at all. I'm going to go through the code to see how the tags are entered into the database and see if i can fabricate something.

Re: postgres issue

Posted: Mon Apr 25, 2005 5:49 pm
by garvinhicking
Thanks a lot. If you happen to find the "real" code, I will commit your patch. Sadly I don't do postgreSQL, and neither seems to do the author of the plugin change, so I'm bound to your help :)

Thanks a lot,
Garvin

Re: postgres issue

Posted: Mon Apr 25, 2005 6:24 pm
by mjxg
garvinhicking wrote:Thanks a lot. If you happen to find the "real" code, I will commit your patch. Sadly I don't do postgreSQL, and neither seems to do the author of the plugin change, so I'm bound to your help :)

Thanks a lot,
Garvin
Well, I figured out how to do it. You need to do it in 3 steps. Here they are:

Code: Select all

CREATE TABLE {$serendipity['dbPrefix']}entrytags (entryid integer not null, tag varchar(50), primary key (entryid, tag));
CREATE INDEX entryindex ON {$serendipity['dbPrefix']}entrytags(entryid);
CREATE INDEX tagIndex ON {$serendipity['dbPrefix']}entrytags(tag); 
I implemented that by hand, and then edited an entry to add some tags. They were inserted into the database properly, and I was able to use the sidebar plugin to search by them. I haven't attempted to modify them for that entry, but if you want to check it out, my blog is at mjxg.com.

I am not sure how you want to implement that into the code, but that will work with postgres :)

-Mike

Re: postgres issue

Posted: Mon Apr 25, 2005 9:31 pm
by garvinhicking
Hi!

Thanks a lot for your code, I now patched the creation code of the plugin so that it should work on pgsql :)

Regards,
Garvin

Posted: Mon Apr 25, 2005 9:36 pm
by mjxg
Awesome :)

Glad I could help!

-Mike