Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Hi,

 

I have tried to find a solution for my problem, but no luck, so maybe someone here can help :-)

 

I installed osCommerce 2.2MS2 version in 2005, and installed also an free sts template design. I have not installed the contribution Simple template System (STS).

 

I'm in the process of upgrading the store to RC2a version, and I get this error at the very top of my catalog/index.php page:

 

 

 

Is there an easy way for me to update some of my sts files for the template to fix this, or do I have to install the simple template system contribution?

Or will the rc2a upgrade fix this when the upgrade is finished?

 

 

Thanks for your help :-)

There's no way you can use a STS template without having STS installed first. Try upgrading to the latest STSv4.6 and the error message will go away.


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

Then that means your stock product_info.php file has been modified to make the changes that you see. STS only pulls what is already there unless you use the content template feature. It's as simple as that.

 

This is not a STS issue. Sorry.

 

I got it removed from teh product pages. I had to make a copy of header.php and application_top.php then link to the new versions with the 4 lines of sts code in them removed. I am not sure how this was installed originally so I don't know why disabling it in admin did not just work right off the bat, not faulting the contribution.

Share this post


Link to post
Share on other sites

I got it removed from teh product pages. I had to make a copy of header.php and application_top.php then link to the new versions with the 4 lines of sts code in them removed. I am not sure how this was installed originally so I don't know why disabling it in admin did not just work right off the bat, not faulting the contribution.

 

 

Gotcha! wink.gif

 

Yeah, not knowing if STS was installed correctly in the first place could cause you some issues. I would suggest downloading the STS contribution (most likely v4.5.8 or earlier) and use a file and compare utility to do a quick scan of the contribution files and your source files to confirm the installation is correct. This would also be a good way of completely removing the contribution as well.


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

There's no way you can use a STS template without having STS installed first. Try upgrading to the latest STSv4.6 and the error message will go away.

 

 

Thanks, I will try to do that as soon as I have finished the RC2a upgrade :-)


Best regards

Kjolebutikken

Share this post


Link to post
Share on other sites

There's no way you can use a STS template without having STS installed first. Try upgrading to the latest STSv4.6 and the error message will go away.

 

 

Thanks, I will try to do that as soon as I have finished the RC2a upgrade :-)


Best regards

Kjolebutikken

Share this post


Link to post
Share on other sites

I am using sts template system. It is working fine with other addons but when I am trying to use idevaffiliate code it is unable to proceed. Idevaffiliate is affiliate system which captures the order id and total sell amount and sends the variables to idevaffiliate system from oscommerce and then calculate commissions according to the data. But I am unable to use this.

 

The idev code is implemented in checkout_success.php file. It looks like below:-

 

///////////IDEV AFFILIATE CODE STARTS/////////////

$idevtotal = tep_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$orders['orders_id'] . "' AND class = 'ot_subtotal'");

$idevtotal = tep_db_fetch_array($idevtotal);

$idev_saleamt = (number_format($idevtotal['value'],2));

$idev_ordernum = $orders['orders_id'];

print "<img border=\"0\" src=\"http://www.salesvideos.com/refer/sale.php?profile=5&idev_saleamt=$idev_saleamt&idev_ordernum=$idev_ordernum\" width=\"1\" height=\"1\">";

//////////IDEV AFFILIATE CODE ENDS/////////////

 

Please help me why it is not working with sts_template. It is working with default oscommerce setup.

 

Please help its very urgent.

Share this post


Link to post
Share on other sites

I am using sts template system. It is working fine with other addons but when I am trying to use idevaffiliate code it is unable to proceed. Idevaffiliate is affiliate system which captures the order id and total sell amount and sends the variables to idevaffiliate system from oscommerce and then calculate commissions according to the data. But I am unable to use this.

 

The idev code is implemented in checkout_success.php file. It looks like below:-

 

///////////IDEV AFFILIATE CODE STARTS/////////////

$idevtotal = tep_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$orders['orders_id'] . "' AND class = 'ot_subtotal'");

$idevtotal = tep_db_fetch_array($idevtotal);

$idev_saleamt = (number_format($idevtotal['value'],2));

$idev_ordernum = $orders['orders_id'];

