<?php

/************************************************************/
/* THEME NAME: Coffee4Arab  (www.Coffee4arab.com)                               */
/* THEME DEVELOPER: سعود (s3od@q82.net)              */
/* THEME Logos and Icons from http://www.phpbb.com/        */
/* IDEA from http://ffx69.de/        */
/************************************************************/

/************************************************************/
/*                                                          */
/* Theme Colors Definition                                  */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

$thename = "coffee4arab";
$bgcolor1 = "#F1E7D3";
$bgcolor2 = "#FEF4EB";
$bgcolor3 = "#FEF4EB";
$bgcolor4 = "#FEF4EB";
$textcolor1 = "#006699";
$textcolor2 = "#006699";

function OpenTable() {
    global $bgcolor1, $bgcolor2;
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\"><tr><td>\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
}

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

function OpenTable2() {
    global $bgcolor1, $bgcolor2;
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\" align=\"center\"><tr><td>\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
}

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

function FormatStory($thetext, $notes, $aid, $informant) {
    global $anonymous;
    if ($notes != "") {
	$notes = "<br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
	$notes = "";
    }
    if ("$aid" == "$informant") {
	echo "<font size=\"2\" color=\"#505050\">$thetext<br>$notes</font>\n";
    } else {
	if($informant != "") {
	    $boxstuff = "<a href=\"modules.php?name=Your_Account?op=userinfo&amp;uname=$informant\">$informant</a> ";
	} else {
	    $boxstuff = "$anonymous ";
	}
	$boxstuff .= ""._WRITES." \"$thetext\" $notes\n";
	echo "<font size=\"2\" color=\"#505050\">$boxstuff</font>\n";
    }
}

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeheader() {
    global $user, $banners, $sitename, $slogan, $cookie, $prefix;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }

    //background coulor for the logo is #C6CFD6

    echo "<body background=\"themes/coffee4arab/images/bac.jpg\" bgcolor=\"#F0E4C8\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\">\n"
	."<table cellpadding=\"0\" cellspacing=\"0\" width=\"97%\" border=\"0\" align=\"center\" bgcolor=\"#F1E7D3\">\n"
	."<tr>\n"
	."<td bgcolor=\"#F0E4C8\" width=\"200\" align=\"right\" valign=\"middle\">\n"
	."<a href=\"index.php\"><img src=\"themes/coffee4arab/images/logo.jpg\" align=\"right\" alt=\""._WELCOMETO." $sitename\" border=\"0\"></a></td>\n"
	."<td bgcolor=\"#F1E7D3\" align=\"right\">\n"
	."\n"
	."\n"
	."<td bgcolor=\"#F0E4C8\">\n"
        ."<br>\n"
        ."\n";
        if ($banners) {
	include("banners.php");
    }
    echo "<br><td bgcolor=\"#F0E4C8\">\n"
        ."\n"
	."<bgcolor=\"#F1E7D3\" align=\"left\">\n"
        ."</select></font></form></td></tr></table></td>\n"
	."<td bgcolor=\"#F1E7D3\" valign=\"top\">&nbsp;</td>\n"
	."</tr></table>\n"
	."<table cellpadding=\"0\" cellspacing=\"0\" width=\"97%\" border=\"0\" align=\"center\" bgcolor=\"#363636\">\n"
	."<tr>\n"
	."<td bgcolor=\"#000000\" colspan=\"4\"><IMG src=\"themes/coffee4arab/images/pixel.gif\" width=\"1\" height=1 alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
	."</tr>\n"
	."<tr valign=\"middle\" bgcolor=\"#F1E7D3\">\n"
	."<td width=\"15%\" nowrap><font size=\"2\"><b>\n";
    if ($username == "Anonymous") {
	echo "&nbsp;&nbsp;<b><a href=\"modules.php?name=Your_Account\">دخول</a></font></b>\n";
    } else {
	echo "&nbsp;&nbsp;Hello $username!";
    }
    echo "</b></font></td>\n"
	."<td align=\"center\" height=\"10\" width=\"71%\"><font size=\"2\">\n"
	."<img src=\"themes/coffee4arab/images/icon_mini_login.jpg\" border=0 align=\"center\"><A href=\"index.php\"> البداية</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_search.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=Downloads\" target=\"_blank\">التحميل</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_profile.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=Your_Account\">حسابك</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_groups.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=Submit_News\">اضف مقال</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_message.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=Top\">افضل 10</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_register.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=Topics\">المقالات</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_members.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=Forums\" target=\"_blank\">المنتدى</a>&nbsp;&nbsp \n"
        ."<img src=\"themes/coffee4arab/images/icon_mini_faq.jpg\" border=0 align=\"center\"> <A href=\"modules.php?name=FAQ\">س و ج</a>&nbsp;&nbsp \n"
        ."</B></font>\n"
        ."</td>\n"
        ."<td align=\"right\" width=\"15%\"><font size=\"2\"><b>\n"
        ."<script type=\"text/javascript\">\n\n"
        ."<!--   // Array ofmonth Names\n"
        ."var monthNames = new Array( \"يناير\",\"فبراير\",\"مارس\",\"ابريل\",\"مايو\",\"يوليو\",\"جوليو\",\"اغسطس\",\"سبتمبر\",\"أكتوبر\",\"نوفمبر\",\"ديسمبر\");\n"
        ."var now = new Date();\n"
        ."thisYear = now.getYear();\n"
        ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
        ."document.write(now.getDate() + \". \" + monthNames[now.getMonth()] + \" \" + thisYear);\n"
        ."// -->\n\n"
        ."</script></b></font></td>\n"
        ."<td>&nbsp;</td>\n"
        ."</tr>\n"
        ."<tr>\n"
        ."<td bgcolor=\"#000000\" colspan=\"4\"><IMG src=\"themes/coffee4arab/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
        ."</tr>\n"
        ."</table><br>\n"
	."<!-- FIN DEL TITULO -->\n"
	."<table width=\"99%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n"
	."<td><img src=\"themes/coffee4arab/images/pixel.gif\" width=\"5\" height=\"3\" border=\"0\" alt=\"\"></td></tr></table>\n"
	."<table width=\"99%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n"
	."<td><img src=\"themes/coffee4arab/images/pixel.gif\" width=\"10\" height=\"1\" border=\"0\" alt=\"\"></td>\n"
	."<td width=\"155\" valign=\"top\">\n";
    blocks(left);
    echo "</td><td><img src=\"themes/coffee4arab/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td width=\"100%\">\n";
}

