Jump to content
Sign in to follow this  
caitanya

Category Descriptions contribution for osCommerce 2.2 CVS

Recommended Posts

Hi,

 

I've just downloaded the Category Descriptions contribution for osCommerce 2.2. This is just what I need, but I have a small problem.

 

I am running the new osCommerce 2.2 CVS 2003/03/24

 

Anyway I added everything like described but I had some problems finding the following lines at admin/categories.php:

 

7) Locate the following 7 lines (approximately line 85):

$categories_image = tep_get_uploaded_file('categories_image');

$image_directory = tep_get_local_path(DIR_FS_CATALOG_IMAGES);

 

if (is_uploaded_file($categories_image['tmp_name'])) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image

= '" . $categories_image['name'] . "' where categories_id = '" . tep_db_input($categories_id)

. "'");

tep_copy_uploaded_file($categories_image, $image_directory);

}

 

There are no such lines in this file???

 

Now if I start in the browser: admin - categories - product: there come these new fields where I can add the new Category Heading Title, etc... and when I press button preview I get the following message:

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/website/public_html/eshop/admin/categories.php

on line 469

 

Has this something to do with the missing lines? or is there something else

i am missing???

 

Thanks, Marko

Share this post


Link to post
Share on other sites

The author has contacted me by email on this subject, and I've investigated the issue and replied back to him.

 

The bad news is: the code for admin/categories.php has changed yet again. And I won't be able to update my contribution until at least mid-May; I'm too busy right now to look at it. :(

 

Brian


Looking for a computer consultant in Winnipeg, Manitoba? Visit my web site at www.groupbcl.ca

Share this post


Link to post
Share on other sites
tep_get_uploaded_file

 

i am 'working' on this between the lines (sometimes)

 

my code is now (not finished yet but getting closer)

 

        if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

       $image_directory = tep_get_local_path(DIR_FS_CATALOG_IMAGES);



       if (is_uploaded_file($categories_image['tmp_name'])) {

         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image->filename . "' where categories_id = '" . tep_db_input($categories_id) . "'"); // check robert

         tep_copy_uploaded_file($categories_image, $image_directory);

       }

 

NOTE: this is not working yet !!!

Share some code to get in the right direction :)


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
NOTE: this is not working yet !!! Share some code to get in the right direction

What's happend is the functions is_uploaded_file and tep_copy_uploaded_file have been replaced with a new object-oriented function called upload():

        if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image->filename . "' where categories_id = '" . tep_db_input($categories_id) . "'");

       }

 

Hope this helps.


Looking for a computer consultant in Winnipeg, Manitoba? Visit my web site at www.groupbcl.ca

Share this post


Link to post
Share on other sites

I've managed to get the categories description mod working with the new upload function. I don't know if anybody still needs the fix - if you do let me know and I'll post the changes here. For now, the new_category.insert should look like this:

 

  //----- new_category_preview (active when ALLOW_CATEGORY_DESCRIPTIONS is 'true') -----

 } elseif ($HTTP_GET_VARS['action'] == 'new_category_preview') {

   if ($HTTP_POST_VARS) {

     $cInfo = new objectInfo($HTTP_POST_VARS);

     $categories_name = $HTTP_POST_VARS['categories_name'];

     $categories_heading_title = $HTTP_POST_VARS['categories_heading_title'];

     $categories_description = $HTTP_POST_VARS['categories_description'];



// copy image only if modified

     if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)){

       $categories_image_name = $categories_image->filename;

     } else {

       $categories_image_name = $HTTP_POST_VARS['categories_previous_image'];

     }

     } else {

     $category_query = tep_db_query("select c.categories_id, cd.language_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.categories_id = '" . $HTTP_GET_VARS['cID'] . "'");

     $category = tep_db_fetch_array($category_query);



     $cInfo = new objectInfo($category);

     $categories_image_name = $cInfo->categories_image;

   }



   $form_action = ($HTTP_GET_VARS['cID']) ? 'update_category' : 'insert_category';



   echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');



   $languages = tep_get_languages();

   for ($i=0; $i<sizeof($languages); $i++) {

     if ($HTTP_GET_VARS['read'] == 'only') {

       $cInfo->categories_name = tep_get_category_name($cInfo->categories_id, $languages[$i]['id']);

       $cInfo->categories_heading_title = tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']);

       $cInfo->categories_description = tep_get_category_description($cInfo->categories_id, $languages[$i]['id']);

     } else {

       $cInfo->categories_name = tep_db_prepare_input($categories_name[$languages[$i]['id']]);

       $cInfo->categories_heading_title = tep_db_prepare_input($categories_heading_title[$languages[$i]['id']]);

       $cInfo->categories_description = tep_db_prepare_input($categories_description[$languages[$i]['id']]);

     }

?>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $cInfo->categories_heading_title; ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

       <td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $categories_image_name, $cInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $cInfo->categories_description; ?></td>

     </tr>



<?php

   }

   if ($HTTP_GET_VARS['read'] == 'only') {

     if ($HTTP_GET_VARS['origin']) {

       $pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);

       if ($pos_params != false) {

         $back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);

         $back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);

       } else {

         $back_url = $HTTP_GET_VARS['origin'];

         $back_url_params = '';

       }

     } else {

       $back_url = FILENAME_CATEGORIES;

       $back_url_params = 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id;

     }