print "<img border=\"0\" src=\"http://www.salesvideos.com/refer/sale.php?profile=5&idev_saleamt=$idev_saleamt&idev_ordernum=$idev_ordernum\" width=\"1\" height=\"1\">";

//////////IDEV AFFILIATE CODE ENDS/////////////

 

Please help me why it is not working with sts_template. It is working with default oscommerce setup.

 

Please help its very urgent.

 

That code and that script have nothing to do with STS so it has to be something else that is causing the conflict. Look at the other edits the contribution is making to try to find the conflict.


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

That code and that script have nothing to do with STS so it has to be something else that is causing the conflict. Look at the other edits the contribution is making to try to find the conflict.

 

I am really not able to find what is the issue exactly. When I turn off STS template the same code works nicely.

 

After a lot of research. I will used the other affiliate integration code to let idev affiliate work with sts template.

 

Please check the following link for other affiliate code :-

 

http://www.groundbreak.com/tutorials/ua_oscommerce.html

 

Can you confirm me if there may be anything wrong with this code. I checked it its working perfectly with idev.

 

Thanks

Share this post


Link to post
Share on other sites

Hi Bill,

 

I am having problems trying to integrate adsense into the footer using sts.

 

<?php
/*
$Id: sts_user_code.php,v 4.1 2005/02/05 05:57:21 rigadin Exp $

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

Copyright (c) 2005 osCommerce

Released under the GNU General Public License

Based on: Simple Template System (STS) - Copyright (c) 2004 Brian Gallagher - brian@diamondsea.com
STS v4.1 by Rigadin (rigadin@osc-help.net)
*/
/* The following code is a sample of how to add new boxes easily.
 Use as many blocks as you need and just change the block names.
  $sts->start_capture();
  require(DIR_WS_BOXES . 'new_thing_box.php');
  $sts->stop_capture('newthingbox', 'box');  // 'box' makes the system remove some html code before and after the box. Otherwise big mess!
Note: If $sts->stop_capture('newthingbox', 'box') is followed by $sts->start_capture, you can replace both by $sts->restart_capture('newthingbox', 'box')
Another way to declare STS variables is to enter them directly into the STS array:
  $sts->template['MyText']='Hello World';
*/


$sts->start_capture();
$productno = $cart->count_contents();
$totalprice = $currencies->format($cart->show_total());

if ($productno > 1) {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEMS;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
} elseif ($productno == 0) {
echo ENTRY_HCART_EMPTY;
} else {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEM;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
}
$sts->stop_capture ('headcart');


   $sts->start_capture();
   echo "\n<!-- Start Category Menu -->\n";
   echo tep_draw_form('goto', FILENAME_DEFAULT, 'get', '');
   echo tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
   echo "</form>\n";
   echo "<!-- End Category Menu -->\n";
   $sts->stop_capture('catmenu');



 function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
   global $languages_id;

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

   if ($include_itself) {
     $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
     $category = tep_db_fetch_array($category_query);
     $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
   }

   $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
   while ($categories = tep_db_fetch_array($categories_query)) {
     if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
     $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '   ', $exclude, $category_tree_array);
   }

   return $category_tree_array;
 }
//////////////////////////////////////////////  
// PAGE LINKS 
// Use the text within the brackets and quotes for your tag ['url_index'] 
// the tag to use in your template would be $url_index$
// Comment out the following tags if you do not need them to save parse time.
//////////////////////////////////////////////
$sts->template['url_index'] = tep_href_link(FILENAME_DEFAULT, '', 'NONSSL');
$sts->template['url_products_new'] = tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL');
$sts->template['url_specials'] = tep_href_link(FILENAME_SPECIALS, '', 'NONSSL');
$sts->template['url_contact_us'] = tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL');
$sts->template['url_advanced_search'] = tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL');
$sts->template['url_reviews'] = tep_href_link(FILENAME_REVIEWS, '', 'NONSSL');
$sts->template['url_conditions'] = tep_href_link(FILENAME_CONDITIONS, '', 'NONSSL');
$sts->template['url_privacy'] = tep_href_link(FILENAME_PRIVACY, '', 'NONSSL');
$sts->template['url_shopping_cart'] = tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL');

