map not showing when using category menu
3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 30, 2011 (RSS)
By rez - March 30, 2011 - edited: March 30, 2011
When adding the getCategories code for a category menu to the top of my page, the map from the geocoder plug-in disappears and shows my "no map available" message. Removing the list at the top for the categories brings the map back (but of course breaks my navigation).
I'm also getting other errors with previously working code:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/myfolder/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// get records
list($nav_menuRecords, $nav_menuMetaData) = getCategories(array(
'tableName' => 'nav_menu',
'categoryFormat' => 'showall', // showall, onelevel, twolevel
));
list($addressRecords, $myMetaData) = getRecords(array(
'tableName' => 'locations',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$record = @$addressRecords[0]; // get first record
// show error message if no matching record is found
if (!$record) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}
list($stateRecords, $stateMetaData) = getRecords(array(
'tableName' => 'state',
));
?>
I'm also getting other errors with previously working code:
Notice: Undefined index: address in /home/myfolder/public_html/contact.php on line 120
Notice: Undefined index: city in /home/myfolder/public_html/contact.php on line 121 , Notice: Undefined index: state:label in /home/myfolder/public_html/contact.php on line 121 , Notice: Undefined index: zipcode in /home/myfolder/public_html/contact.php on line 121
Re: [rez] map not showing when using category menu
By rez - March 30, 2011 - edited: March 30, 2011
btw, on a different page the category menu seems to work fine with just:
this is cmsb 2.07
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/myfolder/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load records
list($nav_menuRecords, $nav_menuMetaData) = getCategories(array(
'tableName' => 'nav_menu',
'categoryFormat' => 'showall', // showall, onelevel, twolevel
));
?>
this is cmsb 2.07
Re: [rez] map not showing when using category menu
By robin - March 30, 2011
Hey Rez,
Perhaps your category menu is resetting the $record variable? Otherwise could you post or send your full code to support@interactivetools.com so we can take a closer look.
Thanks,
Robin
Perhaps your category menu is resetting the $record variable? Otherwise could you post or send your full code to support@interactivetools.com so we can take a closer look.
Thanks,
Robin
Robin
Programmer
interactivetools.com
Programmer
interactivetools.com