World Cup 2014 soccer ball, Adidas Brazuca

I did some coding yesterday to run a 2014 World Cup confidence pool on SportsFilter. The way a confidence pool works is you assign points to teams based on how confident you are they will win. In this contest, you get point values from 32 down to 1 and assign them to the 32 World Cup teams. The more points you assign a team, the more you are awarded when that team wins or ties a match.

Anyone can sign up for a SportsFilter account and play. A prize will be awarded to the winner: the Adidas replica version of the official World Cup ball. The deadline for entries is shortly before the first match Thursday.

I wrote the web application in PHP, stored the database in MySQL and used the Smarty PHP template engine for the presentation. This was a project I had to complete in a single day, so I didn't think I'd go to the trouble of using Smarty. I figured I would just kludge together some ugly PHP pages that had code and HTML markup mixed together.

But Smarty makes it easier to present the HTML output of a PHP web application. I find that I write better PHP code when I use it and there's less debugging required to get things right.

The way Smarty works is you write a PHP script that does the work such as collecting user input and storing data, make some variables from that script available to Smarty and tell it to load a template file that contains HTML and some simple code to present information.

Here's the last part of the script that displays the contest entry form and validates what the user has submitted:

// make data available to templates
$smarty->assign('spofi', $spofi);
$smarty->assign('page_title', "Enter the SportsFilter World Cup 2014 Confidence Pool");
$smarty->assign('spofi', $spofi);
$smarty->assign('form_output', $form_output);
$smarty->assign('error_message', $error_message);
$smarty->assign('random_team', $random_team);
$smarty->assign('submit_widget', $submit_widget);

// display output
$smarty->display('header.tpl');
$smarty->display('confidence-pool.tpl');
$smarty->display('footer.tpl');

Those three .tpl files are templates. The header and footer contain the SportsFilter layout and the main body of the page is in confidence-pool.tpl.

Here's a portion of that template:

{$error_message}
<p><form action="/confidence-pool.php" method="post">
{$form_output}
<input type="submit" value="Preview My Entry" name="command">
{$submit_widget}
</form>

Smarty's template language can do more than display variables. It has for loops to display every element in an array and formatting functions that can do things such as control how the elements of a date are displayed.

I also used it on Wargames.Com. Here's some template code from the state directory pages:

{foreach from=$stores item=store}
<p class="directorystore">
<span class="directorystorename"><a href="{$store.link}">{$store.name}</a><br /></span>
{if $store.phone neq ''}<span class="directorystorephone">{$store.phone}<br /></span>{/if}
<span class="directorystorelocation">{$store.city}, {$store.statename} {$store.zip}<br /></span>
</p>
{/foreach}

The $stores variable is an array with link, name, phone, city, statename and zip elements.

The ultimate goal of today's project is to make it possible for a website's users to create and run their own confidence pools for any sporting event that lends itself to this type of contest. One sport it would be ideal for is the NFL, with players ranking the teams playing that weekend and competing all season.

-- Rogers Cadenhead

Comments

I love this website - its so usefull and helpfull.
fotbollstrojor www.afterglowvp.com


 

You're a very valuable site; couldn't make it without ya!
fodboldtr?jer www.crimsontee.com


 

Extremely user friendly website. Astounding details offered on couple of clicks on.
maglie calcio www.synchronizationofus.com


 

Disentangle your scoring. Try not to make your scoring excessively entangled, or partaking turns out to be more work than fun. The most widely recognized strategy for scoring is the focuses framework, where players acquire focuses for each effective pick.


 

Passion the website-- extremely user friendly and whole lots to see!
fotbollstr?jor www.tampabaygoodliving.com


 

Extremely user friendly website. Tremendous information readily available on few clicks.
billige fotballdrakter www.nottheitgirls.com


 

I love this website - its so usefull and helpfull.
nuove maglie calcio www.glivytech.com


 

You've among the finest web pages.
fodboldtr?jer www.zamanthajoeh.com


 

You've one of the better sites.
billige fotballdrakter www.travelstobhutan.com


 

I value the content on your websites. Thanks a lot!
maglie calcio poco prezzo www.doralcentermall.com


 

You're a really valuable web site; couldn't make it without ya!
maglie calcio www.haeroo.com


 

Hey there, neat online site you've going here.
Magliette Calcio Poco Prezzo www.wendtsporkpalace.com


 

Really....this is a invaluable web-site.
Maglie Calcio a poco prezzo www.niveauradio.com


 

This paragraph will help the internet viewers for setting up new weblog or even a weblog from start to end.
pikachu onesie bookbuilder.cast.org


 

Thanks pertaining to providing these sort of substantial post.


 

Thanks meant for supplying this type of superb write-up.


 

Basically wanted to stress Now i'm ecstatic that i came onto your page!|


 

Lovely Website, Maintain the beneficial job. Thanks for your time!|


 

Maintain the great work and producing in the crowd!


 

Great looking internet site. Presume you did a bunch of your very own coding.
Monaco Tr?jor www.bettermensolutions.com


 

I adore this website - its so usefull and helpfull.
Napoli Tr?jer www.asleftasfound.com


 

Amazing internet site you've got in here.
Maglia Chelsea Poco Prezzo www.zeropartypolitics.com


 

You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complex and extremely broad for me. I'm looking forward for your next post, I'll try to get the hang of it!


 

good night
good morning
happy birthday
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good night
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
good morning
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night Messages
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night quotes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Good night wishes
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari/a>
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
best whatsapp status
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
Diwali Messages
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
good night messages for girlfriend
Night Text Messages For Her
Night Text Messages For Her
Night Text Messages For Her
Night Text Messages For Her
Night Text Messages For Her
Night Text Messages For Her

Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Girlfriend Collection
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Good Night Messages For Her
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Whatsapp Status | Romantic And Sad
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari
Love Shayari

Very usefull article thanks ... keep writing such articles :)
I'm so happy bcoz you are write this post for everyone thnxx a lot

Good night messages for girlfriend

Good Morning messages for girlfriend

Good night love SMS | Romantic Night SMS

Rohit sharma Accountant | Blogger

Good Night Messages For Her

Girlfriend Impress Images and Wallpapaer

I love u messages for girlfriend

Good Night Messages for mother

Good Night Images HD Wallpaper

Happy Diwali Wishes For Girlfriend

Diwali Wishes 2018

Good night messages wishes and quotes

Raksha Bandhan Wishes For Sister *Raksha Bandhan Wishes*

#50 Sweet Good Night Messages For Wife: Romantic Night Quotes For Wife

#50 *Girlfriend Propose Messages* Heart Touching

Good Morning Messages For Wife

Good Morning Messages For Friends

Happy New Year Wishes 2019: Best New Year Messages

I love u Messages for wife

i love u messages for dad

i love u messages for son

i love u messages for mother

good night messages for uncle and aunt

good night images for girlfriend

good night images for whatsapp and facebook

good night quotes messages , wishes, for husband

Good Morning Messages For Friends

Raksha Bandhan Images Brother and Sister

Love Shayari -Love Romantic Shayari

Best Whatsapp Status

Love Attitude Status For Girls & Boys


 

Add a Comment

These HTML tags are permitted: p, b, i, a, and blockquote. A comment may not include more than three links. Participants in this discussion should note the site's moderation policy.