<?php

/*************************

  Coppermine Photo Gallery

  ************************

  Copyright (c) 2003-2006 Coppermine Dev Team

  v1.1 originally written by Gregory DEMAR



  This program is free software; you can redistribute it and/or modify

  it under the terms of the GNU General Public License as published by

  the Free Software Foundation; either version 2 of the License, or

  (at your option) any later version.

  ********************************************

  Coppermine version: 1.4.10

  $Source$

  $Revision: 3275 $

  $Author: gaugau $

  $Date: 2006-09-03 12:10:47 +0200 (So, 03 Sep 2006) $

**********************************************/



// ------------------------------------------------------------------------- //

// This theme has had redundant CORE items removed                           //

// ------------------------------------------------------------------------- //

define('THEME_HAS_RATING_GRAPHICS', 1);

define('THEME_HAS_NO_SUB_MENU_BUTTONS',1);

define('THEME_IS_XHTML10_TRANSITIONAL',1);  // Remove this if you edit this template until

                                            // you have validated it. See docs/theme.htm.



// HTML template for sys_menu

$template_sys_menu = <<<EOT

         |{BUTTONS}|

EOT;



// HTML template for template sys_menu spacer

$template_sys_menu_spacer ="|";



// HTML template for template sub_menu

// special note: I left the java 'hide' off of the first and third buttons to help avoid trouble keeping sys_menu open. :Donnoman



$template_sub_menu = <<<EOT

<table cellpadding="0" cellspacing="0" border="0" width="100%">

<tr>

    <td width="50%"></td>

<!-- BEGIN custom_link -->

	<td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>

<!-- END custom_link -->

	

    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="/index.php" title="View Mark's Galleries">Galleries Home</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>



    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="/about.php" title="Home Page">About Mark</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>





    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="{LASTUP_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="Most Recent Photos">Latest</a>

    </td>



    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="{TOPN_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="Most Viewed Photos">Most Viewed</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>





    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="Search the Site">Search</a>

    </td>
	
	
	    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>



    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="/links.php" title="Links to Friends">Links</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
	
	
	
	    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="/contact.php" title="Contact Mark">Contact</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>
	
	



    <td><img src="themes/mac_ox_x/images/menu_button_bg_left.gif" border="0" alt="" /><br /></td>

    <td style="background-image:url(themes/mac_ox_x/images/menu_button_bg_middle.gif);" valign="top">

            <a href="javascript:;" onmouseover="MM_showHideLayers('SYS_MENU','','show')">Admin</a>

    </td>

    <td><img src="themes/mac_ox_x/images/menu_button_bg_right.gif" border="0" alt="" /><br /></td>

    <td width="50%"></td>

  </tr>

</table>



EOT;





// HTML template for title row of the thumbnail view (album title + sort options)

$template_thumb_view_title_row = <<<EOT



                        <table width="100%" cellpadding="0" cellspacing="0">

                        <tr>

                                <td width="100%" class="statlink">{ALBUM_NAME}</td>
                        </tr>

                        </table>



EOT;









function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();

    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }





    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo "</div>\n";

}








// Function to start a 'standard' table

function starttable($width = '-1', $title = '', $title_colspan = '1')

{

    global $CONFIG;



    if ($width == '-1') $width = $CONFIG['picture_table_width'];

    if ($width == '100%') $width = $CONFIG['main_table_width'];

    if ($title) {

        echo <<<EOT

<!-- Start standard table title -->

<table align="center" width="$width" cellspacing="0" cellpadding="0" class="maintablea">

        <tr>

                <td>

                        <table width="100%" cellspacing="0" cellpadding="0" class="tableh1a">

                                <tr>

                                        <td class="tableh1a"><img src="themes/mac_ox_x/images/tableh1a_bg_left.gif" alt="" /></td>

                                        <td class="tableh1a" style="background-image:url(themes/mac_ox_x/images/tableh1a_bg_middle.gif);" width="100%">$title</td>

                                        <td class="tableh1a"><img src="themes/mac_ox_x/images/tableh1a_bg_right.gif" alt="" /></td>

                                </tr>

                        </table>

                </td>

        </tr>

</table>

<!-- Start standard table -->

<table align="center" width="$width" cellspacing="0" cellpadding="0">

  <tr>

   <td style="background-image:url(themes/mac_ox_x/images/main_table_r1_c1b.gif);" valign="top"><img name="main_table_r1_c1" src="themes/mac_ox_x/images/main_table_r1_c1.gif" border="0"  alt="" /></td>

        <td width="100%"><table width="100%" cellspacing="1" cellpadding="0" class="maintableb">



EOT;

    } else {

        echo <<<EOT



<!-- Start standard table -->

<table align="center" width="$width" cellspacing="0" cellpadding="0">

  <tr>

   <td style="background-image:url(themes/mac_ox_x/images/main_table_r1_c1b.gif);" valign="top"><img name="main_table_r1_c1" src="themes/mac_ox_x/images/main_table_r1_c1.gif" border="0"  alt="" /></td>

        <td width="100%"><table width="100%" cellspacing="1" cellpadding="0" class="maintable">



EOT;

    }

}