// End of PAGE LINKS
///////////////////////////////////////////////

/* // START COMPATIBILITY WITH STS 2 AND 3: $footer
// Uncomment this piece of code if you want $footer like in STS.
// Keep it as comment if you want to have $footer displaying only the copyright info. 
 $sts->start_capture();
?>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
   <td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
   <td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
 </tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center" class="smallText">
<?php echo FOOTER_TEXT_BODY ?>
   </td>
 </tr>
</table>
<?php  
 $sts->stop_capture('footer');
// END COMPATIBILITY WITH STS 2 AND 3: $footer */

/* // START COMPATIBILITY WITH STS 2 AND 3: $banner
 $sts->start_capture();
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center"><?php echo $sts->template['banner_only']; ?></td>
 </tr>
</table>
<?php
 }
$sts->stop_capture('banner');
// END COMPATIBILITY WITH STS 2 AND 3: $banner */

/* // START COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_
// See if there are any $url_ or $urlcat_ variables in the template file, if so, flag to read them
if (strpos($sts->template['template_html'], "\$cat_") or strpos($sts->template['template_html'], "\$urlcat_") ) {
print "<!-- STS: Reading $cat_ and $urlcat_ tags, recommend not using them -->";
$get_categories_description_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION);
// Loop through each category (in each language) and create template variables for each name and path
while ($categories_description = tep_db_fetch_array($get_categories_description_query)) {
      $cPath_new = tep_get_path($categories_description['categories_id']);
      $path = substr($cPath_new, 6); // Strip off the "cPath=" from string

      $catname = $categories_description['categories_name'];
      $catname = str_replace(" ", "_", $catname); // Replace Spaces in Category Name with Underscores

      $sts->template["cat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
      $sts->template["urlcat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
      $sts->template["cat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
      $sts->template["urlcat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
}
}
*/ // END COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_
?>]

 

if I uncomment the code I can get the footer to display the adsense banner but I want it just to have the copyright information also and for the life of me I cant get it right.

 

The footer displays outs sts mode, and in stst mode but only when the above uses the $footer$ and not the $footer_text$ which only shows the copyright info.

 

my footer.php file is as follows:-

 

<?php
/*
 $Id: footer.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
// START STS 4.5
if ($sts->display_template_output) {
 // Get content here, in case column_right is not called.
 if (!isset($sts->template['content'])) $sts->restart_capture ('content');
} else {
//END STS

 require(DIR_WS_INCLUDES . 'counter.php');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
   <td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
   <td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
 </tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center" class="smallText"><?php echo FOOTER_TEXT_BODY; ?></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
 <tr >
   <td align="center" class="footer">

<div style="text-align: center"><?php            
 if(!$_SERVER['HTTPS']){
   $bannerstring_query = tep_db_query("select * from adsense_text where script_id='2'");	
while ($bannerstring = tep_db_fetch_array($bannerstring_query)) {
$banner = $bannerstring['script_text'];
}

  echo $banner;
 }
?></div>
           </td>
         </tr>
</table>
<?php
 if ($banner = tep_banner_exists('dynamic', 'footer')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center"><?php echo tep_display_banner('dynamic', 'footer'); ?></td>
 </tr>
</table>
<?php
 }
// START STS 4.1
}
// END STS 4.1
?>

 

 

Appreciate your help on this I am probably doing something stupid but I just cant get it right right, ie just the copy right and the adsense. I have managed to get the adsense info box working just not the footer.

 

Also I may want to put this adsnse code on the main page, so would I have to do anything different to place the code in the footer or say on the main page, would like to use $adsense$ or $adsenseH for this

 

 

Thanks

Edited by johnnybebad

Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

 

 

Appreciate your help on this I am probably doing something stupid but I just cant get it right right, ie just the copy right and the adsense. I have managed to get the adsense info box working just not the footer.

 

Also I may want to put this adsnse code on the main page, so would I have to do anything different to place the code in the footer or say on the main page, would like to use $adsense$ or $adsenseH for this

 

 

Thanks

 

 

You need to insert your adsense JavaScript into the sts_user_code.php file to make a $adsense$ tag that you would then place the tag into your template pages.

 

Here is an example that I created for a client (xxxxx would be your custom identification code from Google)...

 <script type="text/javascript"><!--

   google_ad_client = "pub-XXXXXXXXXXXXXXXXXXXX";
/* 120x600, created 3/4/09 */
google_ad_slot = "XXXXXXXXXXXXXX";
google_ad_width = 120;
google_ad_height = 600;


 //--></script>
 <script type="text/javascript"
