Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

How do I edit the content in the index? As in the first page that load up? I want to change it quite a bit but do not know how. :(

 

 

200 , what do you want to change in the content? do you mean products and so forth? if so you will use the admin panel for that, if it is style you want to add then you will use the catalog/stylesheet.

Share this post


Link to post
Share on other sites

brief update...

 

I am now getting very close to linking sts template to external files so that the template can be shared by new files, it will hopefully read the content of previously written files with only minor adjustments/additions to those files. finders crossed, and hopefully not to many more walls will crumble from the incessant headbanging ;o).

Share this post


Link to post
Share on other sites

I posted this in the header tags controller forum, and they sent me here. I installed header tags controller using the STS power pack contrib, and everything seems to be working accept the admin section, where I get this message:

 

Fatal error: Call to undefined function: tep_href_link() in /home/content/s/p/e/specterstudios/html/store/catalog/admin/includes/boxes/header_tags_controller.php on line 21

 

Thanks in advance for any help.

Share this post


Link to post
Share on other sites
I posted this in the header tags controller forum, and they sent me here. I installed header tags controller using the STS power pack contrib, and everything seems to be working accept the admin section, where I get this message:

 

Fatal error: Call to undefined function: tep_href_link() in /home/content/s/p/e/specterstudios/html/store/catalog/admin/includes/boxes/header_tags_controller.php on line 21

 

Thanks in advance for any help.

Joey, did you follow all of the suggestions that I mentioned to you back in the header tags forum?

