Forums / Setting Up Categories, Products, Attributes / Music Samples with Media Manager

Music Samples with Media Manager

Started by lowell37 on 13 Mar 2012, 4:55 PM · Views: 1,616

Results 1 to 11 of 11
13 Mar 2012, 4:55 PM
#1
lowell37 avatar

lowell37

New Zenner

Join Date:
Jan 2012
Location:
Catalina, Arizona
Posts:
28
Plugin Contributions:
0

Music Samples with Media Manager

Hi, I've just started offering MP3s for sale on my site and would like to give samples for customers to listen to. I've followed all the steps in the manual using Media Manager and everything seems fine all the way up to assigning the collection to a product. Unlike other threads I've read on this problem, I do get both dropdown boxes and can select the product I want to assign it to, but when I click "Add", it just directs me back to the homepage. When I check Media Manager again, the collection has not been linked to a product. Needless to say, nothing shows up on the product page. Thanks for any clues!

14 Mar 2012, 7:30 PM
#3
lowell37 avatar

lowell37

New Zenner

Join Date:
Jan 2012
Location:
Catalina, Arizona
Posts:
28
Plugin Contributions:
0

Re: Music Samples with Media Manager

Thank you, I was so relieved to see the fix, then when I went to the file indicated
(/admin/includes/init_includes/init_sessions.php file.
On line 40 you'll see a line that starts like this)
Line 40 had nothing like that, in fact there is nothing remotely resembling that content in the whole file. ? any ideas?

14 Mar 2012, 10:41 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Music Samples with Media Manager

Line 40 reads:

  if (strpos ( $PHP_SELF, FILENAME_PRODUCTS_PRICE_MANAGER ) === FALSE && strpos ( $PHP_SELF, FILENAME_PRODUCTS_OPTIONS_NAME ) === FALSE && (strpos( $PHP_SELF, FILENAME_CURRENCIES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_LANGUAGES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_SPECIALS ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_FEATURED ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_SALEMAKER ) === FALSE))

Change to read:

  if (strpos($PHP_SELF, FILENAME_MEDIA_MANAGER)===FALSE && strpos ( $PHP_SELF, FILENAME_PRODUCTS_PRICE_MANAGER ) === FALSE && strpos ( $PHP_SELF, FILENAME_PRODUCTS_OPTIONS_NAME ) === FALSE && (strpos( $PHP_SELF, FILENAME_CURRENCIES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_LANGUAGES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_SPECIALS ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_FEATURED ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_SALEMAKER ) === FALSE))

If you do not have this, check your file is current and up to date ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Mar 2012, 6:05 PM
#5
lowell37 avatar

lowell37

New Zenner

Join Date:
Jan 2012
Location:
Catalina, Arizona
Posts:
28
Plugin Contributions:
0

Re: Music Samples with Media Manager

My site says I am currently using: v1.3.9h

This is the file: home/artbylow/public_html/shopping/includes/init_includes/init_sessions.php

This is line 40: $domainPrefix = (!defined('SESSION_ADD_PERIOD_PREFIX') || SESSION_ADD_PERIOD_PREFIX == 'True') ? '.' : '';

There is nothing like the referred line in this file.
How do I re-install, if that's what you recommend? or should I upgrade to the latest version?
I assume I should just backup my overide files. :frusty:

16 Mar 2012, 5:39 PM
#6
lowell37 avatar

lowell37

New Zenner

Join Date:
Jan 2012
Location:
Catalina, Arizona
Posts:
28
Plugin Contributions:
0

Re: Music Samples with Media Manager

Any ideas? Anyone?

16 Mar 2012, 5:44 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Music Samples with Media Manager

This is what the file looks like, the lines in RED where changed for this fix:

<?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: init_sessions.php 18031 2010-10-23 21:30:12Z wilt $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
// require the session handling functions
  require(DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'sessions.php');

  zen_session_name('zenAdminID');
  zen_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
if (defined('SESSION_USE_ROOT_COOKIE_PATH') && SESSION_USE_ROOT_COOKIE_PATH  == 'True') $path = '/';
$path = (defined('CUSTOM_COOKIE_PATH')) ? CUSTOM_COOKIE_PATH : $path;
$domainPrefix = (!defined('SESSION_ADD_PERIOD_PREFIX') || SESSION_ADD_PERIOD_PREFIX == 'True') ? '.' : '';

if (PHP_VERSION >= '5.2.0') {
  session_set_cookie_params(0, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''), FALSE, TRUE);
} else {
  session_set_cookie_params(0, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''));
}

// lets start our session
  zen_session_start();
  $session_started = true;

if (! isset ( $_SESSION ['securityToken'] ))
{
  $_SESSION ['securityToken'] = md5 ( uniqid ( rand (), true ) );
}
if (isset ( $_GET ['action'] ) && in_array ( $_GET ['action'], array ('copy_options_values', 'update_options_values', 'update_value', 'add_product_option_values', 'copy_options_values_one_to_another_options_id', 'delete_options_values_of_option_name', 'copy_options_values_one_to_another', 'copy_categories_products_to_another_category_linked', 'remove_categories_products_to_another_category_linked', 'reset_categories_products_to_another_category_master', 'update_counter', 'update_orders_id', 'locate_configuration_key', 'locate_configuration', 'update_categories_attributes', 'update_product', 'locate_configuration', 'locate_function', 'locate_class', 'locate_template', 'locate_all_files', 'add_product', 'add_category', 'update_product_attribute', 'add_product_attributes', 'update_attributes_copy_to_category', 'update_attributes_copy_to_product', 'delete_option_name_values','delete_all_attributes', 'save', 'layout_save', 'update', 'update_sort_order', 'update_confirm', 'copyconfirm', 'deleteconfirm', 'insert', 'move_category_confirm', 'delete_category_confirm', 'update_category_meta_tags', 'insert_category' ) ))
{
//  if (strpos ( $PHP_SELF, FILENAME_PRODUCTS_PRICE_MANAGER ) === FALSE && strpos ( $PHP_SELF, FILENAME_PRODUCTS_OPTIONS_NAME ) === FALSE && (strpos( $PHP_SELF, FILENAME_CURRENCIES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_LANGUAGES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_SPECIALS ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_FEATURED ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_SALEMAKER ) === FALSE))
  if (strpos($PHP_SELF, FILENAME_MEDIA_MANAGER)===FALSE && strpos ( $PHP_SELF, FILENAME_PRODUCTS_PRICE_MANAGER ) === FALSE && strpos ( $PHP_SELF, FILENAME_PRODUCTS_OPTIONS_NAME ) === FALSE && (strpos( $PHP_SELF, FILENAME_CURRENCIES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_LANGUAGES ) === FALSE) && (strpos( $PHP_SELF, FILENAME_SPECIALS ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_FEATURED ) === FALSE)&& (strpos( $PHP_SELF, FILENAME_SALEMAKER ) === FALSE))
  {
    if ((! isset ( $_SESSION ['securityToken'] ) || ! isset ( $_POST ['securityToken'] )) || ($_SESSION ['securityToken'] !== $_POST ['securityToken']))
    {
      zen_redirect ( zen_href_link ( FILENAME_DEFAULT, '', 'SSL' ) );
    }
  }
}

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

16 Mar 2012, 7:31 PM
#8
lowell37 avatar

lowell37

New Zenner

Join Date:
Jan 2012
Location:
Catalina, Arizona
Posts:
28
Plugin Contributions:
0

Re: Music Samples with Media Manager

This is what my file looks like:
code: <?php
/**

  • session handling
  • see {@link http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
  • @package initSystem
  • @copyright Copyright 2003-2010 Zen Cart Development Team
  • @copyright Portions Copyright 2003 osCommerce
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: init_sessions.php 18031 2010-10-23 21:30:12Z wilt $
    /
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }
    /
    *
  • sanity check in case zenid has been incorrectly supplied as an htmlencoded param name
    */
    if (!isset($_GET['zenid']) && isset($_GET['amp;zenid'])) {
    $_GET['zenid'] = $_GET['amp;zenid'];
    unset($_GET['amp;zenid']);
    } else if (isset($_GET['amp;zenid'])) {
    unset($_GET['amp;zenid']);
    }