src="[url="http://pagead2.googlesyndication.com/pagead/show_ads.js"]http://pagead2.googlesyndication.com/pagead/show_ads.js[/url]">
 </script> 
 <?php } 

 $sts->stop_capture('adsense');

 

The code above created the $adsense$ tag.

Note: I'm assuming alot here as you did not provide the exact contribution that you used.

 

 


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

You need to insert your adsense JavaScript into the sts_user_code.php file to make a $adsense$ tag that you would then place the tag into your template pages.

 

Here is an example that I created for a client (xxxxx would be your custom identification code from Google)...

 <script type="text/javascript"><!--

   google_ad_client = "pub-XXXXXXXXXXXXXXXXXXXX";
/* 120x600, created 3/4/09 */
google_ad_slot = "XXXXXXXXXXXXXX";
google_ad_width = 120;
google_ad_height = 600;


 //--></script>
 <script type="text/javascript"
src="[url="http://pagead2.googlesyndication.com/pagead/show_ads.js"]http://pagead2.googlesyndication.com/pagead/show_ads.js[/url]">
 </script> 
 <?php } 

 $sts->stop_capture('adsense');

 

The code above created the $adsense$ tag.

Note: I'm assuming alot here as you did not provide the exact contribution that you used.

 

 

Hi Bill, I will look at it, my code is somewhat different see below, the idea is so hat in admin you can just enter the java script and the datbase calls it up, that way for different customers can enter the code without the need to edit any files

 

 

<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
 <tr >
   <td align="center" class="footer">

<div style="text-align: center"><?php            
 if(!$_SERVER['HTTPS']){
   $bannerstring_query = tep_db_query("select * from adsense_text where script_id='2'");       
       while ($bannerstring = tep_db_fetch_array($bannerstring_query)) {
       $banner = $bannerstring['script_text'];
       }

  echo $banner;
        }
?></div>
           </td>
         </tr>
</table>

 

Maybe I would be better off changing the code to just use the google client number and use a configuraton value so they just dd the client code in admin and the rest is taken care of I will look at that in the mean time


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

Hi got there in the end, just got a little confused because of the stuff commented out in the sts_user_code, my code in this file now looks like

<?php
/*
$Id: sts_user_code.php,v 4.1 2005/02/05 05:57:21 rigadin Exp $

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

Copyright (c) 2005 osCommerce

Released under the GNU General Public License

Based on: Simple Template System (STS) - Copyright (c) 2004 Brian Gallagher - brian@diamondsea.com
STS v4.1 by Rigadin (rigadin@osc-help.net)
*/
/* The following code is a sample of how to add new boxes easily.
 Use as many blocks as you need and just change the block names.
  $sts->start_capture();
  require(DIR_WS_BOXES . 'new_thing_box.php');
  $sts->stop_capture('newthingbox', 'box');  // 'box' makes the system remove some html code before and after the box. Otherwise big mess!
Note: If $sts->stop_capture('newthingbox', 'box') is followed by $sts->start_capture, you can replace both by $sts->restart_capture('newthingbox', 'box')
Another way to declare STS variables is to enter them directly into the STS array:
  $sts->template['MyText']='Hello World';
*/


$sts->start_capture();
$productno = $cart->count_contents();
$totalprice = $currencies->format($cart->show_total());

if ($productno > 1) {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEMS;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
} elseif ($productno == 0) {
echo ENTRY_HCART_EMPTY;
} else {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEM;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
}
$sts->stop_capture ('headcart');


   $sts->start_capture();
   echo "\n<!-- Start Category Menu -->\n";
   echo tep_draw_form('goto', FILENAME_DEFAULT, 'get', '');
   echo tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
   echo "</form>\n";
   echo "<!-- End Category Menu -->\n";
   $sts->stop_capture('catmenu');

$sts->start_capture();
 include(DIR_WS_INCLUDES . 'boxes/rapidssl_seal.php');
 $sts->stop_capture('rapidsslbox');

$sts->start_capture();
 include(DIR_WS_INCLUDES . 'boxes/safebuy.php');
 $sts->stop_capture('safebuybox');

 function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
   global $languages_id;

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

   if ($include_itself) {
     $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
     $category = tep_db_fetch_array($category_query);
     $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
   }

   $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
   while ($categories = tep_db_fetch_array($categories_query)) {
     if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
     $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '   ', $exclude, $category_tree_array);
   }

   return $category_tree_array;
 }
//////////////////////////////////////////////  
// PAGE LINKS 
// Use the text within the brackets and quotes for your tag ['url_index'] 
// the tag to use in your template would be $url_index$
// Comment out the following tags if you do not need them to save parse time.
//////////////////////////////////////////////
$sts->template['url_index'] = tep_href_link(FILENAME_DEFAULT, '', 'NONSSL');
$sts->template['url_products_new'] = tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL');
$sts->template['url_specials'] = tep_href_link(FILENAME_SPECIALS, '', 'NONSSL');
$sts->template['url_contact_us'] = tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL');
$sts->template['url_advanced_search'] = tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL');
$sts->template['url_reviews'] = tep_href_link(FILENAME_REVIEWS, '', 'NONSSL');
$sts->template['url_conditions'] = tep_href_link(FILENAME_CONDITIONS, '', 'NONSSL');
$sts->template['url_privacy'] = tep_href_link(FILENAME_PRIVACY, '', 'NONSSL');
$sts->template['url_shopping_cart'] = tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL');

// End of PAGE LINKS
///////////////////////////////////////////////

/* // START COMPATIBILITY WITH STS 2 AND 3: $footer
// Uncomment this piece of code if you want $footer like in STS.
// Keep it as comment if you want to have $footer displaying only the copyright info. 
 $sts->start_capture();
?>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
   <td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
   <td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
 </tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center" class="smallText">
<?php echo FOOTER_TEXT_BODY ?>
   </td>
 </tr>
</table>
<?php  
 $sts->stop_capture('footer');
// END COMPATIBILITY WITH STS 2 AND 3: $footer */
//////////////////////////////////////
// START COMPATIBILITY WITH STS 2 AND 3: $adsense
// Uncomment this piece of code if you want $footer like in STS.
// Keep it as comment if you want to have $footer displaying only the copyright info. 
 $sts->start_capture();
?><table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
 <tr >
   <td align="center" class="footer">

<div style="text-align: center"><?php            
 if(!$_SERVER['HTTPS']){
   $bannerstring_query = tep_db_query("select * from adsense_text where script_id='2'");       
       while ($bannerstring = tep_db_fetch_array($bannerstring_query)) {
       $banner = $bannerstring['script_text'];
       }

  echo $banner;
        }
?></div>
           </td>
         </tr>
</table>
<?php
 $sts->stop_capture('adsense');
// END COMPATIBILITY WITH STS 2 AND 3: $adsense */
//////////////////////////////////////
// START COMPATIBILITY WITH STS 2 AND 3: $banner
 $sts->start_capture();
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center"><?php echo $sts->template['banner_only']; ?></td>
 </tr>
</table>
<?php
 }
$sts->stop_capture('banner');
// END COMPATIBILITY WITH STS 2 AND 3: $banner */

/* // START COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_
// See if there are any $url_ or $urlcat_ variables in the template file, if so, flag to read them
if (strpos($sts->template['template_html'], "\$cat_") or strpos($sts->template['template_html'], "\$urlcat_") ) {
print "<!-- STS: Reading $cat_ and $urlcat_ tags, recommend not using them -->";
$get_categories_description_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION);
// Loop through each category (in each language) and create template variables for each name and path
while ($categories_description = tep_db_fetch_array($get_categories_description_query)) {
      $cPath_new = tep_get_path($categories_description['categories_id']);
      $path = substr($cPath_new, 6); // Strip off the "cPath=" from string

      $catname = $categories_description['categories_name'];
      $catname = str_replace(" ", "_", $catname); // Replace Spaces in Category Name with Underscores

      $sts->template["cat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
      $sts->template["urlcat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
      $sts->template["cat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
      $sts->template["urlcat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
}
}
*/ // END COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_
?>

 

