adding more comment fields adding more comment fields
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

adding more comment fields

Started by testcindyh, September 01, 2004, 09:07:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

testcindyh

Hi,

Just wanted to tell you your system works great and I set it up in almost a matter of minutes (after I got our web admin to change permissions on the required folders).  I love the interface and it is just what we need.

I am writing because I wanted to make sure that I am modifying the correct pages to add in more comment fields. Basically, along with msg_body, I want to add in msg_pic_year, so that the user can look at the picture in the gallery and add in the year that it was made (this is a photo gallery for some art archivists).  Eventually, I'll have to add in more fields, but I'm just starting with msg_pic_year so I get a feel for your system first.

By the way, I am using the classic theme, which you'll see below.

Things I have done so far:

1.  mysql table cpg132_comments:  altered table to add in msg_pic_year varchar(4)

2.  displayimage.php: Altered function html_comments() to add in msg_pic_year field to select query.

3.  displayimage.php: Altered function html_comments() to add in '{MSG_PIC_YEAR}' => $row['msg_pic_year'], to params array  that starts w/ {MSG_AUTHOR}

4.  displayimage.php: Altered function html_comments() to add in '{MSG_PIC_YEAR}' => $row['msg_pic_year'],to params array that starts w/ {ADD_YOUR_COMMENT}

5.  /lang/english.php: Altered $lang_display_comments array to add in   'msg_pic_date'=>'Year',

6.  /themes/classic/theme.php: added <td class="tableb_compact"> {MSG_PIC_DATE} </td> after <td class="tableb_compact"> {COMMENT} </td>

7.  /themes/classic/theme.php: added in the textbox for the new field

8.  db_input.php: altered the update/insert queries in switch($event) statement so that msg_pic_year also updated

I'm now stuck at trying to get input that I add into the msg_pic_year text field to not bomb the insert query.  Any ideas?  Still working on this.  If I can get this to work, this would be the perfect thing for my faculty.

Thx in advance, cindyh

testcindyh

#1
I should mention that I can view the new field just fine (I put in some values into mysql to see), but I think I screwed up my mods in db_input.php because the addition seems to cause an error.  I suspected a couple of things, but none of them seem to be panning out.

--i did indeed screw up in db_input.php.  I failed to see the second case statement.  Fixed it and now my inserts work just fine.  I'll do a final bug check to see if I missed stuff. 

theK

Hi testcindyh,

Your modification is something that I would be very interested in implementing as well. Other gallery programs such as 4images have the extra field built-in (e.g. for website or email).

How is the modification going? All done without any bug?

Regards,
theK