Ugh another error I am almost there I think; searched for this in thread and found nothing:
[06-Feb-2018 21:59:31 America/New_York] Request URI: /, IP address: 98.109.213.21
#1 zen_categories_ul_generator->buildBranch() called at [/var/www/giftboundgifts/includes/classes/categories_ul_generator.php:85]
#2 zen_categories_ul_generator->buildTree() called at [/var/www/giftboundgifts/includes/templates/responsive_sheffield_blue/templates/tpl_modules_mobile_ca$
#3 require(/var/www/giftboundgifts/includes/templates/responsive_sheffield_blue/templates/tpl_modules_mobile_categories_tabs.php) called at [/var/www/giftb$
#4 require(/var/www/giftboundgifts/includes/templates/responsive_sheffield_blue/common/tpl_header.php) called at [/var/www/giftboundgifts/includes/template$
#5 require(/var/www/giftboundgifts/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php) called at [/var/www/giftboundgifts/index.php:97]
[06-Feb-2018 21:59:31 America/New_York] PHP Warning: A non-numeric value encountered in /var/www/giftboundgifts/includes/classes/categories_ul_generator.php on line 58
this is the line 58:
PHP Code:
$result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );
this is what I have in this file:
PHP Code:
class zen_categories_ul_generator {
var $root_category_id = 0,
$max_level = 0,
$data = array(),
$parent_group_start_string = '<ul%s>',
$parent_group_end_string = '</ul>',
$child_start_string = '<li%s>',
$child_end_string = '</li>',
$spacer_string = '
',
$spacer_multiplier = 1;
var $document_types_list = ' (3) ';
// acceptable format example: ' (3, 4, 9, 22, 18) '
function __construct($load_from_database = true)
{
global $languages_id, $db;
$this->data = array();
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_id = cd.categories_id
and c.categories_status=1 " .
" and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
" order by c.parent_id, c.sort_order, cd.categories_name";
$categories = $db->Execute($categories_query);
while (!$categories->EOF) {
$this->data[$categories->fields['parent_id']][$categories->fields['categories_id']] = array('name' => $categories->fields['categories_name'], 'count' => 0);
$categories->MoveNext();
}
}
function buildBranch($parent_id, $level, $submenu=true, $parent_link='')
{
$result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );
if (($this->data[$parent_id])) {
foreach($this->data[$parent_id] as $category_id => $category) {
$category_link = $parent_link . $category_id;
if (($this->data[$category_id])) {
$result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' : '');
} else {
$result .= sprintf($this->child_start_string, '');
}
$result .= str_repeat($this->spacer_string, $this->spacer_multiplier * 1) . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">';
$result .= $category['name'];
$result .= '</a>';
if (($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
$result .= $this->buildBranch($category_id, $level+1, $submenu, $category_link . '_');
}
$result .= $this->child_end_string;
}
}
$result .= $this->parent_group_end_string;
return $result;
}
function buildTree($submenu=false)
{
return $this->buildBranch($this->root_category_id, '', $submenu);
}
}
Bookmarks