This change will make it so your music side boxes only display names associated with active products.
First run these SQL statements....
Code:
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Artists List - Verify Product Exist', 'PRODUCTS_ARTISTS_STATUS', '1', 'Verify that at least 1 product exists and is active for the artist name to show<br /><br />Note: When this feature is ON it can produce slower results on sites with a large number of products and/or artists<br />0= off 1= on', 3, 7, NULL, now(), NULL, 'cfg_select_option(array(\'0\', \'1\'), ');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Record Company List - Verify Product Exist', 'PRODUCTS_RECORD_COMPANY_STATUS', '1', 'Verify that at least 1 product exists and is active for the artist name to show<br /><br />Note: When this feature is ON it can produce slower results on sites with a large number of products and/or record companies.<br />0= off 1= on', 3, 7, NULL, now(), NULL, 'cfg_select_option(array(\'0\', \'1\'), ');
in includes\modules\sideboxes\artists.php find
Code:
$artists_query = "select m.artists_id, m.artists_name
from " . TABLE_RECORD_ARTISTS . " m
order by artists_name";
replace with
Code:
if (PRODUCTS_ARTISTS_STATUS == '1') {
$artists_query = "select distinct a.artists_id, a.artists_name from (" . TABLE_RECORD_ARTISTS . " a left join " . TABLE_PRODUCT_MUSIC_EXTRA . " pme on a.artists_id = pme.artists_id left join " . TABLE_PRODUCTS . " p on pme.products_id = p.products_id ) where p.products_status = 1 order by artists_name";
} else {
$artists_query = "select m.artists_id, m.artists_name
from " . TABLE_RECORD_ARTISTS . " m
order by artists_name";
}
in includes\modules\sideboxes\record_companies.php find
Code:
$record_company_query = "select m.record_company_id, m.record_company_name
from " . TABLE_RECORD_COMPANY . " m
order by record_company_name";
replace with
Code:
if (PRODUCTS_RECORD_COMPANY_STATUS == '1') {
$record_company_query = "select distinct r.record_company_id, r.record_company_name from (" . TABLE_RECORD_COMPANY . " r left join " . TABLE_PRODUCT_MUSIC_EXTRA . " pme on r.record_company_id = pme.record_company_id left join " . TABLE_PRODUCTS . " p on pme.products_id = p.products_id ) where p.products_status = 1 order by record_company_name";
} else {
$record_company_query = "select m.record_company_id, m.record_company_name
from " . TABLE_RECORD_COMPANY . " m
order by record_company_name";
}
You could do the same thing for genres if you like as well. Dont have that handy because I dont currently use genres.
Bookmarks