HotBrackets Tournament Brackets Mod

Started by jon2s, June 08, 2009, 06:19:34 PM

Previous topic - Next topic

jon2s



HotBrackets.com [nofollow] Tournament Brackets Mod for SMF

Version: 1.1 Date 2009-06-05
Compatibility: SMF 1.1.6-1.1.9, SMF 2.0 RC1-1


The HotBrackets.com [nofollow] Tournaments Mod is a simple MOD that simply adds the ability to display a tournament bracket from HotBrackets.com [nofollow] inside of SMF.  There is no functionality as far as setting up the brackets or editing the brackets from within SMF.  All administration of the brackets is done directly from HotBrackets.com [nofollow]

Features:


  • Bracket Types available to use with this MOD:

    • 4, 8, 16, 32 and 64 Team Single Elminiation Brackets
    • 4, 8, 16, 32 and 64 Team Double Elminiation Brackets
    • 4, 8, 16, 32 and 64 Team First Round Consolation Brackets
  • No confusing URLs to give to your viewers. You send them the link to what page you are on and we'll make sure they see what they should.
  • User definable fields for teams that allow you to customize what you have to say about each team.
  • Tournament and Team images
  • User sign up brackets. Yes, you can send people to the bracket on HotBrackets.com [nofollow] and they can sign up their self if they have the password!  Then once the tournament starts, they can view the brackets at your site or the main site.
  • Share control of your tournaments and brackets. You can assign a Co-Owner to your tournaments so if you are not available they can create brackets for you.
  • Permanent teams. Tired of setting up your brackets and having to re-enter the same information? Create a permanent team and use it on future brackets that you create.

Configuration:

Nothing to configure to use this MOD.  Just install it and use it.

How to use it

Use of this MOD is fairly simple.  When you create a bracket at HotBrackets.com [nofollow], the URL will have a bracket ID appended to the end of the URL.  Take this bracket id and add it to the end of http://example.com/index.php?action=bracket;bracketid= [nofollow] where example.com [nofollow] is your forum URL.  For example, the main bracket is located at http://www.hotbrackets.com/brackets?bracketid=1 [nofollow] .  The bracket ID in this example is 1.  So your URL would be http://example.com/index.php?action=bracket;bracketid=1 [nofollow] .  Simple as that. 

Support

If you have any questions or comments, there is a forum located at HotBrackets.com [nofollow].Donations

[nofollow]      If you like my modification packages, please donate to support their continued development. Any amount will be greatly appreciated. Thank you!

Copyright (c) 2009 by jon (at) hotbrackets (dot) com. All rights reserved. Redistribution prohibited except at SimpleMachines.org

jon2s


alex30

Nice mod, let's see how it works. Keep up with this kind of mods.

mlthmp

Wow. Works quite well actually. Better than I thought it would =)

Looks very neat within a forum's current layout. Looks good man.. Can't wait to see future updates.

ormuz


Joe N

Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!



wladymeer

Any idea/suggestion if I could post this hot brackets inside the post somehow?

jon2s

Sorry for the late reply.  I am working on a BBCode add on for this that would allow entering [bracket]123[/bracket] and it would display the bracket in the post.  I have a working version of this up on a server now.  If you want to try it out, the modifications are as follows:

Sources\Subs.php
After:
         array(
            'tag' => 'white',
            'before' => '<span style="color: white;">',
            'after' => '</span>',
         ),
