Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Hiya,

 

This is probably dead simple, but ill ask as i havent got a clue. I want to add in a new side info box which will show my Skype status. Now of course the STS wont have a code for the template to call this box - so what file(s) do i need to change to make this work?

 

If i can do this of course.

 

Thanks for your help.

 

Mark

Share this post


Link to post
Share on other sites
Hiya,

 

This is probably dead simple, but ill ask as i havent got a clue. I want to add in a new side info box which will show my Skype status. Now of course the STS wont have a code for the template to call this box - so what file(s) do i need to change to make this work?

 

If i can do this of course.

 

Thanks for your help.

 

Mark

 

find the following in sts_user_code.php, add new boxes there

 

// PUT USER MODIFIED CODE IN HERE, SUCH AS NEW BOXES, ETC.

 

// The following code is a sample of how to add new boxes easily.

// Just uncomment block below and tweak for your needs!

// Use as many blocks as you need and just change the block names.

 

// $sts_block_name = 'newthingbox';

// require(STS_START_CAPTURE);

// require(DIR_WS_BOXES . 'new_thing_box.php');

// require(STS_STOP_CAPTURE);

// $template['newthingbox'] = strip_unwanted_tags($sts_block['newthingbox'], 'newthingbox');

 

good luck

Share this post


Link to post
Share on other sites

Really nice contrib !

 

I don't know if someone pointed it but you should change this in sts_user_code.php :

------------

if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => "Catalog");

-----------

to ->>

-----------

if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => HEADER_TITLE_CATALOG);

-------------

 

otherwise it will always print "Catalog" in the drop-down box ($catmenu) without taking care of the language

 

--

GdCondor

Share this post


Link to post
Share on other sites

Im trying to get the Categories Tabs mod working with STS and i just cant for the life of me get it to load

 

It works fine in debug and sts off mode but the whole page is blank when loading it under sts

 

Ive foolowed the distructions for category tabs

 

as is says:

For those using STS:

- $categories_tabs: display the categories tabs.

- $categories_subtabs: display the sub-categories.

 

Code to put in sts_user_code.php:

 

//BEGIN Categories Tabs

$sts_block_name='categories_tabs';

require (STS_RESTART_CAPTURE);

include_once(DIR_WS_INCLUDES . 'categories_tab.php');

require(STS_STOP_CAPTURE);

$template['categories_tabs'] = strip_unwanted_tags($sts_block['categories_tabs'], 'categories_tabs');

//END Categories Tabs

 

//BEGIN Sub-Categories Tabs

$sts_block_name='categories_subtabs';

require (STS_RESTART_CAPTURE);

include_once(DIR_WS_INCLUDES . 'categories_subtab.php');

require(STS_STOP_CAPTURE);

$template['categories_subtabs'] = strip_unwanted_tags($sts_block['categories_subtabs'], 'categories_tabs');

//END Sub-Categories Tabs

 

anyone have any ideas?

Share this post


Link to post
Share on other sites

I installed the sts contribution onto a fresh install of osc and got the following error:

 

#################################################################

Notice: Undefined index: no_sts in C:\Inetpub\wwwroot\oscommerce\catalog\includes\application_top.php on line 18

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Inetpub\wwwroot\oscommerce\catalog\includes\application_top.php:18) in C:\Inetpub\wwwroot\oscommerce\catalog\includes\functions\sessions.php on line 97

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\wwwroot\oscommerce\catalog\includes\application_top.php:18) in C:\Inetpub\wwwroot\oscommerce\catalog\includes\functions\sessions.php on line 97

#################################################################

 

I fixed this error using some advice form a post on this forum as below (was it correct?):

 

I changed line 18 in application_top.php from:

