Posted: April 23, 2015 at 8:20 am
|
Hi What would be your suggestion in adding such functionality? Could we add two more tables to the wp database (something like tbl_races and tbl_results) with the tbl_races having an eventID field linking it to an EE4 event, and obviously the tbl_results table having a raceID as well as a wp_user_id to be able to log race results – and then build a user interface around that? Does that sound logical or is there an easier way to achieve this? Thanks a lot |
Hi Jason, If the races and results are specific to one event (not many events) you can avoid adding new tables by using the post_meta table. What’s nice about this option is you can use a plugin like Advanced custom fields to add custom metaboxes for this data on to each event. There’s some pros and cons of using custom tables verses post_meta in these discussions: http://wordpress.stackexchange.com/questions/4852/post-meta-vs-separate-database-tables Another option would be to create a custom post type for races. More discussion here: |
|
|
Hi Josh… thanks a lot for your response. I am a little out of my depth with the subject of the post_meta table but will definitely look into it. One thing I am concerned with however is that we need to be able to extract statistics – we need a way of being able to track a particular participants placings over a season – and thus provide a global ranking (as the events will happen all around the world). If I use post_meta from what I understand we can add say 10 fields (1st through 10th over the finish line) – hopefully these can be drop downs which link to the attendees of the event – we then have a way to track placement (and times) against the top 10 spots. Is this what you are thinking? Would we be able to query this table then and have the results displayed on a members home page (under a “Statistics” section – like, “You have competed in 23 races this season, have come first 2 times, second 6 times and third 3 times with an average speed of 15 seconds/100m.” Do you envisage this being achievable through the post_meta table? Thanks a million |
|
Hi, I think it should be possible via custom meta boxes. You may not be able to use an addon though (I haven’t tested it so it might be possible) and need to write some code for the metaboxes. The admin will of course need to manually select the name and add in the times. The display page will definitely need to be custom coded, but it should be easy enough to loop through the events (posts) and grab the post meta for each, then you can work out what that person’s stats are. YOu might want a hidden input and/or meta field to store the attendees user ID or attendee ID in case of duplicate names. Overall definitely a custom job, but I believe it’s possible. |
The support post ‘EE4 Extending the database tables’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.