thanks


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

 

 

 

Keep in mind, the code was and should remained commented out (or removed) if you don't need COMPATIBILITY WITH STS 2 AND 3. These older versions of STS cause your store to run a lot slower than it should and you should avoid the STS2 & STS3 tags that this code creates.

 

thumbsup.gif STSv4 has it's own banner and footer tags that you should be using in place of the optional tags listed in the sts_user_code.php file.


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

ok, you probably had this question a million time but I searched all over the forum and didn't find any solution for this probably easy to solve problem.

 

All I want to do is to have more than 1 specific template as for now I can only have the homepage (index.php_0.html) and another page (index.php.html) working.

 

In the header I have the standard links (Home-News-Products-Contact Us-About Us-Recipes) and a search box (quite simple). The Home is linked to index.php_0.html and the products is linked to index.php.html and any search result is also linked to index.php.html but if I go to news (news.php.html in the same folder as the index.php.html) the tags are suddenly not active anymore "$searchbox". I've almost tried everything but didn't succeed in having the tags active.

 

Q: Where should the news.php.html file be located

Q: How do I link to this file, what's the exact URL to news.php.html

 

I'm a real newbie to OS and PHP but figured out almost enough to start my webpage.

 

http://www.timberex.be/catalog

Share this post


Link to post
Share on other sites

ok, you probably had this question a million time but I searched all over the forum and didn't find any solution for this probably easy to solve problem.

 

All I want to do is to have more than 1 specific template as for now I can only have the homepage (index.php_0.html) and another page (index.php.html) working.

 

In the header I have the standard links (Home-News-Products-Contact Us-About Us-Recipes) and a search box (quite simple). The Home is linked to index.php_0.html and the products is linked to index.php.html and any search result is also linked to index.php.html but if I go to news (news.php.html in the same folder as the index.php.html) the tags are suddenly not active anymore "$searchbox". I've almost tried everything but didn't succeed in having the tags active.

 

Q: Where should the news.php.html file be located

Q: How do I link to this file, what's the exact URL to news.php.html

 

I'm a real newbie to OS and PHP but figured out almost enough to start my webpage.

 

http://www.timberex.be/catalog

 

First of all, you cannot create your links to point to the actual "template" name. You must create you links to the PHP script in which you are linking to (home page is index.php) as well as arrange it so the session ID is not lost.

 

Here is an example:

STS Link to a category:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

STS Link to a product:

 

<a href="<?php echo tep_href_link('product_info.php', 'products_id=53&', 'NONSSL'); ?>">Product Name Here</a>

 

However, STSv4.6 has some new variables (tags) that you can use as your links to point to specific pages:

$sts->template['url_index'] = tep_href_link(FILENAME_DEFAULT, '', 'NONSSL');

The tag above is already created for you in the includes/modules/sts_inc/sts_user_code.php file. The actual tag is $url_index$ and you would insert it into your template page as so:

<a href="$url_index$">Home</a>

It will automatically create a link in the browser that looks like this: http://yourdomain.com/index.php

It keeps the session ID in place since it uses tep_href_link to build the link.

 

Important Posts for the STS newbie:

 

Post #3755: http://forums.oscomm...p;#entry1226986

 

Post #4326: http://forums.oscomm...p;#entry1303555

 

Post #4974: http://forums.oscomm...p;#entry1361366

 

Post #3772: http://forums.oscomm...p;#entry1227769

 

Post #3757: http://forums.oscomm...p;#entry1227006

 

Please review the above for insight on how the Simple Template System allows you to make templates for pages, categories, home page, products and infoboxes.

 

Hope this was helpful,


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

First of all, you cannot create your links to point to the actual "template" name. You must create you links to the PHP script in which you are linking to (home page is index.php) as well as arrange it so the session ID is not lost.

 

Here is an example:

STS Link to a category:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

STS Link to a product:

 

