<?php
//////////////////////////////////////////
//
//
//        تم تصميم هذا الثييم بواسطة قهوة نت
//       http://www.coffee4arab.com
//
//          coffee4arab@yahoo.com
//////////////////////////////////////////


$bgcolor1 = "#ffffff";
$bgcolor2 = "#EEF4FD";
$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;uname=$informant\">$informant</a> ";
//	} else {
//	    $boxstuff = "$anonymous ";
//	}
	$boxstuff .= "$thetext $notes\n";
	echo "<font class=\"news\">$boxstuff</font>\n";
    }
}

function themeheader() {
	global $banners;
    echo "<body topmargin=\"0\" bgcolor=\"ffffff\" text=\"000000\" link=\"0000ff\" vlink=\"0000ff\">";
    echo ""
	."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td bgcolor=\"ffffff\">"
        ."<table bgcolor=\"#EEF4FD\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\" bgcolor=\"ffffff\"><tr><td>"
        ."<a href=\"index.php\"><img src=\"images/logo.jpg\" alt=\"Welcome to $sitename\" title=\"Welcome to $sitename\" border=\"0\"></a>"
        ."</td><td align=\"left\">";
    if ($banners) {
	include("banners.php");
    }
		echo "</td></tr></table>"
			

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

function themefooter() {
    global $index;
    if ($index == 1) {
	echo "</td><td width=\"4\" bgcolor=\"#ffffff\"><img width=\"4\" src=\"themes/thekiller/images/pixel.gif\"></td>"
		."<td bgcolor=\"#ffffff\" valign=\"top\"><br>";
	blocks(right);

    }
    echo "</td></tr></table></td>"
//		."</tr><tr><td height=\"5\" bgcolor=\"#ffffff\"><img height=\"5\" src=\"themes/thekiller/images/pixel.gif\"></td>"
		."</tr><tr><td height=\"1\" bgcolor=\"#84AAD6\"><img height=\"1\" src=\"themes/thekiller/images/pixel.gif\"></td>"
		."</tr></table><center><br>";
    footmsg();
}	echo "</center>";

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous;
	// copyright: coffee4arab.com. DO NOT REMOVE THIS PLEASE.
    preg_match("/sid=([0-9]{1,})/", $morelink, $matches);

    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\"><tr><td>"
//        ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"#E7E7E7\">"
        ."<a class=\"titlelink\" href=\"modules.php?name=News&amp;file=article&amp;".$matches[0]."\"><b>$title</b></a><br>"
        ."<font class=\"tiny\">";
//        .""._POSTEDBY." <b>";
//    formatAidHeader($aid);
    echo "$time ($counter "._READS.")"
	."</font></td></tr><tr><td bgcolor=\"ffffff\">";
    FormatStory($thetext, $notes, $aid, $informant);
    echo "<br><br>"
        ."</td></tr></table>"
//		."</td></tr></table>"
	."<br>";
}

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid;
    if ("$aid" == "$informant") {
	echo"
	<table border=0 cellpadding=3 cellspacing=1 width=100%><tr><td bgcolor=\"#EEF4FD\">
	<font color=\"green\" class=\"news\"><b>$title</b></font><br><font class=tiny>$datetime";
	if ($admin) {
	    echo "&nbsp;&nbsp; $font2 [ <a href=admin.php?op=EditStory&sid=$sid>Edit</a> | <a href=admin.php?op=RemoveStory&sid=$sid>Delete</a> ]";
	}
	echo "
	<br>الموضوع: <a href=modules.php?name=News&amp;new_topic=$topic>$topictext</a>
	</td></tr><tr><td bgcolor=ffffff>
	<font class=\"news\">$thetext</font>
	</td></tr></table><br>";
    } else {
	if($informant != "") $informant = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&uname=$informant\">$informant</a> ";
	else $boxstuff = "$anonymous ";
	$boxstuff .= "writes <i>\"$thetext\"</i> $notes";
	echo "
	<table border=0 cellpadding=3 cellspacing=1 width=100%><tr><td bgcolor=\"#EEF4FD\"><font color=\"green\" class=\"news\">
	<b>$title</b></font><br><font class=content>$datetime</font>";
	if ($admin) {
	    echo "&nbsp;&nbsp; $font2 [ <a href=admin.php?op=EditStory&sid=$sid>Edit</a> | <a href=admin.php?op=RemoveStory&sid=$sid>Delete</a> ]";
	}
	echo "
	<br>الموضوع: <a href=modules.php?name=News&amp;new_topic=$topic>$topictext</a>
	</td></tr><tr><td bgcolor=ffffff><font class=\"news\">
	$thetext
	</font>
	</td></tr></table><br>";
    }
}

function themesidebox($title, $content) {

	if (substr($title,0,4)=="مخفي") {
		echo $content;
	} else {
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"150\" bgcolor=\"#6C81DC\"><tr><td>"
        ."<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td bgcolor=\"#EEF4FD\">"
        ."<font class=\"content\">$title</font></td></tr><tr><td bgcolor=\"#F0F0F0\"><font class=\"content\">"
        ."$content"
	."</font></td></tr></table></td></tr></table><br>";
	}
}

?>