<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.1 www.exoops.info 2006/03 
// $Id: theme.php,v 1.00 2003/xx/xx xx:xx:xx kain Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Kazumi Ono, Goghs Cheng
// Author Website : http://www.mywebaddons.com/ , http://www.eqiao.com
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
//
// Theme Name: imago02     (v.01)
// By Kain   (http://www.kuht.it)
// Adapted for e-xoops b1.05rev3
// Original theme from Imago
//  rearranged by Farsus (http://www.farsus.dk)
//  16 jan. 2004
define("XOOPS_THEME", "imago02");
// --------------------------------------------------------------------------------------//
/**********************************************************************/
/* 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=1) {
global $bcoosConfig, $xoopsUser,$db;
?>
<!-- HTML CODE -->
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>
<?php if ($xoopsUser) { ?>
<body onLoad="MM_preloadImages('<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c4_f2.gif','<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c5_f2.gif','<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c6_f2.gif','<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c7_f2.gif');">
<?php } else { ?>
<body onLoad="MM_preloadImages('<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c4_f2.gif','<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c5_f2.gif','<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c6_f2.gif','<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c7_f2.gif');document.loginform.uname.focus();">
<?php } ;?>
<table align="center" cellpadding="0" cellspacing="0" class="frame">
  <tr>
    <td><table class="frame" border="0" cellpadding="0" cellspacing="0" width="752">
	  <tr>
	   <td><table border="0" cellpadding="0" cellspacing="0" width="752">
		  <tr>
		   <td><img name="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c2" src="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r1_c2.gif" width="407" height="20" border="0" alt=""></td>
		   
		  </tr>
		</table></td>
	  </tr>
	  <tr>
	   <td><table border="0" cellpadding="0" cellspacing="0" width="752">
              <tr> 
                <td><img name="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r2_c2" src="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r2_c2.gif" width="210" height="81" border="0" alt=""></td>
                <td><img name="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r2_c3" src="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/head_r2_c3.gif" width="542" height="81" border="0" alt=""></td>
              </tr>
              <tr> 
                <td colspan="2">
				
				
				<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" class="footer2"><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 "<bgsound src='".XOOPS_URL."/images/msg.wav' loop='false'>";
		}
		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/".$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>
				
				
				</td>
              </tr>
            </table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">
      <table cellspacing="0" cellpadding="0">
        <tr>
          <td class="left_block" valign="top">
            <!-- Start left blocks -->
            <?php make_sidebar("left"); ?>
            <!-- End left blocks -->
          </td>
          <td class="conter_block"valign="top">
<!-- 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='') {
$url = XOOPS_URL ;
$url = split('//',$url );
if ($show_rblock) { 

?>
<!-- HTML CODE -->
	      <td valign="top" class="right_block">
            <!-- Start right blocks -->
			<?php make_sidebar("right"); } ?>
            <!-- End right blocks -->
            </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="footer"><div class="debug" align="center"><div align='center' style='font-size:large;'><b><a href='<?php echo XOOPS_URL;?>'><?php echo $url[1];?></a></b></div>
	Converted by <a href="http://www.kuht.it">Kain</a>. </font><br>
      &copy; 2003 <font color="#799BB7"><strong>IMAGO:</strong></font><strong><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif">THEMES
      </font></strong><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif">Theme
      Design by <strong><a href="http://www.imagocn.net/theme/">IMAGO DESIGN CORP</a>.</strong></font></div>
    </td>
  </tr>
</table>
<!-- HTML CODE -->
<?php
}
// --------------------------------------------------------------------------------------//
/************************************************************/
/* Function themesidebox_left()                             */
/*                                                          */
/* Controls the look of your left blocks.                   */
/************************************************************/
function themesidebox_left($title='', $content) {
?>
<!-- HTML CODE -->
<table class="left_block_table" cellpadding="0" cellspacing="0">
 <tr>
  <td class="left_block_title" align="left" >&nbsp;<?php echo $title;?></td>
 </tr>
 <tr>
  <td align="left" valign="top" class="left_block_content" ><?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 class="right_block_table" cellspacing="0" cellpadding="2">
 <tr>
  <td class="right_block_title">&nbsp;<?php echo $title;?></td>
 </tr>
 <tr>
  <td class="right_block_content"><?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 class="cl_block_table" align="center" cellpadding="5" cellspacing="1">
 <tr>
  <td class="conter_block_title">&nbsp;<?php echo $title;?></td>
 </tr>
 <tr>
  <td class="conter_block_content"><?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 class="cc_block_table" width="99%" align="center" cellpadding="5" cellspacing="1">
 <tr>
  <td width="148" class="cc_block_title">&nbsp;<?php echo $title;?></td>
 </tr>
 <tr>
  <td class="cc_block_content"><?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 class="cr_block_table" align="center" cellpadding="5" cellspacing="1">
 <tr>
  <td class="conter_block_title">&nbsp;<?php echo $title;?></td>
 </tr>
 <tr>
  <td class="conter_block_content"><?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=''
			) {
// $postedby = _POSTEDBY." $poster "._ON." $time ($counter "._READS.")";
?>
<!-- HTML CODE -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="28"><img border="0" src="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/news-1.gif" width="28" height="22"></td>
    <td></td>
    <td width="15"></td>
  </tr>
  <tr>
    <td width="28" background="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/news-4.gif">&nbsp;</td>
    <td>
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100%">
<table border="0" cellpadding="1" cellspacing="5" width="100%">
<tr>
                <td bgcolor="#FFFFFF">
                  <div class="indextitle"><?php echo $title;?></div><br />
                  <div class='blurb-credit'><?php echo _POSTEDBY;?> <?php echo $poster;?> <?php echo _ON;?> <?php echo $time;?> (<?php echo $counter;?> <?php echo _READS;?>)
</div><br />
</td>
</tr><tr>
<td wrap="hard"><?php echo $timglink;?> <?php echo $thetext;?><br /><br /></td>
</tr><tr>
<td align="right">
<font size="2"><div class='more-link'><?php echo $adminlink;?><?php echo $morelink;?></div></font>
</td>
</tr></table>
</td>
        </tr>
      </table>
    </td>
    <td width="15"></td>
  </tr>
  <tr>
    <td width="28"><img border="0" src="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/news-7.gif" width="28" height="25"></td>
    <td><img border="0" src="<?php echo XOOPS_URL."/themes/".XOOPS_THEME;?>/images/news-8.gif" width="323" height="25"></td>
    <td width="15"></td>
  </tr>
</table>
<!-- 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 cellspacing='0' cellpadding='15' width='100%' bgcolor='white' border='0'>
 <tr>
  <td><div class='content-title'><?php echo $title;?></div>
   <table cellspacing='0' cellpadding='0' width='100%' border='0'>
    <tr valign='top'>
     <td width='100%'><?php echo $content;?></td>
    </tr>
   </table>
  </td>
 </tr>
</table>
<!-- 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 bgcolor='#FFFFFF'>
 <tr>
  <td><table width='100%' border=0 cellspacing=1 cellpadding=5 bgcolor='#ffffff'>
   <tr>
    <td>
<!-- HTML CODE -->
<?php
}
function CloseTable() {
?>
<!-- HTML CODE -->
   </td>
  </tr>
   </table>
  </td>
 </tr>
</table>
<!-- HTML CODE -->
<?php
}
?>
