Exemple #1
0
    public function tcapi_active_contests($atts)
    {
        $contest_type = $atts['type'];
        $userkey = get_option('api_user_key');
        $post_per_page = get_option('contest_per_page');
        $contest_list = get_active_contests($userkey, $contest_type, 1, $post_per_page);
        if ($contest_list->data == null) {
            return "Error in processing request";
        } else {
            $html = '
		<div class="tc_contest">
			<input type="hidden" class="page" value="1" />
			<input type="hidden" class="postPerPage" value="' . $post_per_page . '" />
			<div class="contestPagination">
				<a href="javascript:;" class="pagePrev">&lt;&lt; Previous</a>
				<span>|</span>
				<a href="javascript:;" class="pageNext">Next &gt;&gt;</a>
				</div>
				<table class="contestTable">
					<colgroup>
						<col width="315">
						<col width="140">
						<col span="2" width="71">
					</colgroup>
					<thead>
						<tr class="head">
						<td height="17">Contest</td>
						<td>Contest Type</td>
						<td align="center">First Prize</td>
						<td align="center">End</td>
						</tr>
					</thead>
					<tbody>
		';
            $count = 0;
            foreach ($contest_list->data as $contest) {
                $cls = '';
                if ($count % 2 == 0) {
                    $cls = "odd";
                }
                $html .= '<tr class="' . $cls . '"><td><a href="http://community.topcoder.com/tc?module=ProjectDetail&pj=' . $contest->contestId . '">' . $contest->contestName . ' </a></td>
						<td>' . $contest->type . '</td>
						<td align="center"> $' . $contest->firstPrize . '</td>
						<td align="center">' . $contest->submissionEndDate . '</td></tr>';
                $count += 1;
            }
            $html .= '
						</tbody>
						</table>
					</div>
					<!-- /.tc_contest -->
		';
            return $html;
        }
    }
						<div class="sideQuote">
							<p class="quoteTxt">“<?php 
echo $quote;
?>
”</p>
							<p class="quoterName"><?php 
echo $qAuthor;
?>
</p>
						</div>
						<!-- /.sideQuote -->

						<div class="sideMostRecentChallenges">
							<h3>Most Recent Challenges</h3>
							<?php 
$contest = get_active_contests('develop', '30000000');
?>
							<ul>									
								<li><a class="contestName contestType1" href="<?php 
bloginfo('wpurl');
?>
/challenges/<?php 
echo $contest->contestId;
?>
">
										<i></i><?php 
echo $contest->contestName;
?>
									</a></li>
								<li class="alt"><a class="contestName contestType2" href="<?php 
bloginfo('wpurl');