Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 9 votes

[contribution] Simple Template System (sts)


5806 replies to this topic

#81 monstersink

  • Community Member
  • 3 posts
  • Real Name:Mike

Posted 25 September 2003, 01:22

I'm not sure as to why I'm getting this error. Can someone please explain how to fix this?

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /hsphere/local/home/cyberimp/impactapparel.biz/catalog/includes/application_top.php on line 511

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/local/lib/php') in /hsphere/local/home/cyberimp/impactapparel.biz/catalog/includes/application_top.php on line 511


Thanks,
Mike

#82 digitalsky

  • Community Member
  • 5 posts
  • Real Name:David D.

Posted 25 September 2003, 07:29

Quote

I'm not sure as to why I'm getting this error. Can someone please explain how to fix this?

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /hsphere/local/home/cyberimp/impactapparel.biz/catalog/includes/application_top.php on line 511

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/local/lib/php') in /hsphere/local/home/cyberimp/impactapparel.biz/catalog/includes/application_top.php on line 511


Thanks,
Mike

Mike,

I had the same problem with version 1.5, until I realized that I didn't add the neccessary lines to the config.php file (see below). After I added the lines to the config.php file, it worked perfectly. (thanks for the template solution Brian!)

---From version 1.5 readme.txt---

NOTE: configure-SAMPLE.php is included in the ZIP file, but you will have to
reenter all your configuration settings if you use it. It is easier
to just add the following lines to the bottom of your existing
/catalog/includes/configure.php:

// 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_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');
// STS: EOADD

#83 coiL

  • Community Member
  • 23 posts
  • Real Name:bob

Posted 25 September 2003, 10:17

Hi,

I am having great problems trying to modify the 'breadcrumbs' navigation - I have the STS template contrib installed.

Is there a known problem with this? or has anyone had problems with it and know how to fix it? I've been searching the forums and trying different code for hours and I just can't get it to work. :(

#84 coiL

  • Community Member
  • 23 posts
  • Real Name:bob

Posted 25 September 2003, 12:33

I couldn't find the edit button :blink:

Just thought I'd add that when I try to add something to included/header.php (no matter what it is) it does not show up on the page.

I urgently need help with this - if someone could be so kind :(

thanks

#85 coiL

  • Community Member
  • 23 posts
  • Real Name:bob

Posted 25 September 2003, 13:11

ok I should have payed closer attention to the readme
I don't need to edit the header.php file at all!
I knew that!
:o :D

#86 travisb

  • Community Member
  • 143 posts
  • Real Name:Travis B
  • Gender:Male
  • Location:Richmond, VA

Posted 25 September 2003, 15:57

veetkam, on Sep 24 2003, 03:09 PM, said:

I installed Simple Template System and now the <html>, <head>, etc. tags are showing up twice.
. . . . . .
. . . . . .

If you have an old version, install the new one that fixes it. I think this was fixed in v1.3, current version is 1.4.

- Brian

. . . . . .

Actually, I have v1.5 with this problem.




I have the exactly same problem and - on some Pages (on checkout-process) there is an empty line on place for the "stylesheet-line" the result is therefore not "exactly" what i wish to see  :huh:  ( - if i checked it correct, the solution that was mentioned for this in 1.3 is contained in 1.5 - and the problem is still oder again here)


I hope on a hint  for a solution - aehm  - did i mentioned that i find this contribution veeryyy  helpfull (beside this actual problem)  and that i wish to thank for that    ;)
I found a solution that works for me, but if you are using another contrib for the titles, keywords, etc, it may not work

In sts_template.php I have
<html>
<head>
<!--$headcontent-->
</head>
<body>

and in sts_display_output.php I uncommented the stylesheet line and commented out the get_javascript line
 // Load up the <head> content that we need to link up everything correctly
  $template['headcontent'] .= '<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; 
  $template['headcontent'] .= $sts_block['headertags'];
  $template['headcontent'] .= '<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n";
  $template['headcontent'] .= '<link rel="stylesheet" type="text/css" href="stylesheet.css">' . "\n";
//  $template['headcontent'] .= get_javascript($sts_block['applicationtop2header'],'get_javascript(applicationtop2header)');

and I get the following html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>My Title</title><base href="http://www.mysite.com/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body>

HTH

#87 speckados

  • Community Member
  • 27 posts
  • Real Name:Marco A.
  • Location:Madrid

Posted 25 September 2003, 18:21

speckados, on Sep 24 2003, 10:05 PM, said:

Wel. Just installed version 1.5 and get new problems.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/hostin2/public_html/compras/includes/configure.php:54) in /home/hostin2/public_html/compras/includes/functions/sessions.php on line 67

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/hostin2/public_html/compras/includes/configure.php:54) in /home/hostin2/public_html/compras/includes/functions/sessions.php on line 67