You may have misplaced one of the header_tags.php files and put it in a wrong folder. Double check your installation. You can follow my Step by Step guide on How to install HTC with STS (link is in 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

I've been unable to find the answer to this. When I use the search feature, I get this error on the advanced search results page:

1064 - You have an error in your SQL syntax near 'distinct p.products_id) as total from products p left join manufacturers m usin' at line 1

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%dress%' or p.products_model like '%dress%' or m.manufacturers_name like '%dress%') )

[TEP STOP]

 

Has anyone else had this problem when using STS?

 

Thanks

Share this post


Link to post
Share on other sites
I've been unable to find the answer to this. When I use the search feature, I get this error on the advanced search results page:
1064 - You have an error in your SQL syntax near 'distinct p.products_id) as total from products p left join manufacturers m usin' at line 1

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%dress%' or p.products_model like '%dress%' or m.manufacturers_name like '%dress%') )

[TEP STOP]

 

Has anyone else had this problem when using STS?

 

Thanks

Debbie, this is not a problem with STS but rather something in your script or the database itself.

Your host may have upgraded MySQL and that could be causing your problem.

 

This thread may be of some use to you:

http://forums.oscommerce.com/index.php?sho...4095&st=160


Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites

Thanks for your reply. We haven't upgraded mySQL. I tried the fix they recommend in the thread, but nothing changed.

 

 

Debbie, this is not a problem with STS but rather something in your script or the database itself.

Your host may have upgraded MySQL and that could be causing your problem.

 

This thread may be of some use to you:

http://forums.oscommerce.com/index.php?sho...4095&st=160

Share this post


Link to post
Share on other sites

I just set up a new store using STS. I am having a problem with my product info template. I have my Click to Enlarge link set up like this:

 

<a href = "java script:popupWindow('http://bellagemmadesigns.com/catalog/popup_image.php?pID=$productid')">Click 
					  to Enlarge</a>

 

However, when the template is parsed, the variable $productid isn't being processed. I have an older store that works with this syntax. Did something change with the newest build of OSC?

 

Thanks for any help.

Share this post


Link to post
Share on other sites
200 , what do you want to change in the content? do you mean products and so forth? if so you will use the admin panel for that, if it is style you want to add then you will use the catalog/stylesheet.

 

I am trying to change the style of the boxes. I don't know any codes, I want to get the corners rounded.

Share this post


Link to post
Share on other sites
I am trying to change the style of the boxes. I don't know any codes, I want to get the corners rounded.

 

Peter, the stylesheet will need to be edited. In osCommerce, the rounded corners are actually images.


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 to all..

 

I installed the STS, but before i was excluded these boxes.. manufactures, search, language and currecies...

 

After the instalattion, these boxes appear again... i tried exclude them without sucesss...

 

Can someone help me to exclude these boxes? And the new catalog menu too...

 

thank you...


OScommerce Rocks!

Share this post


Link to post
Share on other sites

Sucess at last, I have sts templates working for files outside of the catalog folder!!!!!!!!!!!!!!!!!!!!!!!!!!

 

I am attempting to bundle it together with the mega power pack {register globals, sts, htc, dynamenu and stsnewpages} but now have a sticking point on dynamenu working externally. just one character change makes it work but breaks the links to images and href links.

 

give me a shout if your interested in external sts templated pages. and if you want to know why you may want to use this addition, PM me and if requests are good i'll do a write up here.

 

the bundle pack will be along shortly...

 

Matt

Share this post


Link to post
Share on other sites

p.s. update.

 

EVERYTHING IS NOW WORKING FOR THE BUNDLE!

 

BIG SMILES ALL ROUND - 4 weeks of utter confusion but now it works. too tired tonight but will pack it up tomorrow after checking through everything twice.

 

Sigh of relief.

 

good night all

 

matt :D beaming!

Share this post


Link to post
Share on other sites

hI...

 

Im interested because i see that is possible implement diferents pages on product info display...and other resources too...

 

so i will put the codes that i change...

 

column_left.php

 

 

<?php
/*
 $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// START STS 4.1
if ($sts->display_template_output) {
 include DIR_WS_MODULES.'sts_inc/sts_column_left.php';
} else {
//END STS 4.1
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }


  require(DIR_WS_BOXES . 'reviews.php');

 require(DIR_WS_BOXES . 'information.php');
// START STS 4.1
}
// END STS 4.1
?>

 

Column_right.php

/*
 $Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// START STS 4.1
if ($sts->display_template_output) {
 $sts->restart_capture ('content');
} else {
//END STS 4.1


 require(DIR_WS_BOXES . 'shopping_cart.php');

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

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

 if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_session_is_registered('customer_id')) {
  $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
  $check = tep_db_fetch_array($check_query);
  if ($check['count'] > 0) {
	include(DIR_WS_BOXES . 'best_sellers.php');
  } else {
	include(DIR_WS_BOXES . 'product_notifications.php');
  }
} else {
  include(DIR_WS_BOXES . 'product_notifications.php');
}
 } else {
include(DIR_WS_BOXES . 'best_sellers.php');
 }

 if (isset($HTTP_GET_VARS['products_id'])) {
if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
 } else {
include(DIR_WS_BOXES . 'specials.php');
 }



// if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
  // include(DIR_WS_BOXES . 'languages.php');
//include(DIR_WS_BOXES . 'currencies.php');
// }

require(DIR_WS_BOXES . 'whats_new.php');

// START STS 4.1
}
// END STS 4.1
?>

 

 

STS_COLUMN_LEFT.PHP

 

 

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

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

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License

STS v4.3.3 by Rigadin (rigadin@osc-help.net)
Based on: Simple Template System (STS) - Copyright (c) 2004 Brian Gallagher - brian@diamondsea.com
*/

 $sts->restart_capture(); // Clear buffer but do not save it nowhere, no interesting information in buffer.
// Get categories box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');  

// Get manufacturer box from db or cache  
// if ((USE_CACHE == 'true') && empty($SID)) {
//   echo tep_cache_manufacturers_box();
//  } else {
//   include(DIR_WS_BOXES . 'manufacturers.php');
// }
// $sts->restart_capture ('manufacturerbox', 'box');

 require(DIR_WS_BOXES . 'whats_new.php');
 $sts->restart_capture ('whatsnewbox', 'box'); // Get What's new box

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

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

 require(DIR_WS_BOXES . 'shopping_cart.php');
 $sts->restart_capture ('cartbox', 'box'); // Get shopping cart box

//  if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');
 //$sts->restart_capture ('maninfobox', 'box'); // Get manufacturer info box (empty if no product selected)

 if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');
 $sts->restart_capture ('orderhistorybox', 'box'); // Get customer's order history box (empty if visitor not logged)

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

// Get bestseller or product notification box. If you use this, do not use these boxes separately!  
 if (isset($HTTP_GET_VARS['products_id'])) {
include(DIR_WS_BOXES . 'product_notifications.php');
$sts->restart_capture ('notificationbox', 'box'); // Get product notification box

// Get bestseller or product notification box. If you use this, do not use these boxes separately!	
if (tep_session_is_registered('customer_id')) {
  $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
  $check = tep_db_fetch_array($check_query);
  if ($check['count'] > 0) {
	$sts->template['bestsellersbox']=$sts->template['bestsellersbox_only']; // Show bestseller box if customer asked for general notifications
  } else {
	$sts->template['bestsellersbox']=$sts->template['notificationbox']; // Otherwise select notification box
  }
} else {
  $sts->template['bestsellersbox']=$sts->template['notificationbox']; // 
}
 } else {
$sts->template['bestsellersbox']=$sts->template['bestsellersbox_only'];
$sts->template['notificationbox']='';
 }

 include(DIR_WS_BOXES . 'specials.php');
 $sts->restart_capture ('specialbox', 'box'); // Get special box
 $sts->template['specialfriendbox']=$sts->template['specialbox']; // Shows specials or tell a friend

 if (isset($HTTP_GET_VARS['products_id']) && basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) {
include(DIR_WS_BOXES . 'tell_a_friend.php');
$sts->restart_capture ('tellafriendbox', 'box'); // Get tell a friend box
$sts->template['specialfriendbox']=$sts->template['tellafriendbox']; // Shows specials or tell a friend
 } else $sts->template['tellafriendbox']='';


// Get languages and currencies boxes, empty if in checkout procedure  
// if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
//   include(DIR_WS_BOXES . 'languages.php');
  // $sts->restart_capture ('languagebox', 'box');

  // include(DIR_WS_BOXES . 'currencies.php');
 //  $sts->restart_capture ('currenciesbox', 'box');
// } else {
//   $sts->template['languagebox']='';
 //  $sts->template['currenciesbox']='';
// }
 if (basename($PHP_SELF) != FILENAME_PRODUCT_REVIEWS_INFO) {
require(DIR_WS_BOXES . 'reviews.php');
$sts->restart_capture ('reviewsbox', 'box');  // Get the reviews box
 } else {
$sts->template['reviewsbox']='';
 }	
?>

 

 

 

Below the image of the index page...

 

Image

 

 

 

thank you

 

Rafael


OScommerce Rocks!

Share this post


Link to post
Share on other sites
Can someone help me to exclude these boxes? And the new catalog menu too...

 

Hi Rafael

 

I am slightly confused as to why you are going into column_left /right etc to hide boxes etc. there is no need to do this that i can see.

 

your template file is located in:

catalog/includes/sts_templates/full(or test)/

and is called:

sts_template.html // the main one used for all pages if in default mode or

index.php.html // for index if you set this through admin

content/product_info.php_XX.html // for individual product pages content layout, XX is a number relating to the product, i dont know how yet.

and box templates in the boxes folder.

 

all is explained through the sts help manuals and some more tips can be found under the sts power pack contribution window:

http://www.oscommerce.com/community/contributions,4456/

 

to remove any box or content just delete from the template the variable name like $content, $breadcrumbs $newpage | $myaccountlogoff | $cartcontents | $checkout $catmenu$categorybox$manufacturerbox$whatsnewbox$specialbox$searchbox$informationbox

etc.

matt

Share this post


Link to post
Share on other sites

I do the changes editing the file... >> index.php.html

 

Im new with STS, so because this i had difficuld to found the exit...

 

thank's for all

 

Rafael


OScommerce Rocks!

Share this post


Link to post
Share on other sites

hi all,

 

i installed the STS mega power pack and got some problems. the dynamenu doesnt work well and the subcategory appears at the bottom of the page. whats wrong with that? anyone can help? really appreciate it..

 

thanks.

Share this post


Link to post
Share on other sites

http://www.oscommerce.com/community/contributions,5245

 

sts_external_pages_templates is packed and ready for your critissismsss as well as my spelling ;o)

 

