[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 media_manager.php

Zen Cart 源代码 media_manager.php




下载文件

文件名: media_manager.php
文件类型: PHP文件
文件大小: 20.99 KiB
MD5: 781d60972b880127cc886d6b28d81a19

media_manager.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2009 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: media_manager.php 17534 2010-09-08 19:50:34Z wilt $
  8.  */
  9.  
  10.   require('includes/application_top.php');
  11.  
  12.   $action = (isset($_GET['action']) ? $_GET['action'] : '');
  13.   $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id);
  14.  
  15.   if (zen_not_null($action)) {
  16.     switch ($action) {
  17.       case 'edit':
  18.         if (!is_writable(DIR_FS_CATALOG_MEDIA)) $messageStack->add(TEXT_WARNING_FOLDER_UNWRITABLE, 'caution');
  19.       break;
  20.       case 'remove_product':
  21.         $db->Execute("delete from " . TABLE_MEDIA_TO_PRODUCTS . "
  22.                      where media_id = '" . (int)$_GET['mID'] . "'
  23.                      and product_id = '" . (int)$_GET['product_id'] . "'");
  24.        zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, 'action=products&current_category_id=' . $current_category_id) . '&mID=' . (int)$_GET['mID'] . '&page=' . $_GET['page']);
  25.  
  26.       break;
  27.       case 'add_product':
  28.         $product_add_query = $db->Execute("insert into " . TABLE_MEDIA_TO_PRODUCTS . " (media_id, product_id) values
  29.                                           ('" . (int)$_GET['mID'] . "', '" . (int)$_GET['current_product_id'] . "')");
  30.          zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, 'action=products&current_category_id=' . $current_category_id) . '&mID=' . $_GET['mID'] . '&page=' . $_GET['page']);
  31.  
  32.       break;
  33.       case 'new_cat':
  34.     $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id);
  35.     $products_filter = $new_product_query->fields['products_id'];
  36.     zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, 'action=products&current_category_id=' . $current_category_id . '&mID=' . $_GET['mID'] . '&page=' . $_GET['page']));
  37.       break;
  38.       case 'remove_clip':
  39.         $delete_query = "delete from " . TABLE_MEDIA_CLIPS . " where clip_id  = '" . $_GET['clip_id'] . "'";
  40.         $db->Execute($delete_query);
  41.         zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, 'action=edit&page=' . $_GET['page']));
  42.       break;
  43.       case 'insert':
  44.       case 'save':
  45.         if (isset($_POST['add_clip'])) {
  46.           $clip_name = $_FILES['clip_filename'];
  47.           $clip_name = zen_db_prepare_input($clip_name['name']);
  48.           if ($clip_name) {
  49.             $media_type = $_POST['media_type'];
  50.             $ext = $db->Execute("select type_ext from " . TABLE_MEDIA_TYPES . " where type_id = '" . $_POST['media_type'] . "'");
  51.             if (preg_match('/'.$ext->fields['type_ext'] . '/', $clip_name)) {
  52.  
  53.               if ($media_upload = new upload('clip_filename')) {
  54.                 $media_upload->set_destination(DIR_FS_CATALOG_MEDIA . $_POST['media_dir']);
  55.                 if ($media_upload->parse() && $media_upload->save()) {
  56.                   $media_upload_filename = $_POST['media_dir'] . $media_upload->filename;
  57.                 }
  58.                 if ($media_upload->filename != 'none' && $media_upload->filename != '' && is_writable(DIR_FS_CATALOG_MEDIA . $_POST['media_dir'])) {
  59.  
  60.                   $db->Execute("insert into " . TABLE_MEDIA_CLIPS . "
  61.                                (media_id, clip_type, clip_filename, date_added) values (
  62.                                 '" . $_GET['mID'] . "',
  63.                                 '" . $media_type . "',
  64.                                 '" . $media_upload_filename . "', now())");
  65.                 }
  66.               }
  67.  
  68.             }
  69.           }
  70.         }
  71.         if (isset($_GET['mID'])) $media_id = zen_db_prepare_input($_GET['mID']);
  72.         $media_name = zen_db_prepare_input($_POST['media_name']);
  73.  
  74.         $sql_data_array = array('media_name' => $media_name);
  75.  
  76.         if ($media_name == '') {
  77.           $messageStack->add_session(ERROR_UNKNOWN_DATA, 'caution');
  78.         } else {
  79.           if ($action == 'insert') {
  80.             $insert_sql_data = array('date_added' => 'now()');
  81.  
  82.             $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
  83.  
  84.             zen_db_perform(TABLE_MEDIA_MANAGER, $sql_data_array);
  85.             $media_id = zen_db_insert_id();
  86.           } elseif ($action == 'save') {
  87.             $update_sql_data = array('last_modified' => 'now()');
  88.  
  89.             $sql_data_array = array_merge($sql_data_array, $update_sql_data);
  90.  
  91.             zen_db_perform(TABLE_MEDIA_MANAGER, $sql_data_array, 'update', "media_id = '" . (int)$media_id . "'");
  92.           }
  93.         }
  94.  
  95.         zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . ($media_id != '' ? 'mID=' . $media_id : '')));
  96.         break;
  97.       case 'deleteconfirm':
  98.         // demo active test
  99.         if (zen_admin_demo()) {
  100.           $_GET['action']= '';
  101.           $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  102.           zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page']));
  103.         }
  104.         $media_id = zen_db_prepare_input($_GET['mID']);
  105.  
  106.         $db->Execute("delete from " . TABLE_MEDIA_MANAGER . "
  107.                      where media_id = '" . (int)$media_id . "'");
  108.         $db->Execute("delete from " . TABLE_MEDIA_TO_PRODUCTS . "
  109.                      where media_id = '" . (int)$media_id . "'");
  110.         $db->Execute("delete from " . TABLE_MEDIA_CLIPS . "
  111.                      where media_id = '" . (int)$media_id . "'");
  112.  
  113.         if (isset($_POST['delete_products']) && ($_POST['delete_products'] == 'on')) {
  114.  
  115. //          while (!$products->EOF) {
  116. //            zen_remove_product($products->fields['products_id']);
  117. //            $products->MoveNext();
  118. //          }
  119.         }
  120.  
  121.         zen_redirect(zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page']));
  122.         break;
  123.     }
  124.   }
  125. ?>
  126. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  127. <html <?php echo HTML_PARAMS; ?>>
  128. <head>
  129. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  130. <title><?php echo TITLE; ?></title>
  131. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  132. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  133. <script language="javascript" src="includes/menu.js"></script>
  134. <script language="javascript" src="includes/general.js"></script>
  135. <script type="text/javascript">
  136.   <!--
  137.   function init()
  138.   {
  139.     cssjsmenu('navbar');
  140.     if (document.getElementById)
  141.     {
  142.       var kill = document.getElementById('hoverJS');
  143.       kill.disabled = true;
  144.     }
  145.   }
  146.   // -->
  147. </script>
  148. </head>
  149. <body onLoad="init()">
  150. <!-- header //-->
  151. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  152. <!-- header_eof //-->
  153.  
  154. <!-- body //-->
  155. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  156.   <tr>
  157. <!-- body_text //-->
  158.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  159.       <tr>
  160.         <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  161.           <tr>
  162.             <td class="pageHeading"><?php echo HEADING_TITLE_MEDIA_MANAGER; ?></td>
  163.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  164.           </tr>
  165.         </table></td>
  166.       </tr>
  167.       <tr>
  168.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  169.           <tr>
  170.             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  171.               <tr class="dataTableHeadingRow">
  172.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MEDIA; ?></td>
  173.                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
  174.               </tr>
  175. <?php
  176.   $media_query_raw = "select * from " . TABLE_MEDIA_MANAGER . " order by media_name";
  177.   $media_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $media_query_raw, $media_query_numrows);
  178.   $media = $db->Execute($media_query_raw);
  179.   while (!$media->EOF) {
  180.     if ((!isset($_GET['mID']) || (isset($_GET['mID']) && ($_GET['mID'] == $media->fields['media_id']))) && !isset($mInfo) && (substr($action, 0, 3) != 'new')) {
  181.  
  182.       $mInfo = new objectInfo($media->fields);
  183.     }
  184.  
  185.     if (isset($mInfo) && is_object($mInfo) && ($media->fields['media_id'] == $mInfo->media_id)) {
  186.       echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $media->fields['media_id']) . '\'">' . "\n";
  187.     } else {
  188.       echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $media->fields['media_id']) . '\'">' . "\n";
  189.     }
  190. ?>
  191.                 <td class="dataTableContent"><?php echo $media->fields['media_name']; ?></td>
  192.                 <td class="dataTableContent" align="right">
  193.                   <?php echo '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $media->fields['media_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?>
  194.                   <?php echo '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $media->fields['media_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . '</a>'; ?>
  195.                   <?php if (isset($mInfo) && is_object($mInfo) && ($media->fields['media_id'] == $mInfo->media_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, zen_get_all_get_params(array('mID')) . 'mID=' . $media->fields['media_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
  196.                 </td>
  197.               </tr>
  198. <?php
  199.     $media->MoveNext();
  200.   }
  201. ?>
  202.               <tr>
  203.                 <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  204.                   <tr>
  205.                     <td class="smallText" valign="top"><?php echo $media_split->display_count($media_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_MEDIA); ?></td>
  206.                     <td class="smallText" align="right"><?php echo $media_split->display_links($media_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
  207.                   </tr>
  208.                 </table></td>
  209.               </tr>
  210. <?php
  211.   if (empty($action)) {
  212. ?>
  213.               <tr>
  214.                 <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
  215.               </tr>
  216. <?php
  217.   }
  218. ?>
  219.             </table></td>
  220. <?php
  221.   $heading = array();
  222.   $contents = array();
  223.  
  224.   switch ($action) {
  225.     case 'new':
  226.       $heading[] = array('text' => '<strong>' . TEXT_HEADING_NEW_MEDIA_COLLECTION . '</strong>');
  227.  
  228.       $contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'action=insert&page=' . $_GET['page'], 'post', 'enctype="multipart/form-data"'));
  229.       $contents[] = array('text' => TEXT_NEW_INTRO);
  230.       $contents[] = array('text' => '<br>' . TEXT_MEDIA_COLLECTION_NAME . '<br>' . zen_draw_input_field('media_name', '', zen_set_field_length(TABLE_MEDIA_MANAGER, 'media_name')));
  231.  
  232.       $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $_GET['mID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  233.       break;
  234.     case 'edit':
  235.       $heading[] = array('text' => '<strong>' . TEXT_HEADING_EDIT_MEDIA_COLLECTION . '</strong>');
  236.  
  237.       $contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
  238.       $contents[] = array('text' => TEXT_EDIT_INTRO);
  239.       $contents[] = array('text' => '<br />' . TEXT_MEDIA_COLLECTION_NAME . '<br>' . zen_draw_input_field('media_name', $mInfo->media_name, zen_set_field_length(TABLE_MEDIA_MANAGER, 'media_name')));
  240.       $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  241.  
  242.       $contents[] = array('text' => zen_draw_separator('pixel_black.gif'));
  243.       $contents[] = array('text' => TEXT_MEDIA_EDIT_INSTRUCTIONS);
  244.       $contents[] = array('text' => zen_draw_separator('pixel_black.gif'));
  245.  
  246.       $dir = @dir(DIR_FS_CATALOG_MEDIA);
  247.       $dir_info[] = array('id' => '', 'text' => "Main Directory");
  248.       while ($file = $dir->read()) {
  249.         if (@is_dir(DIR_FS_CATALOG_MEDIA . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != ".." && $file != '.svn') {
  250.           $dir_info[] = array('id' => $file . '/', 'text' => $file);
  251.         }
  252.       }
  253.       $dir->close();
  254.       $contents[] = array('text' => '<br />' . TEXT_ADD_MEDIA_CLIP . zen_draw_file_field('clip_filename'));
  255.       $contents[] = array('text' => TEXT_MEDIA_CLIP_DIR . ' ' . zen_draw_pull_down_menu('media_dir', $dir_info));
  256.       $media_type_query = "select type_id, type_name, type_ext from " . TABLE_MEDIA_TYPES;
  257.       $media_types = $db->Execute($media_type_query);
  258.       while (!$media_types->EOF) {
  259.         $media_types_array[] = array('id' => $media_types->fields['type_id'], 'text' => $media_types->fields['type_name'] . ' (' . $media_types->fields['type_ext'] . ')');
  260.         $media_types->MoveNext();
  261.       }
  262.       $contents[] = array('text' => TEXT_MEDIA_CLIP_TYPE . ' ' . zen_draw_pull_down_menu('media_type', $media_types_array));
  263.  
  264.       $contents[] = array('text' => '<input type="submit" name="add_clip" value="' . TEXT_ADD . '">', 'align' => 'center');
  265.       $clip_query = "select * from " . TABLE_MEDIA_CLIPS . " where media_id = '" . $mInfo->media_id . "'";
  266.       $clips = $db->Execute($clip_query);
  267.       if ($clips->RecordCount() > 0) $contents[] = array('text' => '<hr />');
  268.       while (!$clips->EOF) {
  269.         $contents[] = array('text' => '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'action=remove_clip&mID='.$mInfo->media_id.'&clip_id='.$clips->fields['clip_id']) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>&nbsp;' . $clips->fields['clip_filename'] . '<br />');
  270.         $clips->MoveNext();
  271.       }
  272.       break;
  273.     case 'delete':
  274.       $heading[] = array('text' => '<strong>' . TEXT_HEADING_DELETE_MEDIA_COLLECTION . '</strong>');
  275.  
  276.       $contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=deleteconfirm'));
  277.       $contents[] = array('text' => TEXT_DELETE_INTRO);
  278.       $contents[] = array('text' => '<br><strong>' . $mInfo->media_name . '</strong>');
  279.  
  280.       if ($mInfo->products_count > 0) {
  281.         $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
  282.         $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
  283.       }
  284.  
  285.       $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  286.       break;
  287.     case 'products':
  288.       $new_product_query = $db->Execute("select ptc.*, pd.products_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc  left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ptc.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' where ptc.categories_id='" . $current_category_id . "' order by pd.products_name");
  289.       $heading[] = array('text' => '<strong>' . TEXT_HEADING_ASSIGN_MEDIA_COLLECTION . '</strong>');
  290.       $contents[] = array('text' => TEXT_PRODUCTS_INTRO . '<br /><br />');
  291.       $contents[] = array('text' => zen_draw_form('new_category', FILENAME_MEDIA_MANAGER, '', 'get') . '&nbsp;&nbsp;' .
  292.                            zen_draw_pull_down_menu('current_category_id', zen_get_category_tree('', '', '0'), '', 'onChange="this.form.submit();"') . zen_hide_session_id() . zen_draw_hidden_field('products_filter', $_GET['products_filter']) . zen_draw_hidden_field('action', 'new_cat') . zen_draw_hidden_field('mID', $mInfo->media_id) . zen_draw_hidden_field('page', $_GET['page']) . '&nbsp;&nbsp;</form>');
  293.       $product_array = $zc_products->get_products_in_category($current_category_id, false);
  294.       if ($product_array) {
  295.         $contents[] = array('text' => zen_draw_form('new_product', FILENAME_MEDIA_MANAGER, '', 'get') . '&nbsp;&nbsp;' .
  296.                            zen_draw_pull_down_menu('current_product_id', $product_array) . '&nbsp;' . '<input type="submit" name="add_product" value="Add">' .
  297.                            zen_draw_hidden_field('current_category_id', $current_category_id) .
  298.                            zen_draw_hidden_field('action', 'add_product') .
  299.                            zen_draw_hidden_field('page', $_GET['page']) .
  300.                            zen_draw_hidden_field('mID', $mInfo->media_id) . '&nbsp;&nbsp;</form>');
  301.       } else {
  302.         $contents[] = array('text' => '&nbsp;&nbsp;' . TEXT_NO_PRODUCTS);
  303.       }
  304.       $products_linked_query = "select * from " . TABLE_MEDIA_TO_PRODUCTS . "
  305.                                where media_id = '" . $mInfo->media_id . "'";
  306.       $products_linked = $db->Execute($products_linked_query);
  307.       if ($products_linked->RecordCount() > 0) $contents[] = array('text' => '<hr />');
  308.       while (!$products_linked->EOF) {
  309.         $contents[] = array('text' => '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'action=remove_product&mID='.$mInfo->media_id . '&page=' . $_GET['page'] . '&product_id='. $products_linked->fields['product_id']) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>&nbsp;' . $zc_products->products_name($products_linked->fields['product_id']) . '<br />');
  310.         $products_linked->MoveNext();
  311.       }
  312.       $contents[] = array('align' => 'center', 'text' =>  '<br /><a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  313.       break;
  314.     default:
  315.       if (isset($mInfo) && is_object($mInfo)) {
  316.         $heading[] = array('text' => '<strong>' . $mInfo->media_name . '</strong>');
  317.  
  318.         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a> ' . '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=products') . '">' . zen_image_button('button_assign_to_product.gif', IMAGE_PRODUCTS) . '</a>');
  319.         $contents[] = array('text' => '<br />' . TEXT_DATE_ADDED . ' ' . zen_date_short($mInfo->date_added));
  320.         if (zen_not_null($mInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($mInfo->last_modified));
  321.         $products_linked_query = "select product_id from " . TABLE_MEDIA_TO_PRODUCTS . "
  322.                                where media_id = '" . $mInfo->media_id . "'";
  323.         $products_linked = $db->Execute($products_linked_query);
  324.         $contents[] = array('text' => '<br />' . TEXT_PRODUCTS . ' ' . $products_linked->RecordCount());
  325.         $clip_query = "select clip_id from " . TABLE_MEDIA_CLIPS . " where media_id = '" . $mInfo->media_id . "'";
  326.         $clips = $db->Execute($clip_query);
  327.         $contents[] = array('text' =>  TEXT_CLIPS . ' ' . $clips->RecordCount());
  328.       }
  329.       break;
  330.   }
  331.  
  332.   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  333.     echo '            <td width="25%" valign="top">' . "\n";
  334.  
  335.     $box = new box;
  336.     echo $box->infoBox($heading, $contents);
  337.  
  338.     echo '            </td>' . "\n";
  339.   }
  340. ?>
  341.           </tr>
  342.         </table></td>
  343.       </tr>
  344.     </table></td>
  345.   </tr>
  346. </table>
  347. <!-- body_eof //-->
  348.  
  349. <!-- footer //-->
  350. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  351. <!-- footer_eof //-->
  352. <br>
  353. </body>
  354. </html>
  355. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  356.  


cron