WordPress.org

Ready to get started?Download WordPress

Forums

Several dates for one post ! Big project ! (3 posts)

  1. Pixelboss
    Member
    Posted 7 years ago #

    Hi,

    I want to use WP for a scientific revue. It will manage events of the scientific community. So I need to had for posts the possibility of 3 dates more :

    - the "frozen date" (the day of the event in the future)
    - the "start date"
    - the "end date" (the days of start and end for an event witch take several days)

    So in the admin panel, for each post, you will be able to attribute these 3 dates to the post. And on the website, home functions will display or archive news of events by these dates.

    I have no problem for writing the functions to dis)play or archive. My problem is that I have created a table in my MYsql calles "wp_home_moredates" with 3 fields :

    - "frozendate"
    - "startdate"
    - "enddate"

    but Mysql says to me there is no key define for my table ... ???!?

    And I don't know how to write the query to select posts by "frozendate", etc...

    I try to do something out of the WP core. It would be easier if I have created the fields in "wp-posts" but when upgrade, it will crash all the machine... !

    I have search in the forum but nothing (except on future date but it doesn't match to my problem).

    Can you all help me to elaborate something clean here about this problem ?

    Is there a way to make the same thing more easier with extra fields ? (I have tried whithout success)

    Please help me. It would be a great feature I believe to control as many dates by post as we want... isn't it ?

  2. Chris_K
    Member
    Posted 7 years ago #

    Have a glance at Using_Custom_Fields before making any more tables. :-)

  3. Pixelboss
    Member
    Posted 7 years ago #

    I have tried custom fields with this plugin : http://rhymedcode.net/projects/custom-field-gui/
    but it doesn't work because it's dates, so when you make the months field people put a name... of month... and impossible after to display like a date or make the difference between two dates to archive when it's necessary...

    I have made this with this plugin :

    [Frozendate]
    type = checkbox

    [day]
    type = select
    value = 01 # 02 # 03 # 04 # 05 # 06 # 07 # 08 # 09 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 # 21 # 22 # 23 # 24 # 25 # 26 # 27 # 28 # 29 # 30 # 31

    [month]
    type = select
    value = janvier # fevrier # mars # avril # mai # juin # juillet # aout # septembre # octobre # novembre # decembre

    [year]
    type = select
    value = 2000 # 2001 # 2002 # 2003 # 2004 # 2005 # 2006 # 2007 # 2008 # 2009 # 2010 # 2011 # 2012 # 2013 # 2014 # 2015 # 2016 # 2017 # 2018 # 2019 # 2020

    But thanks for your answer. If you have a solution, don't hesitate to help more

Topic Closed

This topic has been closed to new replies.

About this Topic