PHP Applications
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Applications

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old August 22nd, 2006, 02:01 AM
MysticHuntress MysticHuntress is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 MysticHuntress User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
New to Oscommerce

Im tring to change the color of the subcatagories in my oscommerce template..the only place I can think of to change it is in my column_left.php or my stylesheet.css I have the code I want but it's not working...Help

php Code:
Original - php Code
  1.  
  2. Stylesheet.css code
  3.  
  4. TR.subBar {
  5.   background: #f4f7fd;
  6. }
  7.  
  8. TD.subBar {
  9.   font-family: Verdana, Arial, sans-serif;
  10.   font-size: 10px;
  11.  color: #ff0482;
  12. }
  13. A.cat {
  14.   color: #000000;
  15.   text-decoration: none;
  16. }
  17. A.subcat1 {
  18.   color: #FF0000;
  19.   text-decoration: none;
  20. }
  21. A.subcat2 {
  22.   color: #5b0d0d;
  23.   text-decoration: none;
  24. }
  25. A.subcat3 {
  26.   color: #019901;
  27.   text-decoration: none;
  28. }


php Code:
Original - php Code
  1.  
  2. column_left.php
  3.  
  4.  
  5.  <table border="0" cellspacing="0" cellpadding="0">
  6.               <tr><td><?=tep_image(DIR_WS_IMAGES.'m15.gif')?></td></tr>
  7.               <tr><td width="153" height="42" class="bg1" style="padding-left:20px;"><span class="tx1"><?=HEADER_TITLE_CATALOG?></span></td></tr>
  8.               <tr><td bgcolor="#2D2D2D">
  9.                    <table border="0" cellspacing="0" cellpadding="0" width="130" align="center">
  10.                     <tr><td height="13"></td></tr>
  11.                     <tr><td><ul>
  12. <?
  13.   function tep_show_category($counter) {
  14.     global $tree, $categories_string, $cPath_array, $ii;
  15.  
  16.  
  17.    $ii++;
  18.    if(!$tree[$counter]['level']){               
  19.                      
  20.     $categories_string .= $categories_string ? '' : '';             
  21.  
  22.     $categories_string .= '<li><a href=';
  23.    
  24.     if ($tree[$counter]['parent'] == 0) {
  25.       $cPath_new = 'cPath=' . $counter;
  26.     } else {
  27.       $cPath_new = 'cPath=' . $tree[$counter]['path'];
  28.     }
  29.     $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
  30. // display categry name
  31.     $categories_string .= $tree[$counter]['name'];
  32.     $categories_string .= '</a></li>';
  33.    
  34.    }else{  // SUBCATEGORY
  35.    
  36.     $categories_string .= '';
  37.  
  38.     for($i=0;$i<$tree[$counter]['le vel'];$i++)
  39.      $categories_string .= '';
  40.    
  41.     $categories_string .= '<li><a href=';   
  42.     if ($tree[$counter]['parent'] == 0) {
  43.       $cPath_new = 'cPath=' . $counter;
  44.     } else {
  45.       $cPath_new = 'cPath=' . $tree[$counter]['path'];
  46.     }
  47.     $categories_string .= tep_href_link('index.php', $cPath_new) . '>-';
  48. // display category name
  49.     $categories_string .= $tree[$counter]['name'];
  50.     $categories_string .= '</a></li>';
  51.    } 
  52.  
  53.     if ($tree[$counter]['next_id'] != false && $ii < 20) {
  54.       tep_show_category($tree[$counter]['next_id']);
  55.     } 
  56.   }
  57.  
  58.  
  59.  
  60.   define(TABLE_CATEGORIES, "categories");
  61.   define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
  62.   $categories_string = '';
  63.   $tree = array();
  64.  
  65.   $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");
  66.   while ($categories = tep_db_fetch_array($categories_query))  {
  67.     $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
  68.                                                 'parent' => $categories['parent_id'],
  69.                                                 'level' => 0,
  70.                                                 'path' => $categories['categories_id'],
  71.                                                 'next_id' => false);
  72.  
  73.     if (isset($parent_id)) {
  74.       $tree[$parent_id]['next_id'] = $categories['categories_id'];
  75.     }
  76.  
  77.     $parent_id = $categories['categories_id'];
  78.  
  79.     if (!isset($first_element)) {
  80.       $first_element = $categories['categories_id'];
  81.     }
  82.   }
  83.  
  84.   //------------------------
  85.   if ($cPath) {
  86.     $new_path = '';
  87.     reset($cPath_array);
  88.     while (list($key, $value) = each($cPath_array)) {
  89.       unset($parent_id);
  90.       unset($first_id);
  91.       $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");
  92.       if (tep_db_num_rows($categories_query)) {
  93.         $new_path .= $value;
  94.         while ($row = tep_db_fetch_array($categories_query)) {
  95.           $tree[$row['categories_id']] = array('name' => $row['categories_name'],
  96.                                                'parent' => $row['parent_id'],
  97.                                                'level' => $key+1,
  98.                                                'path' => $new_path . '_' . $row['categories_id'],
  99.                                                'next_id' => false);
  100.  
  101.           if (isset($parent_id)) {
  102.             $tree[$parent_id]['next_id'] = $row['categories_id'];
  103.           }
  104.  
  105.           $parent_id = $row['categories_id'];
  106.  
  107.           if (!isset($first_id)) {
  108.             $first_id = $row['categories_id'];
  109.           }
  110.  
  111.           $last_id = $row['categories_id'];
  112.         }
  113.         $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
  114.         $tree[$value]['next_id'] = $first_id;
  115.         $new_path .= '_';
  116.       } else {
  117.         break;
  118.       }
  119.     }
  120.   }
  121.   $categories_string .=  '';
  122.   tep_show_category($first_element);
  123.   $categories_string .=  '';
  124.  
  125.   echo $categories_string;
  126. ?>
  127.  
  128.                     </ul></td></tr>
  129.                     <tr><td height="24"></td></tr>
  130.                    </table>
  131.               </td></tr>
  132.               <tr><td id="zxc1"><a href="<?=tep_href_link('index.php?cPath=21')?>"><?=tep_image(DIR_WS_IMAGES.'m17.gif')?></a></td></tr>
  133.              </table>
  134.  


php Code:
Original - php Code
  1.  
  2. This was what I was told would work but its not and Im not sure where to put it...help
  3.  
  4. switch ($tree[$counter]['level']) {
  5. case 0:
  6.   $class = 'cat';
  7.   break;
  8. case 1:
  9.   $class = 'subcat1';
  10.   break;
  11. case 2:
  12.   $class = 'subcat2';
  13.   break;
  14. case 3:
  15.   $class = 'subcat3';
  16.   break;
  17. default:
  18.   $class = '';
  19.   break;
  20. }
  21. $categories_string .= '<a class="' . $class . '" href="';
  22.  

Reply With Quote
  #2  
Old August 22nd, 2006, 07:32 AM
System System is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 665 System User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Message Moved

Thread moved from 'PHP Coding' to 'PHP Applications' by tkarkkainen.

Reason:

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Applications > New to Oscommerce


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump