Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon} Modular Front Page


kymation

Recommended Posts

At first it didn't work, but then I say I needed a comma under the last entry 'select' before my new entry. Brilliant work, Jim. Your contributions and this thread have brought me great joy now and in the past. Your continued commitment to the forum and thread is very appreciated.

 

That being said, I have four questions. What changes do I have to make to scroller.php to fit the images between the scroller images? What do I need to do to make it scroll via clicking only? What do I need to do to make it scroll x amount of pixels per click? Pretty much, I'd like it to scroll pages from clicks on the arrows. Finally, can I enlarge the images beyond what's set in the admin 'images' menu? Thanks again, Jim. For everything.

Link to comment
Share on other sites

1. Fit the images where? I don't understand.

 

2. Automatic scroll is currently the only option. I'll look at the latest version of the scroller library to see if that option has been added, but that will have to wait until my current job is finished. Or you could hack the Javascript yourself.

 

3. The Manual Scroll Step setting in the module.

 

4. Find SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT in the module file and replace those constants with numbers. Or replace one with a number and the other with '' to keep the proportions the same. I probably should make those module settings.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

1. I wanted to get the images off the buttons. I found I can either set the padding past 35 in scroller.php under...

 

$header .= '#scroller {' . "\n";

 

...and then ditch the border, or I can lower the width in ...

 

$header .= 'div.scrollWrapper {' . "\n";

 

...and then center it.

 

2, 3, 4, spent 13 hrs in threads today, I'll get back to you on those. Thanks again.

Link to comment
Share on other sites

Hi. I think I have found a small bug in the categories_images.php module of version 1.2.6.. If I configure the number of columns to be 3 and have 3 categories in my store and specify a box style of grid, the module generates invalid HTML. I am getting an extra unmatched </tr> tag just before the </table> which ends the table of categories.

It looks as though the code doesn't handle the number of categories being an exact multiple of the number of columns correctly.

Link to comment
Share on other sites

kymation, as previously stated, this module has helped me out alot so thanks once again! just an issue im currently having with the banner rotator. for some reason in internet explorer the banners i have tend to overlap my header, but in mozilla this displays where it needs to be... im not too sure if any1 can tell me what fix i can put to resolve this issue in the stylesheet...

Link to comment
Share on other sites

You probably have an image in your header that's taller than the header height specified in your stylesheet. Use FireBug's Inspect Element to see what the settings are and where to find them.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I've been working i little with this addon, and suddenly my Front Modular Page - Install Modules gone. I can work only with 2 modules who have been installed.

 

Any ideas why are they gone?

 

Thank you in advance.

Edited by Huroman
Link to comment
Share on other sites

Never mind. This files just appears suddenly "banner_rotator_old.php". Just i deleted it and voilà, everything's fine.

 

[04-Oct-2011 17:41:08] PHP Fatal error:  Cannot redeclare class banner_rotator in /Applications/MAMP/htdocs/01-osCommerce/catalog/includes/modules/front_page/banner_rotator_old.php on line 13

Link to comment
Share on other sites

You can use the scroller from this Addon as a template, or any of the other modules if you want. The code that is executed on the front page goes in the execute() method. Don't forget to rename your module so it doesn't conflict with one of the existing modules.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Yes, I am using the scroller as the template. But I think the script is being run. I just see all the slideshow images with bullets and no slideshow in them. Here is the code:

 

