Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

How can I tell what version of osC I am running. I inherited the site from a previous user and it appears not to be running the latest version.

 

How can I updrade to the latest version without losing all the catalouge information (I dont care about losing design... just content).

 

or easier (perhaps)...

 

How can I install STS to work on a earlier version (I get the error that filenames.php is missing)?

 

THANK YOU! :)

Share this post


Link to post
Share on other sites

I'm sure this has been asked a zillion times but I can only print this topic upto last Nov.6.

 

COOLMENU WORKING? I can get the DHTML Menu contrib working fine but I can't figure out how to center it in a 750px centered shop.

 

I've done this in sts_user_code:

 

   $sts_block_name = 'coolmenu';
  require(STS_START_CAPTURE);
  require(DIR_WS_BOXES . 'coolmenu.php');
  require(STS_STOP_CAPTURE);
  $template['coolmenu'] = strip_unwanted_tags($sts_block['coolmenu'], 'coolmenu');

 

Then placed the javascript in the template head tag

<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>

 

I can get coolmenu box to show but it is without categories. Just blank.

 

Please, please someone help me with this. I've made other shops with this great STS contrib but this has me stumped.

Share this post


Link to post
Share on other sites

Hey everyone, thanks for the help so far. I screwed something up when I was trying to go from 1.8 to 2.01. Now I'm getting this error:

 

Warning: main(STS_PRODUCT_INFO): failed to open stream: No such file or directory in /home/vintag5/public_html/catalog/includes/sts_display_output.php on line 132

 

Warning: main(STS_PRODUCT_INFO): failed to open stream: No such file or directory in /home/vintag5/public_html/catalog/includes/sts_display_output.php on line 132

 

Fatal error: main(): Failed opening required 'STS_PRODUCT_INFO' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vintag5/public_html/catalog/includes/sts_display_output.php on line 132

 

Here's what my code reads for line 132 of sts_display_output.php:

 

/////////////////////////////////////////////
////// if product_info.php load data
/////////////////////////////////////////////
if ($scriptbasename == 'product_info.php') {
 require(STS_PRODUCT_INFO);
}

 

What went wrong?

 

Also, has anyone got this to work with the PAYPAL IPN v.971 contrib? Thanks!

Share this post


Link to post
Share on other sites
Hey everyone, thanks for the help so far.  I screwed something up when I was trying to go from 1.8 to 2.01.  Now I'm getting this error:

 

Warning: main(STS_PRODUCT_INFO): failed to open stream: No such file or directory in /home/vintag5/public_html/catalog/includes/sts_display_output.php on line 132

 

Warning: main(STS_PRODUCT_INFO): failed to open stream: No such file or directory in /home/vintag5/public_html/catalog/includes/sts_display_output.php on line 132

 

Fatal error: main(): Failed opening required 'STS_PRODUCT_INFO' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vintag5/public_html/catalog/includes/sts_display_output.php on line 132

 

Here's what my code reads for line 132 of sts_display_output.php:

 

/////////////////////////////////////////////
////// if product_info.php load data
/////////////////////////////////////////////
if ($scriptbasename == 'product_info.php') {
 require(STS_PRODUCT_INFO);
}

 

What went wrong?

 

Also, has anyone got this to work with the PAYPAL IPN v.971 contrib? Thanks!

Add the STS_PRODUCT_INFO define to configure.php from configure-SAMPLE.php

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites

Hi everyone :D

 

I?m using STS 2.01 and get a strange html tag at my index.php page, at the bottom left of the page it says "</". I?m using milestone 2.2, windows xp, last stable version of apache, php and mysql. When i was using STS version 1.8 the same tag appered at my frontpage. :unsure:

 

If I comment out this line in application_top.php the "tag error" disappers:

require(STS_START_CAPTURE); ;)

 

Is it safe for me to have the require(STS_START_CAPTURE); deleted from the file application_top.php? I haven?t been geting any errors after the this "hack". But of cource I?d prefer to get a better solution for my problem.

 

