Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

scottburd,

 

you have to rename the file "configure-SAMPLE.php" to "configure.php" or you just add the code lines from the readme.txt in your existing configure file.

 

mfg, cctop

Share this post


Link to post
Share on other sites

Anyone know why this may happen.

 

Please help. its driving me crazy

 

Adam,

 

 

Mark,

 

Its really weird.

 

if i put back the original sts template

the buy now buttons loads perfectly.

but with my template it doesnt want to load

 

Any ideas why?

 

Adam,

Share this post


Link to post
Share on other sites

First of all, just let me express my graditude I have toward the mastermind who created this.. I almost gave up completely with my little store before I found out I didn't have to edit a trillion pages to change the template thanks to STS. :)

 

I waded through about 30 pages trying to find an answer to my little problem.. but when I discovered there were almost 100 pages, I gave up. So forgive me if it's been done before...

 

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

 

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

 

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

 

I only get this error when I click on a product. The front page, category pages, and everything else works fine.

 

http://parental-advisory.org/shop

 

If anyone could find the time to help I would appreciate it =)

Share this post


Link to post
Share on other sites
Fatal error: main(): Failed opening required 'includes/sts_product_info.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/parenta/public_html/shop/includes/sts_display_output.php on line 132[/b]

 

Forgive me if this sounds stupid, but you have that file in includes, sts_product_info.php?

Share this post


Link to post
Share on other sites

Hey everybody... how would i have different banners on the site? I understand i could duplicate the $banner code, but wouldn't that give me 2 of the same banner ads?

 

Specifically i'm looking to have google adwords on my site...

 

Thanks!

Share this post


Link to post
Share on other sites

Hello all I need sts help after I install the files in pkg/catalog/includes directory and attempt to change the configure file as instructed I cant see any changes taking place. below is my configure file

 

<?php