I had the same error.  I fixed it by moving the ?>  to the end of the file instead of leaving it before the sts modification.

BeerCan

In what file move ?> on cofigure.php ? I don't understand

#88 MurrayM

  • Community Member
  • 296 posts
  • Real Name:Murray Mintz
  • Location:Santa Monica, California

Posted 25 September 2003, 19:54

I cannot believe how easy it is to make modifictions to the look and feel of OSC using this contribution. Again, thanks to Brian for giving us this jewel. Now all I need is a simple way to modify the look of the boxes and perhaps add a menus. Any suggestions for modifying boxes would be terrific.
best,
Murray

#89 DiamondSea

  • Community Member
  • 267 posts
  • Real Name:Brian Gallagher
  • Location:Baltimore, MD

Posted 25 September 2003, 20:28

travisb, on Sep 25 2003, 10:57 AM, said:

veetkam, on Sep 24 2003, 03:09 PM, said:

I installed Simple Template System and now the <html>, <head>, etc. tags are showing up twice.
. . . . . .
. . . . . .

If you have an old version, install the new one that fixes it. I think this was fixed in v1.3, current version is 1.4.

- Brian

. . . . . .

Actually, I have v1.5 with this problem.




I have the exactly same problem and - on some Pages (on checkout-process) there is an empty line on place for the "stylesheet-line" the result is therefore not "exactly" what i wish to see  :huh:  ( - if i checked it correct, the solution that was mentioned for this in 1.3 is contained in 1.5 - and the problem is still oder again here)


I hope on a hint  for a solution - aehm  - did i mentioned that i find this contribution veeryyy  helpfull (beside this actual problem)  and that i wish to thank for that    ;)
I found a solution that works for me, but if you are using another contrib for the titles, keywords, etc, it may not work

In sts_template.php I have
<html>
<head>
<!--$headcontent-->
</head>
<body>

and in sts_display_output.php I uncommented the stylesheet line and commented out the get_javascript line
 // Load up the <head> content that we need to link up everything correctly
  $template['headcontent'] .= '<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; 
  $template['headcontent'] .= $sts_block['headertags'];
  $template['headcontent'] .= '<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n";
  $template['headcontent'] .= '<link rel="stylesheet" type="text/css" href="stylesheet.css">' . "\n";
//  $template['headcontent'] .= get_javascript($sts_block['applicationtop2header'],'get_javascript(applicationtop2header)');

and I get the following html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>My Title</title><base href="http://www.mysite.com/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body>

HTH
The problem with this 'solution' is that pages that use javascript won't work.

Also, from your code snippets you aren't using the v1.5 code (no stylesheet tag in sts_template.html, and the stylesheet code is not commented out in sts_display_output.php.

I would try updating your files to the latest version of STS (v1.5 at the moment) and see if you still have the problems.

If the latest version doesn't fix it, It could be that my get_javascript() routine isn't working correctly please post a URL for me to look at the source of?

- Brian
Simple Template System (STS)
Layout your site with 1 (or more) HTML file!
Download STS: http://www.oscommerce.com/community/contributions,1524
Support: http://forums.oscommerce.com/index.php?showtopic=58541

#90 DiamondSea

  • Community Member
  • 267 posts
  • Real Name:Brian Gallagher
  • Location:Baltimore, MD

Posted 25 September 2003, 20:37

MurrayM, on Sep 25 2003, 02:54 PM, said:

I cannot believe how easy it is to make modifictions to the look and feel of OSC using this contribution. Again, thanks to Brian for giving us this jewel.  Now all I need is a simple way to modify the look of the boxes and perhaps add a menus. Any suggestions for modifying boxes would be terrific.
best,
Murray
Thanks! I'm glad you like it.