Any ideas??? I would be very happy for some help here :rolleyes:

 

Here is a image of the tag displayed at the index page:

tag.gif

 

IMAGE

Share this post


Link to post
Share on other sites

Never mind the above tread!!!

 

Found the answer to my question

 

 

At the bottom of each page, I see the characters "</".

 

Answer: You need to upgrade your server's version of PHP. This was a subtle bug in older versions. Updating your PHP will fix it. You should upgrade it anyway, since if you are running a version with this problem, there are also security fixes that have been added to later versions of PHP that you need to secure your system.

Edited by Johnson

Share this post


Link to post
Share on other sites

How can I display a different product_info.php.html template for individual categories ?

 

placing a file named "product_info_26.php.html" (where cPath==26) does not work. <_<

 

The site is TradersCart.com should display the same template for the Baby Gift category products as is does for the category page.

 

What do I need to change? Thanks!

- Ari

Share this post


Link to post
Share on other sites
How can I display a different product_info.php.html template for individual categories ?

 

placing a file named "product_info_26.php.html" (where cPath==26) does not work.  <_<

 

The site is TradersCart.com should display the same template for the Baby Gift category products as is does for the category page.

 

What do I need to change? Thanks!

- Ari

You can't (yet).

 

I've also had a request for per-product product_info templates.

 

What sayeth the crowd? What would be better for you?

 

- Brian

Edited by DiamondSea

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites

Is there a way to print the Cpath # - this would greatly help as I could then name images as "imagename_cpath.gif"

 

If we wanted to have our own custom variable to insert (like $content, for example, but with another function)... what steps would we take to program that in?

 

Thanks a ton! Your work helps a lot.

- Ari

Edited by teman

Share this post


Link to post
Share on other sites

Sorry, I know I've posted this thread before but i really need som help

 

I tried to use an index.php_0.html without the $content tag because I want to add my own content (flash) on the main catalog page. The problem is that the manufacturer box doesnt work any longer since there is no $content. I thought the index.php_0.html should ONLY affect my main catalog page.. Can I somehow use a different template for the manufacturers? I also tried to upload an index.php.html (note that its a different file) WITH the $content tag but it still doesnt work.

 

Please help me, the shop is supposed to be up and live in the weekend. Thanks!

Share this post


Link to post
Share on other sites

Hello all,

 

regarding the Ultrapics problem, thanks for the pointers Brian but I was trying to fiddle around on my own and worked around it by actually coding javascript pop-up function in the template file itself.

 

I created extra image hrefs variables in the page where the product_info variables are defined, then used those variables in my javascript code on my product_info template page. It works for me!

 

New question, how do I link up all the product_info pages within a category together? For example, when I'm in Product 1 product_info page, how can I create a button that says "Next" that links you straight to Product 2 product_info page?

 

Thanks!!

Share this post


Link to post
Share on other sites

Store Slow To Load.

 

My store shop.sounds-alarming.co.uk has become very slow to load. Could this be something to do with STS? I would be greatfull for any advice on speeding up the download time. I am aware that some of the images need some optimising but when I click on a link to the store it takes 4 seconds for the page to start downloading, which dosent sound much but when your waiting it seems forever.

Share this post


Link to post
Share on other sites

Hi some one please help me with this, okay

I want to put a cart summary at the top of my page

and I have the code for it

 

<!-- Cart Contents -->

<table width="294" border="0" cellspacing="0" cellpadding="0">

<tr>

  <td width="28" class="smallText"><b><img src="images/cart.gif" width="22" height="14" align="absmiddle"></b></td>

  <td width="110" class="smallText"><b>Cart Summary:</b></td>

  <td width="66" align="right" class="smallText"> </td>

  <td width="90" class="smallText">

    <?php if ($cart->count_contents() > '0') { ?>

    <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><img src="images/content.gif" border="0" align="absmiddle"></a> <b><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>">Edit</a></b>

    <?php } ?>

  </td>

