<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.5 www.bcoos.net 2006-08 GPL
//v1.4 www.exoops.info 2006/03 
// $Id: theme.php,v 1.37 2003/08/17 20:07:47 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
/************************************************************/
/* Theme Name: e-xoops (v1.1)                               */
/* By Half-Dead (http://www.e-xoops.com)                    */
/* Last Updated: Sep/10/2002                                */
/************************************************************/
// Change to the foldername of your theme
define("XOOPS_THEME", "e-xoops");
// --------------------------------------------------------------------------------------//
/**********************************************************************/
/* Function themeheader()                                             */
/*                                                                    */
/* Everything that comes before stuff in the center of your site.     */
/* It's goes up to the first <td> right before center stuff appears.  */
/*                                                                    */
/* themeheader<td>                                                    */
/* center stuff                                                       */
/* </td>themefooter                                                   */
/**********************************************************************/
function themeheader($show_rblock=0) {
global $bcoosConfig, $xoopsUser,$db;
?>
<script type="text/javascript" src="<?php echo XOOPS_URL;?>/include/date.js" ></script>
<!-- HTML CODE --></head>
<?php if ($xoopsUser) { ?>
<body onload="startclock();" background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_grid.gif">
<?php } else { ?>
<body onload="startclock();document.loginform.uname.focus();" background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_grid.gif">
<?php } ;?>
<?php OpenWaitBox();?>
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0"><tr><td>
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0"><tr>
<td width="160" height="75" align="left" valign="middle" class="exoops"><a href="<?php echo XOOPS_URL.'/';?>"><img src="<?php echo XOOPS_URL."/images/".$bcoosConfig['logo'];?>" alt="<?php echo $bcoosConfig['title'];?>"  border="0" align="left" /></a></td>
<td colspan="2"><div align="center"><?php showbanner();?></div></td>
</tr></table>
<table width="100%" border="0" align="center" height="25" cellspacing="0" cellpadding="0"><tr>
<td colspan="2" align="center">
</td>
</tr><tr class="loginbar">
 <?php if ($xoopsUser) { ?>
<td  class="loginbar" align="left" >&nbsp;
<?php 
echo "<b>&nbsp;&nbsp;&nbsp;<a href='".XOOPS_URL."/user.php'>"._VIEWACCOUNT."</a>";
echo "&nbsp;&nbsp;&nbsp;<a href='".XOOPS_URL."/user.php?op=logout'>"._LOGOUT."</a>";
list($total_messages) = $db->fetchRow($db->query("SELECT COUNT(*) FROM ".$db->prefix("priv_msgs")." WHERE to_userid = ".$xoopsUser->getVar("uid").""));
list($new_messages)   = $db->fetchRow($db->query("SELECT COUNT(*) FROM ".$db->prefix("priv_msgs")." WHERE to_userid = ".$xoopsUser->getVar("uid")." AND read_msg=0"));
if ($total_messages > 0) {
	if ($new_messages > 0) {
		echo  "&nbsp;&nbsp;&nbsp;".$new_messages.": <a id='msgtxt' href='".XOOPS_URL."/viewpmsg.php' onmouseover='setBlink(0);' onmouseout='setBlink(1);'><b>"._NEWMESSAGES."</b></a><br />";
		if ( !defined('EXOOPS_PM_INCLUDED') ) {
			
		}
		echo  '
					<script type="text/javascript">
					<!--
					var blink    = 1;
					var blinkdom = xoopsGetElementById("msgtxt");
					function blink1() {
					blinkdom.style.visibility = "hidden";
					if (blink == 1) {
						setTimeout("blink2()", 500);
						} else {
							blinkdom.style.visibility = "visible";
						}
					}
					function blink2() {
					blinkdom.style.visibility = "visible";
					if (blink == 1) {
						setTimeout("blink1()", 1000);
					}
					}
					function setBlink(val) {
					blink = val;
					blink1();
					}
					setBlink(1);
					//-->
					</script>';
		} else {
			echo  "&nbsp;&nbsp;&nbsp;"._NOMESSAGES."";
		}
	echo  "&nbsp;&nbsp;&nbsp;".$total_messages.": <a href='".XOOPS_URL."/viewpmsg.php'>"._TOTALMESSAGES."</a>";
	} else {
		echo  "&nbsp;&nbsp;&nbsp;<a href='".XOOPS_URL."/viewpmsg.php'>"._NOMESSAGES."</a>";
	}
if ($xoopsUser->isAdmin()) {
	echo "&nbsp;&nbsp;&nbsp;<a href='".XOOPS_URL."/admin.php'>"._ADMINMENU."</a>";
}
echo "&nbsp;&nbsp;&nbsp;";
?>
</b>
</td>
<?php } else { ?>
<form action="<?php echo XOOPS_URL;?>/user.php" name="loginform" method="post">
<td class="loginbar"  width="320" >
<input type="hidden" name="op" value="login" />
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."user.gif";?> alt="username" align="absmiddle" >&nbsp;<input type="text" class="login" size="10" name="uname"  />
<img src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."key.gif";?>" alt="password" align="absmiddle" >&nbsp;<input type="password" class="login" size="10" name="pass" />
<input type="image" name="submit" src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."pen.gif";?>" alt="login" align="absmiddle"  />
</td></form>
<td class="loginbar">&nbsp;<a href="<?php echo XOOPS_URL;?>/register.php"><img src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."register.gif";?>" alt="register" align="absmiddle"  ></a>
<a href="<?php echo XOOPS_URL;?>/user.php#lost"><img src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."lostpass.gif";?>" alt="lostpass" align="absmiddle" ></a></td>
<?php } ;?>
<form id="pagesearch" action="<?php echo XOOPS_URL;?>/search.php" method="post">
<td class="loginbar" align="right">
<img style="cursor: hand;" onclick="xoopsGetElementById('pagesearch').submit();" align="absmiddle" src="<?php echo XOOPS_URL;?>"/images/icons/<?php echo $bcoosConfig['iconset']."search.gif";?>" alt="search" />
<input type="text" class="login" name="query" size="23" />
<input type="hidden" name="action" value="results" />
</td></form>
</tr></table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="0"><tr>
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_grid.gif" id="leftblocks" name="leftblocks" align="left" valign="top" class="sidebar1">
<?php make_sidebar("left");?>
</td>
<td align="center" valign="top" width="100%">
<table class="sidboxtitle" width="100%" border="0" cellpadding="0" cellspacing="0"  background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_degrade.gif"><tr>
<td width="1"><img style="cursor: hand;" onclick="toggleDisplay('leftblocks');" src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."sidebar.gif";?>" align="absmiddle" alt="<?php echo _TOGGLE;?>" /></td>
<td><div class="myclock" align="right" id="myclock">&nbsp;</div></td>
<td width="1"><img style="cursor: hand;" onclick="toggleDisplay('rightblocks');" src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."sidebar.gif";?>" align="absmiddle" alt="<?php echo _TOGGLE;?>" /></td>
</tr></table>
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/*************************************************************************/
/* Function themefooter()                                                */
/*                                                                       */
/* This is everything that appears right after any center stuff.         */
/*                                                                       */
/* themeheader<td>                                                       */
/* center stuff                                                          */
/* </td>themefooter                                                      */
/*************************************************************************/
function themefooter($show_rblock=0, $footer='') {
?>
<!-- HTML CODE -->
<br /></td>
<?php if ($show_rblock) { ?>
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_grid.gif" id="rightblocks" name="rightblocks" align="right" valign="top" class="sidebar2">
<?php make_sidebar("right");?>
</td>
<?php } else { echo "<td width='1' id='rightblocks' style='display:none;'></td>"; } ?>
</tr><tr>
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_degrade.gif" colspan="3" class="footer"><?php echo $footer;?></td>
</tr></table>
</td></tr></table>
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themesidebox_left()                             */
/*                                                          */
/* Controls the look of your left blocks.                   */
/************************************************************/
function themesidebox_left($title='', $content) {
?>
<!-- HTML CODE -->
<table width="160" border="0" cellpadding="0" cellspacing="0"><tr class="bg1">
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_degrade.gif"><div class="sidboxtitle"><?php echo $title;?></div></td>
</tr><tr>
<td class="sideboxcontent"><?php echo $content;?></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themesidebox_right()                            */
/*                                                          */
/* Controls the look of your right blocks.                  */
/************************************************************/
function themesidebox_right($title='', $content) {
?>
<!-- HTML CODE -->
<table width="160" border="0" cellpadding="0" cellspacing="0"><tr class="bg1">
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_degrade.gif"><div class="sidboxtitle"><?php echo $title;?></div></td>
</tr><tr>
<td class="sideboxcontent"><?php echo $content;?></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themecenterbox_left()                           */
/*                                                          */
/* Controls the look of your left-center blocks.            */
/************************************************************/
function themecenterbox_left($title='', $content) {
?>
<!-- HTML CODE -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td><li style="list-style-type: square;"><span class="centerblocktitle"><?php echo $title;?></span><br /><br /></td>
</tr><tr>
<td><?php echo $content;?></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themecenterbox_center()                         */
/*                                                          */
/* Controls the look of your center-center blocks.          */
/************************************************************/
function themecenterbox_center($title='', $content) {
?>
<!-- HTML CODE -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td><li style="list-style-type: square;"><span class="centerblocktitle"><?php echo $title;?></span><br /><br /></td>
</tr><tr>
<td><?php echo $content;?></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themecenterbox_right()                          */
/*                                                          */
/* Controls the look of your right-center blocks.           */
/************************************************************/
function themecenterbox_right($title='', $content) {
?>
<!-- HTML CODE -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td><li style="list-style-type: square;"><span class="centerblocktitle"><?php echo $title;?></span><br /><br /></td>
</tr><tr>
<td><?php echo $content;?></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themenews()                                     */
/*                                                          */
/* This function formats the stories on your homepage       */
/************************************************************/
function themenews(
			$poster,
			$time,
			$title,
			$counter,
			$thetext,
			$timglink,
			$adminlink,
			$morelink=''
			) {
?>
<!-- HTML CODE -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr class="bg1">
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_degrade.gif"><div class="indextitle"><?php echo $title;?></div></td>
</tr><tr>
<td class="indextable2">
<span class="postedby">
<?php echo _POSTEDBY;?> <?php echo $poster;?> <?php echo _ON;?> <?php echo $time;?> (<?php echo $counter;?> <?php echo _READS;?>)
</span>
<div class="indextext">
<p><?php echo $timglink;?> <?php echo $thetext;?></p>
</div></td>
</tr><tr>
<td class="bg1"><div class="more" align="right"><?php echo $adminlink;?> <?php echo $morelink;?></div></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themecenterposts()                              */
/*                                                          */
/* Controls the look of various center blocks,              */
/* like when you preview posts in the forum & news.         */
/************************************************************/
function themecenterposts($title='', $content) {
?>
<!-- HTML CODE -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/bg_degrade.gif"><div class="indextitle"><?php echo $title;?></div></td>
</tr><tr>
<td class="indextable"><div class="indextext">
<p><?php echo $content;?></p>
</div></td>
</tr></table>
<br />
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/*************************************************************************/
/* Function theme_post()                                                 */
/*                                                                       */
/* Used for displaying thread content for comments in various modules.   */
/*************************************************************************/
function theme_post(
			$subject,
			$text,
			$color_number='',
			$subject_image='',
			$post_date='',
			$ip_image='',
			$reply_image='',
			$edit_image='',
			$delete_image='',
			$username='',
			$rank_title='',
			$rank_image='',
			$avatar_image='',
			$reg_date='',
			$posts='',
			$user_from='',
			$online_image='',
			$profile_image='',
			$pm_image='',
			$email_image='',
			$www_image='',
			$icq_image='',
			$aim_image='',
			$yim_image='',
			$msnm_image=''
			) {
if ($color_number == 1) {
	$bg1 = 'bg1';
	
	} else {
		$bg1 = 'bg3';
	
	}
?>
<!-- HTML CODE -->
<table border="0" cellpadding="0" cellspacing="0" align="center" valign="top" width="100%" ><tr>
<td class="bg2">
	  <table width="100%" border="0" cellspacing="1" cellpadding="4">
        <tr class="<?php echo $bg1;?>" align="left" >  
          <td width="140" ><b><?php echo $username?> </b></td>
          <td><?php echo $subject_image;?> <b><?php echo $subject;?></b>&nbsp;-&nbsp;<i><?php echo $post_date;?></i>&nbsp;&nbsp;<?php echo $ip_image;?> 
            <?php echo $delete_image;?> <?php echo $edit_image;?> <?php echo $reply_image;?> </td>
          <td width="20%" ><center><?php echo $pm_image;?> <?php echo $email_image;?> <?php echo $www_image;?> 
              <?php echo $icq_image;?> <?php echo $aim_image;?> <?php echo $yim_image;?> 
              <?php echo $msnm_image;?></center> </td>
        </tr>
        <tr class="<?php echo $bg1;?>" align="left">  
          <td ><?php echo $rank_image, $posts;?><br /> 
            <?php echo $rank_title;?><br /> <br /> <div align="center"><?php echo $avatar_image;?></div>
            <!-- SPACER IMAGE -->
            <img width="105" height="1" src="<?php echo XOOPS_URL;?>/images/pixel.gif"></td>
          <td colspan="2" valign="top" ><table border="0">
              <tr> 
                <td><?php echo $text;?></td>
              </tr>
            </table></td>
        </tr>
      </table> </td>
</tr></table>
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/**************************************************************************/
/* Function theme_waitbox()                                               */
/*                                                                        */
/* Controls the look of the waitbox when it's turned on                   */
/**************************************************************************/
function theme_waitbox() {
global$bcoosConfig;
?>
<!-- HTML CODE -->
<table cellpadding="3" cellspacing="3" class="waitbox"><tr>
<td align="center">
<b><big><?php echo _LOADING;?></big></b><br />
<img src="<?php echo XOOPS_URL;?>/images/icons/<?php echo $bcoosConfig['iconset']."await.gif";?>" alt="" />
<br /><?php echo _PLEASEWAIT;?>
</td>
</tr></table>
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/**************************************************************************/
/* OpenTable Functions                                                    */
/*                                                                        */
/* The look of certain tables opend/closed in variousparts of xoops, like */
/* the tables in the center of the admin section, and in various modules. */
/**************************************************************************/
function OpenTable($width='100%') {
?>
<!-- HTML CODE -->
<table width="<?php echo $width;?>" border="0" cellspacing="1" cellpadding="0"><tr class="bg2">
<td valign="top">
<table width="100%" border="0" cellspacing="1" cellpadding="8"><tr class="bg1">
<td valign="top">
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
function CloseTable() {
?>
<!-- HTML CODE -->
</td></tr></table>
</td></tr></table>
<!-- HTML CODE -->
<?php
}
?>
