Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /data/members/free/tripod/uk/j/u/t/jutr/htdocs/catalog/includes/application_top.php on line 511

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/data/apache/php/mmp_lib') in /data/members/free/tripod/uk/j/u/t/jutr/htdocs/catalog/includes/application_top.php on line 511

well what is line 511 asking for??

Share this post


Link to post
Share on other sites
Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /data/members/free/tripod/uk/j/u/t/jutr/htdocs/catalog/includes/application_top.php on line 511

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/data/apache/php/mmp_lib') in /data/members/free/tripod/uk/j/u/t/jutr/htdocs/catalog/includes/application_top.php on line 511

 

All relevant files have been uploaded and the define statements have been added to the configure.php file in the /catalog/includes/ directory.

 

Can anyone help, please?

 

Here's my URL - http://members.lycos.co.uk/jutr/catalog/index.php

 

Thanks in advance,

 

Justin

this is because u didn't change ur configure.php file !

 

u must add this in it :

  // 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

 

good code ;)

Share this post


Link to post
Share on other sites

Thanks for your answers guys, but the STS_START_CAPTURE file has been uploaded and the define statements have been added to the correct configure.php file.

 

I will try a fresh install and see how I get on.

 

Thanks,

 

Justin

Share this post


Link to post
Share on other sites

Hi all...

 

I have read a bunch of the pop-up window fixes and tried them all but my pop ups still dont seem to work on my product page...

 

This is the script that is in the product_info.php

<script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>

and this is the code in my sts_display_output.php

/////////////////////////////////////////  ERROR FIXED by Walo /////////////
// Override if we need to show a pop-up window
$scriptname = $_SERVER['PHP_SELF'];
//$scriptname = getenv('SCRIPT_NAME');
$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);
// If script name contains "popup" then turn off templates and display the normal output
// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly
if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false) {
$display_normal_output = 1;
$display_template_output = 0;
}
/////////////////////////////////////////  ERROR FIXED by Walo /////EOF/////
*/

// Override if we need to show a pop-up window
$scriptname = $_SERVER['PHP_SELF'];
$scriptname = strstr($scriptname, "popup");
$scriptname2 = strstr($scriptname, "info_shopping_cart");
// If script name contains "popup" then turn off templates and display the normal output
// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly
if ($scriptname != false || $scriptname2 != false) {
$display_normal_output = 1;
$display_template_output = 0;
}

here is a product page from my site... You can see for yourself that pop up doesnt work... http://www.ipodxtras.com/catalog/product_i...?products_id=45

Any ideas what is wrong with my script?

Thanks,

Steve

Share this post


Link to post
Share on other sites

The problem that I am having is that $footer is not displaying the footer with the date and "requests since" text. If I hard code

require(DIR_WS_INCLUDES . 'footer.php') into the page then it displays fine.

 

Any help would be greatly appreciated.

 

Thanks,

 

Josh

Share this post


Link to post
Share on other sites

Can anyone help a little problem I have on my STS site almost completed but I have an issue with descriptions on the front page, here is the site:

 

http://www.eurorep.net/retail/

 

What I am having issues with is the descriptions are not matching the model names and images, I have a RAND in the code to chagne the products on the front page but its too random. :unsure:

 

Here is the code for new_products.php I have highlighted the area which I am having problems with.

 

<?php

 

$limit = 20;

 