/************************************************************/
/* Function themefooter()                                   */
/*                                                          */
/* Control the footer for your site. You don't need to      */
/* close BODY and HTML tags at the end. In some part call   */
/* the function for right blocks with: blocks(right);       */
/* Also, $index variable need to be global and is used to   */
/* determine if the page your're viewing is the Homepage or */
/* and internal one.                                        */
/************************************************************/

function themefooter() {
    global $index;
    if ($index == 1) {
	echo "</td><td><img src=\"themes/coffee4arab/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td valign=\"top\" width=\"155\">\n";
	blocks(right);
    }
    echo "</td><td><img src=\"themes/coffee4arab/images/pixel.gif\" width=10 height=1 border=0 alt=\"\">\n"
	."</td></tr></table>\n"
        ."<table width=\"99%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n"
        ."<td height=\"17\">&nbsp;</td>\n"
        ."</tr></table>\n"
        ."<br>"
        ."<table width=\"97%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#FEF4EB\" align=\"center\"><tr valign=\"top\">\n"
        ."</tr><tr align=\"center\">\n"
        ."<td width=\"100%\" colspan=\"3\">\n";
    footmsg();
    echo "</td>\n"
        ."</tr>\n"
        ."</table>\n"
        ."</tr></table><center><br>تعريب وتطوير <a href=\"http://www.coffee4arab.com\"><b> قهوه نت </a></b></center>\n";
}

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#F1E7D3\" width=\"100%\"><tr><td>\n"
	."<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"#F1E7D3\" width=\"100%\"><tr><td>\n"
	."<table background=\"themes/coffee4arab/images/cellpic1.gif\" border=\"0\" cellpadding=\"3\" cellspacing=\"2\" bgcolor=\"#EEEEEE\" width=\"100%\"><tr><td align=\"left\">\n"
	."<font class=\"option\" color=\"#363636\"><center><b>&nbsp;&nbsp;$title</b></center></font>\n"
	."</td></tr></table></td></tr></table>\n";
	echo "<a href=\"modules.php?name=News&amp;new_topic=$topic\"><img src=\"$tipath$topicimage\" border=\"0\" Alt=\"$topictext\" align=\"right\" hspace=\"3\" vspace=\"0\" bgcolor=\"#EFEFEF\"></a>\n";

    FormatStory($thetext, $notes, $aid, $informant);
    echo "</td></tr></table>\n"
	."<table background=\"themes/coffee4arab/images/cellpic5.jpg\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\"><tr><td>\n"
	."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"center\">\n"
	."<font color=\"#000000\" size=\"1\">"._POSTEDBY." ";
    formatAidHeader($aid);
    echo " "._ON." $time $timezone ($counter "._READS.")<br></font>\n"
	."<font class=\"content\">$morelink</font>\n"
	."</td></tr></table></td></tr></table>\n"
	."<br>\n\n\n";
}