?>

     <tr>

       <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

     </tr>

<?php

   } else {

?>

     <tr>

       <td align="right" class="smallText">

<?php

/* Re-Post all POST'ed variables */

     reset($HTTP_POST_VARS);

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

       if (!is_array($HTTP_POST_VARS[$key])) {

         echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));

       }

     }

     $languages = tep_get_languages();

     for ($i=0; $i<sizeof($languages); $i++) {

       echo tep_draw_hidden_field('categories_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_name[$languages[$i]['id']])));

       echo tep_draw_hidden_field('categories_heading_title[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_heading_title[$languages[$i]['id']])));

       echo tep_draw_hidden_field('categories_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_description[$languages[$i]['id']])));

     }

     echo tep_draw_hidden_field('X_categories_image', stripslashes($categories_image_name));

     echo tep_draw_hidden_field('categories_image', stripslashes($categories_image_name));



     echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';



     if ($HTTP_GET_VARS['cID']) {

       echo tep_image_submit('button_update.gif', IMAGE_UPDATE);

     } else {

       echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

     }

     echo '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?></td>

     </tr>

<?php

   }

 

Cheers

 

Del

Share this post


Link to post
Share on other sites

:D I just found this mod and am ready to try it out. Is the code above what I need to change from the original contribution.. or is there more or something else? Let me know if possible, or if anyone has installed it lately.

 

I'm running the 2.2 csv snapshot from 5/3/03

 

Thanks!


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

This is what I have for the categories_image line:

        if ( ($categories_image != 'none') && ($categories_image != '') ) {

         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image_name . "' where categories_id = '" . tep_db_input($categories_id) . "'");

         $image_location = DIR_FS_CATALOG_IMAGES . $categories_image_name;

         copy($categories_image, $image_location);

       }

Replace that line with:

 

if (ALLOW_CATEGORY_DESCRIPTIONS == 'true') {

           tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $HTTP_POST_VARS['categories_image'] . "' where categories_id = '" .  tep_db_input($categories_id) . "'");

           $categories_image = '';

         } else {

           $categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES);

             tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image['name'] . "' where categories_id = '" . tep_db_input($categories_id) . "'");

             copy($categories_image, $image_location);

           }

 