On my site I'm probably not going to use the $categorybox as the primary naviagation on my site. I might have it somewhere on the side, but I'll probably make a graphical menu system (like I put on http://jewelrydays.com [not my site, I just created it] ) as a simpler, more user-friendly navigation system. That's why I added the $urlcat_XXX links in v1.5 so that I could make links from my imagemaps.

Basically, my goal is to get osC to the point where it can do all the things that I've done with custom code before. It's a very powerful foundation, but I need something simple enough for my novice users to use, and the stock osC, um, isn't it. God help me trying to explain to someone how to use the Attributes!

Maybe I'll tackle that next... :)

- Brian

Edited by DiamondSea, 25 September 2003, 20:40.

Simple Template System (STS)
Layout your site with 1 (or more) HTML file!
Download STS: http://www.oscommerce.com/community/contributions,1524
Support: http://forums.oscommerce.com/index.php?showtopic=58541

#91 beercan

  • Community Member
  • 16 posts
  • Real Name:sean

Posted 25 September 2003, 20:37

speckados, on Sep 25 2003, 06:21 PM, said:

speckados, on Sep 24 2003, 10:05 PM, said:

Wel. Just installed version 1.5 and get new problems.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/hostin2/public_html/compras/includes/configure.php:54) in /home/hostin2/public_html/compras/includes/functions/sessions.php on line 67

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/hostin2/public_html/compras/includes/configure.php:54) in /home/hostin2/public_html/compras/includes/functions/sessions.php on line 67


I had the same error.  I fixed it by moving the ?>  to the end of the file instead of leaving it before the sts modification.

BeerCan

In what file move ?> on cofigure.php ? I don't understand
Yes in configure.php Originally I just cut and pasted the modifications to configure.php to the end of the file and I had the same issue as you are having. I then realized I had to move the ?> Now I am no programmer but I beleive that is some kind of end file indicator.

BC

#92 DiamondSea

  • Community Member
  • 267 posts
  • Real Name:Brian Gallagher
  • Location:Baltimore, MD

Posted 25 September 2003, 20:56

[quote name='beercan' date='Sep 25 2003, 03:37 PM'][QUOTE]Yes in configure.php Originally I just cut and pasted the modifications to configure.php to the end of the file and I had the same issue as you are having. I then realized I had to move the ?> Now I am no programmer but I beleive that is some kind of end file indicator.[/QUOTE]

The programming/logic parts of OSC are written in PHP and are stored in what are basically HTML files.

The <? and ?> tags separate the PHP programming code from the HTML display code. If you want it to be a "programming command" as opposed to a "display command" you need the code to be between the <? and ?> tags.

In most of the header files, the entire file is enclosed in the <? and ?> tags, which means that it is all PHP programming code, not HTML display code.

For example, if you have this in a file "demo.php":



It would print out in your browser



That help at all?

- Brian
Simple Template System (STS)
Layout your site with 1 (or more) HTML file!
Download STS: http://www.oscommerce.com/community/contributions,1524
Support: http://forums.oscommerce.com/index.php?showtopic=58541

#93 travisb

  • Community Member
  • 143 posts
  • Real Name:Travis B
  • Gender:Male
  • Location:Richmond, VA

Posted 25 September 2003, 21:13

Quote

The problem with this 'solution' is that pages that use javascript won't work.

Also, from your code snippets you aren't using the v1.5 code (no stylesheet tag in sts_template.html, and the stylesheet code is not commented out in sts_display_output.php.

I would try updating your files to the latest version of STS (v1.5 at the moment) and see if you still have the problems.

If the latest version doesn't fix it, It could be that my get_javascript() routine isn't working correctly please post a URL for me to look at the source of?

- Brian

I am using v1.5, I was showing the changes I made to get it to work for me. You can the output from my stock v1.5 in my first post here: http://forums.oscommerce.com/index.php?sho...ndpost&p=233195

#94 coiL

  • Community Member
  • 23 posts
  • Real Name:bob

Posted 26 September 2003, 14:42

Sorry if I missed this in the instructions somewhere - but is there a way to define extra variables (or whatever you want to call them)?

for example - $myaccount - shows "My Account", can I define one like $myhistory = "My History" ?

#95 speckados

  • Community Member
  • 27 posts
  • Real Name:Marco A.
  • Location:Madrid

Posted 26 September 2003, 15:02

beercan, on Sep 25 2003, 09:37 PM, said:

speckados, on Sep 25 2003, 06:21 PM, said:

speckados, on Sep 24 2003, 10:05 PM, said:

Wel. Just installed version 1.5 and get new problems.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/hostin2/public_html/compras/includes/configure.php:54) in /home/hostin2/public_html/compras/includes/functions/sessions.php on line 67

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/hostin2/public_html/compras/includes/configure.php:54) in /home/hostin2/public_html/compras/includes/functions/sessions.php on line 67


I had the same error.  I fixed it by moving the ?>  to the end of the file instead of leaving it before the sts modification.

BeerCan

In what file move ?> on cofigure.php ? I don't understand
Yes in configure.php Originally I just cut and pasted the modifications to configure.php to the end of the file and I had the same issue as you are having. I then realized I had to move the ?> Now I am no programmer but I beleive that is some kind of end file indicator.

BC
wel this it's my config.php end:
  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
  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_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');
?>

And error show line 51. This it's >?.

I'm looking for a returb carriage or any stupid problem, but all code it's well. All lines end with a CR return.

I'm lost.

Error page

#96 knipper

  • Community Member
  • 130 posts
  • Real Name:Steve

Posted 27 September 2003, 02:47

I am also on a brand new clean install, and the only mod is STS v1.5. I also have the double html and header tags.

Did I miss a solution? I do need Javascript to work as I use javascript rollovers for navigation so commenting out that portion won't be good for me.

Just to be sure I did a second clean install on a different server/domain, and but this time I added WebMakers.com's Header Tag Controller contribution afterwords to see the results...

The first HTML/Header tags include the header tag controller contents,

The second set are normal HTML/Head/ Etc. but not the content in the meta tags.

Granted I have not yet had time to dig through yet.... SO does anyone have a correction? :blink:
Steve K AKA - Knipper -

#97 coiL

  • Community Member
  • 23 posts
  • Real Name:bob

Posted 27 September 2003, 06:44

I have also got a clean install of 1.5 - am not using any titles contributions but am getting the double <html><head> tag problem as described in previous posts.

This is how mine appears
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Shop</title>
<base href="http://www.mydomain.com.au/catalog/">

<!-- start get_javascript(applicationtop2header) //-->
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<title>Shop</title>
<base href="http://www.mydomain.com.au/catalog/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->

<!-- end get_javascript(applicationtop2header) //-

Edited by coiL, 27 September 2003, 06:46.


#98 DiamondSea

  • Community Member
  • 267 posts
  • Real Name:Brian Gallagher
  • Location:Baltimore, MD

Posted 27 September 2003, 11:55

coiL, on Sep 27 2003, 01:44 AM, said:

I have also got a clean install of 1.5 - am not using any titles contributions but am getting the double <html><head> tag problem as described in previous posts.

I just uploaded a new version 1.6 which corrects this problem.

Here's the (stupid) fix for the (stupid) mistake I made in the file:

In sts_display_output.php line 354 in the get_javascript function remove the variable $tmpstr from the returned string.

Replace:
return  "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";
With this:
return  "\n<!-- start $commentlabel //-->\n\n<!-- end $commentlabel //-->\n";
It was a stupid, stupid error. I apologize to everyone for the hassle.

- Brian :wacko:
Simple Template System (STS)
Layout your site with 1 (or more) HTML file!
Download STS: http://www.oscommerce.com/community/contributions,1524
Support: http://forums.oscommerce.com/index.php?showtopic=58541

#99 coiL

  • Community Member
  • 23 posts
  • Real Name:bob

Posted 27 September 2003, 12:27

and if you don't want the comments there at all change it to
  // If empty, return nothing
  if ($tablestart === false) {
 	 return  "\n";
  }


Great fix :D Thanks for working on it.


Is it possible to use php in the sts_template? or does anyone know how I could make it so that the "My Account" etc only displays when the user is logged in?

I don't need to know the code, just where abouts I could edit it.

thanks :)

#100 Mustang302

  • Community Member
  • 59 posts
  • Real Name:Jim

Posted 27 September 2003, 16:00

i just did the _easy_ installation of 1.6, and am getting these error messages.

Warning: main(includes/sts_restart_capture.php): failed to open stream: No such file or directory in /home/jim/public_html/catalog/includes/header.php on line 15

Fatal error: main(): Failed opening required 'includes/sts_restart_capture.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jim/public_html/catalog/includes/header.php on line 15