Jump to content
kymation

[Addon} Modular Front Page

Recommended Posts

I didn't know that. I just tried it and it certainly does work that way. Thank you very much for that useful tip.

 

Edit: The banner controls are a deliberate design. Some customers (like me) are annoyed by moving things on a web page. You can't really remove the controls, but you can replace the images with transparent GIFs, and even move them off the page. It's up to you.

 

Regards

Jim

Edited by kymation

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

Share this post


Link to post
Share on other sites

I didn't know that. I just tried it and it certainly does work that way. Thank you very much for that useful tip.

 

You're welcome! Actually, I stumbled on it by pure accident, but it sure is nice to know that it works that way.

 

Edit: The banner controls are a deliberate design. Some customers (like me) are annoyed by moving things on a web page. You can't really remove the controls, but you can replace the images with transparent GIFs, and even move them off the page. It's up to you.

 

Thanks for that info. Hmmm... I do see your point. Maybe if I resize them so that they're smaller that would be better? My "beef" is that they're so darned big they kinda "take over" the banner, at least to me.

 

Anyway, thanks again for creating such a fabulous add-on! I'm having a blast getting my main page looking exactly how I want it to. Btw, that tip about how to clone the text area sure is coming in handy too! You *rock* dude! :thumbsup:

 

Regards,

 

Chris

Share this post


Link to post
Share on other sites

Hi, Jim:

 

I know... I'm such a pest! However, I do have another question...

 

I've added the "Specials" module, and I want to add a text area just above it with a "teaser" blurb about the specials. I have cloned "Text Main" and made the necessary changes to get it to display. However, I discovered that the "Specials" module only displays if there are, indeed, specials available, but my "teaser" blurb displays all the time.

 

Can you explain to me how to modify my "teaser" text area module so that it, too, only displays when there are specials available?

 

Thanks!

 

Regards,

 

Chris

Share this post


Link to post
Share on other sites

You would have to enclose the text part in code similar to the specials. Try something like this:

 

	    $specials_products_query_raw = "
		    select
			  p.products_id
		    from
			  " . TABLE_PRODUCTS . " p
			  join " . TABLE_PRODUCTS_DESCRIPTION . " pd
			    on pd.products_id = p.products_id
			  join " . TABLE_SPECIALS . " s
			    on s.products_id = p.products_id
		    where
			  p.products_status = '1'
			  and pd.language_id = '" . ( int ) $languages_id . "'
			  and s.status = '1'
		    limit 1
		  ";
    // print 'Specials Query: ' . $specials_products_query_raw . '<br />';
    $specials_products_query = tep_db_query( $specials_products_query_raw );
    if (tep_db_num_rows($specials_products_query) > 0) {
// existing code in the execute() method goes here
    }

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Wow! You're quick with the responses today! (wink!)

 

Yeah, I was trying to re-use the code from the Specials module, but wasn't having much success. I just tried your code, too, and now my text area isn't showing up at all, whether or not there's a special available. Here's the code I've currently got:

 


function execute() {
  $specials_products_query_raw = "
				  select
						p.products_id
				  from
						" . TABLE_PRODUCTS . " p
						join " . TABLE_PRODUCTS_DESCRIPTION . " pd
						  on pd.products_id = p.products_id
						join " . TABLE_SPECIALS . " s
						  on s.products_id = p.products_id
				  where
						p.products_status = '1'
						and pd.language_id = '" . ( int ) $languages_id . "'
						and s.status = '1'
				  limit 1
					";
  // print 'Specials Query: ' . $specials_products_query_raw . '<br />';
  $specials_products_query = tep_db_query( $specials_products_query_raw );
  if (tep_db_num_rows($specials_products_query) > 0) {


	global $oscTemplate, $language, $PHP_SELF, $cPath;

	if ($PHP_SELF == 'index.php' && $cPath == '') {

	  // Set the text to display on the front page
	  $body_text = '<!-- Text Main BOF -->' . PHP_EOL;
	  $body_text .= '  <div class="contentText">' . PHP_EOL;
	  $body_text .= constant( 'MODULE_FRONT_PAGE_TEXT_3_' . strtoupper( $language ) ) . PHP_EOL;
	  $body_text .= '  </div>' . PHP_EOL;
	  $body_text .= '<!-- Text Main EOF -->' . PHP_EOL;

	  $oscTemplate->addBlock( $body_text, $this->group );
	}
  }
}

 