The new_category_insert should read:

  //----- new_category / edit_category (when ALLOW_CATEGORY_DESCRIPTIONS is 'true') -----

 if ($HTTP_GET_VARS['action'] == 'new_category_ACD' || $HTTP_GET_VARS['action'] == 'edit_category_ACD') {

   if ( ($HTTP_GET_VARS['cID']) && (!$HTTP_POST_VARS) ) {

     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $HTTP_GET_VARS['cID'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name");

     $category = tep_db_fetch_array($categories_query);



     $cInfo = new objectInfo($category);

   } elseif ($HTTP_POST_VARS) {

     $cInfo = new objectInfo($HTTP_POST_VARS);

     $categories_name = $HTTP_POST_VARS['categories_name'];

     $categories_heading_title = $HTTP_POST_VARS['categories_heading_title'];

     $categories_description = $HTTP_POST_VARS['categories_description'];

     $categories_url = $HTTP_POST_VARS['categories_url'];

   } else {

     $cInfo = new objectInfo(array());

   }



   $languages = tep_get_languages();



   $text_new_or_edit = ($HTTP_GET_VARS['action']=='new_category_ACD') ? TEXT_INFO_HEADING_NEW_CATEGORY : TEXT_INFO_HEADING_EDIT_CATEGORY;

?>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo sprintf($text_new_or_edit, tep_output_generated_category_path($current_category_id)); ?></td>

           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr><?php echo tep_draw_form('new_category', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=new_category_preview', 'post', 'enctype="multipart/form-data"'); ?>

       <td><table border="0" cellspacing="0" cellpadding="2">

<?php

   for ($i=0; $i<sizeof($languages); $i++) {

?>

         <tr>

           <td class="main"><?php if ($i == 0) echo TEXT_EDIT_CATEGORIES_NAME; ?></td>

           <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', (($categories_name[$languages[$i]['id']]) ? stripslashes($categories_name[$languages[$i]['id']]) : tep_get_category_name($cInfo->categories_id, $languages[$i]['id']))); ?></td>

         </tr>

<?php

   }

?>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

<?php

   for ($i=0; $i<sizeof($languages); $i++) {

?>

         <tr>

           <td class="main"><?php if ($i == 0) echo TEXT_EDIT_CATEGORIES_HEADING_TITLE; ?></td>

           <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('categories_heading_title[' . $languages[$i]['id'] . ']', (($categories_name[$languages[$i]['id']]) ? stripslashes($categories_name[$languages[$i]['id']]) : tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']))); ?></td>

         </tr>

<?php

   }

?>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

<?php

   for ($i=0; $i<sizeof($languages); $i++) {

?>

         <tr>

           <td class="main" valign="top"><?php if ($i == 0) echo TEXT_EDIT_CATEGORIES_DESCRIPTION; ?></td>

           <td><table border="0" cellspacing="0" cellpadding="0">

             <tr>

               <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

               <td class="main"><?php echo tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (($categories_description[$languages[$i]['id']]) ? stripslashes($categories_description[$languages[$i]['id']]) : tep_get_category_description($cInfo->categories_id, $languages[$i]['id']))); ?></td>

             </tr>

           </table></td>

         </tr>

<?php

   }

?>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

         <tr>

         <tr>

           <td class="main"><?php echo TEXT_EDIT_CATEGORIES_IMAGE; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('categories_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $cInfo->categories_image . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image); ?></td>

         </tr>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo TEXT_EDIT_SORT_ORDER; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'); ?></td>

         </tr>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

       <td class="main" align="right"><?php echo tep_draw_hidden_field('categories_date_added', (($cInfo->date_added) ? $cInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $cInfo->parent_id) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

     </form></tr>

<?php



 //----- new_category_preview (active when ALLOW_CATEGORY_DESCRIPTIONS is 'true') -----

 } elseif ($HTTP_GET_VARS['action'] == 'new_category_preview') {

   if ($HTTP_POST_VARS) {

     $cInfo = new objectInfo($HTTP_POST_VARS);

     $categories_name = $HTTP_POST_VARS['categories_name'];

     $categories_heading_title = $HTTP_POST_VARS['categories_heading_title'];

     $categories_description = $HTTP_POST_VARS['categories_description'];



// copy image only if modified 

     if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)){ 

       $categories_image_name = $categories_image->filename; 

     } else { 

       $categories_image_name = $HTTP_POST_VARS['categories_previous_image']; 

     } 

     } else { 

     $category_query = tep_db_query("select c.categories_id, cd.language_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.categories_id = '" . $HTTP_GET_VARS['cID'] . "'"); 

     $category = tep_db_fetch_array($category_query); 



     $cInfo = new objectInfo($category); 

     $categories_image_name = $cInfo->categories_image; 

   }



   $form_action = ($HTTP_GET_VARS['cID']) ? 'update_category' : 'insert_category';



   echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');



   $languages = tep_get_languages();

   for ($i=0; $i<sizeof($languages); $i++) {

     if ($HTTP_GET_VARS['read'] == 'only') {

       $cInfo->categories_name = tep_get_category_name($cInfo->categories_id, $languages[$i]['id']);

       $cInfo->categories_heading_title = tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']);

       $cInfo->categories_description = tep_get_category_description($cInfo->categories_id, $languages[$i]['id']);

     } else {

       $cInfo->categories_name = tep_db_prepare_input($categories_name[$languages[$i]['id']]);

       $cInfo->categories_heading_title = tep_db_prepare_input($categories_heading_title[$languages[$i]['id']]);

       $cInfo->categories_description = tep_db_prepare_input($categories_description[$languages[$i]['id']]);

     }

?>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $cInfo->categories_heading_title; ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

     </tr>

     <tr>

       <td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $categories_image_name, $cInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $cInfo->categories_description; ?></td>

     </tr>



<?php

   }

   if ($HTTP_GET_VARS['read'] == 'only') {

     if ($HTTP_GET_VARS['origin']) {

       $pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);

       if ($pos_params != false) {

         $back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);

         $back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);

       } else {

         $back_url = $HTTP_GET_VARS['origin'];

         $back_url_params = '';

       }

     } else {

       $back_url = FILENAME_CATEGORIES;

       $back_url_params = 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id;

     }

?>

     <tr>

       <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

     </tr>

<?php

   } else {

?>

     <tr>

       <td align="right" class="smallText">

<?php

/* Re-Post all POST'ed variables */

     reset($HTTP_POST_VARS);

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

       if (!is_array($HTTP_POST_VARS[$key])) {

         echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));

       }

     }

     $languages = tep_get_languages();

     for ($i=0; $i<sizeof($languages); $i++) {

       echo tep_draw_hidden_field('categories_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_name[$languages[$i]['id']])));

       echo tep_draw_hidden_field('categories_heading_title[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_heading_title[$languages[$i]['id']])));

       echo tep_draw_hidden_field('categories_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_description[$languages[$i]['id']])));

     }

     echo tep_draw_hidden_field('X_categories_image', stripslashes($categories_image_name));

     echo tep_draw_hidden_field('categories_image', stripslashes($categories_image_name));



     echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';



     if ($HTTP_GET_VARS['cID']) {

       echo tep_image_submit('button_update.gif', IMAGE_UPDATE);

     } else {

       echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

     }

     echo '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?></td>

     </form></tr>

<?php

   }

 

Thanks for the added info from all... it works great!!

Share this post


Link to post
Share on other sites

knipper

 

I installed that contibution about 3 days ago no problems at all, the version i found was 1.2c, but I just seached the contributions and can only find the 1.1 version, I dont know where I got my version from, but its updated.. and trouble free --> installed on MS1 2.2

 

Cheers Lee

Share this post


Link to post
Share on other sites

I am stuck! As the original contribution creator mentioned there is a new function.

 

I understand changes or the replacement need to be made to new_category.insert but what needs to get changed in /admin/categories.php now?

 

I have the following code from my 5/3/03 snapshot:

if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image->filename . "' where categories_id = '" . tep_db_input($categories_id) . "'");

       }

 