/**

  • require the session handling functions
    /
    require(DIR_WS_FUNCTIONS . 'sessions.php');
    /
    *
  • set the session name and save path
    /
    zen_session_name('zenid');
    zen_session_save_path(SESSION_WRITE_DIRECTORY);
    /
    *
  • set the session cookie parameters
    */
    $path = str_replace('\', '/', dirname($_SERVER['SCRIPT_NAME']));
    if (defined('SESSION_USE_ROOT_COOKIE_PATH') && SESSION_USE_ROOT_COOKIE_PATH == 'True') $path = '/';
    $path = (defined('CUSTOM_COOKIE_PATH')) ? CUSTOM_COOKIE_PATH : $path;
    $domainPrefix = (!defined('SESSION_ADD_PERIOD_PREFIX') || SESSION_ADD_PERIOD_PREFIX == 'True') ? '.' : '';

if (PHP_VERSION >= '5.2.0') {
session_set_cookie_params(0, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''), FALSE, TRUE);
} else {
session_set_cookie_params(0, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''));
}
/**

  • set the session ID if it exists
    /
    if (isset($_POST[zen_session_name()])) {
    zen_session_id($_POST[zen_session_name()]);
    } elseif ( ($request_type == 'SSL') && isset($_GET[zen_session_name()]) ) {
    zen_session_id($_GET[zen_session_name()]);
    }
    /
    *
  • need to tidy up $_SERVER['REMOTE_ADDR'] here beofre we use it any where else
  • one problem we don't address here is if $_SERVER['REMOTE_ADDRESS'] is not set to anything at all
    /
    $ipAddressArray = explode(',', $_SERVER['REMOTE_ADDR']);
    $ipAddress = (sizeof($ipAddressArray) > 0) ? $ipAddressArray[0] : '';
    $_SERVER['REMOTE_ADDR'] = $ipAddress;
    /
    *
  • start the session
    /
    $session_started = false;
    if (SESSION_FORCE_COOKIE_USE == 'True') {
    zen_setcookie('cookie_test', 'please_accept_for_session', time()+60
    602430, '/', (zen_not_null($current_domain) ? $current_domain : ''));

if (isset($_COOKIE['cookie_test'])) {
zen_session_start();
$session_started = true;
}
} elseif (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$spider_flag = false;
if (zen_not_null($user_agent)) {
$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
if (zen_not_null($spiders[$i]) && substr($spiders[$i], 0, 4) != '$Id:') {
if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
$spider_flag = true;
break;
}
}
}
}
if ($spider_flag == false) {
zen_session_start();
$session_started = true;
} else {
if (isset($_GET['zenid']) && $_GET['zenid'] != '') {
$tmp = (isset($_GET['main_page']) && $_GET['main_page'] != '') ? $_GET['main_page'] : FILENAME_DEFAULT;
@header("HTTP/1.1 301 Moved Permanently");
@zen_redirect(@zen_href_link($tmp, @zen_get_all_get_params(array('zenid')), $request_type, FALSE));
unset($tmp);
die();
}
}
} else {
zen_session_start();
$session_started = true;
}
unset($spiders);
/**

  • set host_address once per session to reduce load on server
    /
    if (!isset($_SESSION['customers_host_address'])) {
    if (SESSION_IP_TO_HOST_ADDRESS == 'true') {
    $_SESSION['customers_host_address']= @gethostbyaddr($_SERVER['REMOTE_ADDR']);
    } else {
    $_SESSION['customers_host_address'] = OFFICE_IP_TO_HOST_ADDRESS;
    }
    }
    /
    *
  • verify the ssl_session_id if the feature is enabled
    /
    if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == 'true') && ($session_started == true) ) {
    $ssl_session_id = $_SERVER['SSL_SESSION_ID'];
    if (!$_SESSION['SSL_SESSION_ID']) {
    $_SESSION['SSL_SESSION_ID'] = $ssl_session_id;
    }
    if ($_SESSION['SSL_SESSION_ID'] != $ssl_session_id) {
    zen_session_destroy();
    zen_redirect(zen_href_link(FILENAME_SSL_CHECK));
    }
    }
    /
    *
  • verify the browser user agent if the feature is enabled
    /
    if (SESSION_CHECK_USER_AGENT == 'True') {
    $http_user_agent = $_SERVER['HTTP_USER_AGENT'];
    if (!$_SESSION['SESSION_USER_AGENT']) {
    $_SESSION['SESSION_USER_AGENT'] = $http_user_agent;
    }
    if ($_SESSION['SESSION_USER_AGENT'] != $http_user_agent) {
    zen_session_destroy();
    zen_redirect(zen_href_link(FILENAME_LOGIN));
    }
    }
    /
    *
  • verify the IP address if the feature is enabled
    */
    if (SESSION_CHECK_IP_ADDRESS == 'True') {
    $ip_address = zen_get_ip_address();
    if (!$_SESSION['SESSION_IP_ADDRESS']) {
    $_SESSION['SESSION_IP_ADDRESS'] = $ip_address;
    }
    if ($_SESSION['SESSION_IP_ADDRESS'] != $ip_address) {
    zen_session_destroy();
    zen_redirect(zen_href_link(FILENAME_LOGIN));
    }
    }

Would you recommend I put the other file in an overide folder, or paste in the missing lines?

16 Mar 2012, 9:16 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Music Samples with Media Manager

The confusion is, the file that needs to be changed is:
/your_secret_admin/includes/init_includes/init_sessions.php

You are looking at your catalog file ...

Go look at the correct file to make the changes ...

NOTE: there are no override files for the Admin ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

17 Mar 2012, 1:53 AM
#10
lowell37 avatar

lowell37

New Zenner

Join Date:
Jan 2012
Location:
Catalina, Arizona
Posts:
28
Plugin Contributions:
0

Re: Music Samples with Media Manager

That was it! Whoopee!:clap: Works perfectly now.
Muchas , Muchas Gracias!

17 Mar 2012, 3:19 AM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Music Samples with Media Manager

You are most welcome ... thanks for the update that this is now working for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!