New Zenner
- Join Date:
- Dec 2010
- Posts:
- 21
- Plugin Contributions:
- 0
Create a "Record_Companies" dropdown in the navigation
Hello Everyone, I couldn't find a solution to this anywhere in the forums. I'm using zen 1.5.1, and i'm using CSS mega-menu for my navigation (a fantastic plug-in from Picaflor-azul btw) BUT my issue is not technically with the menu itself. I want to customize it to have a drop-down similar to manufacturers (or "brands" on the menu) but for record_companies -- actually a copied/modified version of record companies that should work just the same called "DVD studios" (I created a DVD product type). So far, I can get it to display the list of studios i have in the database, but it doesn't connect and show which products are listed under those studios, it just keeps returning saying there are no products listed under each studio. Here's my demo site: http://kingsdist.com/devdummy/index.php?main_page=index&studios_id=4
And here is the code I have so far:
<li class="submenu studios-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>"><?php echo HEADER_TITLE_STUDIOS; ?></a><!--bof shop by dvd studio -->
<div class="dropdown_1column">
<div class="col_1 firstcolumn">
<ul >
<?
$show_studios= true;
// for large lists of studios uncomment this section
/*
if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or ($request_type == 'SSL')) {
$show_studios= false;
} else {
$show_studios= true;
}
*/
// Set to true to display studios images in place of names
define('DISPLAY_STUDIOS_IMAGES',false);
if ($show_studios) {
// only check products if requested - this may slow down the processing of the studios sidebox
if (PRODUCTS_STUDIOS_STATUS == '1') {
$studios_sidebox_query = "select distinct pe.studios_id, pe.studios_name, pe.studios_image
from " . TABLE_STUDIOS . " pe
left join " . TABLE_PRODUCTS . " p on pe.studios_id = p.studios_id
where pe.studios_id = p.studios_id and p.products_status= 1
order by studios_name";
} else {
$studios_sidebox_query = "select pe.studios_id, pe.studios_name, pe.studios_image
from " . TABLE_STUDIOS . " pe
order by studios_name";
}
$studios_sidebox = $db->Execute($studios_sidebox_query);
if ($studios_sidebox->RecordCount()>0) {
$number_of_rows = $studios_sidebox->RecordCount()+1;
// Display a list
$studios_sidebox_array = array();
// kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
// if (!isset($_GET['studios_id']) || $_GET['studios_id'] == '' ) {
// $studios_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
// } else {
// $studios_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_STUDIOS);
// }
while (!$studios_sidebox->EOF) {
$studios_sidebox_name = ((strlen($studios_sidebox->fields['studios_name']) > MAX_DISPLAY_STUDIOS_NAME_LEN) ? substr($studios_sidebox->fields['studios_name'], 0, MAX_DISPLAY_STUDIOS_NAME_LEN) . '..' : $studios_sidebox->fields['studios_name']);
$studios_sidebox_image = $studios_sidebox->fields['studios_image'];
$studios_sidebox_array[] =
array('id' => $studios_sidebox->fields['studios_id'],
'text' => DISPLAY_STUDIOS_IMAGES ?
zen_image(DIR_WS_IMAGES . $studios_sidebox_image, $studios_sidebox_name) :
$studios_sidebox_name);
$studios_sidebox->MoveNext();
}
}
} // $show_studios
for ($i=0;$i<sizeof($studios_sidebox_array);$i++) {
$content = '';
$content .= '<li ><a class="hide" href="' . zen_href_link(FILENAME_DEFAULT, 'studios_id=' . $studios_sidebox_array[$i]['id']) . '">';
$content .= $studios_sidebox_array[$i]['text'];
$content .= '</a></li>' . "\n";
echo $content;
}
?>
</ul>
</div>
</div>
</li><!-- eof shop by dvd studio -->
if anyone can help, that would be awesome, I've been stuck for a couple weeks!:wacko: