Forums / Templates, Stylesheets, Page Layout / Change the font color in Product Listing page

Change the font color in Product Listing page

Started by wilson_li on 8 Aug 2011, 2:37 AM · Views: 3,507

Results 21 to 28 of 28
8 Aug 2011, 3:18 PM
#21
wilson_li avatar

wilson_li

New Zenner

Join Date:
Jul 2011
Location:
New Jersey
Posts:
98
Plugin Contributions:
0

Change the font color in Product Listing page

dgent:

Don't edit those, edit the body tag only.

background-color: #000 !important;

So you mean I should edit the/ following code:

body {
	margin: 0;
	font-family: verdana, arial, helvetica, sans-serif;
	font-size: 62.5%;
	color: #000000;
	background-color: #ffffff !important;
	}
8 Aug 2011, 3:19 PM
#22
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Change the font color in Product Listing page

wilson_li:

So you mean I should edit the/ following code:

body {
margin: 0;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 62.5%;
color: #000000;
background-color: #ffffff !important;
}


Yes, just edit the background-colour to #000
8 Aug 2011, 3:24 PM
#23
wilson_li avatar

wilson_li

New Zenner

Join Date:
Jul 2011
Location:
New Jersey
Posts:
98
Plugin Contributions:
0

Re: Change the font color in Product Listing page

dgent:

Yes, just edit the background-colour to #000

Thanks dgent, I edited the css file but still I had the space between each additional images:(

8 Aug 2011, 3:33 PM
#24
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Change the font color in Product Listing page

Go to includes/modules/additional_images.php

At the bottom is this line...

$list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',

This line below is identical, but it has percentages added to change spacing - I used this on one of my own sites. Try replacing the line above with the one below, and play around with the percentages to see if it helps. Back up your original file first.

 $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width: 80px;"' . $col_width . '10%;"',
8 Aug 2011, 3:40 PM
#25
wilson_li avatar

wilson_li

New Zenner

Join Date:
Jul 2011
Location:
New Jersey
Posts:
98
Plugin Contributions:
0

Re: Change the font color in Product Listing page

dgent:

Go to includes/modules/additional_images.php

At the bottom is this line...

$list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',

This line below is identical, but it has percentages added to change spacing - I used this on one of my own sites. Try replacing the line above with the one below, and play around with the percentages to see if it helps. Back up your original file first.

 $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width: 80px;"' . $col_width . '10%;"',

Thanks, dgent! I replaced the line with yours but it still doesn't work :(

<?php
/**
 * additional_images module
 *
 * Prepares list of additional product images to be displayed in template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: additional_images.php 16913 2010-07-16 03:38:06Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
$images_array = array();

// do not check for additional images when turned off
if ($products_image != '' && $flag_show_product_info_additional_images != 0) {
  // prepare image name
  $products_image_extension = substr($products_image, strrpos($products_image, '.'));
  $products_image_base = str_replace($products_image_extension, '', $products_image);

  // if in a subdirectory
  if (strrpos($products_image, '/')) {
    $products_image_match = substr($products_image, strrpos($products_image, '/')+1);
    //echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' -  base ' . $products_image_base . '<br>';
    $products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
    $products_image_base = $products_image_match;
  }

  $products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
  if ($products_image_directory != '') {
    $products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
  } else {
    $products_image_directory = DIR_WS_IMAGES;
  }

  // Check for additional matching images
  $file_extension = $products_image_extension;
  $products_image_match_array = array();
  if ($dir = @dir($products_image_directory)) {
    while ($file = $dir->read()) {
      if (!is_dir($products_image_directory . $file)) {
        if (substr($file, strrpos($file, '.')) == $file_extension) {
          //          if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
          if(preg_match("/" . $products_image_base . "/i", $file) == 1) {
            if ($file != $products_image) {
              if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
                //  echo 'I AM A MATCH ' . $file . '<br>';
                $images_array[] = $file;
              } else {
                //  echo 'I AM NOT A MATCH ' . $file . '<br>';
              }
            }
          }
        }
      }
    }
    if (sizeof($images_array)) {
      sort($images_array);
    }
    $dir->close();
  }
}

// Build output based on images found
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';

if ($num_images) {
  $row = 0;
  $col = 0;
  if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
    $col_width = floor(100/$num_images);
  } else {
    $col_width = floor(100/IMAGES_AUTO_ADDED);
  }

  for ($i=0, $n=$num_images; $i<$n; $i++) {
    $file = $images_array[$i];
    $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
    $flag_has_large = file_exists($products_image_large);
    $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
    $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
    $base_image = $products_image_directory . $file;
    $thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);

    // Link Preparation:
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';

    $noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';

    //      $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

    $link = $script_link . "\n      " . $noscript_link;
    //      $link = $alternate_link;

    // List Box array generation:
   $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width: 80px;"' . $col_width . '40%;"', 
    'text' => "\n      " . $link);
    $col ++;
    if ($col > (IMAGES_AUTO_ADDED -1)) {
      $col = 0;
      $row ++;
    }
  } // end for loop
} // endif
8 Aug 2011, 3:56 PM
#26
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Change the font color in Product Listing page

Find this in your sheet and change to below..

#addImagecont{
background-color: #fff;
border-top: solid 70px white;
border-bottom: solid 70px white;
border-left: solid 80px white;
border-right: solid 80px white;
width: 720px;
margin-left: auto;
margin-right: auto;

padding-right: 0px;
padding-left: 2px;
8 Aug 2011, 4:02 PM
#27
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Change the font color in Product Listing page

Hmm, Im not really getting what your trying to do. Youre making the main content of your site black, but adding lots of white. You might want to rethink your layout properly.

8 Aug 2011, 5:56 PM
#28
wilson_li avatar

wilson_li

New Zenner

Join Date:
Jul 2011
Location:
New Jersey
Posts:
98
Plugin Contributions:
0

Re: Change the font color in Product Listing page

dgent:

Hmm, Im not really getting what your trying to do. Youre making the main content of your site black, but adding lots of white. You might want to rethink your layout properly.

Thanks dgent! Right now I wanna keep the main content black. But when I tried in IE, almost all of the contents are mussed up, how can I do with that?

Thanks