<?php

/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* 2_The_Xtreme Theme                                                   */
/* Copyright (c) 2002-2003 by MGCJerry                                  */
/* http://www.2thextreme.org                                            */
/************************************************************************/

/* Include Colors page */
include("themes/2_The_Xtreme/colors.php");

/* Open Table functions */
/* Delete or comment out the background code if you dont want stars in your modules */
function OpenTable() {
    global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"CC0000\"><tr><td>\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"000000\" background=\"themes/2_The_Xtreme/images/rdbkg.gif\"><tr><td>\n";
}

function OpenTable2() {
    global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"CC0000\" align=\"center\"><tr><td>\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"000000\" background=\"themes/2_The_Xtreme/images/rdbkg.gif\"><tr><td>\n";
}

/* Close Table Functions */
function CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

function CloseTable2() {
    echo "</td></tr></table></td></tr></table>\n";
}

/* Header Code */
function themeheader() {
        global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;

/* Credits - Please do not remove :) */
        echo "<!-- 2_The_Xtreme Theme By: MGCJerry (http://www.2thextreme.org) -->\n\n";

        echo "<body bgcolor=\"000000\" text=\"C5C5C5\" link=\"FFFFFF\" vlink=\"FFFFFF\"
        topmargin=\"3\" leftmargin=\"5\" marginwidth=\"5\">";

/* Cookie Decode, and User Theme Links */
        cookiedecode($user);
        $username = $cookie[1];
        if ($username == "") {
                $username = "Anonymous";
                $account = "Votre Compte";
                $accounturl = "modules.php?name=Your_Account";
                $theuser = "<a href=\"modules.php?name=Forums&file=profile&mode=register\">Devenez Membre";
        } else {
                $account = "Votre Compte";
                $accounturl = "modules.php?name=Your_Account";
                $theuser = "Bienvenue $username!";
        }
        
/* If user is admin, show admin link in header */
        if ($admin) {
                $adminlink = " | <a href=\"admin.php\">Admin</a>";
        }

/* Banner Code */
        if ($banners) {
                include("banners.php");
                echo "<br>";
        }
        
/* Frame Killer */
/* if a site links to yours using a frame of thiers, this will take your site out of the other site's frame */
echo "<script language=\"JavaScript\">if (window != top) top.location.href = location.href; // End --></script>\n";

/* Header HTML Code */
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100\">
    <tr>
        <td align=\"center\" valign=\"top\" rowspan=\"2\" width=\"423\" background=\"themes/2_The_Xtreme/images/mainback.gif\">&nbsp;</td>
        <td rowspan=\"2\" width=\"21\" background=\"themes/2_The_Xtreme/images/slope.gif\">&nbsp;</td>
        <td align=\"center\" valign=\"top\" rowspan=\"2\" background=\"themes/2_The_Xtreme/images/longbar.gif\">
        <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">
            <tr>
                <td height=\"22\">&nbsp;</td>
            </tr>
            <tr>
                <td align=\"center\"><font class=\"title\">$sitename<font color=\"#C5C5C5\"></font></font>
                <br>$slogan</td>
            </tr>
        </table>
        </td>
        <td rowspan=\"2\" width=\"5\" background=\"themes/2_The_Xtreme/images/end.gif\">&nbsp;</td>
    </tr>
</table>

<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#CC0000\">
    <tr>
        <td align=\"center\" width=\"150\" bgcolor=\"#000000\">
        <font color=\"#C5C5C5\"><font class=\"content\">$theuser</font></font></td>
        <td align=\"center\" bgcolor=\"#000000\"><font class=\"content\">
        <a href=\"modules.php?name=Content\">Rubriques</a> |
		<a href=\"modules.php?name=Downloads\">Téléchargements</a> |
        <a href=\"$accounturl\">$account</a> |        
        <a href=\"modules.php?name=Submit_News\">Proposer un article</a> |
        <a href=\"modules.php?name=Top\">Top10</a>
        $adminlink</font></td>
        <td align=\"center\" width=\"150\" bgcolor=\"#000000\">
        <font color=\"#C5C5C5\"><font class=\"content\">
        <script type=\"text/javascript\">
                <!--   // Array ofmonth Names
                var monthNames = new Array( \"Janvier\",\"Février\",\"Mars\",\"Avril\",\"Mai\",\"Juin\",\"Juillet\",\"Août\",\"Septembre\",\"Octobre\",\"Novembre\",\"Décembre\");
                var now = new Date();
                thisYear = now.getYear();
                if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem
                document.write(now.getDate() + \" \" + monthNames[now.getMonth()] + \" \" + thisYear);
                // -->
        </script></font></font></td>
    </tr>
</table>
<br>";

    echo "<table border=\"0 cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td>"
        ."<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td valign=\"top\" width=\"150\">";
    blocks(left);
    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>  </td><td width=\"100%\" valign=\"top\">";

}

/* Footer Code - Also affects right side blocks */
function themefooter() {
    global $index;
    if ($index == 1) {
        echo "</td><td>  </td><td valign=\"top\">";
        blocks(right);
        echo "</td>";
    }
    echo "</td></tr></table></td></tr></table>";
    footmsg();
}

/* Main page news display */
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
        global $tipath, $anonymous, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;

/* Notes */
        if ($notes != "") {
                $notes = "<tr>
                <td><font class=\"content\"><b>"._NOTE."</b> <i>$notes</i></font></td>
           </tr>\n";
        } else {
                $notes = "";
        }

/* Poster and Aid Formatting */
        if($informant != "") {
                $poster = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
        } else {
                $poster = "$anonymous ";
        }

        if ("$aid" == "$informant") {
                $posted = ""._POSTEDBY.": $poster on $time $timezone ($counter "._READS.")";
                $story = "<a href=\"modules.php?name=News&amp;new_topic=$topic\">
                <img src=\"$tipath$topicimage\" alt=\"$topictext\" align=\"right\" border=\"0\" hspace=\"15\" vspace=\"15\"></a>
                $thetext";
        } else {
                $posted = ""._POSTEDBY.": <a href=\"modules.php?name=Your_Account&op=userinfo&uname=$aid\">$aid</a> on $time $timezone ($counter "._READS.")";
                $story = "<a href=\"modules.php?name=News&amp;new_topic=$topic\">
                <img src=\"$tipath$topicimage\" alt=\"$topictext\" align=\"right\" border=\"0\" hspace=\"15\" vspace=\"15\"></a>
                <a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> "._WRITES.", \"<em>$thetext</em>\"";
        }

/* Story HTML */
echo "<table border=\"0\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr>
        <td colspan=\"3\"><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
            <tr>
                <td height=\"25\" width=\"350\" background=\"themes/2_The_Xtreme/images/storyhead.gif\"><strong>&nbsp;$title</strong></td>
                <td height=\"25\" background=\"themes/2_The_Xtreme/images/storystrip.gif\">&nbsp;</td>
                <td height=\"25\" width=\"5\" background=\"themes/2_The_Xtreme/images/storyend.gif\">&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td background=\"themes/2_The_Xtreme/images/storyback.gif\">&nbsp;</td>
        <td bgcolor=\"000000\" background=\"themes/2_The_Xtreme/images/rdbkg.gif\"><table border=\"0\" border=\"0\"
        cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">
            <tr>
                <td><font class=\"content\">$story</font></td>
           </tr>
           $notes
        </table><br>
        <table align=\"center\" width=\"90%\" bgcolor=\"$bgcolor2\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">
            <tr>
                <td bgcolor=\"$bgcolor1\"><center><font class=\"tiny\">$posted<br>$morelink</font></center></td>
            </tr>
        </table><br>
        </td>
        <td width=\"5\" background=\"themes/2_The_Xtreme/images/storybackend.gif\">&nbsp;</td>
    </tr>
    <tr>
        <td colspan=\"3\"><table border=\"0\" width=\"100%\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
            <tr>
                <td height=\"25\" width=\"5\" background=\"themes/2_The_Xtreme/images/storybackendfoot.gif\">&nbsp;</td>
                <td height=\"25\" background=\"themes/2_The_Xtreme/images/storystripfoot.gif\">&nbsp;</td>
                <td height=\"25\" width=\"350\" background=\"themes/2_The_Xtreme/images/storyfoot.gif\">&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<br>";
}

/* Article Display - Also affects post/view comments */
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
        global $tipath, $anonymous, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;

/* Poster and Aid Formatting */
        if($informant != "") {
                $poster = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
        } else {
                $poster = "$anonymous ";
        }

        if ("$aid" == "$informant") {
                $posted = ""._POSTEDBY.": $poster";
                $story = "<a href=\"modules.php?name=News&amp;new_topic=$topic\">
                <img src=\"$tipath$topicimage\" alt=\"$topictext\" align=\"right\" border=\"0\" hspace=\"15\" vspace=\"15\"></a>
                $thetext";
        } else {
                $posted = ""._POSTEDBY.": <a href=\"modules.php?name=Your_Account&op=userinfo&uname=$aid\">$aid</a>";
                $story = "<a href=\"modules.php?name=News&amp;new_topic=$topic\">
                <img src=\"$tipath$topicimage\" alt=\"$topictext\" align=\"right\" border=\"0\" hspace=\"15\" vspace=\"15\"></a>
                <a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> "._WRITES.", \"<em>$thetext</em>\"";
        }

/* Story HTML */
echo "<table border=\"0\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr>
        <td colspan=\"3\"><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
            <tr>
                <td height=\"25\" width=\"350\" background=\"themes/2_The_Xtreme/images/storyhead.gif\"><strong>&nbsp;$title</strong></td>
                <td height=\"25\" background=\"themes/2_The_Xtreme/images/storystrip.gif\">&nbsp;</td>
                <td height=\"25\" width=\"5\" background=\"themes/2_The_Xtreme/images/storyend.gif\">&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td background=\"themes/2_The_Xtreme/images/storyback.gif\">&nbsp;</td>
        <td bgcolor=\"000000\" background=\"themes/2_The_Xtreme/images/rdbkg.gif\"><table border=\"0\" border=\"0\"
        cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">
            <tr>
                <td><font class=\"content\">$story</font></td>
           </tr>
        </table><br>
        <table align=\"center\" width=\"90%\" bgcolor=\"$bgcolor2\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">
            <tr>
                <td bgcolor=\"$bgcolor1\"><center><font class=\"tiny\">$posted<br>$morelink</font></center></td>
            </tr>
        </table><br>
        </td>
        <td width=\"5\" background=\"themes/2_The_Xtreme/images/storybackend.gif\">&nbsp;</td>
    </tr>
    <tr>
        <td colspan=\"3\"><table border=\"0\" width=\"100%\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
            <tr>
                <td height=\"25\" width=\"5\" background=\"themes/2_The_Xtreme/images/storybackendfoot.gif\">&nbsp;</td>
                <td height=\"25\" background=\"themes/2_The_Xtreme/images/storystripfoot.gif\">&nbsp;</td>
                <td height=\"25\" width=\"350\" background=\"themes/2_The_Xtreme/images/storyfoot.gif\">&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<br>";
}

/* Blocks Code */
function themesidebox($title, $content) {
//    $content = str_replace("&middot;","<img src='themes/2_The_Xtreme/images/arrow.gif' alt='Arrow'>","$content");
    echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"150\">
    <tr>
        <td background=\"themes/2_The_Xtreme/images/blockhead.gif\" height=\"22\"><font class=\"content\"> <strong>$title</font></strong></td>
    </tr>
    <tr>
        <td background=\"themes/2_The_Xtreme/images/blockstrip.gif\"><font class=\"content\"> $content</font></td>
    </tr>
    <tr>
        <td background=\"themes/2_The_Xtreme/images/blockfoot.gif\" height=\"22\">&nbsp;</td>
    </tr>
</table>
<br>";
}

?>
