Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Graphical Borders on RSS News


mikes

Recommended Posts

Hello,

 

All is working fine except for my heading for the "new products" it still has the original stock OSC look. Im wanting it to look like the heading in the screenshot file called new_products_central_module.

 

Ive certainly forgotten or left something out. :blink: What is it that I havent done but need to do?

 

You can view My Site here so you can see what I mean.

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 164
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...
hello, someone, pleeeeeeeease :)

********************************************************************************

*****************

*

* 6) OPEN file:

*

* catalog/includes/modules/new_products.php

*

* NOTE: THE NEXT MODIFICATION 6.1, 6.2 AND 6.3

* IS FOR DISPLAY THE "NEW PRODUCTS IN MONTH..." MODULE

* WITH A GRAPHIC ROUNDED BORDERS.

*

* IF YOU WANT TO DISPLAY THE PRODUCTS OF THIS MODULE

* IN INDIVIDUAL BOXES THEN DONT DO STEPS 6.1, 6.2 AND 6.3

* AND USE FOR THIS FILE THE CONTRIBUTION:

* Individual boxes for products in central modules

* http://www.oscommerce.com/community/contributions,4491

*

********************************************************************************

*****************

*

 

*

* 6.1. Open File and Find:

*

 

<!-- new_products //-->

 

*

* ADD AFTER:

*

 

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

<tr>

<?php

$titulo = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'));

echo mws_header_main($titulo);

?>

<td>

 

*

* INCLUDE FIX: fix to display the month in the title of module. Fix by OSdave

* (http://oscommerce.qadram.com/modules.php?name=Forums&file=profile&mode=viewprofile&u=5673)

*

 

 

*

* 6.2. FIND:

*

 

<!-- new_products_eof //-->

 

*

* ADD BEFORE:

*

 

</td>

<?php echo mws_footer(''); ?>

</tr>

</table>

 

*

* 6.3. FIND:

*

 

new contentBoxHeading($info_box_contents);

 

*

* REPLACE With:

*

 

// new contentBoxHeading($info_box_contents);

 

 

*

* *****************************************************************************

*

* 7) FOR DONT DISPLAY THE DEFAULT BORDERS OF MODULE "NEW PRODUCTS ON MONTH...":

*

* *****************************************************************************

*

* 7.1. OPEN file:

*

catalog/includes/classes/boxes.php

 

*

* and ADD at botton of file before ?>:

*

 

// Graphical Borders

class noborderBox extends tableBox {

function noborderBox($contents) {

$this->table_cellpadding = '0';

$this->table_cellspacing = '3';

$this->table_data_parameters = 'class="noborderBox"';

$this->tableBox($contents, true);

}

}

// Graphical Borders - end modification

Link to comment
Share on other sites

*

* 6.3. FIND:

*

 

new contentBoxHeading($info_box_contents);

 

*

* REPLACE With:

*

 

// new contentBoxHeading($info_box_contents);

 

Thanks Matej,

 

That was the little bit of code I forgot. New I missed something. Thank You :)

Link to comment
Share on other sites

Thanks Matej,

 

That was the little bit of code I forgot. New I missed something. Thank You :)

You're welcome. Anyway I forgot to mention how to fix an error you've certainly found out - the "new products" box has different borders on the top and on the bottom... how is that possible?

 

A/ BORDERS AS THE BOXES (with darker shadow inside):

echo mws_header_main($titulo);

replace with

echo mws_header($titulo);

 

B/ BORDERS AS THE MAIN PAGES (with no shadow inside)

<?php echo mws_footer(''); ?>

replace with

<?php echo mws_footer_main(''); ?>

 

USEFUL ADVICE:

Notice that if you use the...

echo mws_header_main('');
<?php echo mws_footer_main(''); ?>

...you get the borders for MAIN pages (with no shadow inside in your case, actually it was developed to distinguish the boxes that need headign as the Windows windows ;) and the boxes used for info pages and so on with no heading in the header stripe).

 

Then, naturally, if you use the...

echo mws_header('');
<?php echo mws_footer(''); ?>

