Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I believe STS is a cool easy way to customize oscommerce. and thank you Bill for it.

However, I did what you said but it didn't work. I deleted all the code in includes\sts_templates\modernrc2a\boxes\infobox_languages.php.html

except $content tag

 

and then i placed $languagebox tag just below the quick find box in the header.

 

 

Can you please tell me what's wrong in this?

Did you confirm that this is the template folder that is being used in the STS Default Module in the admin? (modernrc2a)


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Thanks Bill, sorry for disturbing you. I figured out where was the problem, but I couldn't resolve it. IThe problem is caused by one simple instruction in Better Product Display contribution, Please Bill tell me how to adjust classes/boxes.php

 

Better Product Display addon

catalog / includes / classes / boxes

 

Add before the final ?>

// better display start
class productListingOSCBox extends tableBox {
function productListingOSCBox($contents) {
  $this->table_parameters = 'align="center"';
  $this->table_width = '100%';
  $this->table_cellpadding = '0';
  $this->tableBox($contents, true);
}
 }
// Better display end

 

 

 

I did add this piece of code to classes/boxes.php but it gives me this error.

 

Parse error: parse error, expecting `T_FUNCTION' in C:\xampp\htdocs\catalog\includes\classes\boxes.php on line 293

 

Regards,

Edited by oslover

Share this post


Link to post
Share on other sites

Hi, great contrib,

 

I was wondering is there a way and of so how you show the previous / next item navigation buttons in the product info?

 

Have been looking for the answer for many hours, probably staring me in the face, please help!

 

Thankyou in advance.

Share this post


Link to post
Share on other sites

Hi installed the newsdesk contribution, and need to get it to work with STS.

 

I have tried to add it to the system but getting nowhere and not so fast either.

 

Can anyone give me some pointers on what I need to do to create the infoboxes for the news desk system please.

 

Thanks

 

Johnny


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites
Hi installed the newsdesk contribution, and need to get it to work with STS.

 

I have tried to add it to the system but getting nowhere and not so fast either.

 

Can anyone give me some pointers on what I need to do to create the infoboxes for the news desk system please.

 

Thanks

 

Johnny

 

If all you need is the infobox variable (tag) to add to your template, then you should follow the examples in includes/modules/sts_inc/sts_column_left.php file:

 

Example:

  require(DIR_WS_BOXES . 'search.php');
 $sts->restart_capture ('searchbox', 'box'); // Get search box

The above example creates a tag called $searchbox that brings in the file located at includes/boxes/search.php.

The

,'box'

is optional and you should play around with using it to see if it makes a difference in your design or not.

 

If you are having bigger problems such as how to insert the Flash from that contribution, you should see the following link:

 

http://forums.oscommerce.com/index.php?sho...p;#entry1297184

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi thats great I was trying to do completly the wrong thing.

 

thanks.

 

I have installed msrp, and this has affected the layout of the new products for mont disply, ie, its pushed them all over to the left hand side.

 

When I switch sts off, the new products are correctly displayed.

 

I tried removing the msrp code from the catalog/products_new.php and this seemed to have no affect so i am guessing that the code thats interferring is the In catalog/includes/modules/new_products.php file.

 

although it could be anywahere as there are lots of changes, but those two seemed the most relevant.

 

Any idea what it may be, tried searching the forums but have had no look finding the issue and a fix, doesnt mean its not there just means I cantr find it.

 

Will have a tinker around in the meantime to see if I can identify the code more accuratley.

 

Thanks

 

Johnny


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

trying to work out what has caused the shrinking of the new products section to the left.

 

As I progess I have several shops, the idea being to replicate them and when everything is working stop developing and just have the one perfectly running shop with all the mods I want in it (high hopes....maybe).

 

Shop 2 and and shop4 are identical except for the following modules:-

 

news desk

create manual order

Create account

MSRP

 

Shop4 is the one with the dispaly error.

 

So if anyone has any ideas, let me know, I will start to biuld up shop 2 with these mods and see what happens, however this will be later in the week as I have other things on.

 

Thanks

 

Johnny


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

Its me i am stupid, dont know how I did it but i had to create the box for design purposes and had the content setcion set at width 170 instead of 100%, whats strange is that in shop 2 it is correct and I copied the templates across or at least I though I had.

 

Been driving me crazy that had. Just though I better admit to finding the mistake

 

Thanks

Johnny


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

When I was manually adding the text to add the STS module I got the following error

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/e/i/s/eisik/html/admin/includes/languages/english.php:307) in /home/content/e/i/s/eisik/html/admin/includes/functions/general.php on line 22

 

This was when I was adding the

 

//START STS 4.1

define('BOX_MODULES_STS', 'STS');

//END STS 4.1

 

to the end of the catalog/admin/includes/languages/english.php file

 

Any help would be appreciated

Thanks

Share this post


Link to post
Share on other sites
When I was manually adding the text to add the STS module I got the following error

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/e/i/s/eisik/html/admin/includes/languages/english.php:307) in /home/content/e/i/s/eisik/html/admin/includes/functions/general.php on line 22

 

This was when I was adding the

 

//START STS 4.1

define('BOX_MODULES_STS', 'STS');

//END STS 4.1

 

to the end of the catalog/admin/includes/languages/english.php file

 

Any help would be appreciated

Thanks

This would be a user error on your part. Most likely you have an extra "space" after the last ?>.

 

The problem can be solved by walking through the code logic flow in the files involved, which are mentioned in the warning message, to make sure no headers are being set after content has been sent to the client.

 

A common cause to the problem is spaces ("whitespace") existing before the first <?php tag and/or after the last ?> tag with the files involved. By removing all spaces so that <?php is at the very start of the file and that ?> is at the very end of the file, no content would have been sent to the client and headers can be set safely.

 

Open the file in a text editor -> place your mouse cursor after the very last ?> tag at the very end of the file and press the 'delete' key on your computer keyboard. Make sure that whitespace does not exist before the opening <?php tag at the very beginning of the file - delete whitespace if present. Save and upload the file to your installation.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
This would be a user error on your part. Most likely you have an extra "space" after the last ?>.

 

The problem can be solved by walking through the code logic flow in the files involved, which are mentioned in the warning message, to make sure no headers are being set after content has been sent to the client.

 

A common cause to the problem is spaces ("whitespace") existing before the first <?php tag and/or after the last ?> tag with the files involved. By removing all spaces so that <?php is at the very start of the file and that ?> is at the very end of the file, no content would have been sent to the client and headers can be set safely.

 

Open the file in a text editor -> place your mouse cursor after the very last ?> tag at the very end of the file and press the 'delete' key on your computer keyboard. Make sure that whitespace does not exist before the opening <?php tag at the very beginning of the file - delete whitespace if present. Save and upload the file to your installation.

 

 

Thanks so much

It seems like it is working

Share this post


Link to post
Share on other sites

Hi.

 

I hope you can help. I have been struggling with a HTTP 500 error on a couple of my sites for a while now. I have identified the problem is caused by the column_left.php file - at least, when I leave out the include for this file I do not get the HTTP 500 error.

 

Obviously this is stopping the Search Engines from indexing the site, so I need to get it sorted quickly.

 

My hosting provider insists that there is not a problem with the server set up and that the problem muct be with this file.

 

Has anyone any ideas?

Share this post


Link to post
Share on other sites
Hi.

 

I hope you can help. I have been struggling with a HTTP 500 error on a couple of my sites for a while now. I have identified the problem is caused by the column_left.php file - at least, when I leave out the include for this file I do not get the HTTP 500 error.

 

Obviously this is stopping the Search Engines from indexing the site, so I need to get it sorted quickly.

 

My hosting provider insists that there is not a problem with the server set up and that the problem muct be with this file.

 

Has anyone any ideas?

 

500 Server Error messages relate to the server and can only be solved by them. Have your host view the error log to pin point the problem.

 

You mentioned your column_left.php file but which one did you mean; includes/coulumn_left.php or includes/modules/sts_inc/sts_column_left.php ?


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Bill,

 

Thanks so much for so much help. STS has proven to be our "Killer App" and our new OSC store is not only close to going live, but it looks just about EXACTLY as I want it to thanks to STS.

 

Before I go live, I want to incorporate an SEO URL type mod. Can you recommend one that will work well with STS?

 

Thanks again,

 

Boom

Share this post


Link to post
Share on other sites

Hi,

i have a issue, i use STSv4.5.8, and in the index.php.html and sts_template.html in top i want to use something like $head,

where $head is for language=ro

<?php
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html $htmlparams>
<head>
<!--$headcontent-->
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
.style1 {
text-align: center;
background-color: #EAEAEA;
}
.style3 {
background-color: #EAEAEA;
}
.style4 {
background-color: #242F4A;
}
.style5 {
color: #FFFFFF;
font-size: large;
}
</style>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" >

<table width="100%" border="0" cellpadding="10" cellspacing="0" style="width: 100%">
<tr class="header">
  <td class="style1"><span style="width: 740px">
	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="740" height="200">



		  <param name="movie" value="../img/navigare.swf">



		  <param name="quality" value="high">



		  <embed src="../img/navigare.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="740" height="200"></embed></object>	  </span></td>
</tr>
<tr class="header">
	<td class="style4"><p style="width: 828px; height: 12px;">
	  <!--<![endif]-->
	  </object>		  
	 <span class="style5"> <strong>Produse</strong></span></p>
	</td>
</tr>
<tr class="header">
	<td class="style3">Firma "FENO" din Franta este cel mai important 
	producator european de borne si accesorii topografice pentru marcare, 
	produsele sale fiind omologate si folosite în tari cu traditie 
	topografica si cadastrala.<br>

				Prin parteneriatul dezvoltat împreuna cu THEOTOP, începand 
	din 1998 , produsele "FENO" au patruns si pe piata româneasca, ele fiind 
	omologate de catre Oficiul National de Cadastru, Geodezie si Cartografie 
	si utilizate pe o scara larga în lucrarile topografice si cadastrale.</td>
</tr>
</table>

</body>
</html>

 

and for language=en

 

<?php
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html $htmlparams>
<head>
<!--$headcontent-->
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
.style1 {
text-align: center;
background-color: #EAEAEA;
}
.style3 {
background-color: #EAEAEA;
}
.style4 {
background-color: #242F4A;
}
.style5 {
color: #FFFFFF;
font-size: large;
}
</style>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" >

<table width="100%" border="0" cellpadding="10" cellspacing="0" style="width: 100%">
<tr class="header">
  <td class="style1"><span style="width: 740px">
	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="740" height="200">



		  <param name="movie" value="../img/navigare1.swf">



		  <param name="quality" value="high">



		  <embed src="../img/navigare.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="740" height="200"></embed></object>	  </span></td>
</tr>
<tr class="header">
	<td class="style4"><p style="width: 828px; height: 12px;">
	  <!--<![endif]-->
	  </object>		  
	 <span class="style5"> <strong>Products</strong></span></p>
	</td>
</tr>
<tr class="header">
	<td class="style3">"FENO" company from France is the most important 
	European producer of land marks and topographical accessories for 
	marking, its products being homologated and used in countries with 
	topographical and cadastral tradition.<br>
				   Starting with 1998, FENO developed a partnership 
				with THEOTOP and the FENO products became known on the Romanian
				market, being homologated by the National Office for Cadastre, 
				Geodesy and Chartography and used on a large scale in the 
				topographical and cadastral works.</td>
</tr>
</table>

</body>
</html>

 

where i have to define $head?...the ideea is when i change the language, the head from index.php.html also change how i wish...

Share this post


Link to post
Share on other sites
where i have to define $head?...the ideea is when i change the language, the head from index.php.html also change how i wish...

 

There is already a tag for the language...$langid.

 

You can use this tag to create different flash headers such as:

 

flash_1.swf

flash_2.swf

and so on...

The numbers will correlate with the actual language IDs in your shop.

 

and use the following in your template as the name of the flash file: flash_$langid.swf


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
500 Server Error messages relate to the server and can only be solved by them. Have your host view the error log to pin point the problem.

 

You mentioned your column_left.php file but which one did you mean; includes/coulumn_left.php or includes/modules/sts_inc/sts_column_left.php ?

 

 

Hi Bill. Thanks for getting back to me.

 

The problem actually seems to be in sts_inc/sts_column_left.php

 

At least when I comment out a pile of code in this file the site returns a 200 in the Header.

 

The id comment at the top of this file is:

$Id: sts_column_left.php,v 4.3.3 2006/03/12 22:06:41 rigadin Exp $

 

I've copied the code which I have to remove to solve the header problem - obviously this breaks the site so I can't leave it out! (by the way - not subset of this solves the problem - I have to remove it all).

 

The latest from the hosting company is "> There is some OSC module called STS ? Can you upgrade this on your sites ?

>

> "STS is on version 4.1 but the latest version is 4.5.8. So I'd start

> with upgrading that. "

 

What do you think?

 

 

$sts->restart_capture(); // Clear buffer but do not save it nowhere, no interesting information in buffer.

// Get categories box from db or cache

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_categories_box();

} else {

include(DIR_WS_BOXES . 'categories.php');

}

 

$sts->restart_capture ('categorybox', 'box');

 

// Get manufacturer box from db or cache

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_manufacturers_box();

} else {

include(DIR_WS_BOXES . 'manufacturers.php');

}

$sts->restart_capture ('manufacturerbox', 'box');

 

require(DIR_WS_BOXES . 'whats_new.php');

$sts->restart_capture ('whatsnewbox', 'box'); // Get What's new box

 

require(DIR_WS_BOXES . 'search.php');

$sts->restart_capture ('searchbox', 'box'); // Get search box

 

require(DIR_WS_BOXES . 'information.php');

$sts->restart_capture ('informationbox', 'box'); // Get information box

 

require(DIR_WS_BOXES . 'shopping_cart.php');

$sts->restart_capture ('cartbox', 'box'); // Get shopping cart box

 

if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

$sts->restart_capture ('maninfobox', 'box'); // Get manufacturer info box (empty if no product selected)

 

if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

$sts->restart_capture ('orderhistorybox', 'box'); // Get customer's order history box (empty if visitor not logged)

 

include(DIR_WS_BOXES . 'best_sellers.php');

$sts->restart_capture ('bestsellersbox_only', 'box'); // Get bestseller box only, new since v4.0.5

 

 

// Get bestseller or product notification box. If you use this, do not use these boxes separately!

if (isset($HTTP_GET_VARS['products_id'])) {

include(DIR_WS_BOXES . 'product_notifications.php');

$sts->restart_capture ('notificationbox', 'box'); // Get product notification box

 

// Get bestseller or product notification box. If you use this, do not use these boxes separately!

if (tep_session_is_registered('customer_id')) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] > 0) {

$sts->template['bestsellersbox']=$sts->template['bestsellersbox_only']; // Show bestseller box if customer asked for general notifications

} else {

$sts->template['bestsellersbox']=$sts->template['notificationbox']; // Otherwise select notification box

}

} else {

$sts->template['bestsellersbox']=$sts->template['notificationbox']; //

}

} else {

$sts->template['bestsellersbox']=$sts->template['bestsellersbox_only'];

$sts->template['notificationbox']='';

}

 

include(DIR_WS_BOXES . 'specials.php');

$sts->restart_capture ('specialbox', 'box'); // Get special box

$sts->template['specialfriendbox']=$sts->template['specialbox']; // Shows specials or tell a friend

Share this post


Link to post
Share on other sites

Hi Bill,

thx,

its works, with swf was easy, but I have to convert a html in jpg, thats was hard(so i make a jpg with Photoscape), and now its greath, thx again;

Share this post


Link to post
Share on other sites

 

 

Nothing wrong with STSv4.5.8. Which version are you using?

 

Also, what other contributions do you have installed? It appears this is either a server issue (most likely) or that you have modified some code within your shop that is conflicting with the sts_column_left.php file.

 

Hundreds if not thousands have installed STS on all kinds of server setups with no issues. A handful have experienced issues such as yours and it ended up being some cheap host not willing to setup the server to work properly.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi again Bill,

 

I don't doubt that lots of people use the module without problem - I wasn't hoping to be the one to find a flaw. I just have a problem with 2 of my shops and desperately need to fix it!

 

The hosting company tell me the problem isn't theirs so I'm searching for something that I can fix.

 

I'm using STS_VERSION 4.5.5 and osCommerce Online Merchant v2.2 RC2

 

I just noticed when I ran debug to get that info for you that there is a line in the debug info:

$sts->template['error_message']

 

Is that of any relevance?

Share this post


Link to post
Share on other sites

Hi all,

 

any advice on upgrading from STS 4.5.5 to STS 4.5.8?

 

Much involved?

Share this post


Link to post
Share on other sites

Hi,

 

- i want to add a box in column left like $languages or $currencies, but with my own data; how i do theat(make a php file, where i define this, to be a $aaa)?

Share this post


Link to post
Share on other sites
Hi all,

 

any advice on upgrading from STS 4.5.5 to STS 4.5.8?

 

Much involved?

 

There is no database upgrades so it would be just a simple matter of using a file comparison tool such as Beyond Compare or WinMerge to compare your shops files with those from the STSv4.5.8 contribution. This would be very easy and not time consuming at all as all of the STS code is commented within the scripts.

 

Note: STSv4.5.8 fixed a lot of bugs that existed since STSv4.4.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi Bill,

 

OK, I've doen the compare and I have come across a large difference in includes/functions/html_output.php

 

I am using // Ultimate SEO URLs v2.1 which introduces code to replace function tep_href_link

Lines such as:

global $request_type, $session_started, $SID;

 

Are not in the version I am using.

 

Think this might be causing my http 500 error?

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

×