• Hey,

    So I’m writing this plugin for WordPress which lets people manage a tournament and display score tables and tournament brackets and such. I’ve got the administrative side working pretty well but now I need to work on how the data is displayed.

    What I’ve got right now is a filter for “the_content” which looks for tags (similar to the wp-tables plugin) – if the proper tag is found, it’s replaced with data from the plugin.

    The problem is that when I display a tournament bracket or something I want it to include links to other information: for instance, click on a single round of the tournament and you get linked to detailed information about that match and how it turned out.

    The best answer I’ve come up with so far is to mimic how the WP-Forum plugin does things: when you display a page that contains the WP-forum tag, the WP-forum content is displayed, and if there’s additional GET queries in the URL apart from the page_id, then those are used by the content filter in order to determine what forum content to display or what action to take…

    Alternately I could try writing my own PHP file in the plugin directory which I could link to by name – which would go through all the steps usually done to display a post, except show my content instead of displaying a post… But I’m not sure how to do that. Or I could create a new query for the site’s top-level, like instead of “page_id=5” I could have “tournament=2007-07” – but I don’t know how to do that, either…

    Any help would be greatly appreciated. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Unfortunately, I cannot help you with your question, but the plugin sounds great. Will it accomodate different size tournaments? 4,8,16 players? Thanks.

    Thread Starter gec144

    (@gec144)

    Yeah, doesn’t have to be a power of two, either. (If a single-elimination tournament starts with a number that’s not a power of two, then the first round reduces the number to a power of two)

    You can check out an old version of the plugin, see how it displays the elimination tree, etc. here:

    https://www.mechamodelcomp.com/?page_id=106

    The old version isn’t very user-friendly. I’m still working on the new version, it’s in CVS on my Sourceforge page (https://www.sf.net/projects/tetsujin) if you want to play with it. It’s still not quite ready for prime-time, though. There will be a proper release when it really is ready.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I write a plugin that adds another class of content to WP?’ is closed to new replies.