Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

ok got this working,

 

turns out you need the <!-- $headcontent --> in your template which i didnt have.

 

anyone,

 

does anyone know what would cause the pages to all have js errors on the page. i got the popups etc to work but it still has js errors.

 

any ideas?

I had <!-- $headcontent --> in my html page and nothing. As a matter of fact non of my other js on my pages worked right either, then i just added the js from the source it was calling on and added it to my page and it worked.

Share this post


Link to post
Share on other sites

Sorry to double post, but can anyone help with this

 

Hi Guys,

 

I have a slight issue and I have no idea if its STS that is causing the problem. If yuo look at my site here and click on a couple of links everything seems to work great.

 

However, I have been working on the all products page (with a lot of help from stevel) and if you look here at the all products page you will see that the specials, great offers boxes are not displaying.

 

Also the shopping cart info is missing from its box as well.

 

Can anyone give me any ideas on why it only happens on this page, because it has got me stumped!

 

Thanks

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites
I've installed version 3 so that I could have different templates for each of the product categories and it works like a dream.

 

But I have a problem. I use the page editor contribution and I need to be able to have a different templae for each page... this used to work in the old STS version.

 

The URLs look like this "pages.php?page=story1" and in the old version I could call the template like this "pages.php_story1.html" and it worked. But in this new version, STS is calling the default template for these pages.

 

Any idea what the problem is?

 

Thanks!

 

 

OK, I've figured this out. Add the below to "sts_display_output.php" at about line 140....

 

if ($scriptbasename == "pages.php") {

 

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

array_push($sts_template_array, STS_TEMPLATE_DIR . "pages.php_" . $HTTP_GET_VARS['page'] . ".html");

}

 

 

}

Share this post


Link to post
Share on other sites
Hello.

 

I've installed the mod and everything is working great.  I would like to add a tag for a full size image instead of a small image with a click to enlarge link.

 

I would also like to use the xsell mod, but don't see away to add it to the product page.  Is there a way/tag to do this?

 

I figured out the image tag, but still can't find the tag needed to recommend my xsell items. Can someone help me out here?


Thanks!

Clesha

Share this post


Link to post
Share on other sites

Open up your sts_user_code located in catalog/includes, and add this at the end

$sts_block_name = 'xsell';
 require(STS_START_CAPTURE);
require(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
 require(STS_STOP_CAPTURE);
 $template['xsell'] = $sts_block['xsell'];

 

You should now beable to use $xsell as a variable on your html pages.

Edited by jdlev

Share this post


Link to post
Share on other sites

Upgraded to the newest beta, and love the fact that you can now tweak the manufacturers pages. My question is, are there other variables that can be used to redesign the layout like in product info?

Share this post


Link to post
Share on other sites
Use the $langid variable in your image path names.

 

ie: /img/logo/banner-$langid.gif

 

Then create

 

banner-1.gif, banner-2.gif, etc, depending on the languages being used.  The number for the LangID will come from your particular osC implementation.

 

- Brian

 

Tried with for exmple button-$langid.gif in sts_template.html and named my button to button-4.gif (langid 4 = swedish). But it doesnt work.. I'm using STS 3.0 Beta 2. Please help, I've been waiting for this feature for over a year!! :) Or has it always been there?

Share this post


Link to post
Share on other sites
Open up your sts_user_code located in catalog/includes, and add this at the end
$sts_block_name = 'xsell';
 require(STS_START_CAPTURE);
require(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
 require(STS_STOP_CAPTURE);
 $template['xsell'] = $sts_block['xsell'];

 

You should now beable to use $xsell as a variable on your html pages.

 

 

It works perfectly!


Thanks!

Clesha

Share this post


Link to post
Share on other sites

It's not easy to find the answer your looking for in 128 pages that cannot be searched individually.

 

Anyway. I got it installed the newest dowload

Q. Ok it say you can have multiple templates??? How do you choose which ones.

Can you have more than one at a time?

Can a customer choose a template?


q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Share this post


Link to post
Share on other sites

I have the custom variables product_info.php and I dont see a variable for the View Larger link? I have a $smallimagesrc variable which shows the smaller image, then i need to figure out how to make the View Larger work for each product to there bigger picture. Anybody help with this?

Share this post


Link to post
Share on other sites

hello :)

 

i'm trying to use sts template tags like so but it's not working:

 