I don't have the same lines as marg showed.

 

Any suggestions?

 

PS MaxiDVD... I think the mod you are refering to is a similar contribution just released. I tried it out but didn't like it. Thanks though! :)


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

knipper..

Have you simply tried replacing that code with the code I wrote above? In looking at my original snapshot, it was written as you have yours. I must have added something along the way that added the extra "stuff".

Give it a shot...

Marg

Share this post


Link to post
Share on other sites

I have made all the changes as posted in the instructions, including using the text from your file instead of the original.

 

I have now changed the lines you showed for the categories_image area as well. I can go into the admin, but do not get a new page when I try to edit categories.

 

No error messages, just no new page. Also the ability to upload image, etc. is no longer there. I just went back and looked at all the code changes, and everything looks OK. ANy Idea where I could look for a problem?

 

Thanks !


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

I went back through the code again in /admin/categories.php and don't see anything out-of-whack. Unless copying the code from the forum post made it not work.

 

The only other contributions I use are Lindas header tag controller, and Richards admin for the tag controller. I did notice some of the lines modified were in the same area as the admin controller, but it didn't look like any changes were made.

 

Anyone point me the right way or have advice?


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

Ahhhh....

 

I got it working. :lol: I started with an unmodded local test site and worked my way down the instructions. I was able to use the code from Margs' post for the categories_image line. The I did find some of the code for default PHP had to be moved to different locations.

 

