# This file is auto generated and contains a perl hash of
# your template globals for 'twitch' template set.
# Generated on: Wed Mar 16 15:40:42 2016
{
'ad_300x250' => '',
'ad_300x600' => '',
'ad_728x90' => '
',
'ad_wallpaper' => '',
'comscore' => '
',
'current_poll' => 'home',
'fb_pixel' => '
',
'forum_url' => 'sub {
return $CFG->{cgi_root_url};
}',
'ga_link_tracker' => '',
'get_cgi' => 'sub {
my $in = $IN->get_hash();
return $in;
}',
'get_cgi_value' => 'sub {
my $name = shift || return;
my $val = $IN->param($name);
return $val ? { \'cgi_\' . $name => $val } : {};
}',
'google_analytics' => '
',
'main_site_url' => 'http://www.slowtwitch.com',
'mixed_calendar_loop' => 'sub {
my ($user_id, $username) = @_;
my (@racetags, @race_loop);
my $db = $DB->table("User");
my $sth = $db->select(["user_racetags"], { user_username => $username }) or die($GT::SQL::error);
my ($racetags) = $sth->fetchrow_array;
if ($racetags) {
$racetags =~ s/\s*|^,//g;
$racetags =~ s/,$//g;
@racetags = split (\',\',$racetags);
$db = $DB->table("Triathlons");
my $cond = GT::SQL::Condition->new(\'uid\',\'=\', \@racetags);
$db->select_options(\'ORDER BY date ASC\');
my $sth = $db->select($cond) or die $GT::SQL::error;
while (my $result = $sth->fetchrow_hashref) {
$result->{racedate} = GT::Date::date_transform($result->{date}, \'%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%\', \'%ddd% %mmm% %dd% %yyyy%\');
push @race_loop, {
name => $result->{name},
location => "$result->{city}, $result->{state}",
racedate => "$result->{racedate}",
url => "http://forum.slowtwitch.com/racecalendar/$result->{statetag}/$result->{nametag}-$result->{uid}.html",
date => $result->{date},
};
}
}
my $sth = $DB->table("UserPersonalRace", "PersonalRace")->select({ user_id_fk => $user_id });
while (my $row = $sth->fetchrow_hashref) {
my $added;
for (my $i = 0; $i < @race_loop; ++$i) {
if (GT::Date::date_is_smaller($row->{pr_date}, $race_loop[$i]->{date})) {
my $racedate = GT::Date::date_transform($row->{pr_date}, \'%yyyy%-%mm%-%dd%\', \'%ddd% %mmm% %dd% %yyyy%\');
splice @race_loop, $i, 0, {
id => $row->{pr_id},
name => $row->{pr_name},
location => "$row->{pr_city}, $row->{pr_state}, $row->{pr_country}",
racedate => $racedate,
url => $row->{pr_url},
date => $row->{pr_date},
user_race=> 1
};
$added = 1;
last;
}
}
unless ($added) {
my $racedate = GT::Date::date_transform($row->{pr_date}, \'%yyyy%-%mm%-%dd%\', \'%ddd% %mmm% %dd% %yyyy%\');
push @race_loop, {
id => $row->{pr_id},
name => $row->{pr_name},
location => "$row->{pr_city}, $row->{pr_state}, $row->{pr_country}",
racedate => $racedate,
url => $row->{pr_url},
date => $row->{pr_date},
user_race=> 1
};
}
}
return { race_loop => \@race_loop };
}',
'quantcast' => '
',
'site_description' => '',
'slowtwitch_retailer_loop' => 'sub {
my $username = shift;
my @shoptags;
my $db = $DB->table("User");
my $sth = $db->select(["user_shoptags"], { user_username => $username }) or die($GT::SQL::error);
my ($shoptags) = $sth->fetchrow_array;
if ($shoptags) {
$shoptags =~ s/\s*|^,//g;
$shoptags =~ s/,$//g;
my @shop_loop;
@shoptags = split (\',\',$shoptags);
$db = $DB->table("Retailers");
my $cond = GT::SQL::Condition->new(\'retailer_id\',\'=\', \@shoptags);
$db->select_options(\'ORDER BY retailer_name ASC\');
my $sth = $db->select($cond);
while (my $result = $sth->fetchrow_hashref) {
push @shop_loop, {
name => $result->{retailer_name},
location => "$result->{retailer_city}, $result->{retailer_state}",
url => "http://www.slowtwitch.com/retailers/individual.php?retailer_id=$result->{retailer_id}",
};
}
return { shop_loop => \@shop_loop };
}
}',
'ticker_flashvars_loop' => 'sub {
my @flashvars_links_loop;
my $db = $DB->table(\'Ticker\');
my $sth = $db->do(\'SELECT ticker_text, ticker_link FROM gforum_Ticker\');
while (my $result = $sth->fetchrow_hashref) {
$result->{ticker_link} =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
$result->{ticker_text} =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
push @flashvars_links_loop, {
coupon => $result->{ticker_text},
url => $result->{ticker_link}
};
}
return { \'flashvars_links_loop\' => \@flashvars_links_loop };
}',
'ticker_loop' => 'sub {
my @coupon_links_loop;
my $db = $DB->table(\'Forum\');
my $sth = $db->do(\'SELECT ticker_text, ticker_link FROM glinks_Ticker ORDER BY ticker_text ASC\');
while (my $result = $sth->fetchrow_hashref) {
push @coupon_links_loop, {
coupon => $result->{ticker_text},
url => $result->{ticker_link}
};
}
return { \'coupon_links_loop\' => \@coupon_links_loop };
}',
'tri_search' => '
'
};
# vim:syn=perl:ts=4:noet