/*

$Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2003 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- new_products //-->

<?php

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select pd.products_id, pd.products_description, p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_id, pd.products_description, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

echo '

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="greetinguser">

<tr>

<td>

<table width="100%" border="0" cellspacing="3" cellpadding="3">

<tr>

<td>

<table width="100%" border="0" cellspacing="1" cellpadding="1" class="greetinguserwhite">

<tr>

<td><font size="2"><font color="#000000"><center><b>Welcome to Euro Rep Ltd</center></font></b></td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>';

while ($new_products = tep_db_fetch_array($new_products_query)) {

$new_products['products_name'] = tep_get_products_name($new_products['products_id']);

$products_description = $new_products['products_description'];

$description_length = strlen($products_description);

if ($description_length > $limit) {

$products_description = substr($products_description,0,$limit) . "";

}

echo ' <table width="100%" border="0" cellspacing="3" cellpadding="3">

<tr>

<td width="50%" valign="top"><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1" class="greetinguserwhite">

<tr>

<td colspan="2">

 

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="ourtexthere" width="90%"><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></b></td>

<td class="ourtexthere" align="right" width="10%"><font color="red"><b>'.$currencies->display_price($new_products['products_price'],tep_get_tax_rate($new_products['products_tax_class_id'])).'</b></font></td>

</tr>

</table>

 

</td>

</tr>

 

<tr>

<td colspan="2"></td>

</tr>

<tr>

<td class="ourtexthere"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">'. tep_image(DIR_WS_IMAGES . $new_products['products_image'],$new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT). '</a></td>

<td class="ourtexthere">'.$products_description.'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '"><br><font color="red"><b> More..</b></font></a><br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $new_products['products_name'] . TEXT_NOW). '</a></td>

</tr>

<tr>

<td colspan="2">'. tep_draw_separator('pixel_trans.gif', '100%', '10'). '</td>

</tr>

</table></td>'

?>

<?php

$new_products = tep_db_fetch_array($new_products_query);

$new_products['products_name'] = tep_get_products_name($new_products['products_id']);

 

$products_description = $new_products['products_description'];

 

$description_length = strlen($products_description);

 

if ($description_length > $limit) {

$products_description = substr($products_description,0,$limit) . "";

 

}

 

// if(empty($new_products['products_name']))

// {

// exit;

// }else{

if (empty($new_products['products_name'])){

echo ' <td width="50%" valign="top">

<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1">

<tr>

<td colspan="2">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="ourtexthere" width="90%"></td>

<td class="ourtexthere" align="right" width="10%"></td>

</tr>

</table>

</td>

</tr>

<tr>

<td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td>

</tr>

<tr>

<td class="ourtexthere">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td>

<td class="ourtexthere">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td>

</tr>

<tr>

<td colspan="2" align="right">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td>

</tr>

<tr>

<td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td>

</tr>

</table></td>

</tr>

</table>';

}

else{

?>

<?php

echo ' <td width="50%" valign="top"><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1" class="greetinguserwhite">

<tr>

<td colspan="2">

 

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="ourtexthere" width="90%"><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></b></td>

<td class="ourtexthere" align="right" width="10%"><font color="red"><b>'.$currencies->display_price($new_products['products_price'],tep_get_tax_rate($new_products['products_tax_class_id'])).'</b></font></td>

</tr>

</table>

</td>

</tr>

<tr>

<td colspan="2"></td>

</tr>

<tr>

<td class="ourtexthere"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">'. tep_image(DIR_WS_IMAGES . $new_products['products_image'],$new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT). '</a></td>

<td class="ourtexthere">'.$products_description.'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '"><br><font color="red"><b> More..</b></font></a><br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $new_products['products_name'] . TEXT_NOW). '</a></td>

</tr>

 

<tr>

<td colspan="2">'.tep_draw_separator('pixel_trans.gif', '100%', '10').'</td>

</tr>

</table></td>

</tr>

</table>';

}

}

echo '</td>

</tr>

</table>';

?>

<!-- new_products_eof //-->

Edited by j0ker

Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

I added the contrib to my site, which by the way, is amazing. Psyched to get it all set up. Default layout's so boring.

I had a couple questions:

1) can I change the layout of the boxes ($categorybox, etc) So they're horizontal, rather than vertical?

2) Can I change the width of the $content? I'm using tables in my design, and the content's too wide, and gets cut off from where I want it to fit.

3) How can I remove the little corner image from the boxes? ($categorybox, $informationbox, etc)

 

Any help would be appreciated. I'm sure I could figure this out on my own, but I'd rather just ask.

Thanks


What's your TopFive? -

Share this post


Link to post
Share on other sites
I added the contrib to my site, which by the way, is amazing. Psyched to get it all set up. Default layout's so boring.

I had a couple questions:

1) can I change the layout of the boxes ($categorybox, etc) So they're horizontal, rather than vertical?

2) Can I change the width of the $content? I'm using tables in my design, and the content's too wide, and gets cut off from where I want it to fit.

3) How can I remove the little corner image from the boxes? ($categorybox, $informationbox, etc)

 

Any help would be appreciated. I'm sure I could figure this out on my own, but I'd rather just ask.

Thanks

1) don't know

 

2) it's an HTML template file which you can use the normal <table> characteristics on, including width, height, border, cellpadding, etc.

 

3) check each of the catalog/includes/boxes/filename.php and change these lines;

 

new infoBoxHeading($info_box_contents, true, true);

 

to

 

new infoBoxHeading($info_box_contents, false, false);

Share this post


Link to post
Share on other sites
Hi all...

 

I have read a bunch of the pop-up window fixes and tried them all but my pop ups still dont seem to work on my product page...

 

here is a product page from my site... You can see for yourself that pop up doesnt work... http://www.ipodxtras.com/catalog/product_i...?products_id=45

Any ideas what is wrong with my script?

Thanks,

Steve

Try adding the popup code to your sts_template.html file and they should work. I have had the popup problem on a few sites and this fixed it for me.

 

<html>

<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>

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>


The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Share this post


Link to post
Share on other sites
I added the contrib to my site, which by the way, is amazing. Psyched to get it all set up. Default layout's so boring.

I had a couple questions:

1) can I change the layout of the boxes ($categorybox, etc) So they're horizontal, rather than vertical?

2) Can I change the width of the $content? I'm using tables in my design, and the content's too wide, and gets cut off from where I want it to fit.

3) How can I remove the little corner image from the boxes? ($categorybox, $informationbox, etc)

 

Any help would be appreciated. I'm sure I could figure this out on my own, but I'd rather just ask.

Thanks

You can do anything you want with the layout of your template file. In fact in some cases it may well be easier to start from scratch with a brand new html file and just name it sts_template.html to replace the one that comes with the contribution. You can place the $tags anywhere you want in your template that you want them to be.


The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Share this post


Link to post
Share on other sites

I get the following error after installing STS and then the Header Tags Controller contrib..

 

Warning: main(DIR_WS_FUNCTIONSheader_tags.php): failed to open stream: No such file or directory in /home2/hudhud/public_html/clothing/includes/application_top.php on line 14

Fatal error: main(): Failed opening required 'DIR_WS_FUNCTIONSheader_tags.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/hudhud/public_html/clothing/includes/application_top.php on line 14

 

I get this error when I put in the lines as follows from the header tags controller contrib:

// BOF: WebMakers.com Added: Header Tags Controller v1.0
 require(DIR_WS_FUNCTIONS . 'header_tags.php');
// Clean out HTML comments from ALT tags etc.
 require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');
// Also used by: WebMakers.com Added: FREE-CALL FOR PRICE
// EOF: WebMakers.com Added: Header Tags Controller v1.0

 

any ideas?

Share this post


Link to post
Share on other sites

I have a question? I just want to add the header tags to the header of the STS which will show up on all pages. I dont want to install the header tags module. Will this work and will the meta tags (and I know they will be the same ones) show up on all pages in my site?

 

Thanks

Share this post


Link to post
Share on other sites
I have a question? I just want to add the header tags to the header of the STS which will show up on all pages. I dont want to install the header tags module. Will this work and will the meta tags (and I know they will be the same ones) show up on all pages in my site?

 

Thanks

If you just want the same tag on all your pages you should just be able to add it to your sts_template.html file.


The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Share this post


Link to post
Share on other sites
I have a question? I just want to add the header tags to the header of the STS which will show up on all pages. I dont want to install the header tags module. Will this work and will the meta tags (and I know they will be the same ones) show up on all pages in my site?

 

Thanks

If you just want the same tag on all your pages you should just be able to add it to your sts_template.html file.

Thats what I thought just wanted to make sure. I thank you.

Share this post


Link to post
Share on other sites
I have a question? I just want to add the header tags to the header of the STS which will show up on all pages. I dont want to install the header tags module. Will this work and will the meta tags (and I know they will be the same ones) show up on all pages in my site?

 

Thanks

I have been wondering this also...

Share this post


Link to post
Share on other sites
Hi all...

 

I have read a bunch of the pop-up window fixes and tried them all but my pop ups still dont seem to work on my product page...

 

here is a product page from my site... You can see for yourself that pop up doesnt work...  http://www.ipodxtras.com/catalog/product_i...?products_id=45

Any ideas what is wrong with my script?

Thanks,

Steve

Try adding the popup code to your sts_template.html file and they should work. I have had the popup problem on a few sites and this fixed it for me.

 

<html>

<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>

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

Awesome! That worked for the images on the catalog pages...

But now when you try to view the advanced search pop-up, the box is only 100x100... How do you make it its default size?

 

Also, I have a pop up window in my shopping cart box (coupon mode) that wont pop up.... Any ideas?

 

Thanks so much,

Steve

Share this post


Link to post
Share on other sites

For the coupon to work you need to change the same code to (I put this answer in the Gift Voucher thread previously);

 

(url,'couponpopupWindow','toolbar

 

and this bit defines the window size;

 

width=100,height=100

Share this post


Link to post
Share on other sites

Developing a new fascination for the potential of this new sts contrib. Haven't gotten to use it yet, but am very excited.

 

This is my first dabbling with OSC though too, and am unsure of what the minimal page structure would be.

 

My first idea was to just copy my home page along with my four existing product pages as sts_templates folder pages (index.php_0.html for the home page with the current product pg selector nav; and index.php_01_00.html, etc. through index.php_04_00.html for each of the products pages [each of these category pages has multiple products]). I actually did this. Now I was planning to either copy and paste code, or just type it in where I want it on the new template pages, but am not clear about it.

 

Are there additional parameters for coding the products?

Can I add a letter for color or size to help recognize the item just by looking at the code?

Can I use dashes or the like?

If my original layout used submit buttons to add the item to a cart, where is this product code actually generated in osc/sts?

What code would actually be used on the submit button's AREF tag?

If product numbers, submit to cart, and go to cart functions are all that I want right now from the cart program, is this enough for osc?

If product codes are dynamically assigned, can they be locked if products are discontinued, so that item 3 doesn't now become item 2?

 

These may sound like total newbie questions, but I've read through the docs and a lot of the forum and haven't seen these addressed, so maybe someone else will benefit from them too - besides over having a good laugh. :P

 

So thanks for you help.

Share this post


Link to post
Share on other sites

Hi,

 

First let me thank for this great contribution.

 

I have a question:

I'm trying to install the "coolmenu" contribution along with STS, but the menu doesn't work.

Does anyone know how to solve this problem?

THanks,

 

Manuel

Share this post


Link to post
Share on other sites

Oops. Posted this to the general thread...

 

Developing a new fascination for the potential of this new sts contrib. Haven't gotten to use it yet, but am very excited.

 

This is my first dabbling with OSC though too, and am unsure of what the minimal page structure would be.

 

My first idea was to just copy my home page along with my four existing product pages as sts_templates folder pages (index.php_0.html for the home page with the current product pg selector nav; and index.php_01_00.html, etc. through index.php_04_00.html for each of the products pages [each of these category pages has multiple products]). I actually did this. Now I was planning to either copy and paste code, or just type it in where I want it on the new template pages, but am not clear about it.

 

Are there additional parameters for coding the products?

Can I add a letter for color or size to help recognize the item just by looking at the code?

Can I use dashes or the like?

If my original layout used submit buttons to add the item to a cart, where is this product code actually generated in osc/sts?

What code would actually be used on the submit button's AREF tag?

If product numbers, submit to cart, and go to cart functions are all that I want right now from the cart program, is this enough for osc?

If product codes are dynamically assigned, can they be locked if products are discontinued, so that item 3 doesn't now become item 2?

 

These may sound like total newbie questions, but I've read through the docs and a lot of the forum and haven't seen these addressed, so maybe someone else will benefit from them too - besides over having a good laugh. :P

Share this post


Link to post
Share on other sites

just installed sts and dont understand how its supposed to work. if i look at the STS template.htm file it just shows the boxes with the $info in them.

 

http://www.bookwormannex.com/store/include...s_template.html

 

could somebody post or email me an example of the way the html file should be for the layout?

 

is there a guide for this anywhere?

 

info@bookwormannex.com

 

thanks

Share this post


Link to post
Share on other sites

The best place to start is by reading the readme.txt file.

It describes the supported template tags ($info etc.) and where they are used.

what sts does is read the sts_template.html and substitutes the $ tag with data from sts_display_output.php, which in turn is made up of links to tag definitions in other files.

 

A short answer, hope it gets you going

:D

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

×