Add:
            array(
            'tag' => 'bracket',
            'type' => 'unparsed_content',
            'content' => '$1',
            'validate' => create_function('&$tag, &$data, $disabled', '
                  $data = strtr($data, array(\'<br />\' => \'\'));
                  $data = bracketid($data);
               '),
         ),

After:
function smf_seed_generator()
{
   global $modSettings;

   // Never existed?
   if (empty($modSettings['rand_seed']))
   {
      $modSettings['rand_seed'] = microtime() * 1000000;
      updateSettings(array('rand_seed' => $modSettings['rand_seed']));
   }

   if (@version_compare(PHP_VERSION, '4.2.0') == -1)
   {
      $seed = ($modSettings['rand_seed'] + ((double) microtime() * 1000003)) & 0x7fffffff;
      mt_srand($seed);
   }

   // Change the seed.
   updateSettings(array('rand_seed' => mt_rand()));
}

Add:
function bracketid($data)
{
    global $sourcedir;
    require_once ($sourcedir . '/Subs-Package.php');
    $site_url = "http://hotbrackets.com/bracketz/brackets.php?bracketid="; [nofollow]
    $site_url = $site_url . $data;
    $file_contents = fetch_web_data($site_url);
    $str = $str . $file_contents;
    return trim($str);
}

themedir/index.template.php
Change from:
if ($context['current_action'] == 'bracket') {
   echo '
<link href="' . $settings['theme_url'] . '/hb.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="http://hotbrackets.com/bracketz/hb.js [nofollow]"></script>
   <script type="text/javascript">
   window.addEvent(\'domready\', function() {
      var myTips1 = new MooTips($$(\'.toolTipImg\'), {
         maxTitleChars: 100
      });
   });
   </script>';
   }

to:
   echo '
<link href="' . $settings['theme_url'] . '/hb.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="http://hotbrackets.com/bracketz/hb.js [nofollow]"></script>
   <script type="text/javascript">
   window.addEvent(\'domready\', function() {
      var myTips1 = new MooTips($$(\'.toolTipImg\'), {
         maxTitleChars: 100
      });
   });


Let me know if this works for you or not.

Jon

wladymeer

#9
Will try it these days, just, tell me one thing, what's with these green MEGA DROPDOWNS all of sudden? It seems that it ruined tables that were created before. I've cheked demo you've posted in this thread for 2.x SMF and it seems to have same problem :(

I did try that code that you gave me and here is what I get instead of brackets (see attachment)


wladymeer

Tried it and it works! It looks really good.

However, it doesn't accept my settings from /hb.css and there are no bracket lines at all and there is another problem - when I hover results I get this type of error (see attachment)

It must be somewhere in these lines you gave me as when I revert it to original I had normal hover.

Cheers.

C4G-TK

The BB Code is a great idea!  Hope you get this added for RC2, too.

-img removed-

MATTEK

Yea I'm interested in this for my forum. I run Comic tournaments all the time.
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

C4G-TK

The package can't be used as is.  It just needs to be edited to allow for install into RC2.  (Not sure how to do that or I would have repackaged it up.  I may look at it a little later to see what I come up with.)

In the meantime...

I installed the mod manually into Curve.  All the edits are able to be done that are listed in the parser.  It was as simple as doing the edits, extracting the zip file on my computer, and FTP the included files to the appropriate folders on your forum. 

-img removed-

C4G-TK

Also, I was able to go into the hb.css file that is included in the package to make the bracket show up on dark backgrounds.  You just need to change the #000 entries to colors that you use.

Pic included of it working on RC2

-img removed-

jon2s

Version 2.0 has been uploaded.  Now includes bbcodes and localizes the javascript.

If you want to change the colors of the bracket line for use on darker themes, the css file is located in the theme directory and should be fairly straight forward.

Hollar if you have problems or questions.

Thanks!

Jon

C4G-TK


-img removed-

C4G-TK

Ok, if you do what I did in this post, I don't have a problem with this mod.

Quote from: C4G-TK on January 22, 2010, 03:00:07 PM
The package can't be used as is.  It just needs to be edited to allow for install into RC2.  (Not sure how to do that or I would have repackaged it up.  I may look at it a little later to see what I come up with.)

In the meantime...

I installed the mod manually into Curve.  All the edits are able to be done that are listed in the parser.  It was as simple as doing the edits, extracting the zip file on my computer, and FTP the included files to the appropriate folders on your forum. 

But, if I install the mod with the new updated package on the mod site, there is a problem.  In IE8, it causes problems.  What happens is the area from the bottom of the post block when making a reply to the footer of the page is missing.  I asked a friend of mine to try it on their computer and there seems to be a parse error in that IE will load the page at differing points depending on the speed of the browser.  He sometimes gets the page to load further down.

Now, I'm not talking about a page loading when looking at a bracket.  I'm talking about going into any thread and hitting REPLY.  It differs as to how far the page loads depending on how much IE8 can read of the scripts.  When I take uninstall this mod, it doesn't happen. 

Also, like I said, if I do it the way that I did above with the old package, it works fine.  Can someone else confirm this new updated package with IE?

You can see a picture of the problem here: http://www.simplemachines.org/community/index.php?topic=367275.0

-img removed-

damnitmike

In IE, have you tried using the campatability setting found under TOOLS.....

I know IE has some troubles with the posting boxes.......

c23_Mike

Hi there!

Really nice mod and nice feature!
Works wonderful in my RC3 Forum!
So long, Mike

http://www.c23.at
c23 - DER Computer Club
~ never play alone ~

Advertisement: