Jump to content
Sign in to follow this  
vikal

Bugs in Article Manager v 1.5.6.zip please fix this

Recommended Posts

hi

 

good morning

 

i have just installed this module Article Manager v 1.5.6.zip on my site...

it's working in admin site but at the front end

 

at the top of right column there comes this error..

 

Fatal error: Cannot redeclare tep_show_topic() (previously declared in C:\xampp\htdocs\article\article\includes\boxes\articles.php:13) in C:\xampp\htdocs\article\article\includes\boxes\articles.php on line 59..

 

please tell me how to fix this...

 

waiting for your response

 

best regards

 

vikal

Share this post


Link to post
Share on other sites

I also have the same problem

====

code :

<?php

/*

$Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

function tep_show_topic($counter) {

global $tree, $topics_string, $tPath_array;

 

for ($i=0; $i<$tree[$counter]['level']; $i++) {

$topics_string .= "  ";

}

 

$topics_string .= '<a href="';

 

if ($tree[$counter]['parent'] == 0) {

$tPath_new = 'tPath=' . $counter;

} else {

$tPath_new = 'tPath=' . $tree[$counter]['path'];

}

 

$topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';

 

if (isset($tPath_array) && in_array($counter, $tPath_array)) {

$topics_string .= '<b>';

}

 

// display topic name

$topics_string .= $tree[$counter]['name'];

 

if (isset($tPath_array) && in_array($counter, $tPath_array)) {

$topics_string .= '</b>';

}

 

if (tep_has_topic_subtopics($counter)) {

$topics_string .= ' ->';

}

 

$topics_string .= '</a>';

 

if (SHOW_ARTICLE_COUNTS == 'true') {

$articles_in_topic = tep_count_articles_in_topic($counter);

if ($articles_in_topic > 0) {

$topics_string .= ' (' . $articles_in_topic . ')';

}

}

 

$topics_string .= '<br>';

echo $tree[$counter]['next_id'];

if ($tree[$counter]['next_id'] != false) {

tep_show_topic($tree[$counter]['next_id']);

}

}

?>

 

<!-- topics //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_ARTICLES);

 

new infoBoxHeading($info_box_contents, true, true);

 

$topics_string = '';

$tree = array();

 

$topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");

while ($topics = tep_db_fetch_array($topics_query)) {

$tree[$topics['topics_id']] = array('name' => $topics['topics_name'],

'parent' => $topics['parent_id'],

'level' => 0,

'path' => $topics['topics_id'],

'next_id' => false);

 

if (isset($parent_id)) {

$tree[$parent_id]['next_id'] = $topics['topics_id'];

}

 

$parent_id = $topics['topics_id'];

 

if (!isset($first_topic_element)) {

$first_topic_element = $topics['topics_id'];

}

}

 

//------------------------

if (tep_not_null($tPath)) {

$new_path = '';

reset($tPath_array);

while (list($key, $value) = each($tPath_array)) {

unset($parent_id);

unset($first_id);

$topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");

if (tep_db_num_rows($topics_query)) {

$new_path .= $value;

while ($row = tep_db_fetch_array($topics_query)) {

$tree[$row['topics_id']] = array('name' => $row['topics_name'],

'parent' => $row['parent_id'],

'level' => $key+1,

'path' => $new_path . '_' . $row['topics_id'],

'next_id' => false);

 

if (isset($parent_id)) {

$tree[$parent_id]['next_id'] = $row['topics_id'];

}

 

$parent_id = $row['topics_id'];

 

if (!isset($first_id)) {

$first_id = $row['topics_id'];

}

 

$last_id = $row['topics_id'];

}

$tree[$last_id]['next_id'] = $tree[$value]['next_id'];

$tree[$value]['next_id'] = $first_id;

$new_path .= '_';

} else {

break;

}

}

}

tep_show_topic($first_topic_element);

 

$info_box_contents = array();

$new_articles_string = '';

$all_articles_string = '';

 

if (DISPLAY_NEW_ARTICLES=='true') {

if (SHOW_ARTICLE_COUNTS == 'true') {

//originale

// $articles_new_query = tep_db_query("select a.articles_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where ((a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY))");

// modifi閑

$articles_new_query = tep_db_query("SELECT a.articles_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_TOPICS_DESCRIPTION . " td, " . TABLE_AUTHORS . " au, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.authors_id = au.authors_id and a2t.topics_id = td.topics_id and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");

$articles_new_count = '';

}

 

if (strstr($_SERVER['PHP_SELF'],FILENAME_ARTICLES_NEW) or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {

$new_articles_string = '<b>';

}

 

$new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';

 

if (strstr($_SERVER['PHP_SELF'],FILENAME_ARTICLES_NEW) or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {

$new_articles_string .= '</b>';

}

 

$new_articles_string .= $articles_new_count . '<br>';

 

}

 

if (DISPLAY_ALL_ARTICLES=='true') {

if (SHOW_ARTICLE_COUNTS == 'true') {

// $articles_all_query = tep_db_query("select a.articles_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where ((a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "')");

$articles_new_query = tep_db_query("SELECT a.articles_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_TOPICS_DESCRIPTION . " td, " . TABLE_AUTHORS . " au, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.authors_id = au.authors_id and a2t.topics_id = td.topics_id and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "'");

} else {

$articles_all_count = '';

}

 

if ($topic_depth == 'top') {

$all_articles_string = '<b>';

}

 

$all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';

 

if ($topic_depth == 'top') {

$all_articles_string .= '</b>';

}

 

$all_articles_string .= $articles_all_count . '<br>';

 

}

 

$info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- topics_eof //-->

Edited by xmbill

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×