CODEif ($HTTP_GET_VARS["no_sts"] > 0) {

to:

CODEif (isset($HTTP_GET_VARS["no_sts"])) {

 

Now the shop seems to work ok, however when i edit my sts_template.html file in catalog/includes folder nothing happens. None of the changes i have made show up on the site.

 

Any ideas?

Share this post


Link to post
Share on other sites

I used to have that error when I set to use session on file in cconfigure.php. Try setting it to store session on mysql.

When you changed that lone of code, you disactivated sts.

Share this post


Link to post
Share on other sites
Im trying to get the Categories Tabs mod working with STS and i just cant for the life of me get it to load

 

It works fine in debug and sts off mode but the whole page is blank when loading it under sts

 

Ive foolowed the distructions for category tabs

 

as is says:

anyone have any ideas?

 

i have them working together just fine. Did you put the $tabs into the sts_template.html? Also, when the category has a sort number blank or 0, it doesn't show up on the top. I'm using it on my site www.vonita.com

however, it has some problems with firefox and macosx. I'm creating a new design for the site and will move to the cat_tab mod. i suggest you to take a look at that as well.

Share this post


Link to post
Share on other sites

How can i run this contribution with the Meta Tags Generator

contrib ?

contrib:

http://www.oscommerce.com/community/contri...all/search,Meta

forum:

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

 

I guess it is just few lines Meta Tags Generator

wants to change this lines:

 

<title><?php echo TITLE; ?></title>

 

to:

 

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

<title><?php echo META_TAG_TITLE; ?></title>

<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>">

<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>">

 

 

so i guess i just have to change the else section in the sts_display_output.php:

 

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

require(DIR_WS_FUNCTIONS . 'header_tags.php');

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

echo "<title>" . TITLE . "</title>";

}

 

 

i tried it but i am not expierieced enough with php.

 

Could someone help me.

 

Greatings from Germany

 

Michael

Share this post


Link to post
Share on other sites

I have read through this whole support file and can't seem to find the answer to my problem. I have STS set up and everything right where I want it. I'm also using Linda's header tags, Easy populate, AP, On the fly, and PWA. I wanted to change the look of the product info pages and for some reason, it is not showing up. I have changed it just like I did with the sts_template.html file and that is working just fine. Its the product_info.php.html file that is not working. Do I have to change the name of it or something for it to pull the info from that page?

Share this post


Link to post
Share on other sites
I have a little problem.

STS works fine, however. On the productinfo page, i get an javascript error and when i try to click the "Enlarge Picture" nothing happens.

 

What can be wrong?

 

Thanks for any help :thumbsup:

 

I have the same problem. But can't find a resolution on the forum anywhere. Anyone got any ideas?

 

Great contrib by the way.

Share this post


Link to post
Share on other sites

I?m using the sts_template system and made some links on my page some using images and others as text.But i found a problem that i dont know what to do.For example, the "home" link.I dont want to use those $breadcumbs i only want a link "home".If a user makes login, ALL the other links (infoboxes) changes to something like this: link.php?osCsid=e85739eeb741b7225ed053fb54740742.I know that those numbers are some sort of identification of the user.

 

Then i creat the link "home" in the sts_template, and put it like this: "<a href="index.php">Home</a>".If a logged user click on this link, he will logoff, because it doesnt generate those letters and numbers of identification.

 

I wanted to know what should i do to generate that code.Thanks

 

PS: Forgive my english :blush:

Share this post


Link to post
Share on other sites
I have the same problem. But can't find a resolution on the forum anywhere. Anyone got any ideas?

Great contrib by the way.

woosah & rk31,

this question has been answered many times on this extremely long thread. I know it can be a challenge to find answers quickly but they are there. In fact if you look at page 144, just one page before this page, you will see a few things u need to check to get this working, namely:

  1. Are you are missing the $headcontent variable inside the <head> tags , add the following line to sts_template.html and any other sts template files you have created just inside the <head> tags and before <script LANGUAGE="JavaScript" ....etc..
    <!--$headcontent-->
  2. Do you have popWindow function located in sts_osc_javascript.js , also make sure sts_osc_javascript.js does not have unnecessary lines:
    line 1: <script language="javascript"><!--
      line 94: //--></script>


  3. If you have the js, then check to see it is opening the correct $productsid, make sure your product_info.php.html reflects correct path to your product. change:
    <a href="java script:popupWindow('http://sts.diamondsea.com/sts3/popup_image.php?pID=$productsid')">

    to:

    <a href="java script:popupWindow('http://www.yourdomain.com/catalog/popup_image.php?pID=$productsid')">


let me know how it works after making these changes.

Share this post


Link to post
Share on other sites

Guys im using STS 3 on a site im doing up and ive got the Newsdesk installed and working fine under it but everytime i try and activate the Faqdesk module i get a premature end of script error caused by the faqdesk infobox

 

If i turn STS off and debug it displays correctly but as soon as i turn it on its stuffed.

 

has anyone mananged to get it working under STS and if so what did you need to do to get it to work?

Share this post


Link to post
Share on other sites
woosah & rk31,

this question has been answered many times on this extremely long thread. I know it can be a challenge to find answers quickly but they are there. In fact if you look at page 144, just one page before this page, you will see a few things u need to check to get this working, namely:

  1. Are you are missing the $headcontent variable inside the <head> tags , add the following line to sts_template.html and any other sts template files you have created just inside the <head> tags and before <script LANGUAGE="JavaScript" ....etc..
     
     
  2. Do you have popWindow function located in sts_osc_javascript.js , also make sure sts_osc_javascript.js does not have unnecessary lines:
    line 1: <script language="javascript"><!--
      line 94: //--></script>


     

  3. If you have the js, then check to see it is opening the correct $productsid, make sure your product_info.php.html reflects correct path to your product. change:
    <a href="java script:popupWindow('http://sts.diamondsea.com/sts3/popup_image.php?pID=$productsid')">

    to:

    <a href="java script:popupWindow('http://www.yourdomain.com/catalog/popup_image.php?pID=$productsid')">


let me know how it works after making these changes.

 

You are a god!!!!! Thank you so much deano. Works a treat.

Share this post


Link to post
Share on other sites

I have installed STS and now I have a real problem. Both My Account and Checkout now display page not found errors. Any ideas?


Ah, the world wide web. What a wonderful place.

Share this post


Link to post
Share on other sites

I am also trying this now that I can't get Header tags controller to work.

 

How can i run this contribution with the Meta Tags Generator

contrib ?

contrib:

http://www.oscommerce.com/community/contri...all/search,Meta

forum:

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

 

I guess it is just few lines Meta Tags Generator

wants to change this lines:

 

<title><?php echo TITLE; ?></title>

 

to:

 

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

<title><?php echo META_TAG_TITLE; ?></title>

<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>">

<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>">

so i guess i just have to change the else section in the sts_display_output.php:

 

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

require(DIR_WS_FUNCTIONS . 'header_tags.php');

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

echo "<title>" . TITLE . "</title>";

}

i tried it but i am not expierieced enough with php.

 

Could someone help me.

 

Greatings from Germany

 

Michael

Share this post


Link to post
Share on other sites
I am also trying this now that I can't get Header tags controller to work.

To der.brain & swtnhpy ,

 

STS and Header Tag Controller coexist together fine. Not sure why you choose MTC over HTC, but HTC is far more popular than MTC and is currently ranked 4th amongst top downloads. It will take you a good two hours minimum to install it, but follow the install instructions verbatim and it works. here is HTC. Be sure to uninstall MTC first. Good luck.

Share this post


Link to post
Share on other sites
I?m using the sts_template system and made some links on my page some using images and others as text.But i found a problem that i dont know what to do.For example, the "home" link.I dont want to use those $breadcumbs i only want a link "home".If a user makes login, ALL the other links (infoboxes) changes to something like this: link.php?osCsid=e85739eeb741b7225ed053fb54740742.I know that those numbers are some sort of identification of the user.

 

Then i creat the link "home" in the sts_template, and put it like this: "<a href="index.php">Home</a>".If a logged user click on this link, he will logoff, because it doesnt generate those letters and numbers of identification.

 

I wanted to know what should i do to generate that code.Thanks

 

PS: Forgive my english :blush:

 

Two choices

- Create the link using osC functions, put it in an STS variable and place the corresponding placeholder on your template, this is the only way to get the osCsid to follow your customer from page to page.

- Force the use of cookies (parameter in admin). The osCsid is not needed anymore. This is also more friendly for search engines and more secure. I'm not doing any store without forcing the use of cookies. If customers are not ready to accept cookies, for sure they are not ready to buy from internet!

 

- Rigadin


STS PLUS, a variation of STS, is now available.

ACA 2.0 is also out!

Share this post


Link to post
Share on other sites

Snowman and everyonelse,

it would appear that some of us wish to determine readily compatible contributions to STS so I thought I list popular and compatible ones I am aware of and ask you to please add to it.

 