<?php
/*
 $Id: slideshow.php v1.0.1 20110107 Kymation $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
*/
 class slideshow {
   var $code = 'slideshow';
   var $group = 'front_page';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;
   function slideshow() {
  $this->title = MODULE_FRONT_PAGE_SLIDESHOW_TITLE;
  $this->description = MODULE_FRONT_PAGE_SLIDESHOW_DESCRIPTION;
  if( defined( 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS' ) ) {
    $this->sort_order = MODULE_FRONT_PAGE_SLIDESHOW_SORT_ORDER;
    $this->enabled = ( MODULE_FRONT_PAGE_SLIDESHOW_STATUS == 'True' );
  }
   }
   function execute() {
  global $oscTemplate, $PHP_SELF, $cPath;
  if ($PHP_SELF == 'index.php' && $cPath == '') {
    // Set the Javascript and styles to go in the header
    $header ='<link href="stylesheet.css" rel="stylesheet" type="text/css" />'. "\n";
 $header ='<script type="text/javascript" src="ext/slideshow/easySlider1.7.js"></script>'. "\n";
 $header ='<script type="text/javascript">'. "\n";
 $header ='$(document).ready(function(){'. "\n";
 $header ='$("#slider").easySlider({'. "\n";
 $header ='auto: true,'. "\n";
 $header ='continuous: true'. "\n";
 $header ='});'. "\n";
 $header ='}); '. "\n";
 $header ='</script>'. "\n";
    $oscTemplate->addBlock($header, 'header_tags');

function tep_get_slideshow($output='ul', $width, $height) {

$slides_query = tep_db_query("select slideshow_name, slideshow_url, slideshow_description, slideshow_image FROM " . TABLE_SLIDESHOW . " order by slideshow_id");

$slides_array = array();
 $slides_ul = '<ul>';

  while ($slide_values = tep_db_fetch_array($slides_query)) {
    $slides_array[] = array('slide_name' => $slide_values['slideshow_name'],
							   'slide_url' => $slide_values['slideshow_url'],
	   'slide_description' => $slide_values['slideshow_description'],
	   'slide_image' => $slide_values['slideshow_image']);

if($slide_values['slideshow_url']) $slides_ul .=  '<li><a href="' . $slide_values['slideshow_url']. '">' . tep_image(DIR_WS_IMAGES . $slide_values['slideshow_image'], $slide_values['slideshow_name'], $width, $height) . '</a></li>'."\n"; 
 else $slides_ul .=  '<li>' . tep_image(DIR_WS_IMAGES . $slide_values['slideshow_image'], $slide_values['slideshow_name'], $width, $height) . '</li>'."\n"; 


  }

  $slides_ul .= '</ul>';

   if($output=='array') return $slides_array;
else return $slides_ul;

 }
  $slideshow = tep_get_slideshow('ul','565','255');

  $oscTemplate->addBlock($slideshow, $this->group );
  }
}
   function isEnabled() {
  return $this->enabled;
   }
   function check() {
  return defined( 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS' );
   }
   function install() {
  tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_FRONT_PAGE_SLIDESHOW_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())" );
  tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Heading Title', 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS', 'True', 'Do you want to show the heading title?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())" );
   }
   function remove() {
  tep_db_query( "delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')" );
   }
   function keys() {
  return array( 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS', 'MODULE_FRONT_PAGE_SLIDESHOW_SORT_ORDER' );
   }
 }
?>

Link to comment
Share on other sites

You're trying to put a function (tep_get_slideshow) inside a method. That won't work. Try moving your function to a separate file, or make it a separate class method.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

You could just make it another method in the existing class, then call it with

$this->tep_get_slideshow('ul','565','255')

I would get rid of the function call and make the code it contains part of the execute method.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I am not so knowledgeable in these things. I tried my best. But I am facing problems on Line 47 and 77

 

<?php
/*
 $Id: slideshow.php v1.0.1 20110107 Kymation $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com  Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
*/  class slideshow {
   var $code = 'slideshow';
   var $group = 'front_page';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;
   function slideshow() {
  $this->title = MODULE_FRONT_PAGE_SLIDESHOW_TITLE;
  $this->description = MODULE_FRONT_PAGE_SLIDESHOW_DESCRIPTION;	  if( defined( 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS' ) ) {
    $this->sort_order = MODULE_FRONT_PAGE_SLIDESHOW_SORT_ORDER;
    $this->enabled = ( MODULE_FRONT_PAGE_SLIDESHOW_STATUS == 'True' );
  }
   }
   function execute() {
  global $oscTemplate, $PHP_SELF, $cPath;
  if ($PHP_SELF == 'index.php' && $cPath == '') {
    // Set the Javascript and styles to go in the header
    $header ='<link href="stylesheet.css" rel="stylesheet" type="text/css" />'. "\n";
 $header ='<script type="text/javascript" src="ext/slideshow/easySlider1.7.js"></script>'. "\n";
 $header ='<script type="text/javascript">'. "\n";
 $header ='$(document).ready(function(){'. "\n";
 $header ='$("#slider").easySlider({'. "\n";
 $header ='auto: true,'. "\n";
 $header ='continuous: true'. "\n";
 $header ='});'. "\n";
 $header ='}); '. "\n";
 $header ='</script>'. "\n";
    $oscTemplate->addBlock($header, 'header_tags');
//line 46
tep_get_slideshow($output='ul', $width, $height) {

$slides_query = tep_db_query("select slideshow_name, slideshow_url, slideshow_description, slideshow_image FROM " . TABLE_SLIDESHOW . " order by slideshow_id");

$slides_array = array();
 $slides_ul = '<ul>';

  while ($slide_values = tep_db_fetch_array($slides_query)) {
    $slides_array[] = array('slide_name' => $slide_values['slideshow_name'],
							   'slide_url' => $slide_values['slideshow_url'],
	   'slide_description' => $slide_values['slideshow_description'],
	   'slide_image' => $slide_values['slideshow_image']);

if($slide_values['slideshow_url']) $slides_ul .=  '<li><a href="' . $slide_values['slideshow_url']. '">' . tep_image(DIR_WS_IMAGES . $slide_values['slideshow_image'], $slide_values['slideshow_name'], $width, $height) . '</a></li>'."\n"; 
 else $slides_ul .=  '<li>' . tep_image(DIR_WS_IMAGES . $slide_values['slideshow_image'], $slide_values['slideshow_name'], $width, $height) . '</li>'."\n"; 


  }

  $slides_ul .= '</ul>';

   if($output=='array') return $slides_array;
else return $slides_ul;

 }   $this->tep_get_slideshow('ul','565','255')

   // LINE 76    $oscTemplate->addBlock($slideshow, $this->group );
  }
}    function isEnabled() {
  return $this->enabled;
   }
   function check() {
  return defined( 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS' );
   }    function install() {
  tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_FRONT_PAGE_SLIDESHOW_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())" );
  tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Heading Title', 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS', 'True', 'Do you want to show the heading title?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())" );
   }
   function remove() {
  tep_db_query( "delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')" );
   }    function keys() {
  return array( 'MODULE_FRONT_PAGE_SLIDESHOW_STATUS', 'MODULE_FRONT_PAGE_SLIDESHOW_SORT_ORDER' );
   }
 }
?>

Link to comment
Share on other sites

I already told you what I would suggest doing with those lines.

 

In any case, you have more problems than that. It appear that there is code missing -- your broken function is returning data that is then thrown away. I don't know how to fix that, and I don't have the time to do this for you.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi Jim.....excellent contribution!!!!...thanks a lot for that, very useful, and very easy to work with....its perfect to do lot of things, specially for beginners like me.

 

Here is the Spanish folder, just in case someone has the Spanish language installed, to avoid errors when changing the language in the page.

 

Thanks again

catalog.zip

Link to comment
Share on other sites

I've uploaded a new version to the usual location. The file is also available from my server until the official upload is approved.

 

This version makes all of the modules multi-language, and fixes some bugs in others. It also includes the previous improvements and translations by others. Thanks to everyone who has helped with code and translations. Of course more translations are welcome, as are fixes and new modules.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

All of the modules in this package can also be used in the page header or footer using the Header Footer Content Modules Addon. You will need to move the module and language files to the appropriate directory, then change one line in the module code file from

 

    var $group = 'front_page';

to

 

    var $group = 'header_footer_contents';

I have used the Categories Images module (with the images turned off) in the Footer as an alternate site navigations system. Works just fine. So if you want a banner rotator in your page header, now that's easy to do.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

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...