Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ContributionUnique Category Descriptions -- (made simple) 1.0


Digerdoo

Recommended Posts

Posted

If there is not any files it show

 

 

Warning: main(includes/descriptions/--none--.php): failed to open stream: No such file or directory in /home/precious/public_html/index.php on line 199

 

Warning: main(includes/descriptions/--none--.php): failed to open stream: No such file or directory in /home/precious/public_html/index.php on line 199

 

Warning: main(): Failed opening 'includes/descriptions/--none--.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/precious/public_html/index.php on line 199

 

Here is the code:

 

<tr>

<td>

<?php

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

include( 'includes/descriptions/'.$category['categories_name'].'.php' );

?>

<?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?>

</td>

</tr>

 

 

can someone put in the code that kind of line IF THERE IS NO FILE IT JUST LISTING NORMAL..

 

:)

Posted

change this line:

 

include( 'includes/descriptions/'.$category['categories_name'].'.php' );

 

to

if (file_exists('/home/user/public_html/includes/descriptions/'.$category['categories_name'].'.php') ) {
include( 'includes/descriptions/'.$category['categories_name'].'.php' );
}

you need to set the full path according to your server. Or make a couple of definitions in the configure.php to have this code portable.

Posted
change this line:

 

include( 'includes/descriptions/'.$category['categories_name'].'.php' );

 

to

if (file_exists('/home/user/public_html/includes/descriptions/'.$category['categories_name'].'.php') ) {
include( 'includes/descriptions/'.$category['categories_name'].'.php' );
}

you need to set the full path according to your server. Or make a couple of definitions in the configure.php to have this code portable.

 

 

thanks

 

:)

Posted
If there is not any files it show

Warning: main(includes/descriptions/--none--.php): failed to open stream: No such file or directory in /home/precious/public_html/index.php on line 199

 

Warning: main(includes/descriptions/--none--.php): failed to open stream: No such file or directory in /home/precious/public_html/index.php on line 199

 

Warning: main(): Failed opening 'includes/descriptions/--none--.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/precious/public_html/index.php on line 199

 

Here is the code:

 

<tr>

<td>

<?php

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

include( 'includes/descriptions/'.$category['categories_name'].'.php' );

?>

<?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?>

</td>

</tr>

can someone put in the code that kind of line IF THERE IS NO FILE IT JUST LISTING NORMAL..

 

:)

 

'

 

 

One more thing to do. Why it not show maincategory especially if i have maincategory called COMPUTERS and i create file COMPUTERS.PHP it not show description at all ? Only subcategories show..

 

 

:blush:

Archived

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

×
×
  • Create New...