Base Install osC 2.2 MS 2 update 051113

STS v3.0 beta 2 31 Jul 2005

Header Tags Controller v2.5.6 Complete 30 Jan 2006

All Products 2.8 11 Jul 2005 & 8 Aug 2005

All Products v3.0 MS 2.2 with Images 26 Dec 2005

Featured Products 25 Jan 2006

Article Manager v1.0 8 Aug 2005

Contrib Installer 14 Feb 2006

 

To be Continued

Share this post


Link to post
Share on other sites
i have them working together just fine. Did you put the $tabs into the sts_template.html? Also, when the category has a sort number blank or 0, it doesn't show up on the top. I'm using it on my site www.vonita.com

however, it has some problems with firefox and macosx. I'm creating a new design for the site and will move to the cat_tab mod. i suggest you to take a look at that as well.

 

$tabs is indeed setup in the sts_template and i have the releavant box setup in the output file

 

works fine without sts on, turn sts on and no joy

Share this post


Link to post
Share on other sites
Snowman and everyonelse,

it would appear that some of us wish to determine readily compatible contributions to STS so I thought I list popular and compatible ones I am aware of and ask you to please add to it.

 

Base Install osC 2.2 MS 2 update 051113

STS v3.0 beta 2 31 Jul 2005

Header Tags Controller v2.5.6 Complete 30 Jan 2006

All Products 2.8 11 Jul 2005 & 8 Aug 2005

All Products v3.0 MS 2.2 with Images 26 Dec 2005

Featured Products 25 Jan 2006

Article Manager v1.0 8 Aug 2005

Contrib Installer 14 Feb 2006

 

To be Continued

 

More Pics 6 will work fine in it

Newsdesk and Faq Desk work under it (but not together due to internal coding issues)

osCAffiliate works just fine :)

Share this post


Link to post
Share on other sites
Two choices

- Create the link using osC functions, put it in an STS variable and place the corresponding placeholder on your template, this is the only way to get the osCsid to follow your customer from page to page.

- Force the use of cookies (parameter in admin). The osCsid is not needed anymore. This is also more friendly for search engines and more secure. I'm not doing any store without forcing the use of cookies. If customers are not ready to accept cookies, for sure they are not ready to buy from internet!

 

- Rigadin

 

Thanks for the hint Rigadin, but this problem still bother me.I?m running my shop on Apache2Triad 1.3, just to test all the stuff.Since I don't know how to follow the first hint, i forced the use of cookies, and then, the shop keep asking me to allow the use of cookies in my browse (IE 6 and Firefox 1.5).No matter what i do in the browse config, it is still asking for the same thing, always and always both IE and Firefox.

 

Is the prob in my shop (something to do with that /tmp directory?I forced the use of cache too, to make it use the tmp folder, but nothing...) or in the Apache?Or maybe in the domain name?In the instalation of the shop, i left everthing as default, the url it use is http://localhost/shop (it doesn't uses those domain terminations like .com) .

 

*I installed another shop (with the original version of OsCommerce 2.2 - not in my language) in the folder that Apache uses as the directory for sites, i called it "Test".I did the same thing, forced the use of cookies, and the same error happens.No matter if I?m using STS or BTS.

 

**Both IE and Firefox are enabled to use cookies, they even have some stored in their cache. .

 

***I?m also using the same Apache2Triad to test and build a forum using phpbb2, with the forum, the cookies works, their name:

 

localhost phpbb2mysql_sid

localhost phpbb2mysql_data

localhost lang

 

****The file name of the "original" version of Oscommerce that found the some prob of mine is oscommerce-2.2ms2-051113.zip.Anyone here uses the same version?If so, did you found the same prob?Is it some kind of bug?

Share this post


Link to post
Share on other sites
To der.brain & swtnhpy ,

 

STS and Header Tag Controller coexist together fine. Not sure why you choose MTC over HTC, but HTC is far more popular than MTC and is currently ranked 4th amongst top downloads. It will take you a good two hours minimum to install it, but follow the install instructions verbatim and it works. here is HTC. Be sure to uninstall MTC first. Good luck.

 

I chose to try to use MTC because no matter what I did, HTC would not work. I know I must be doing something wrong but I can't seem to figure it out. I will try it again.

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

×