h1

Expanding Phorum

January 8, 2008

I want to expand Phorum.  I want to be able to relate specific phorum threads to one specific entry on my FreeBSD Diary website.  I do this for article feedback.  This is very much like comments on a weblog.

To see this features in action, look at Phorum – how to install and customize it. This article is about Phorum 3, so you might not find much there for your existing Phorum 5 installation. Note the link to the comments under the date in the top right corner. If you click on it, you will find it links to http://www.freebsddiary.org/phorum/list.php?f=3&article_id=258. Note the additional URL paramter article_id. This uniquely identifies the article you were reading.

In the FreeBSD Diary database (freebsdiary.org), there is an article table:

freebsddiary.org=# \d articles
                               Table "public.articles"
    Column    |     Type     |                       Modifiers
--------------+--------------+-------------------------------------------------------
 id           | integer      | not null default nextval('articles_id_seq'::regclass)
 actual_date  | date         | not null
 name         | text         | not null
 completed    | character(1) | not null default 'N'::bpchar
 visible_date | text         | not null
 link         | text         | not null
 filename     | text         | not null
 description  | text         |
 author       | text         | default ''::text
Indexes:
    "articles_pkey" PRIMARY KEY, btree (id)
Check constraints:
    "articles_completed" CHECK (completed = 'Y'::bpchar OR completed = 'N'::bpchar)   

freebsddiary.org=#

This table is referenced from the article_feedback_xref table:

freebsddiary.org=# \d article_feedback_xref
Table "public.article_feedback_xref"
   Column   |  Type   | Modifiers
------------+---------+-----------
 article_id | integer | not null
 thread_id  | integer | not null
Indexes:
    "article_feedback_xref_pkey" PRIMARY KEY, btree (article_id, thread_id)
Foreign-key constraints:
    "$2" FOREIGN KEY (thread_id) REFERENCES article_feedback(id) ON UPDATE CASCADE ON DELETE CASCADE  

freebsddiary.org=#

I have customized the Phorum 3 code to restrict message selection to those related to this particular article. The entry in the cross reference table is added when a new post is made to the phorum.

I want Phorum 5 to provide the same functionality. I am not yet sure of how I am going to achieve this goal. It may be with a table similar to the able. It could be with custom fields on the message table.

I’m still in the idea phase. Ideas? Comments?

Leave a Comment