</tr>

<tr>

  <td width="28" class="smallText"> </td>

  <td width="110" class="smallText">Item(s) in Cart:</td>

  <td width="156" colspan="2" class="smallText"><?php echo $cart->count_contents(); ?></td>

</tr>

<tr>

  <td width="28" class="smallText"> </td>

  <td width="110" class="smallText">Current Total:</td>

  <td width="156" colspan="2" class="smallText"><?php echo $currencies->format($cart->show_total()); ?></td>

</tr>

<tr>

  <td width="28" class="smallText"> </td>

  <td width="110" class="smallText">Shipping Weight:</td>

  <td width="156" colspan="2" class="smallText"><?php echo $cart->show_weight(); ?>lbs

    (est.) </td>

</tr>

</table>

 

this code is saved as /include/cart_summmary.php

now I can call this by

<?php require(DIR_WS_INCLUDES . 'cart_summary.php'); ?>

 

but how do I do that in STS?

Please help

Share this post


Link to post
Share on other sites
Nice store.

You need the osCommerce link at the footer.

 

Turn off STS and test.

Test loading the template alone.

Thanks for the reply

 

It's still the same with the template off so I guess theres something else a miss.

 

Do you agree with me that its to slow or am i just to critical?

 

PS. osc link added. thanks for pointing that out

Edited by SoundsAlarming

Share this post


Link to post
Share on other sites
Nice store.

You need the osCommerce link at the footer.

 

Turn off STS and test.

Test loading the template alone.

 

 

STS should not affect the speed of your pages. One person who tested it early on said it actually worked faster with STS. Not sure why that would be, but that's what they said. :)

 

Also, You do not need to have the osCommerce link at the bottom of your page if you have modified it from the default OSC look and feel, which you have. This is documented on the OSC site (somewhere), I think in one of the FAQ's.

 

You must leave the copyright notices in the code and in the Admin area, but you don't need to display it in your actual shop.

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
Also, You do not need to have the osCommerce link at the bottom of your page if you have modified it from the default OSC look and feel, which you have.  This is documented on the OSC site (somewhere), I think in one of the FAQ's.

 

Brian,

Thank you for clarifing that. STS rocks !!!

 

 

SoundsAlarming,

Store loaded fast for me.

I checked it two different sessions and they were both fast (opera browser, no cache)


ibandyop

Share this post


Link to post
Share on other sites
is it also possible that sometimes the characters "</" is displayed and sometimes not? because that happens with me...

 

Guessing... Difficult to give an answer when the problem is described only in one line.

 

Here are some possibilities.

 

If you have an older version of STS then you would see it on the index.php

but not elsewhere. STS version 2.0+ allows you to template your categories and products

 

Or are you describing something more intermittent on the same page ?

Remember your web browser may be caching pages so you do not actually

generate a new page everytime unless you have setup your html page to

empty the cache. If it's the same page, upgrade your PHP version.


ibandyop

Share this post


Link to post
Share on other sites

is it also possible that sometimes the characters "</" is displayed and sometimes not? because that happens with me...

 

Guessing... Difficult to give an answer when the problem is described only in one line.

 

Here are some possibilities.

 

If you have an older version of STS then you would see it on the index.php

but not elsewhere. STS version 2.0+ allows you to template your categories and products

 

Or are you describing something more intermittent on the same page ?

Remember your web browser may be caching pages so you do not actually

generate a new page everytime unless you have setup your html page to

empty the cache. If it's the same page, upgrade your PHP version.

hello Ibandyop,

"If you have an older version of STS then you would see it on the index.php"

i use sts 1.9

 

 

its noware when I use:

<!--

@import url("../stylesheet.css");

-->

 

when using this and better for kb to download so preffered:

<link href="https://secure.optimizekit.com/stylesheet.css" rel="stylesheet" type="text/css">

 

the "</" is on every page.

 

"Or are you describing something more intermittent on the same page?" I thougt it was but this was due to the css thing described above..

 

