mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-13 08:27:41 +00:00
90 lines
2.7 KiB
PHP
90 lines
2.7 KiB
PHP
<?php
|
|
/* Array functions */
|
|
// Search array for data
|
|
function inArray( $needle, $haystack )
|
|
{
|
|
$found = false;
|
|
|
|
for ( $ptr = 0 ; $ptr < count ( $haystack ) ; $ptr++ ) {
|
|
if ( $haystack[$ptr] == $needle ) {
|
|
$found = true;
|
|
}
|
|
}
|
|
return $found;
|
|
}
|
|
|
|
/* Sections */
|
|
function isFocused( $name, $newname )
|
|
{
|
|
return ( strToLower( $name ) == strToLower( $newname ) ) ? 1 : 0;
|
|
}
|
|
|
|
function iconLink ( $url, $img, $desc, $border )
|
|
{
|
|
echo '<TD><A class="tabs" href="' . $url . '"><IMG src="' . $img . '" alt="' . $desc . '" border="' . $border . '" width="24" height="24"></A></TD>';
|
|
}
|
|
|
|
/* Menu functions */
|
|
// Create a Menu item
|
|
function menuItemLink( $url, $desc )
|
|
{
|
|
echo '<A CLASS="menus" HREF="' . $url . '">' . $desc . '</A><BR>';
|
|
}
|
|
// Create a Menu Section header
|
|
function menuSectionHeader( $name, $fgColor , $bgColor )
|
|
{
|
|
echo "\n<!-- menuSectionHeader(" . $name . ') -->';
|
|
echo '<TABLE cellSpacing="0" cellPadding="3" width="100%" border=0 bgColor="' . $bgColor . '">';
|
|
echo ' <TR bgColor="' . $color . '">';
|
|
echo ' <TD align="center">';
|
|
echo ' <IMG src="/img/blank.gif" height="1" width="135" alt="" border="0"><BR>';
|
|
echo ' <SPAN class="titlebar"><FONT color="' . $fgColor . '">' . $name . '</FONT></SPAN>';
|
|
echo ' </TD>';
|
|
echo ' </TR>';
|
|
echo ' <TR align="right" bgColor="#4b4f66">';
|
|
echo ' <TD>';
|
|
}
|
|
// Create a Menu Section footer
|
|
function menuSectionFooter()
|
|
{
|
|
echo ' </TD>' .
|
|
' </TR>' .
|
|
'</TABLE>';
|
|
}
|
|
/* Table functions */
|
|
//
|
|
function tableBoxHeader( $name, $cols, $fgColor, $bgColor, $intBgColor )
|
|
{
|
|
echo '<TABLE cellSpacing="0" cellPadding="1" width="100%" border="0" bgColor="' . $bgColor . '">' .
|
|
' <TR>' .
|
|
' <TD>' .
|
|
' <TABLE cellspacing="1" cellpadding="2" width="100%" border="0" bgcolor="' . $intBgColor . '">' .
|
|
' <TR bgColor="' . $bgColor . '" align="center">' .
|
|
' <TD colspan="' . $cols . '">' .
|
|
' <SPAN class="titlebar">' . $name . '</SPAN>' .
|
|
' </TD>' .
|
|
' </TR>';
|
|
}
|
|
|
|
function tableBoxFooter()
|
|
{
|
|
echo ' </TABLE>' .
|
|
' </TD>' .
|
|
' </TR>' .
|
|
'</TABLE>';
|
|
}
|
|
|
|
function tableNewsItem( $date, $user, $text )
|
|
{
|
|
echo '<TR><TD><DL><DT>Posted on ' . $date . ' by ' . $user . '</DT>' .
|
|
' <DD>' . $text . '</DD>' .
|
|
'</DL></TD></TR>';
|
|
}
|
|
|
|
function tableSpacer( $height, $width, $cols, $bgColor )
|
|
{
|
|
echo '<TD colSpan="' . $cols . '" width="' . $width . '" bgColor="' . $bgColor . '">';
|
|
echo ' <IMG src="/img/misc/blank.gif" height="' . $height . '" width="' . $width . '" border="0" alt="">';
|
|
echo '</TD>';
|
|
}
|
|
?>
|