osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

category.php box help

This is a discussion on category.php box help within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Just tring to modify the categories box so in writes mouse over title tag i have got this done now ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 08-15-2007, 07:06 AM
osCMax Testing Team
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 48
Thanks: 1
Thanked 23 Times in 14 Posts
Rep Power: 0
automotiveuk will become famous soon enoughautomotiveuk will become famous soon enough
Default category.php box help

Just tring to modify the categories box so in writes mouse over title tag i have got this done now i would like to go one step further and wright the category decription as the title tag but i am struggling a bit this what i got so far but it will not work many thanks

Code:
<?php
/*
$Id: categories.php 3 2006-05-27 04:59:07Z user $

  osCMax Power E-Commerce
  http://oscdox.com

  Copyright 2006 osCMax

  Released under the GNU General Public License
*/

// Most of this file is changed or moved to BTS - Basic Template System - format.

   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_categories_box();
   } else {

     if ( DISPLAY_DHTML_MENU == 'Dhtml' ) {
       include(DIR_WS_BOXES . 'categories_dhtml.php');
   } elseif (DISPLAY_DHTML_MENU == 'CoolMenu') {
 	  include(DIR_WS_BOXES . 'coolmenu.php');
   } else {


  $boxHeading = BOX_HEADING_CATEGORIES;
  $corner_left = 'rounded';
  $corner_right = 'square';
  $box_base_name = 'categories'; // for easy unique box template setup (added BTSv1.2)

  $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)

  function tep_show_category($counter) {
    
// BoF - Contribution Category Box Enhancement 1.1
    global $tree, $boxContent, $cPath_array, $cat_name;

    for ($i=0; $i<$tree[$counter]['level']; $i++) {
      $boxContent .= "&nbsp;&nbsp;";
    }
    $cPath_new = 'cPath=' . $tree[$counter]['path'];
    $boxContent .= '<a href="';
    $boxContent .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
//	$boxContent .= ' title=''test this title''">';
	$boxContent .= '" title=" Click here to view all products from '.$tree[$counter]['name'].' catagory">';
	
    if (tep_has_category_subcategories($counter)) {
      $boxContent .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '');
    }
    else {
      $boxContent .= tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '');
    }

    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
      $boxContent .= '<b>';
    }
    
    if ($cat_name == $tree[$counter]['name']) {
      $boxContent .= '<span class="errorText">';
    }

// display category name
    $boxContent .= $tree[$counter]['name'];
	$boxContentTitle .= $tree[$counter]['categories_description'];

                if ($cat_name == $tree[$counter]['name']) {
                        $boxContent .= '</span>';
    }

    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
      $boxContent .= '</b>';
    }
//         EoF Category Box Enhancement

    $boxContent .= '</a>';

    if (SHOW_COUNTS == 'true') {
      $products_in_category = tep_count_products_in_category($counter);
      if ($products_in_category > 0) {
        $boxContent .= '&nbsp;(' . $products_in_category . ')';
      }
    }

    $boxContent .= '<br>';

    if ($tree[$counter]['next_id'] != false) {
      tep_show_category($tree[$counter]['next_id']);
    }
  }
?>
<!-- categories //-->
<?php
// BoF - Contribution Category Box Enhancement 1.1
 if (isset($cPath_array)) {
                for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
                                $categories_query = tep_db_query("select categories_name, categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
                                if (tep_db_num_rows($categories_query) > 0)
                                $categories = tep_db_fetch_array($categories_query);
                }
        $cat_name = $categories['categories_name'];
		$cat_title = $categories['categories_description']; 
        }
// EoF Category Box Enhancement

  $boxContent = '';
  $tree = array();

  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  while ($categories = tep_db_fetch_array($categories_query))  {
    $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
                                                'parent' => $categories['parent_id'],
                                                'level' => 0,
                                                'path' => $categories['categories_id'],
                                                'next_id' => false);

    if (isset($parent_id)) {
      $tree[$parent_id]['next_id'] = $categories['categories_id'];
    }

    $parent_id = $categories['categories_id'];

    if (!isset($first_element)) {
      $first_element = $categories['categories_id'];
    }
  }

  //------------------------
  if (tep_not_null($cPath)) {
    $new_path = '';
    reset($cPath_array);
    while (list($key, $value) = each($cPath_array)) {
      unset($parent_id);
      unset($first_id);
      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
      if (tep_db_num_rows($categories_query)) {
        $new_path .= $value;
        while ($row = tep_db_fetch_array($categories_query)) {
          $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                               'parent' => $row['parent_id'],
                                               'level' => $key+1,
                                               'path' => $new_path . '_' . $row['categories_id'],
                                               'next_id' => false);

          if (isset($parent_id)) {
            $tree[$parent_id]['next_id'] = $row['categories_id'];
          }

          $parent_id = $row['categories_id'];

          if (!isset($first_id)) {
            $first_id = $row['categories_id'];
          }

          $last_id = $row['categories_id'];
        }
        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
        $tree[$value]['next_id'] = $first_id;
        $new_path .= '_';
      } else {
        break;
      }
    }
  }
  tep_show_category($first_element); 


include (bts_select('boxes', $box_base_name)); // BTS 1.5
}
}
?><!-- categories_eof //-->
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Adding Category Descriptions in Category List for each Cat. el1jones osCMax v2 Customization/Mods 1 03-15-2006 01:37 AM
which category box enhancement? joanstead osCommerce 2.2 Modification Help 3 03-11-2005 10:44 AM
Browse By Category MSatterwhite osCMax v1.7 Discussion 0 01-18-2005 09:36 AM
Category name damnedpig osCMax v1.7 Discussion 8 06-11-2004 11:32 AM
New category does not create new category folder Anonymous osCommerce 2.2 Installation Help 3 02-23-2003 12:52 PM


All times are GMT -8. The time now is 11:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax