Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] haf_dictionary

#1 2007-10-11 00:44:18

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

[archived] haf_dictionary

Notice: This thread is archived, this plugin is no longer available

**********************************************************

Hi all

My first plugin – how exiting! This is a very early stage in the development, but this is to gauge the interest and maybe get some co-operation working since i am not a programmer. I am a student of physical therapy, and this would help me and my fellow students keep track of all the terms in our field – that was the idea :-)

The goal of the plugin is to be able to maintain a collection of words, terms or whatever that the front-end user can search in and find the definition of.

Preliminary ToDo for the plugin

  1. add category for words (closed)
  2. adding, editing, deleting of words, there definition and category (bugs)
  3. add extensions > dictionary tab for the words (closed)
  4. add extensions > dictionary cats tab for the word categories (closed)
  5. new table in the db to hold the words (closed)
  6. integration with the mlp_language_pack plugin for easy localization (open)
  7. front-end tag(s) for the dictionary where one could search by word, definition or category, and maybe also suggest words (open)
  8. auto-notification of failed searches to site-owner (open)
  9. maybe auto-cross-referencing of words – tricky, but cool. Maybe we can use Phpxref? (open)
Known Bugs
  1. not able to sort by definition on extensions > dictionary tab (closed)
  2. not able to delete words in extensions > dictionary tab (open)
  3. no category list in the extensions > dictionary tab (open)
  4. adding of words throws error in extensions > dictionary tab (closed)
What the plugin does
  • adds one table in the db, not two as i wrote (thanks Mario)
  • adds two extra tabs in admin under the extensions tab
What can i do with it now?
  • add word categories
  • add, edit words

It is with purpose that i have not serialized the plugin but only offer it as a .txt file since the development is very early and this could break you site. So please only install this in a test environment, and not a production setting. Use the Plugin Cache dir in textpattern. If it’s oki to make it into a real plugin at this stage i will do that, of course.

The code borrows heavily from Zem’s plugins so thanks goes to him – i hope it is oki to do that :-)

Again, i am not a programmer so any bug reports, feature req’s and generel improvements of the coding is always welcome. And there will be errors in the code, but no syntax errors.

If you think you could help with some of the bugs, find new bugs or implement some of the ToDo’s write it here in the forum so we dont trample each other.

So have a go, thanks :-)

For those that want to edit the file below and make it in to a real importable plugin by serializing it i highly recommend: Ied Plugin composer you can do that in a jiffy with this plugin.

Kind Regards
Klaus Brinch, DK

UPDATE
This plugin requires txp 4.0.5 or at least r2439 as it seems from Marios findings

Download latest haf_dictionary-0.1.2.txt

Last edited by hafnius (2007-10-11 06:54:11)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#2 2007-10-11 00:47:38

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [archived] haf_dictionary

Looks interesting/promising!

Offline

#3 2007-10-11 01:46:45

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: [archived] haf_dictionary

Thanks mrdale

- new version uploaded after squashing bug# 4


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#4 2007-10-11 03:19:28

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: [archived] haf_dictionary

With regards to ToDo#9 i found this arcane project on SourceForge that is no longer maintaned:
HT Cross-Reference Article DB

It says it does article cross-reference on the fly. Tried setting it up on my testserver but the db-config of the script i cant figure out, so i am left with the scipts, but they are nice and well commented. I guess when the articles are pulled from the db by keyword they are searched for words that are titles of other articles and these are made into links.

In our case when a word is pulled from the db, the definition is searched for words that are equal to other words with definitions in the db and these are auto-linked. Doesnt sound un-doable and the good thing about doing it on the fly is that we keep just clean text in the db – no HTML, and the cross-reference is always up-to-date. There might be a speed penalty though, but we will see. This is actually pretty exciting!


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#5 2007-10-11 06:28:34

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: [archived] haf_dictionary

I get the following Error on a 4.0.4 (r1956) base installation with admin mod.

Fatal error: Call to undefined function gTime() in /Users/www/Sites/dev_example2/textpattern/lib/txplib_misc.php(512) : eval()’d code on line 544

Only one table was created, looking at further down, allthough the dictionary values get inserted there, they are not listeed.

Does it need 4.0.5 at all ?

Looks like a nice piece of work, may be better to try this one on a vaniilla install.
( I just wanted to take a quick look )

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#6 2007-10-11 06:47:32

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: [archived] haf_dictionary

Hi Marios

Looking in Trac, the function Gtime() wasn’t introduced until r2439, so that is why it is complaining. I have added to my first post that this plugin requires txp 4.0.5.

The plugin only creates one table, haf_dictionary_tbl for the words and uses textpatterns own table for storing the extra categories. I see that in my initial post i wrote that it creates two extra tables, its only one; This is corrected now. I have taken care to rename all the function calls to avoid name collision, but a vanilla install would be a good idea, and set txp to Debug mode as well :)

/Klaus

Last edited by hafnius (2007-10-11 06:56:01)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#7 2007-10-11 07:02:26

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [archived] haf_dictionary

Without having looked at the plugin itself, I have a question: Why not give each word an article (title = word, body = definition)? What’s the benefit of using a plugin?

Offline

#8 2007-10-11 07:41:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,119
Website GitHub

Re: [archived] haf_dictionary

@ hafnius: looks interesting – do you have an example somewhere, or a screenshot of front-end and back-end?

BTW: there are some other dedicated glossary solutions on sourceforge, some of which are quite well-developed (even quite complex) though none I found were updated regularly. It’s been a while since I researched into that, though.

why not give each word an article (title = word, body = definition)

I’ve done something similar to what Ruud suggests for a 2-3 language glossary with a slightly modified write tab – here two pics of the admin area: 1 and 2.

A benefit of using articles, is that people can comment on terms.
A disadvantage of using articles is that it really needs to be a dedicated install of its own and unrelated to other aspects of a site. This is not just due to the re-arranged write tab but also the sheer number of articles which swamp other content.

Having it in a separate tab makes it more manageable. Theoretically this would be possible with articles too if it were possible to have multiple articles tabs with different list-views (and write-views) for different sections (as dale’s txpattern txp-offshoot project wanted to achieve). Also, I’m not sure how well multiple cross-references would work with txp. You could use related articles via category, or a custom-field holding the ID(s) of related articles.

@mrdale: how’s xpattern coming along – I get an internal server error on the site?

Last edited by jakob (2007-10-11 07:46:58)


TXP Builders – finely-crafted code, design and txp

Offline

  1. Index
  2. » Archives
  3. » [archived] haf_dictionary

Board footer

Powered by FluxBB