Adding additional fileds in comments (4 posts)

  1. xeddy
    Posted 9 years ago #

    I want to modify the current comment box to have a field like country, city etc. How can i do something like this? I am using the latest version of wordpress.

  2. jwilliams
    Posted 9 years ago #

    This will be difficult. in general, you need to

    (1) enter the apropriate database fields in the apropriate tables.
    (2) start writing your own SQL queries since the post_query() mechanism and other WP functions won't be written for your mod.
    (3) The easiest part is just plopping in the HTML form stuff with apropriate PHP query scripts.

    so, probably, start by looking at the DB with PHPmyadmin, knowing alot about MySQL, and then spend an afternoon writing your own PHP into your comments.php file.

  3. xeddy
    Posted 9 years ago #

    yeah, thats what i thought i would have to do, i was looking for a quick hack :) Thanks alot though!

  4. jwilliams
    Posted 9 years ago #

    well, this might be of some help.

    i mean basically you can just add a few fields with phpmyadmin, thats easy enough.

    then, copy and rename and change varnames in the functions that operate on the existing fields ot the new fields, and if you need to, heres some documentation on creating custom SQL queries for someone doing just the thing you are!

    Good luck though! I'll understand if you decided to let this one slide by ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic