Author Topic: More that just title/description?  (Read 3286 times)

0 Members and 1 Guest are viewing this topic.

Offline rdbrown

  • album.pl User
  • *
  • Posts: 5
  • Karma: +0/-0
  • I didn't forget to change the default text.
More that just title/description?
« on: May 26, 2005, 14:38:14 »
How much trouble would it be add fields to the database beyond just "title" and "description"?

For example, I might want to add a seperate text field containing the medium which a painting was originally composed, or the size that prints are available in, and so forth.

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: More that just title/description?
« Reply #1 on: May 26, 2005, 17:58:37 »
Unfortunately the "database" is just a specially formatted text file. It wouldn't be hard to have the script save new data in the file, but all the locations that read from the file would also have to be updated... would take a bit of work to get it completely done.

Offline rdbrown

  • album.pl User
  • *
  • Posts: 5
  • Karma: +0/-0
  • I didn't forget to change the default text.
Re: More that just title/description?
« Reply #2 on: May 27, 2005, 09:08:43 »
Leaping ahead: so to make it flexible all instances of reading a record from the database would be changed to calling a single subroutine which returns the values of title, description, and any other variables you've added?

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: More that just title/description?
« Reply #3 on: May 27, 2005, 19:22:44 »
There already are "getDescription" and "updateDesc" subroutines that cover off *most* of those cases. However since owner is also stored in the same file, it gets complicated... authentication, permissions, etc are all basded on this file as well. Basically, if you don't mess with the first line (the one with the photo name itself) then you can probably get away with just editing the two subs above.