/*

$Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', ''); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', false); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', '');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '');

define('HTTPS_COOKIE_PATH', '');

define('DIR_WS_HTTP_CATALOG', '');

define('DIR_WS_HTTPS_CATALOG', '');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', ''); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '');

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

// STS: ADD: Define Simple Template System files

define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php');

define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php');

define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php');

define('STS_TEMPLATE_DIR', DIR_WS_INCLUDES . 'sts_templates/');

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html');

define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php');

define('STS_USER_CODE', DIR_WS_INCLUDES . 'sts_user_code.php');

define('STS_PRODUCT_INFO', DIR_WS_INCLUDES . 'sts_product_info.php');

// STS: EOADD

?>

 

 

please advise

Share this post


Link to post
Share on other sites

FYI - for the contribution coders of this mod:

 

The code in sts_display_output.php is not scalable and will bring down a MySQL server if there are a significant number of categories.

 

I would suggest caching the data otherwise those large stores will suffer from ~4 queries per category and incredibly large table scans.

 

Bobby

Share this post


Link to post
Share on other sites
The template files can not contain executable code, as they are simply read into STS, replace all the variables, and then print it out.

 

If you want to add dynamic content, you could put the code in the sts_user_code.php file and assign it to a new (your own creation) template variable name and then put that variable in your template file.

 

This make any sense?

 

  - Brian

 

Reading thru the forum I found this message and it seems important for what I try

(and fail doing so). I am actually looking for a Dynamic horizonal dropdown menu

to put into my STS-template and replace the Categories and Breadcrump navis.

As I didn`t find a DHTML-contrib that seems to go with STS, I tried to incoporate

fw_menu.js into the template and got rid of the idea of getting it "fed" by the

database with nice category/subcategory-data.

Anyway, even that didn`t work. What is amazing is that it seems that javascript code

that is incoporated INTO the template DOES work. The fw_menu.js has external

js-code - so is that the problem? It`s driving me crazy since a week now - any

idea, hint, help, alternate or plain "stop trying, this`ll never work" would come as

a release and be much appriciated.

Thanx,

Ken :'(

Share this post


Link to post
Share on other sites

I just managed to incoporate the fw_menu.js into the sts_template.html. Yeah!

The problem was that the external javascript files were placed wrongly.

For everybody who encounters this problem: those scripsts certainly have to be

put into the root not the includes folder! Now I see my next challenge and another

problem on the horizon:

First the challenge: I`d just love to get the menu filled dynamicly.

How can I draw the catergory and subcategory data into the script?

Then the problem: Let`s forget about the challenge a moment. Wouldn`t I

have to have this javascript be generated instead of it being a fixed item?

I heard about similar problems of session-cookies not getting passed by using

such menus and thus the customer looses his log-in and cart-content and the like.

Do I have to modify here?

Anyway, as an example here is a line from one of the javascripts being used,

this one fills the menu:

fw_menu_1.addMenuItem("Subcategory whatever","location='index.php?cPath=1_6'");

Thanks,

Ken :sweating:

Share this post


Link to post
Share on other sites

I am trying to add an infobox for RSS News by editing column_left.php with this:

 

// STS: ADD

$sts_block_name = 'rssreaderbox';

if (SHOW_RSS_NEWS == 'true')

if (basename($PHP_SELF) != 'rss_reader.php')

include(DIR_WS_BOXES . 'rss_news.php');

 

and then editing the sts_display_output.php with this:

 

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

 

 

The box now takes over the entire top of the page and forces others to the bottom. I then moved the code from column_left.php to column_right.php and it is now at the bottom of the page, but not in a box on the side as I would like. Can anyone advise if my process is wrong and recommend how I can resolve this issue? You can see the site at www.adazonusa.com


Laser labels, barcode labels, custom labels

Share this post


Link to post
Share on other sites

i loaded sts on a test store rather than my funcitioning one so i'm not in a big predicament. however, my shopping ($cartbox) and speacials ($specialfriendbox) are showing up twice on the right column....

again humbly looking for help...:)

Share this post


Link to post
Share on other sites

one small update...

 

when i move the cart and specials to a different column (table) they still remain in the right column...

Share this post


Link to post
Share on other sites

sorry for having to add an additional post but i wanted to provide an example from my test store with the doiuble cart and specials box. (not my actual):

www.badsoup.com/cart

 

the actual is at www.ballparkcardsonline.com... i'm going to implement the template design contrib. into the store once i've perfected it into the test store.

Share this post


Link to post
Share on other sites
Well there's nothing obvious at all. It's just weird because both source codes look exactly the same... I think it's just that this script bit won't properly function in Explorer nor Netscape but it does in Safari or Omniweb:

 

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

document.write('<img src="images/myimage.jpg" border="0" alt="Product 1" title=" Product 1 " width="-1" height="-1" hspace="5" vspace="5">');

//--></script>

 

Any ideas?

:(

 

 

Not sure if you ever got his fixed, but IE reads the 'width=" and 'height=' attributes and screws up the image accordingly. Removing those tags will usually fix the problem.

 

:not_the_usual1


:not_the_usual1

[you decide]

 

-- Trying to figure it out, just like everyone else --

Share this post


Link to post
Share on other sites

Hi,

 

We are currently using AutoTheme (AT-Lite .8)

 

AT-Lite: The free GPL version of the AutoTheme HTML Theme System for osCommerce, MD-Pro, PostNuke, PHP-Nuke, CPG-Nuke and eNvolution.

 

for an osCommerce site at http://johnnyzmodz.com/

 

(This seems to work more like a templating system though ?). The site looks good, however having looked in detail through the osCommerce modifications, I'm concerned at the method/s that were used to do the templating, in that it could impose restrictions to further improving the site, by the addition of osCommerce contributions, or other customisations.

 

Various files in the /includes path have been modified to suit this product, and at least 40 files in the /catalog path have also been modified. Modifying files does not concern me, however, the replacement of standardised osCommerce code and the addition of various functions, further removes this product from the osCommerce standard/model.

 

As stated, my main concern is the ease of which we can add add other osC contribs, or add our own customisation, and I'm concerned that as most contributions I've installed are based on the 'osCommerce model' if you like, that using 'autotheme' may not be a good long term solution where a site has significant customisation.

 

Now to my question, will the STS contribution be able to produce the same layout as displayed on the website at present ? We need to keep the same 'green theme'' with the dark background,etc.

 

We also need to be able to:

 

* Remove or add information boxes easily

* Adding a better navigation bar on the left hand side

* Increase the page width without showing 'gaps' with high resolution

* More buttons that are matched to current images.

* Add a good thumbnail contribution

 

Hopefully someone can advise if the STS contribution will be a suitable replacement.

 

Thanks,

 

Peter

Share this post


Link to post
Share on other sites

Hello,

I downloaded the STS and FTP them to my site (clinic316.com) But unfotunately it still will not work, and its giving me the following error:

1146 - Table 'clinic31_shop.configuration' doesn't exist

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

I made all the modifications stated in the readme.txt. Please help me get this think work.

 

Tony

clinic316.com

Share this post


Link to post
Share on other sites
Im trying to debug a sts problem

 

the site im working on

 

http://www.blackorchiddesigns.ca/catalog/index.php/cPath/23

 

the buy now image doesnt load

 

but if i use the default sts_template.html file

 

the button loads properly

 

can anyone tell me why its not loading with the template file i use now?

 

Sorry i can't help except to say that there's no t in extensions. Cool site though.

Share this post


Link to post
Share on other sites

Hi everybody!

 

Anybody knows how I must to install this contribution: More products page (http://www.oscommerce.com/community/contributions,1732/category,3/search,more+pages/page,2 )

 

 

I have installed STS

 

First I installed More products page and everything was ok ..... But now I installed STS and suddenly I can't see my links (generated for this contribution)

 

I think I need to modify STS_PRODUCT_INFO.PHP but I don't know how

 

Before to install STS

 

I clue this code in product_info.php

 

 

 

<tr>

 

<td class=main>

 

<?

 

$bst=tep_db_query("select products_additional_info_title, products_additional_info_id from products_additional_info where products_id=".$HTTP_GET_VARS['products_id'].' and status=1');

 

$nrw=@mysql_numrows($bst);

 

$j=0;

 

if (($nrw>0))

 

{

 

echo "<center><b>Additional info about this product<br></b><table width=70% border=0 cellpadding=2 cellspacing=4><tr>";

 

for ($i=0;$i<$nrw;$i++)

 

{

 

echo '<td align=center class=main width=20%><a href="java script:MM_openBrWindow(\''.HTTP_SERVER.DIR_WS_CATALOG.'additional_info_popup.php?pAID='.@mysql_result($bst,$i,"products_additional_info_id").'\')">'.@mysql_result($bst, $i, "products_additional_info_title").'</a></td>';

 

$j++;

 

if (($j==5))

 

{

 

$j=0;

 

echo "</tr></table><table width=70% border=0 cellpadding=2 cellspacing=4><tr>";

 

}

 

}

 

echo "</table>";

 

}

 

?>

 

</td>

 

</td>

 

 

Please help me... What I need to change :'(

Share this post


Link to post
Share on other sites

what am I doing wrong here? can someone please help me setting this up correctly?

 

I just finished installing STS 2.00 and now I`m getting these errors when calling index.php

 

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /www/htdocs/v142832/catalog/includes/application_top.php on line 514

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /www/htdocs/v142832/catalog/includes/application_top.php on line 514

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:..') in /www/htdocs/v142832/catalog/includes/application_top.php on line 514

 

 

Where is the problem here? I`m a newbie with .php as well as OSC...

 

sts_start_capture.php is in the right folder and every needed file is modified.

I followed all the steps in the readme!

Is it the inlcude path '.:..' in the fatal error I`m getting? If yes, where do I change the include_path?

 

I didn`t use a clean install of OSC to install STS but I didn`t see a problem using on the already altered OSC version.

 

Thanks in advance, any help is appreciated!!

Share this post


Link to post
Share on other sites
Not sure if you ever got his fixed, but IE reads the 'width=" and 'height=' attributes and screws up the image accordingly. Removing those tags will usually fix the problem.

 

:not_the_usual1

 

Hey someone to the rescue!!!

No... I never got that fixed, so this is just what I'm going to try. Thanks a lot for your answer brett!!!

;)

Share this post


Link to post
Share on other sites

Now I need urgent help!

 

I have a different Main page for my catalog inside the sts_templates folder named index.php_0.html but it only shows the format of the sts_template.html.

I have deleted the index.php_0.html just to try if it still shows and it does. Anyone knows what can I do to have my main page back?

:'(

Share this post


Link to post
Share on other sites

Double check. Is your index template in the includes/sts_templates folder?

 

Now I need urgent help!

 

I have a different Main page for my catalog inside the sts_templates folder named index.php_0.html but it only shows the format of the sts_template.html.

I have deleted the index.php_0.html just to try if it still shows and it does. Anyone knows what can I do to have my main page back?

:'(

Edited by charmdiva

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

×