示例#1
0
/**
 * displayNews($data)
 * Function that takes an array of news and displays it as html
 * @param data - associative array of news from the database
 */
function displayNews($data, $short = false)
{
    date_default_timezone_set("America/New_York");
    if (empty($data)) {
        ReportError("Sorry, we found no news using these parameters.");
        echo "<br />";
    }
    foreach ($data as $news) {
        $numComments = getNumOfComments($news['news_id']);
        OpenContent();
        ?>
	
			<div class="contentHeading">
					<table width="100%">
						<tr>
							<td style="text-align:left;"><?php 
        echo $news['title'];
        ?>
</td>
							<td style="text-align:right;">Posted by: <?php 
        echo $news['author'];
        ?>
</td>
						</tr>
					</table>
			</div>
			<div class="content news">
				<img src="modules/news/categories/<?php 
        echo $news['catimage'];
        ?>
" alt="<?php 
        echo $news['catname'];
        ?>
" align="right" />
				<?php 
        if ($short) {
            echo substr(bbcode_format($news['message']), 0, 1000) . "...";
            echo '<br /><br /><a href="?load=news&id=' . $news['news_id'] . '">Continue reading.</a>';
        } else {
            echo bbcode_format($news['message']);
        }
        if (!is_null($news['eauthor'])) {
            echo "<br /><div style=\"text-align:right; font-size: 10px; font-style:italic;\">Last edit: " . date('F j, Y, g:i a T', strtotime($news['edited'])) . " by " . $news['eauthor'] . "</div>";
        }
        ?>
			</div>	
			<div class="contentFooter">
				<table width="100%">
					<tr>
						<td style="text-align:left;">
							View Comments: <a href="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?load=news&amp;id=<?php 
        echo $news['news_id'];
        ?>
"><?php 
        echo $numComments;
        ?>
 Comments</a>
						</td>
						<td style="text-align:right;">Posted: <?php 
        echo date('D F j, Y, g:i a T', strtotime($news['date']));
        ?>
</td>
					</tr>
				</table>
			</div>
	
	<?php 
        CloseContent();
        echo "<br />";
    }
}
示例#2
0
    ?>
">View</a></td>
  <td class="rudi"><?php 
    echo $drill->date;
    ?>
 </td>
</tr>
<?php 
}
?>
</table>

</div>
<?php 
CloseContent();
OpenContent();
if (isset($_GET['stats']) && $_GET['stats'] == 'true') {
    ?>
<div class="contentHeading">Statistics</div>
<div class="content">
<?php 
    //decho($drills->getMemberAttendanceFull());
    require_once 'view.drills.statistics.php';
    ?>
</div>
</div>

<?php 
}
?>
示例#3
0
function OpenBlock($title = 'New Block')
{
    OpenContent();
    echo "<div class=\"contentHeading\">{$title}</div>";
    echo "<div class=\"content\">";
}