Freetag Issue

Creating and modifying plugins.
Post Reply
mjxg
Regular
Posts: 11
Joined: Thu Apr 07, 2005 2:30 pm
Contact:

Freetag Issue

Post 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 :(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Freetag Issue

Post 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)" .
                ")";
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mjxg
Regular
Posts: 11
Joined: Thu Apr 07, 2005 2:30 pm
Contact:

postgres issue

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: postgres issue

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mjxg
Regular
Posts: 11
Joined: Thu Apr 07, 2005 2:30 pm
Contact:

Re: postgres issue

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: postgres issue

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mjxg
Regular
Posts: 11
Joined: Thu Apr 07, 2005 2:30 pm
Contact:

Post by mjxg »

Awesome :)

Glad I could help!

-Mike
Post Reply