<?php

$bgcolor1 = "#ffffff";
$bgcolor2 = "#cccccc";
$bgcolor3 = "#ffffff";
$bgcolor4 = "#eeeeee";
$textcolor1 = "#ffffff";
$textcolor2 = "#000000";

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 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 CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

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

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

function themeheader() {
	global $banners;
    echo "<body topmargin=\"0\" bgcolor=\"ffffff\" text=\"000000\" link=\"0000ff\" vlink=\"0000ff\">";
	echo "<!-- الثييم من تصميم قهوة نت -->";
    if ($banners) {
	include("banners.php");
    echo "<br>";
    }

	echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"780\" align=\"center\"><tr><td bgcolor=\"ffffff\">"
        ."<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\" bgcolor=\"ffffff\">"
		."<tr><td height=\"15\" background=\"themes/coffee4arab3/images/top1.gif\"><img src=\"images/pix.gif\" border=\"0\"></td></tr>"
		."<tr><td height=\"44\" background=\"themes/coffee4arab3/images/top2.gif\"><img src=\"images/pix.gif\" border=\"0\"></td></tr>"
		."<tr><td>"
		."<img src=\"themes/coffee4arab3/images/logo_04.gif\" border=\"0\">"
        ."<a href=\"index.php\"><img src=\"themes/coffee4arab3/images/logo_03.gif\" alt=\"مرحبا بك في $sitename\" title=\"Welcome to $sitename\" border=\"0\"></a>"
		."<img src=\"themes/coffee4arab3/images/logo_02.gif\" border=\"0\">"
		."<img src=\"themes/coffee4arab3/images/logo_01.gif\" border=\"0\">"
        ."</td></tr></table>"

		."</td></tr><tr><td valign=\"top\" width=\"100%\" bgcolor=\"ffffff\">";
    $public_msg = public_message();
    echo "$public_msg<br>";
    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\" width=\"150\" bgcolor=\"ffffff\">";
    blocks(left);
    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"100%\" valign=\"top\">";
}

function themefooter() {
    global $index;
    if ($index == 1) {
	echo "</td><td>&nbsp;&nbsp;</td><td valign=\"top\" bgcolor=\"#ffffff\">";
	blocks(right);
	echo "</td>";
    }
    echo "</td></tr></table></td></tr><tr><td><center>"
        ."<table style=\"border:1px solid #C0CC0C\" bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"10\">"
        ."<tr><td bgcolor=\"#3B76CA\" align=\"center\"><font color=\"#ffffff\">";

    footmsg();
	echo "</font></td></tr></table></td></tr>"
		."</center>"
		."</td></tr></table>";
}

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous,$tipath;

	// copyright: coffee4arab.com. DO NOT REMOVE THIS PLEASE.
    preg_match("/sid=([0-9]{1,})/", $morelink, $matches);

    echo "<table style=\"border:1px solid #C9C9C9\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td>"
		."<table style=\"border:1px solid #FFFFFF\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td bgcolor=\"#ECECEC\">"
        ."<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">"
		."<tr><td style=\"border:1px solid #C9C9C9\">"
        ."<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"
        ."<tr><td bgcolor=\"#3B76CA\" align=\"center\">"
		."<a href=\"modules.php?name=News&amp;file=article&amp;".$matches[0]."\"><font color=\"#ffffff\"><b>$title</b></font></a>"

        ."<br /><font class=\"tiny\">"
        .""._POSTEDBY." <b>";
	    formatAidHeader($aid);
    echo "</b> "._ON." $time $timezone ($counter "._READS.")"
		."</td></tr></table></td></tr>"
		."<tr><td style=\"border:1px solid #C9C9C9\" bgcolor=\"#ffffff\">"
        ."<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\"><tr><td>"
		."<font class=\"content\">";
	FormatStory($thetext, $notes, $aid, $informant);
	echo "</font></td><td valign=\"top\" width=\"10%\">"
		."<a href=\"modules.php?name=News&amp;new_topic=$topic\"><img src=\"$tipath$topicimage\" alt=\"$topictext\" border=\"0\"></a></td>"
		."</tr></table></td></tr></table>"
	."</td></tr></table>"
	."</td></tr></table><br>";

}

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid,$tipath;


	if(($informant != "") and ($informant != "$aid")) {$informant = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&username=$informant\">$informant</a> ";}

    echo "<table style=\"border:1px solid #C9C9C9\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td>"
		."<table style=\"border:1px solid #FFFFFF\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td bgcolor=\"#ECECEC\">"
        ."<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">"
		."<tr><td style=\"border:1px solid #C9C9C9\">"
        ."<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"
        ."<tr><td bgcolor=\"#3B76CA\" align=\"center\">"
		."<a href=\"modules.php?name=News&amp;file=article&amp;".$matches[0]."\"><font color=\"#ffffff\"><b>$title</b></font></a>"
	
        ."<br /><font class=\"tiny\">"
        .""._POSTEDBY." <b>$informant";
    echo "</b> "._ON." $datetime"
		."<br />الموضوع:$topictext"
		."</td></tr></table></td></tr>"
		."<tr><td style=\"border:1px solid #C9C9C9\" bgcolor=\"#ffffff\">"
        ."<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\"><tr><td>"
		."<a href=\"modules.php?name=News&amp;new_topic=$topic\"><img align=\"left\" src=\"$tipath$topicimage\" alt=\"$topictext\" border=\"0\"></a>"
		."<font class=\"content\">$thetext";	
	echo "</font>"
		."</td></tr></table></td></tr></table>"
	."</td></tr></table>"
	."</td></tr></table><br>";



}

function themesidebox($title, $content) {
	if (substr($title,0,4)=="مخفي") {
		echo $content;
	} else {
	    echo "<table style=\"border:1px solid #C9C9C9\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"150\"><tr><td>"
			."<table style=\"border:1px solid #FFFFFF\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td bgcolor=\"#ECECEC\">"
	        ."<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">"
			."<tr><td style=\"border:1px solid #C9C9C9\">"
	        ."<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"
	        ."<tr><td bgcolor=\"#3B76CA\" align=\"center\"><font color=\"#ffffff\"><b>$title</b></font></td></tr></table></td></tr>"
			."<tr><td style=\"border:1px solid #C9C9C9\" bgcolor=\"#ffffff\"><font class=\"content\">"
	        ."$content<br />"
		."</font></td></tr></table>"
		."</td></tr></table>"
		."</td></tr></table><br>";
	}
}

?>