...you get the borders with heading stripe (bkg of title).

Edited by wizaard
Link to comment
Share on other sites

And the last hint I "created" today is about "featured products" addon (contrib) - I tested it on the featured products version 1.5.8 but I think it should work in almost all versions...

 

It's simple - you can download a step by step guide how to add the graphical borders 2.1 to featured products (and to other contribs). I did it as the guide says but found out that the featured products table in the middle doesn't dissapear if the graphical borders are applied after the guide. I looked into the PHP file after installing the borders (includes/modules/featured.php) and changed the original one to work properly. It's absolutely simple and easy (notice that I'm not a PHP programmer).

 

The file should look like this (just copy and overwrite the whole code if you want):

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 Featured Products V1.1
 Displays a list of featured products, selected from admin
 For use as an Infobox instead of the "New Products" Infobox  
*/
?>
<!-- featured_products //-->
<?php
if(FEATURED_PRODUCTS_DISPLAY == 'true')
{
 $featured_products_category_id = $new_products_category_id;
 $cat_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $featured_products_category_id . "' limit 1");
 $cat_name_fetch = tep_db_fetch_array($cat_name_query);
 $cat_name = $cat_name_fetch['categories_name'];
 $info_box_contents = array();

 if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {
  // by wizaard
  $gh_heading = TABLE_HEADING_FEATURED_PRODUCTS . " <a href=\"featured_products.php\"><img src=\"images/infobox/arrow_right.gif\" border=\"0\" title=\"Show all...\" alt=\"Show all...\"></a>";
// end by wizaard
$info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

 list($usec, $sec) = explode(' ', microtime());
 srand( (float) $sec + ((float) $usec * 100000) );
 $mtm= rand();

$featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
 } else {
  // by wizaard
  $gh_heading = TABLE_HEADING_FEATURED_PRODUCTS . " " . $cat_name;
// end by wizaard
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
$subcategories_array = array();
tep_get_subcategories($subcategories_array, $featured_products_category_id);
$featured_products_category_id_list = tep_array_values_to_string($subcategories_array);
if ($featured_products_category_id_list == '') {
  $featured_products_category_id_list .= $featured_products_category_id;
} else {
  $featured_products_category_id_list .= ',' . $featured_products_category_id;
}
$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
}

 $row = 0;
 $col = 0; 
 $num = 0;
 while ($featured_products = tep_db_fetch_array($featured_products_query)) {
$num ++; if ($num == 1) { //new contentBoxHeading($info_box_contents); 
}
$featured_products['products_name'] = tep_get_products_name($featured_products['products_id']);
if($featured_products['specstat']) {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . 
									   $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>');
} else {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));
}	
$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }
 if($num) {
  ?> 
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>

<?php echo mws_header($gh_heading); ?>
  <td>

  <?php new noborderBox($info_box_contents); ?>

  </td>
<?php echo mws_footer(''); ?>
 </tr>
</table>
<?php 
 }
} else // If it's disabled, then include the original New Products box
{
  // include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); // disable for dont show if desactive the feature module
}
?>
<!-- featured_products_eof //-->

 

And it works, and it's easy and much smarter than the original version (I can't write PHP scripts but this was absolutely easy - the whole idea is just about to find the exact part of the code that calls for showing the box). Enjoy.

Link to comment
Share on other sites