function endtable()

{

    echo <<<EOT

        </table>

   </td>

   <td style="background-image:url(themes/mac_ox_x/images/main_table_r1_c3b.gif);" valign="top"><img name="main_table_r1_c3" src="themes/mac_ox_x/images/main_table_r1_c3.gif" border="0"  alt="" /></td>

  </tr>

  <tr>

   <td><img name="main_table_r2_c1" src="themes/mac_ox_x/images/main_table_r2_c1.gif" width="10" height="4" border="0"  alt="" /></td>

   <td style="background-image:url(themes/mac_ox_x/images/main_table_r2_c2b.gif);"><img name="main_table_r2_c2" src="themes/mac_ox_x/images/main_table_r2_c2.gif" border="0"  alt="" /></td>

   <td><img name="main_table_r2_c3" src="themes/mac_ox_x/images/main_table_r2_c3.gif" width="10" height="4" border="0"  alt="" /></td>

  </tr>

</table>

<!-- End standard table -->





EOT;








// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT
<td>
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
<option value="#">Select</option>
<!-- BEGIN admin_approval -->
<option value="editpics.php?mode=upload_approval">{UPL_APP_LNK}</option>
<!-- END admin_approval -->
<option value="admin.php">{ADMIN_LNK}</option>
<option value="catmgr.php">{CATEGORIES_LNK}</option>
<option value="albmgr.php{CATL}">{ALBUMS_LNK}</option>
<option value="groupmgr.php">{GROUPS_LNK}</option>
<option value="usermgr.php">{USERS_LNK}</option>
<option value="banning.php">{BAN_LNK}</option>
<option value="reviewcom.php">{COMMENTS_LNK}</option>
<!-- BEGIN log_ecards -->
<option value="db_ecard.php">{DB_ECARD_LNK}</option>
<!-- END log_ecards -->
<option value="picmgr.php">{PICTURES_LNK}</option>
<option value="searchnew.php">{SEARCHNEW_LNK}</option>
<option value="util.php">{UTIL_LNK}</option>
<option value="profile.php?op=edit_profile">{MY_PROF_LNK}</option>
<!-- BEGIN documentation -->
<option value="{DOCUMENTATION_HREF}">{DOCUMENTATION_LNK}</option>
<!-- END documentation -->
</select>
</form>
</td>
EOT;





}



$template_user_admin_menu = <<<EOT



                <div align="center">

                <table cellpadding="0" cellspacing="3">

                        <tr>

                                <td class="admin_menu"><a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a></td>
                        </tr>
                        <tr>
                          <td class="admin_menu"><a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a></td>
                        </tr>
                        <tr>
                          <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
                        </tr>
                        <tr>
                          <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                        </tr>
                </table>

                </div>



EOT;



// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
Click on the image to see a larger version
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2" cellpadding="0" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;



// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
        <tr colspan="4">
                <td class="tableh1"><b>{CATEGORY}</b></td>
				<td class="tableh1"><b></b></td>
				<td class="tableh1"><b></b></td>
                <td class="tableh1"><b></b></td>
        </tr>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
                <td class="catrow_noalb" colspan="4"><table border="0"><tr><td align="left"><div align="center">{CAT_THUMB}<br>
                          <span class="catlink"><b>{CAT_TITLE}</b></span></div></td>
                </tr>
                </table></td>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
                <td class="catrow" align="left"><table border="0"><tr><td><div align="center">{CAT_THUMB}<br>
                          <span class="catlink"><b>{CAT_TITLE}</b></span></div></td>
                </tr>
                </table></td>
				
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="9" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;

function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
    global $template_cat_list, $lang_cat_list;
    if (count($cat_data) > 0) {
        starttable('100%');
        $template = template_extract_block($template_cat_list, 'header');
        $params = array('{CATEGORY}' => $lang_cat_list['category'],
            '{ALBUMS}' => $lang_cat_list['albums'],
            '{PICTURES}' => $lang_cat_list['pictures'],
            );
        echo template_eval($template, $params);
    }

    $template_noabl = template_extract_block($template_cat_list, 'catrow_noalb');
    $template = template_extract_block($template_cat_list, 'catrow');
	
	
    $count=0;
    $columnCount=4; 
    echo "<tr>";	
	
    foreach($cat_data as $category) {
		If ($count%$columnCount==0) {
		    echo "</tr><tr>";
		}
        $count++;
        if (count($category) == 3) {
            $params = array('{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1]
                );
            echo template_eval($template_noabl, $params);
        } elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
            $params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => $category['cat_albums'],
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
                );
            echo template_eval($template, $params);
        } else {
            $params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => '',
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
                );
            echo template_eval($template, $params);
        }
    }
	echo "</tr>";
    if ($statistics && count($cat_data) > 0) {
        $template = template_extract_block($template_cat_list, 'footer');
        $params = array('{STATISTICS}' => $statistics);
        echo template_eval($template, $params);
    }


    if (count($cat_data) > 0)
          endtable();
        echo template_extract_block($template_cat_list, 'spacer');
}

?>