I'm not doing something right, but I'm just not sure what it is??? :unsure:

 

Regards,

 

Chris

 

EDIT: I added these two lines to the code to output the query and result:

 

    print 'Specials Query: ' . $specials_products_query_raw . '<br />';
    print 'Number of Specials: ' . tep_db_num_rows($specials_products_query) . '<br />';

 

This is what's printing out (there's one special, btw):

 

Specials Query: select p.products_id from products p join products_description pd on pd.products_id = p.products_id join specials s on s.products_id = p.products_id where p.products_status = '1' and pd.language_id = '0' and s.status = '1' limit 1

Number of Specials: 0

 

Is that helpful?

Edited by Chrison

Share this post


Link to post
Share on other sites

This line needs to come right after the function execute() line, not where is is now:

 

[url="http://global%20$oscTemplate,%20$language,%20$PHP_SELF,%20$cPath;"]    global $oscTemplate, $language, $PHP_SELF, $cPath, [/url]$languages_id[url="http://global%20$oscTemplate,%20$language,%20$PHP_SELF,%20$cPath;"];[/url]

 

Note that I added $languages_id to the list -- forgot that the first time.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Ta Da! That fixed it! I had to clean-up that line a bit to get it working (had some "" and other garbage in it), but once I got it declaring the global variables the query worked and my "blurb" text area now only displays when there's specials. Here's the final code for anyone that needs it:

 

   function execute() {

  global $oscTemplate, $language, $PHP_SELF, $cPath, $languages_id;

  if ($PHP_SELF == 'index.php' && $cPath == '') {

    $specials_products_query_raw = "
				    select
						  p.products_id
				    from
						  " . TABLE_PRODUCTS . " p
						  join " . TABLE_PRODUCTS_DESCRIPTION . " pd
						    on pd.products_id = p.products_id
						  join " . TABLE_SPECIALS . " s
						    on s.products_id = p.products_id
				    where
						  p.products_status = '1'
						  and pd.language_id = '" . ( int ) $languages_id . "'
						  and s.status = '1'
				    limit 1
					  ";
    // print 'Specials Query: ' . $specials_products_query_raw . '<br />';
    $specials_products_query = tep_db_query( $specials_products_query_raw );

    print 'Specials Query: ' . $specials_products_query_raw . '<br />';
    print 'Number of Specials: ' . tep_db_num_rows($specials_products_query) . '<br />';

    if (tep_db_num_rows($specials_products_query) > 0) {

	  // Set the text to display on the front page
	  $body_text = '<!-- Text Main BOF -->' . PHP_EOL;
	  $body_text .= '  <div class="contentText">' . PHP_EOL;
	  $body_text .= constant( 'MODULE_FRONT_PAGE_TEXT_3_' . strtoupper( $language ) ) . PHP_EOL;
	  $body_text .= '  </div>' . PHP_EOL;
	  $body_text .= '<!-- Text Main EOF -->' . PHP_EOL;

	  $oscTemplate->addBlock( $body_text, $this->group );
    }
  }
   }

 

WOO HOO! Thanks for the help!

 

Regards,

 

Chris

Edited by Chrison

Share this post


Link to post
Share on other sites

Sorry, it looks like the forum munged that line. Weird.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Sorry, it looks like the forum munged that line. Weird.

 

Regards

Jim

 

No problem! I figured it out.

 

This stuff is SO cool! I'm on cloud 9 about how my front page is coming along! Again, you ROCK dude!

 

Regards,

 

Chris

Share this post


Link to post
Share on other sites

Yes, that's a bug. You can fix it by changing the code similar to the other modules. I'll fix this as soon as I can, but my time is limited right now.

