Example #1
0
function section_news_displayNews($adm, $lnk, $num)
{
    section_news_doSelectForm($lnk, $num);
    if ($adm) {
        echo '<center><BR>' . htmlURLbutton('ADD News', 'newsadmin', 'id=0', ADMBUT);
    }
    $res = sqlQuery('select *, unix_timestamp(newsdate) as utime from ' . TBL_NEWS . " order by newsdate desc limit {$num}");
    echo "<table align=center border=0 cellspacing=0 cellpadding=1>";
    while ($obj = mysql_fetch_object($res)) {
        if ($obj->utime > $_SESSION['last_login']) {
            echo '<TR class=new>';
        } else {
            echo '<TR>';
        }
        echo '<td><i>' . $obj->newsdate . '</i></td><td align=right>';
        if ($adm) {
            htmlMiniTable(array("<i>By:</i>{$obj->authorname}", htmlURLbutSmall('Edit', 'newsadmin', "id={$obj->id}", ADMBUT)));
        } else {
            echo "<i>By:</i> {$obj->authorname}";
        }
        echo '</td></tr><TR><TD colspan=2>' . text_disp($obj->text) . '</td></tr>
      <tr><td colspan=2 align=center><hr></td></tr>';
    }
    echo "</table>";
}
Example #2
0
function section_faq()
{
    $obj = mysql_fetch_object(mysql_query("select text from bzl_siteconfig where name='faq'"));
    $faq = str_replace("<HEAD>", "<p></font><font class=hfaq><center><b>", $obj->text);
    $faq = str_replace("<Q>", "</b></font></center><hr><font class=qfaq><b>Q:</b></font>&nbsp;<font class=qfaqtxt>", $faq);
    $faq = str_replace("<A>", "</font><font class=afaq>A:</font>&nbsp;", $faq);
    echo '<BR>' . text_disp($faq) . '<BR>';
}
Example #3
0
function section_home()
{
    $obj = mysql_fetch_object(sqlQuery("select text from bzl_siteconfig where name='homepage'"));
    echo "<table align=center border=0><tr><td>" . text_disp($obj->text) . "</td></tr></table>";
    // Display some statistics!!!
    $numplayer = mysql_fetch_object(sqlQuery("select count(*) num from l_player where status !='deleted'"));
    $numnone = mysql_fetch_object(sqlQuery("select count(*) num from l_player where team=0 and status!='deleted'"));
    $numteam = mysql_fetch_object(sqlQuery("select count(*) num from l_team where status!='deleted'"));
    $numfight = mysql_fetch_object(sqlQuery("select count(*) num from " . TBL_MATCH));
    $countries = mysql_fetch_object(sqlQuery("select count(distinct(country)) num from l_player WHERE country>0 AND status!='deleted'"));
    echo '<hr><table border=0 align=center cellspacing=0 cellpadding=1>' . '<tr><td colspan=2 class=tabhead align=center>Some statistics: </td></tr>' . '<tr><td>Number of players</td><td align=right>' . $numplayer->num . '</td></tr>' . '<tr><td>Players without a team</td><td align=right>' . $numnone->num . '</td></tr>' . '<tr><td>Number of teams</td><td align=right>' . $numteam->num . '</td></tr>' . '<tr><td>Number of matches played &nbsp;</td><td align=right>' . $numfight->num . '</td></tr>' . '<tr><td>Countries Represented &nbsp;</td><td align=right>' . $countries->num . '</td></tr>' . '</table>
        <BR><BR><TABLE cellpadding=0 cellspacing=0 align=center style="border-top: solid 1px #888">
        <TR><TD><font size=1>powered by <a href="http://sf.net/projects/web-league">web-league</a> v' . CODE_VERSION . '</td></tr></table>';
}
Example #4
0
function section_links_displayLinks($adm)
{
    if ($adm) {
        echo '<center>' . htmlURLbutton('ADD New Link', 'linkadmin', 'id=0', ADMBUT) . '</center><BR>';
    }
    $res = mysql_query('select * from ' . TBL_LINKS . ' order by ord, name');
    echo "<table align=center width=95% border=0 cellspacing=0 cellpadding=4>";
    $row = 0;
    while ($obj = mysql_fetch_object($res)) {
        $c = $row++ % 2 ? 'rowodd' : 'roweven';
        echo "<tr class={$c}><td width=25%><a href=\"{$obj->url}\" target=\"_blank\">{$obj->name}</a></td>\n      <td>" . text_disp($obj->comment) . '</td>';
        if ($adm) {
            echo "<TD>[{$obj->ord}]</td><TD>" . htmlURLbutSmall('Edit', 'linkadmin', "id={$obj->id}", ADMBUT) . '</td>';
        }
        echo '</tr>';
    }
    echo "</table>";
}