I then copied the changes back to my previously modded store, and all was well.

 

Thanks. 8)


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

hi all,

 

I have just download this contribution .. Category_description 1.1 and the readme file is difficult to read and understand, As some of you have managed to install and get it working i would appreciate if you guys could help me, and also what do i do with the new_category.insert file....

 

would appreciate feedback thanks

Share this post


Link to post
Share on other sites

I'm curious if this contrib is OK for MS 2 use.


<>< <>< <>< <>< <>< <><

<><

<>< Tony Pros - tony@funksmith.com

<><

<>< <>< <>< <>< <>< <><

 

I've learned that if someone says something unkind about me, I must live so that no one will believe it.

Share this post


Link to post
Share on other sites
I'm curious if this contrib is OK for MS 2 use.

Sorry, no.

 

This is Brian Lowe, posting under his company name "Group BCL". I wrote the Category Descriptions mod, and it appears I'm still the maintainer :D.

 

The README file for the latest version of the mod is now out of date. As of two weeks ago I have started a full time job. Which unfortunately leaves me with even less time to put into maintaining Category Descriptions.

 

So, while it's not in the spirit of open source software such as OS Commerce, I have been asking people for a financial contribution to cover off the estimated 10 hours of work I estimate it will take me to get this working. That includes the time required to download and install MS2, update the source with the patches posted in this thread, test it, update the documentation, build a new package, and upload it.

 

Usually I get replies along the lines of "Sorry, but I'm just starting out myself and can't afford to pay you." Which is quite understandable. Being marginally employed for two years has also stretched my bank account rather thin.

 

Yes, I will eventually get around to updating my mod to work with MS2, if no one steps forward first with a bit of money. When, I can't say for sure. It's summer here in Canada, and with summers as short as they are in this part of the world I'm not very willing to give up a weekend at the beach to work on my mod 8)


Looking for a computer consultant in Winnipeg, Manitoba? Visit my web site at www.groupbcl.ca

Share this post


Link to post
Share on other sites

I have a problem an dwould greatly appreciate any suggestions to guide me in the right direction.

 

Ive installed everything, step by step.

 

No Errors.... but when I edit or add a category, there are no changes????

 

Thanks

tammy

Share this post


Link to post
Share on other sites

Fallen at the first hurdle, can anyone help??

 

The guide states;

4. NEW FILE: admin/includes/functions/categories_description.php

 

The categories_description.php file contains two service routines:

tep_get_category_heading_title

tep_get_category_description

 

It should be installed in the admin/includes/functions directory.

 

What should be in this file? Do I create but leave empty?

Share this post


Link to post
Share on other sites

Just wanted to add a comment about this mod. The version found here:

 

http://www.oscommerce.com/community/contributions,1373

 

DOES work with OSC 2.2 MS2. I have personally installed version "20 Jul 2003 - Categories Description MS2 1.5" on OSC 2.2 MS2, and it works great. Thank you for the update to the original version 1.1 which was not compatible with OSC 2.2 MS2, this is a great contrib!!!

 

The only thing I should mention is that within the installation instructions, step #4 for changes for "catalog/index.php", it mentions looking for the line "// We build the manufacturers Dropdown ...". This line is not in the code, however if you go down to around line 258, you should fine the line it mentions,

"?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> " . This is where you need to be for step # 4.

 

Other than that, the instructions are accurate.

 

Hope this helps a little bit, for those having trouble getting this contrib to work on OSC 2.2 MS2.

 

--

Chris

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  

×