Example #1
0
    </div>

    <div id="events_registered" class="sub-category">
        <div class="header">
            <span>Events registered</span>
        </div>
        <ul>
            <?php 
if (count($user_events_reg) > 0) {
    foreach ($user_events_reg as $event) {
        ?>
                <li><a href="show_event.php?id=<?php 
        echo $event['id'];
        ?>
"><?php 
        echo printEvent($event);
        ?>
</a></li>
            <?php 
    }
    ?>
        <?php 
} else {
    ?>
            <li>User isn't registered in any events</li>
            <?php 
}
?>
        </ul>
    </div>
</div>
Example #2
0
function printCompetitor($comp_id)
{
	global
		$compstable, $timestable;
	//
	$competitor = strict_query("SELECT $compstable.id, $compstable.name, $compstable.WCAid, $compstable.gender, countries.name AS cname FROM $compstable JOIN countries ON countries.id=$compstable.country_id WHERE $compstable.id=?",array($comp_id));
	if (!sql_num_rows($competitor))
	{
		echo "No such competitor in this competition!";
		return;
	}
	echo "<font size=+1>".cased_mysql_result($competitor,0,"name")."</font> &nbsp;&nbsp;·&nbsp;&nbsp; ".cased_mysql_result($competitor,0,"cname");
	$wcaid = cased_mysql_result($competitor,0,"WCAid");
	if ($wcaid) 
		echo " &nbsp;&nbsp;·&nbsp;&nbsp; see ".(cased_mysql_result($competitor,0,"gender")=="m"?"his":"her")." <a href='http://worldcubeassociation.org/results/p.php?i=".$wcaid."' target=_blank class=a_white>WCA's official results</a>";
	echo "<br>";
	//
	$scores = strict_query("SELECT * FROM $timestable WHERE comp_id=? ORDER BY cat_id, round",array($comp_id));
	if (!sql_num_rows($scores))
		echo "No scores available for this competitor yet.";
	else
	{
		$last_cat = 0;
		while ($row=cased_mysql_fetch_array($scores))
		{
			if ($row["cat_id"]!=$last_cat)
			{
				if ($last_cat) echo "</table>";
				$last_cat = $row["cat_id"];
				$print_headers = true;
			}
			else
				$print_headers = false;
			//
			printEvent(NULL,$dummy, $print_headers,$row["cat_id"],$row["round"],$comp_id);
		}
		echo "</table>";
	}
}
Example #3
0
    if (strtotime($event->start_time) + 60 * 60 * 24 < time()) {
        continue;
    }
    if (strtotime($event->realEndTime()) + 60 * 60 * 4 < time()) {
        continue;
    }
    printEvent($event, $calendarurl, $params);
}
foreach ($events as $event) {
    if (strtotime($event->start_time) + 60 * 60 * 24 > time()) {
        continue;
    }
    if (strtotime($event->realEndTime()) + 60 * 60 * 4 < time()) {
        continue;
    }
    printEvent($event, $calendarurl, $params);
}
function printEvent($event, $calendarurl, $params)
{
    echo '<div class="items-row">
		<div class="item">';
    $domdoc = new DOMDocument();
    @$domdoc->loadHTML($event->introtext);
    $tags = $domdoc->getElementsByTagName('img');
    $tag = $tags->item(0);
    if (isset($tag)) {
        if (strpos($tag->getAttribute('src'), "http") !== FALSE && !strpos($tag->getAttribute('src'), "www") !== FALSE) {
            echo '<div class="mod_helkacal_imagecontainer helkacal_bgimage" style="background-image: url(' . $tag->getAttribute('src') . ');" alt="">';
        } else {
            echo '<div class="mod_helkacal_imagecontainer helkacal_bgimage" style="background-image: url(' . JURI::root() . $tag->getAttribute('src') . ');" alt="">';
        }