/************************************************************/
/* Function themeartikel-gross()                            */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid, $tipath;
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#F1E7D3\" width=\"100%\"><tr><td>\n"
        ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"#F1E7D3\" width=\"100%\"><tr><td>\n"
        ."<table background=\"themes/coffee4arab/images/cellpic1.gif\" border=\"0\" cellpadding=\"3\" cellspacing=\"2\" bgcolor=\"#EEEEEE\" width=\"100%\"><tr><td align=\"left\">\n"
        ."<font class=\"option\" size=\"1\"><center><b>&nbsp;&nbsp;$title</b></center></font><br>\n"
        ."</td></tr></table>\n"
        ."<font size=\"1\">"._POSTEDON." $datetime "._BY." ";
    $posted .= formatAidHeader($aid); echo "$posted";
    if (is_admin($admin)) {
	echo "<br>[ <a href=\"admin.php?op=EditStory&amp;sid=$sid\">"._EDIT."</a> | <a href=\"admin.php?op=RemoveStory&amp;sid=$sid\">"._DELETE."</a> ]\n";
    }
    echo "</td></tr></table></td></tr></table><br>";
    echo "<a href=\"modules.php?name=News&amp;new_topic=$topic\"><img src=\"$tipath$topicimage\" border=\"0\" Alt=\"$topictext\" align=\"right\" hspace=\"3\" vspace=\"0\" bgcolor=\"#EFEFEF\"></a>\n";
    FormatStory($thetext, $notes="", $aid, $informant);
    echo "</td></tr></table><br>\n\n\n";
}

/************************************************************/
/* Function themebox()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themesidebox($title, $content) {

	if (substr($title,0,4)=="مخفي") {
		echo $content;
	} else {
	    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" bgcolor=\"#AF6161\" width=\"150\"><tr><td>\n"
	        ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"125\">\n"
	   	."</table>\n"
	    	."<table border=\"0\" cellpadding=\"3\" cellspacing=\"2\" bgcolor=\"#F1E7D3\" width=\"100%\">\n"
		."<tr><td background=\"themes/coffee4arab/images/cellpic1.gif\" align=\"center\">\n"
		."<font class=\"titel\" size=\"2\"><b>$title</b></font>\n"
		."</td></tr>\n"
		."<tr>\n"
		."<td bgcolor=\"#F1E7D3\"><font size=\"1\">$content</td>\n"
		."</tr>\n"
		."</table></td></tr></table>\n"
		."<br>\n\n\n";
	}
}
?>