i created a new box named links.php

 

<?php

 $title = array();
 $content = array();
 
 $html = file_get_contents(DIR_WS_BOXES."../sts_templates/mysite/links.php.html");

 $title[] = array('text' => "");
 $content[] = array('text' => $html);

 new infoBox($content);

?>

 

that box calls up this file: sts_templates/mysite/links.php.html

<html>
<head>
<!--$headcontent-->
<script LANGUAGE="JavaScript" SRC="$templatepath/sts_osc_javascript.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="$templatepath/stylesheet.css">
</head>
<body>
$myaccountlogoff
<br />
$cartcontents
<br />
$checkout
</body>
</html>

 

then i added this to sts_user_code.php:

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

 

but instead of the template tags doing what they are supposed to do they are being displayed in the box as text.

 

any thoughts?

 

thank you :)

Share this post


Link to post
Share on other sites

I have applied a base oscommerce setup with master products and the applied STS over the top and I get the following issue:

 

Parse error: parse error, unexpected '}' in /home/wlilies/public_html/catalog/includes/header.php on line 92

 

 

Must be simple right?

Thanks


Hey its free!

Share this post


Link to post
Share on other sites
<?php
/*
 $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
   if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
     $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
   }
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
   if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
     $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
   }
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
   if (STORE_SESSIONS == '') {
     if (!is_dir(tep_session_save_path())) {
       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
     } elseif (!is_writeable(tep_session_save_path())) {
       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
     }
   }
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
   if (ini_get('session.auto_start') == '1') {
     $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
   }
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
   if (!is_dir(DIR_FS_DOWNLOAD)) {
     $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
   }
 }

 if ($messageStack->size('header') > 0) {
   echo $messageStack->output('header');
 }
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
   <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>
   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>
 </tr>
</table>
<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerError">
   <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
 </tr>
</table>
<?php
 }

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
   <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
 </tr>
</table>
<?php
 }
?>
ass="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
 </tr>
</table>
<?php
 }

 // STS: ADD
 $sts_block_name = 'header';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

?>


Hey its free!

Share this post


Link to post
Share on other sites

either the brace on line 86 or on 91 is an extra brace comment each at a time and run and check.

 

Satish Mantri


Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Share this post


Link to post
Share on other sites
Tried with for exmple button-$langid.gif in sts_template.html and named my button to button-4.gif (langid 4 = swedish). But it doesnt work.. I'm using STS 3.0 Beta 2. Please help, I've been waiting for this feature for over a year!! :) Or has it always been there?

 

Please, need help with this.

Share this post


Link to post
Share on other sites

this is a repost. i didn't solve the problem but i did take the html, head and body tags out of links.php

_____________

 

i'm trying to use sts template tags like so but it's not working:

 

i created a new box named links.php

 

<?php

?$title = array();
?$content = array();
?
?$html = file_get_contents(DIR_WS_BOXES."../sts_templates/mysite/links.php.html");

?$title[] = array('text' => "");
?$content[] = array('text' => $html);

?new infoBox($content);

?>

 

that box calls up this file: sts_templates/mysite/links.php.html

$myaccountlogoff
<br />
$cartcontents
<br />
$checkout

 

then i added this to sts_user_code.php:

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

 

but instead of the template tags doing what they are supposed to do they are being displayed in the box as text.

 

any thoughts?

 

thank you :)

Share this post


Link to post
Share on other sites
I am having this same problem.

Fresh install of osCommerce.

Overwrite files with the files from the STS3.

Change the configuration file.

 

Get the errors posted below, as well as a javascript error on every page. No idea what that is all about. Anyone have any ideas?

 

I am also using easyphp to run this on my local machine for testing.

Thanks!

 

 

Brian, I have the same problem!!! Please Advice, it?s very very importent since i am launcing a new webstore but can?t due to the above problems :'(

Share this post


Link to post
Share on other sites
No idea what this code is but if I remove lines 197-203 in catalog/includes/application_top.php

    if ($spider_flag == false) {

      tep_session_start();

      $session_started = true;

    }

  } else {

    tep_session_start();

    $session_started = true;

 

It removes the 2 errors

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\program files\easyphp1-8\www\includes\application_top.php:18) in c:\program files\easyphp1-8\www\includes\functions\sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\program files\easyphp1-8\www\includes\application_top.php:18) in c:\program files\easyphp1-8\www\includes\functions\sessions.php on line 67

 

Anyone have any idea why this would be and do I need that code? lol It has something to do with blocking spiders?

My admin has Block Spiders set to false.

Force cookie use set to False.

Actually everything in my sessions is set to false as that is how it comes but I may want to change that in the future so if I remove that code does it mean I won't be able to block spiders?

 

Store sessions on my config is set to mysql

Still can't figure out why it is not picking up either of the template inside the sts_templates folder though or what the javascript error is. If I figure it out I will be back. :)

 

 

 

 

Brian, I have the same problem!!! Please Advice, it?s very very importent since i am launcing a new webstore but can?t due to the above problems :'(

 

If the problems can?t be solved within a soon future, please tell me/us so that we know!

Share this post


Link to post
Share on other sites
this is a repost. i didn't solve the problem but i did take the html, head and body tags out of links.php

_____________

 

i'm trying to use sts template tags like so but it's not working:

 

i created a new box named links.php

 

<?php

 $title = array();
 $content = array();
 
 $html = file_get_contents(DIR_WS_BOXES."../sts_templates/mysite/links.php.html");

 $title[] = array('text' => "");
 $content[] = array('text' => $html);

 new infoBox($content);

?>

 

that box calls up this file: sts_templates/mysite/links.php.html

$myaccountlogoff
<br />
$cartcontents
<br />
$checkout

 

then i added this to sts_user_code.php:

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

 

but instead of the template tags doing what they are supposed to do they are being displayed in the box as text.

 

any thoughts?

 

thank you :)

 

 

It seems that your sts_user_code.php is wrong. Switch it to this:

$sts_block_name = 'links';
 require(STS_START_CAPTURE);
require(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
 require(STS_STOP_CAPTURE);
 $template['links'] = $sts_block['links'];

Share this post


Link to post
Share on other sites

Hi Guys,

 

I still have an issue and I have no idea if its STS that is causing the problem. If you look at my site herehere and click on a couple of links everything seems to work great.

 

However, I have been working on the all products page (with a lot of help from stevel) and if you look here at the all products page you will see that the specials, great offers boxes are not displaying.

 

Also the shopping cart info is missing from its box as well.

 

This also happens when you go through the checkout but only when you hit the payment page.

 

SSL is set to false in the config files so there should be no issues at all.

 

I am however running the sts-templated store from the same dbase as my original store but the only tables that are the same are the products tables. All the rest are prefixed.

 

Can anyone please shed some light on this as this is the only major problem which is going to stop this store going live.

 

Thanks

 

Mark :thumbsup:


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

Hi,

 

I have been using STS V2.01 for a long time, and it's been working fine. This week, I added a contribution (osCAffiliate v2.5a ) to my website, but I got some problem with some popup windows. The question has been asked in the osCAffiliate support thread by someone else, but i didn't see anyone answering the questions there. So I am asking it here in the general board.

 

When I popup the help files by clicking "?" in affiliate_summary.php, there are popup windows coming up. But I cannot see anything in the popup window, except the STS template of my site.

 

Popup windows in affiliate_banners_build.php, etc. have the same problem.

 

An intesting thing is that the affiliate terms and conditions popup (affiliate_terms_pop.php from affiliate_signup.php) does work. If I replace all the codes in affiliate_terms_pop.php with all the codes in other popup window files, such as affiliate_help1.php, the right help popup come up correctly from affiliate_signup.php.

 

I hope i have made the problem clear here. Maybe there are just some small tricks here to solve the problem. But I just didn't find them.

 

Can someone here help me out?

 

Thanks a lot,

 

Bo

Share this post


Link to post
Share on other sites

I HAVE FINALLY GOT NO ERRORS !!!

 

 

what i did was --

 

change

 

<!--$headcontent-->

 

to

 

$headcontent

 

in both sts_template.html and product_info.php.html

 

then i added the following javascript to the head because for some reason sts wasnt adding it !

 

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

 

I also cleared out all other bits between <head> and </head>

 

so my head now looks like

 

<head>

$headcontent

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

</head>

 

Doing this finally got rid of the errors caused, i think, by the repeated tags created by sts

 

This is probally wrong but to hell with it! no-one seems to be able to get STS actually working properly anyway !

 

Cheers!

;)

Edited by mr_biggles

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

×