Thank you, I managed to do that by copying from featured.php, it wasn't difficult.

Share this post


Link to post
Share on other sites

Jim, I wonder if it's useful for you to have the file I edited and how to make it reach you.

Edited by figuera

Share this post


Link to post
Share on other sites

I saw that. Looks like a bug in the stock osCommerce banner code. Other people are working on it, so I'll just keep an eye on their progress for now.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi,

 

I've read all this thread and Googled my problem too but to no avail so I'm hoping you'll be able to help me.

 

I've installed the modual and activated the Customer Greeting, Text Main and Heading Title but when I view the front page I have the following appear:

 

PHP_EOL

PHP_EOL

 

MY TEXT MAIN CONTENT

 

PHP_EOLPHP_EOL

PHP_EOL

 

Furthermore whenever I go back into admin to edit my Main Text it won't allow me to. The only way I can update it is by uninstalling the Text Main module and then reinstalling it.

 

Any help would be much appreciated.

 

Thank you.

Edited by VickyB

Share this post


Link to post
Share on other sites

Your Text Main module may be damaged. Try uploading the file again. Also, check that you have not added any unescaped apostrophes in your text.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

This add-on seems great,but I am having a small problem with it.I've installed it on a clean 2.3.1,but now I cannot get the social bookmark module to work at all.Any ideas anyone? Thanks.

Share this post


Link to post
Share on other sites

Social Bookmarks are a set of modules, not just one, and they are a part of stock osCommerce. I suggest you ask for help in the general help forum.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Thanks for replying.I must have been dreaming to think that this module was supposed to appear on the front page.of course it only shows on product info.pages.sorry!

Share this post


Link to post
Share on other sites

Your Text Main module may be damaged. Try uploading the file again. Also, check that you have not added any unescaped apostrophes in your text.

 

Regards

Jim

 

Hi, I tried reinstalling it but to no joy so I rolled back from the latest version to 1.2.6 which I know worked on a site I had working and it works fine.

 

I know it doesn't get to the heart of the problem but at least i have a working version of it now.

 

Thank you for your help! :)

Share this post


Link to post
Share on other sites

Version 1.2.6 has a bug that can cause problems if you have multiple languages installed, otherwise it's the same. I'm still puzzled at this one.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for this contribution.

 

I installed the Front Page contribution and Banner Box and I don´t know if have any incompatibility between these two contributions, but not work very well. I removed all the boxes (OSC 2.3.1) from the right column but the Banner Rotator not aligned to right direction and the banner box overlapped the banner rotator. Any help, please? Thank you.

Share this post


Link to post
Share on other sites

The Banner Rotator is sized to fit the stock osCommerce center page. Removing one of the columns makes the center page wider, so you have to adjust the Banner Rotator to fix that. See section A1 in the User's Manual.

 

The only thing that could make the Banner Box too wide is a banner that's too wide for the box. Make your banner image(s) the correct size. See section 3.2.1 of the User's Manual.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

The Banner Rotator is sized to fit the stock osCommerce center page. Removing one of the columns makes the center page wider, so you have to adjust the Banner Rotator to fix that. See section A1 in the User's Manual.

 

The only thing that could make the Banner Box too wide is a banner that's too wide for the box. Make your banner image(s) the correct size. See section 3.2.1 of the User's Manual.

 

Regards

Jim

 

Thanks for the answer, Jim.

 

I had changed the size of the banner rotator for enhanced and changed the file size in the stylesheet. What I'd like is to increase the width of the left column. The problem is in the banner box, which I increased his size to 240 width and I though that the left column would change automatically, but its overlapping the banner rotator. Should I change any specifications in some css file for banner box?

 

Thanks

Edited by rdbello

Share this post


Link to post
Share on other sites

An extra question, Jim:

 

How can I do to remove de margins inside de box (banner box)? I want the image occupies the entire space of the box.

 

Thanks

Share this post


Link to post
Share on other sites

The column widths are set by the 960 Grid template. See this forum post.

 

The margins are part of the boxes. You might be able to override that with CSS, but I've never tried so I can't tell you how.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×