And (as it's ussual about me) I need to add something to the previous hind. When I read the post again I found out that I forgot to mention exactly what the hint actually does. So... If you've applied the graphical borders as the downloadable guide says, you must have discovered that if you have no featured products, the box (table) in the middle doesn't disappear. When you apply my code (catalog/includes/module/featured.php) it will behave correctly and will even have the link in the heading (I have translated the title and alt of the image into English but if you want you can connect it to the lang files).

Link to comment
Share on other sites

Hi, I am having a problem with the main center section when viewing shopping cart & reviews when they are empty. The title is showing the title of the last infobox in colum left.

 

I have read earlier in this thread about a fix but my skills are not to good.

 

Could someone who has solved this problem post a step by step - page by page instruction.

 

Thanks a lot for a good looking contribution.

Link to comment
Share on other sites

Hello John,

 

Mine does that, hehehe, If you can post the fix here that you found, (I was looking but couldnt find it) I might be able to help you with it.

I did find a fix, it's actually in the install.txt although I found the fix earlier in this thread. It basically adds a noborder box to the offending boxes so removing the problem.

Link to comment
Share on other sites

I need some help. On the categories page I want to get rid of the "Let's see what we have here" fixed title and show the name of the category the customer is viewing. I did find a piece of code that did this but I can't intergrate into the main box heading.

 

I also wish to do the same thing for the products page.

 

This is one snippet of code I found for index.php

 

if (isset($cPath) && tep_not_null($cPath)) {

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

$category = tep_db_fetch_array($category_query);

 

echo $category['categories_name'];

 

}

 

Anyone know what I need to do to solve this?

 

Thanks

Link to comment
Share on other sites

I did find a fix, it's actually in the install.txt although I found the fix earlier in this thread. It basically adds a noborder box to the offending boxes so removing the problem.

 

If you found the fix could you please repost it so as I can fix mine.

 

Thanks

Link to comment
Share on other sites

If you found the fix could you please repost it so as I can fix mine.

 

Thanks

The fix is in this thread, that's where I got it from. Look around pages 2 to 4.

Link to comment
Share on other sites

I know its in this thread, I have already done all that, thought you had found something else.

Ok, I followed the instructions in this post and it solved it for me, here is how my empty review page looks: http://www.coolnquiet.co.uk/product_review...p?products_id=3

Normally you would see the graphical box with the title taken from the bottom infobox on the left.

 

These are the instructions I followed from the thread:

 

Open catalog/includes/classes/boxes.php ADD the following code just before the final ?> at the end of the file

 

// Graphical Borders

class noborderBox extends tableBox {

function noborderBox($contents) {

$this->table_cellpadding = '0';

$this->table_cellspacing = '3';

$this->table_data_parameters = 'class="noborderBox"';

$this->tableBox($contents, true);

}

}

// Graphical Borders - end modification

 

Now open catalog/stylesheet.css ADD the following code just before the final ?> at the end of the file

 

TD.noborderbox {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

}

 

Now open catalog/shopping_cart.php

around line 209 look for:

 

<td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>

 

Replace With:

 

<td align="center" class="main"><?php new noborderbox(array(array('text' => TEXT_CART_EMPTY))); ?></td>

 

For Reviews do the same: Open catalog/reviews.php

around line 112 look for:

 

<td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>

 

Replace With:

 

<td align="center" class="main"><?php new noborderbox(array(array('text' => TEXT_CART_EMPTY))); ?></td>

 

I haven't found anywhere else that needs the mod yet but if you find something you just following the last instruction above in the offending file changing the box class from infobox to noborderbox.

 

Also don't forget to backup first and refresh your browser a couple times to make it show the changes.

 

Hope this works out, if you need more help I can post code from my files, just let me know what you need.

 

Cheers

John

Link to comment
Share on other sites

I need some help. On the categories page I want to get rid of the "Let's see what we have here" fixed title and show the name of the category the customer is viewing. I did find a piece of code that did this but I can't intergrate into the main box heading.

 

I also wish to do the same thing for the products page.

 

This is one snippet of code I found for index.php

 

if (isset($cPath) && tep_not_null($cPath)) {

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

$category = tep_db_fetch_array($category_query);

 

echo $category['categories_name'];

 

}

 

Anyone know what I need to do to solve this?

 

Thanks

Sorry to bump this but can anyone help solve this?

 

Thank

Link to comment
Share on other sites

Thanks for that John, I am sooooooo blind sometimes, I already had all that code done. I left out one little noborderbox. :blush:

 

As for replacing the lets see what we have here, you can change that in the english file but im not sure how you would make it call on the catagory titles. Have you tried Header Tag Controller, thats really good it will fill in all the headings for you. If you dont think that is what you are needing, maybe you should post that topic in the general thread as its nothing to do with GB so you will have more luck in finding an answer there.

 

Hope that helps you a little.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...