If it's the same page, upgrade your PHP version.

I heard this before and we use 4.2.2 so this is sure a possible source.

 

ANOTHER PROBLEM:

about background image not displaying.

This is in the template

<body background="https://secure.optimizekit.com/images/background.gif" HTMLArea.replaceAll()">

and the same shows up in the output pages.

but the background image is not displayed. Anyone has the same problem. is this duea to sts or maybe css or totally no interconnection? Sts parses it good to the result page so this could not be the problem IMHO.


Keesjan

Share this post


Link to post
Share on other sites

Hello,

 

My biggest problem right now is how to use my own templates (in index and conditions) without $content and still get the manufacturer links to work. Im planning to use static links for categories and manufacturers.

Share this post


Link to post
Share on other sites

Brian, just wanted to give my 2-cents about product_info.php pages for each categroy: Please, please, please do it!!! :). I ran into this problem right after you came out with the newest STS. My categories are great but their product info pages don't match each category's look and feel. I'm going to try and figure out a work-around for now.

 

In addition, allowing the ability to create product_info pages for each product would even be more powerful. Thanks so much for all of your great work!

Share this post


Link to post
Share on other sites

Hi

I am trying to some banners on my front page to link to the product categories and I am having probs with the link URL's... using the following method to link one banner works and the other does not..

 

The working link

<A href="$cat_Diy"><IMG height=150

src="http://www.beeonline.net/store/images/banners-frontpage/banner-diy.jpg"

width=227 border=0></A> this works and goes to http://beeonline.net/store/index.php?cPath=46

 

The non-working link

 

<A href="$cat_Auto_Care"><IMG height=150

src="http://www.beeonline.net/store/images/banners-frontpage/banner-auto-care.jpg"

width=227 border=0></A> this does not work and goes to http://beeonline.net/store/index.php?cPath=90Auto_Care

 

I have also used the following $urlcat and this doesn't work either...

 

Can anyone help with this one its driving me nuts...

 

I have tried this method also <A href="http://www.beeonline.net/store/index.php?cpath=46"> I can get this to work if I activate search engine safe url wich is supposed to be in development

 

Cheers Malc :blink:

Share this post


Link to post
Share on other sites
Hi some one please help me with this, okay

I want to put a cart summary at the top of my page

and I have the code for it

 

<!-- Cart Contents -->

<table width="294" border="0" cellspacing="0" cellpadding="0">

<tr>

?  <td width="28" class="smallText"><b><img src="images/cart.gif" width="22" height="14" align="absmiddle"></b></td>

?  <td width="110" class="smallText"><b>Cart Summary:</b></td>

?  <td width="66" align="right" class="smallText"> </td>

?  <td width="90" class="smallText">

? ?  <?php if ($cart->count_contents() > '0') { ?>

? ?  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><img src="images/content.gif" border="0" align="absmiddle"></a> <b><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>">Edit</a></b>

? ?  <?php } ?>

?  </td>

</tr>

<tr>

?  <td width="28" class="smallText"> </td>

?  <td width="110" class="smallText">Item(s) in Cart:</td>

?  <td width="156" colspan="2" class="smallText"><?php echo $cart->count_contents(); ?></td>

</tr>

<tr>

?  <td width="28" class="smallText"> </td>

?  <td width="110" class="smallText">Current Total:</td>

?  <td width="156" colspan="2" class="smallText"><?php echo $currencies->format($cart->show_total()); ?></td>

</tr>

<tr>

?  <td width="28" class="smallText"> </td>

?  <td width="110" class="smallText">Shipping Weight:</td>

?  <td width="156" colspan="2" class="smallText"><?php echo $cart->show_weight(); ?>lbs

? ?  (est.) </td>

</tr>

</table>

 

this code is saved as /include/cart_summmary.php

now I can call this by

<?php require(DIR_WS_INCLUDES . 'cart_summary.php'); ?>

 

but how do I do that in STS?

Please help

I am still waiting for the help, some one please

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

×