Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

articles content module


Supletech

Recommended Posts

I just installed the articles content module v0222, and I got everything working fine until I wanted to move an article from a subcategory to a main category ...

This is the message I got :

 

Fatal error: Call to undefined function: tep_array_reverse() in /home/dilmer/public_html/tienda/admin/includes/functions/articles_general.php on line 155

 

 

Could you guys take a look at this code please!

 

function tep_generate_articlecategory_path($id, $from = 'category', $articlecat_array = '', $index = 0) {
global $languages_id;

if (!is_array($articlecat_array)) $articlecat_array = array();

if ($from == 'article') {
$articlecat_query = tep_db_query("select articlecat_id from " . TABLE_ARTICLES_TO_ARTICLECAT . " where articles_id = '" . $id . "'");
while ($articlecat = tep_db_fetch_array($articlecat_query)) {
if ($articlecat['articlecat_id'] == '0') {
$articlecat_array[$index][] = array('id' => '0', 'text' => TEXT_TOP);
} else {
$category_query = tep_db_query("select cd.articlecat_name, c.parent_id from " . TABLE_ARTICLECAT . " c, " . TABLE_ARTICLECAT_DESCRIPTION . " cd where c.articlecat_id = '" . $articlecat['articlecat_id'] . "' and c.articlecat_id = cd.articlecat_id and cd.language_id = '" . $languages_id . "'");
$category = tep_db_fetch_array($category_query);
$articlecat_array[$index][] = array('id' => $articlecat['articlecat_id'], 'text' => $category['articlecat_name']);
if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $articlecat_array = tep_generate_articlecategory_path($category['parent_id'], 'category', $articlecat_array, $index);
$articlecat_array[$index] = tep_array_reverse($articlecat_array[$index]);
}
$index++;
}
} elseif ($from == 'category') {
$category_query = tep_db_query("select cd.articlecat_name, c.parent_id from " . TABLE_ARTICLECAT . " c, " . TABLE_ARTICLECAT_DESCRIPTION . " cd where c.articlecat_id = '" . $id . "' and c.articlecat_id = cd.articlecat_id and cd.language_id = '" . $languages_id . "'");
$category = tep_db_fetch_array($category_query);
$articlecat_array[$index][] = array('id' => $id, 'text' => $category['articlecat_name']);
if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $articlecat_array = tep_generate_articlecategory_path($category['parent_id'], 'category', $articlecat_array, $index);
}

return $articlecat_array;
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...