<a href="<?php echo tep_href_link('product_info.php', 'products_id=53&', 'NONSSL'); ?>">Product Name Here</a>

 

However, STSv4.6 has some new variables (tags) that you can use as your links to point to specific pages:

$sts->template['url_index'] = tep_href_link(FILENAME_DEFAULT, '', 'NONSSL');

The tag above is already created for you in the includes/modules/sts_inc/sts_user_code.php file. The actual tag is $url_index$ and you would insert it into your template page as so:

<a href="$url_index$">Home</a>

It will automatically create a link in the browser that looks like this: http://yourdomain.com/index.php

It keeps the session ID in place since it uses tep_href_link to build the link.

 

Important Posts for the STS newbie:

 

Post #3755: http://forums.oscomm...p;#entry1226986

 

Post #4326: http://forums.oscomm...p;#entry1303555

 

Post #4974: http://forums.oscomm...p;#entry1361366

 

Post #3772: http://forums.oscomm...p;#entry1227769

 

Post #3757: http://forums.oscomm...p;#entry1227006

 

Please review the above for insight on how the Simple Template System allows you to make templates for pages, categories, home page, products and infoboxes.

 

Hope this was helpful,

 

Thanks Bill,

 

I knew I did something wrong with the URL's. For the products or category linking I do understand how STS works could you however tell me where to store a simple page like eg.: news.php.html and what the link (url) should be to that page to have the tags still working? Should I store it in the same page as the Default template file or elsewhere? and should the url be like this (bare in mind that I don't really know PHP so don't laugh):

 

<a href="<?php echo tep_href_link('news.php.html', 'NONSSL'); ?>">news</a>

 

I allready went trough all the newbie posts but didn't find the right answer.

 

H.

Share this post


Link to post
Share on other sites

<a href="<?php echo tep_href_link('news.php.html', 'NONSSL'); ?>">news</a>

 

You link again to the template file. Thats wrong. You need to link to the php file

 

If you have a file news.php, that is defined in includes/filenames as ie FILENAME_NEWS, then the link to it in your template would look like

    
<a href="<?php echo tep_href_link(FILENAME_NEWS, '', 'NONSSL'); ?>" >news</a>          

You can pace this link anywhere into any template and it will link to news.php

 

From there on, if you have a template for news.php, called news.php.html, then sts will pick it for the display, if not, then the content of news.php will come in the default template environment, thats indifferent for the link

Share this post


Link to post
Share on other sites

Thanks Bill,

 

I knew I did something wrong with the URL's. For the products or category linking I do understand how STS works could you however tell me where to store a simple page like eg.: news.php.html and what the link (url) should be to that page to have the tags still working? Should I store it in the same page as the Default template file or elsewhere? and should the url be like this (bare in mind that I don't really know PHP so don't laugh):

 

<a href="<?php echo tep_href_link('news.php.html', 'NONSSL'); ?>">news</a>

 

I allready went trough all the newbie posts but didn't find the right answer.

 

H.

 

thumbsup.gif Take a look at the STSv4 Power Pack download site (a site dedicated to STS add-ons) and you will find a tutorial that I created on "How to Add a New Page using STS". The link is in the STS User Manual as well as my signature below.


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

thumbsup.gif Take a look at the STSv4 Power Pack download site (a site dedicated to STS add-ons) and you will find a tutorial that I created on "How to Add a New Page using STS". The link is in the STS User Manual as well as my signature below.

 

Thanks Bill and George,

 

I think I got it sorted out,... for now :-)

 

Great contribution btw.

 

Harold

Share this post


Link to post
Share on other sites

I guess I'm being a bit slow today but I managed to get the STS system to work all except for the Multiple Custom Categories.

 

I created a file in the main directory of the template i amy using (it is within the same area as /test and /full) the file name is product_info.php_c1.php

 

So I want it to affect all of cpath 1...but nothing happens.

 

Am I missing something am I to add something? All I wanted the STS system was specifically for custom multiple categories and i can't get it to work...

Ive searched about this problem and I cant find anything. There is a section in the instructions 4.10 which looks related. Do I need to go into this to re arrange the product display layout for all products? I can get the other features to work like different templates per category, that is no problem, but changing the product layout has got me completely stumped. Is changing the layout of the content tag a big step forward in complication in relation to the overall templates?

