WordPress.org

Ready to get started?Download WordPress

Forums

Design Help For Event Registration Plugin (2 posts)

  1. sebastion11500
    Member
    Posted 7 years ago #

    Hi,

    I would like to develop a plugin that lets people register for posts listed under a certain category (e.g., events). The requirements are as follows:

    * registration data must be stored in the database; not as part of the post content.
    * posts in the event category must append an html table of registered users.
    * logged in users must have an option to add/remove themselves from the list.

    Additional desired (but not required) features include:

    * if current user is in registered list, highlight that row.
    * if current user is not logged in, enable the "add" feature but re-direct to a login prompt.
    * use cool (dhtml? ajax?) effects similar to administration screen for the add/remove functionality.
    * prevent table from showing up in post excerpts (from main screen or searches).

    I created a new database table, wp_event_registration with a primary key (id), and two foreign keys (post_id, user_id) referencing wp_posts and wp_users respectively. I understand that this should eventually be automatically generated by the plugin; however, for now, I created it manually.

    My problem is in trying to understand the high level structure of which action & filter hooks I should be using. I *think* one approach would be to use a single "the_posts" filter; however, this seems excessively wasteful in the number of posts it will consider (keeping in mind that I only want to modify posts that are being viewed directly).

    I have struggled with finding good documentation or plugins to use as references. Not because they aren't out there, but because I'm not even quite sure what to search for. At the moment, I am using the EventCalendar3 plugin and the site http://wphooks.flatearth.org/ as references.

    Recommendations on additional references would be appreciated. And, in the interest of proving the concept to my company before they give up on the idea, any recommendations on the structure of the plugin for my particular needs would be appreciated as well.

    Thanks much,
    Sebastion

  2. sebastion11500
    Member
    Posted 7 years ago #

    Hi,

    I have been partially successful in implementing this system. However, I have not been able to implement any of the "desired" features.

    In particular, I would love help in preventing the table from showing up in the non- single-post-view pages (e.g., the blog home).

    Currently, I use a filter on "the_posts" to determine which posts are events and to fetch the registration info from the database. Then, a later filter on "the_content" parses this data into a table and appends this to the original post.

    I tried inserting the "more" comment between the main post and the table; however, this has no effect. Any suggestions regarding this (or other parts of my original post) would be very welcome.

    Thanks much,
    Sebastion

Topic Closed

This topic has been closed to new replies.

About this Topic