what a slog! my fingers are sore.

 

i havent made a straight forward copy over contrib but have expained as much as possible and provided the files etc in respective folders. some files are prefixed with 'updated --- ' so as to not copy over your files but you must must must must must! read the pdf first. not too long at 4/5 pages.

 

my first hack has been a hugely enjoyable one, from first head scratching through butting head against various hardnesses of walls etc to having no fingernails. the idea has finally come to fruit, hope you like it.

 

i will soon add it into a mega-mega-mega bundle but im sure you can play withit yourselves and see what comes off it.

 

spread the love osc'ers

 

Matthew John Ritchie

demo: not ready yet

www.bluegreentechnologies.com

Share this post


Link to post
Share on other sites
hi all,

 

i installed the STS mega power pack and got some problems. the dynamenu doesnt work well and the subcategory appears at the bottom of the page. whats wrong with that? anyone can help? really appreciate it..

 

thanks.

 

geepers!

 

what other contribs do you have? walk us through what you did.

 

did you get the update file too? some code was missing but dynamenu should be fine, itis here but this aint your computer so not too helpfull.

Share this post


Link to post
Share on other sites

I have a fresh install of osCommerce 2.2 ms2 and the newest version of STS 4.5.2 installed. I followed the instructions just as it said. I went into the STS module settings for "Default" and tried to set Use Templates? to true, and it would not let me. It stayed on False. The Index was stuck on True though.

I used the index.php?sts_debug=debug and it said "This is the default template" and all of the information came up to say the template was working.

 

I went back to the STS module and realized that it would not let me change anything for STS settings!

Share this post


Link to post
Share on other sites
I have a fresh install of osCommerce 2.2 ms2 and the newest version of STS 4.5.2 installed. I followed the instructions just as it said. I went into the STS module settings for "Default" and tried to set Use Templates? to true, and it would not let me. It stayed on False. The Index was stuck on True though.

I used the index.php?sts_debug=debug and it said "This is the default template" and all of the information came up to say the template was working.

 

I went back to the STS module and realized that it would not let me change anything for STS settings!

 

Terry,

This is not a STS problem but rather a bug in the latest release of osC.

Here is the fix:

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


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

×