Share this post


Link to post
Share on other sites

Ive searched about this problem and I cant find anything. There is a section in the instructions 4.10 which looks related. Do I need to go into this to re arrange the product display layout for all products? I can get the other features to work like different templates per category, that is no problem, but changing the product layout has got me completely stumped. Is changing the layout of the content tag a big step forward in complication in relation to the overall templates?

 

 

You should enable the following modules:

STS Default

STS Index

 

Then, select your template folder that you want to use for all of your templates in the STS Default module.

 

Then, create your template that you need using the following naming syntax below and save it in the template folder that you selected above:

TIP

Here is a quick rundown of common template names:

 

  • sts_template.html
    • = Default template

    [*]index.php.html

    • = Default Category template (used for all category pages that do not have a specific template page created for it – if you didn’t have this template, STS would use sts_template.html).

    [*]index.php_0.html

    • = Home page template

    [*]index.php_x.html

    • = Specific category template where x = the category ID. This template will create your custom category template(s) that you are interested in.

    [*]index.php_x_y.html

    • = Specific subcategory template where x = the category ID and y = the subcategory ID

    [*]product_info.php.html

    • = Default Product template (used for all products, in all categories, if no specific product template is found).

    [*]product_info.php_c23.html

    • = Product template for all products in a specific category (23 in this example – change to the category ID needed)

    [*]product_info.php_23.html

    • = CONTENT template for product ID 23. All content template should be saved in the SGP/content/ folder. Review the sample content template provided in the STS template “full/content” folder. The STS Module Product Info must be enabled in order to use this STS feature. This template is not recommended unless you really know what you are doing since you would need to make modifications to it if you ever added new osCommerce contributions to your shop.

    [*]popup_image.php.html

    • = Template for the product popup image.

    [*]index.php.mfr.html

    • = Default Manufacturer template page (used for all manufacturer pages that do not have a specific template page created for it - if you didn’t have this template, STS would use sts_template.html).

    [*]index.php.mfr_x.html

    • = Specific Manufacturer template where x = the manufacturer ID.


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, I have just upgraded from 2.2MS2 to 2.2 RC2a.

Both store url and admin is totally blank, but no error message.

 

Link to my store

 

I have an old sts template, and I am going to upgrade to 4.6 version.

 

Do you know if this will fix the blank store problem?

Or should the store and admin be visible before upgrade to 4.6?

 

 

I also have added this problem in the support thread for upgrading to RC2, but then I wondered if it could be caused by the old sts template :-)

 

 

Thanks


Best regards

Kjolebutikken

Share this post


Link to post
Share on other sites

Hi, I have just upgraded from 2.2MS2 to 2.2 RC2a.

Both store url and admin is totally blank, but no error message.

 

Link to my store

 

I have an old sts template, and I am going to upgrade to 4.6 version.

 

Do you know if this will fix the blank store problem?

Or should the store and admin be visible before upgrade to 4.6?

 

 

I also have added this problem in the support thread for upgrading to RC2, but then I wondered if it could be caused by the old sts template :-)

 

 

Thanks


Best regards

Kjolebutikken

Share this post


Link to post
Share on other sites

Hi, I have just upgraded from 2.2MS2 to 2.2 RC2a.

Both store url and admin is totally blank, but no error message.

 

Link to my store

 

I have an old sts template, and I am going to upgrade to 4.6 version.

 

Do you know if this will fix the blank store problem?

Or should the store and admin be visible before upgrade to 4.6?

 

 

I also have added this problem in the support thread for upgrading to RC2, but then I wondered if it could be caused by the old sts template :-)

 

 

Thanks

What version of STS are you using now? Is STS even installed at the moment?

 

I wouldn't recommend installing anything until you figure out what the problem is that is causing your blank page in both the admin and the front end. If you have STS installed now, then you need to go into the admin and turn it off to see if that takes care of your blank page.

 

I'm thinking this is not realted to STS at all but rather a fouled osC RC2a upgrade. Try your RC2a upgrade again or install RC2a from scratch and then install STSv4.6.


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

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

×