Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

First of all, congratulations to the developer of STS contribution.

I've just installed successfully the STS 1.8 contribution but I've found a little bug. When I install some contribution in DHTML or JAVASCRIPT, I've no results, simply the contribution will not appear. Please try to install, for example this ... http://www.oscommerce.com/community/contributions,1494

Someone have a solution for this problem?

Thanks to all.

Share this post


Link to post
Share on other sites

Hi,

This question has been asked a couple of time and i'm just repeating it again.

 

"When you click at Tell a frien link, it adds the produc to the shopping cart". I've checked the "SevenD" demo and this problem is there as well.

 

Is there any way to fix it?

Share this post


Link to post
Share on other sites

Alright, I have been reading through this in an attempt to solve my problem, but to no avail. So, I will post it. I know this bears some resemblance to a previously mentioned variable problem; however, when I tried all the fixes suggested by that, nothing worked. Here is the error message I get:

 

Warning: main(includes/filenames.php): failed to open stream: No such file or directory in /home/opulent/public_html/store/includes/application_top.php on line 53

Fatal error: main(): Failed opening required 'includes/filenames.php' (include_path='.:..:/usr/local/lib/php:/var/www/htdocs') in /home/opulent/public_html/store/includes/application_top.php on line 53

 

Do I need to set certain permissions maybe? I uploaded all of the files in the right places, and edited the configure.php file. Anyone know what's wrong? Any help would be greatly appreciated.

 

Thanks!

Share this post


Link to post
Share on other sites

I posted an update to the Purchase Without Account (PWA) contrib last night that fixes a compatibility issue with Simple Template System (STS).

Available here:

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

 

Before, if you tried to use PWA with STS installed, you would get a blank page when trying to pay without account.

 

To upgrade to this version, open Order_Info.php and replace this:

<!-- body_text_eof //-->
</tr>

<!-- body_eof //-->

 

with this:

<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->

 

This download includes the updated Order_Info.php.

 

-Graham

Share this post


Link to post
Share on other sites

sorry to kinda cross post... but could you answer my problems here? (and post back here)

 

I'm not quite sure if it is related to sts...

 

thanks :)

 

link to thread


Ian Harvie

Share this post


Link to post
Share on other sites

Hello, I installed STS and i've been messing around with my infoboxes. I noticed in search infobox if i mess with this code in ../includes/boxes/search.php

 

  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
                              'align' => 'center',
                              'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

 new infoBox($info_box_contents);

... my add to cart button will go directly to the signup/signin page. Does anyone know what's going on?

 

peace

sean

Share this post


Link to post
Share on other sites
When I install some contribution in DHTML or JAVASCRIPT, I've no results, simply the contribution will not appear. Please try to install, for example this ... http://www.oscommerce.com/community/contributions,1494

Someone have a solution for this problem?

Yea I tried the DHTML/Coolmenu and got nowhere. I can't remember why...sorry, but it was probably me not being able to track down the errors. Then I tried the DHTML menu on it's own and it works fine. Have a look at my testing site:

http://sirius.mgs.vic.edu.au/~rag/catalog

 

Just make sure to add the javascript into the <head> of your includes/sts_template.html file.

 

Cheers and good luck,

Rob

Share this post


Link to post
Share on other sites

ok so I wont try and disrupt threads...

 

the problem is... that even since I transferred from 4development.com to gymwear.org as the production name... my cat links on the main page and the manufacturers box still points to 4dev rather than the gymwear domain... can anyone help me 'refresh' this? I think it has to do with sts_templates but not sure :(

 

gymwear.org

Edited by Nossie

Ian Harvie

Share this post


Link to post
Share on other sites

this is where the code says it is going, . . .

 

<tr>

<td class="boxText"><form name="manufacturers" action="http://4development.com/store/index.php" method="get"><select name="manufacturers_id" onChange="this.form.submit();" size="1" style="width: 100%"><option value="" SELECTED>Please Select</option><option value="19">AST Sports Scie..</option><option value="18">Biotest</option><option value="14">Chem Nutrition</option><option value="10">Crazee Wear</option><option value="12">Extreme Nutriti..</option><option value="13">Muscletech</option><option value="11">Powerhouse</option><option value="15">Pro-Lab</option><option value="16">Stacker 2</option><option value="17">Xenadrine</option></select></form></td>

</tr>

 

 

search all your source code for 4development and you should find it.


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
Share on other sites

yeah but it must be a variable somewhere surely ? so would that not make it in a config file or the database? :-|


Ian Harvie

Share this post


Link to post
Share on other sites

I downloaded the store files using my slowdem and did a search in dw for 4development.com and 4development...

 

nothing found for 4development.com

and nothing relevant for 4development

 

I also did a search in phpmyadmin for the two keyphrases and found e-mail addresses at best...

 

so I'm still at a loss sadly :(

 

cheers !


Ian Harvie

Share this post


Link to post
Share on other sites
In all .php who are to display without STS - somwhere in the beginning of the codepart

 

Insert the following line(s)

 

// ****** flag to prevent STS template-system

$notemplate = "YES";

// ****** end

 

Perhaps this may help others who have similar problems. There are for sure more clever solutions possible, but for this "payment-problem" it was helpfull.

 

 

regarding the post about worldpay and sts templates... could someone point me in the direction of the files that are to display without sts ? :blink: :unsure:

 

This is really killing me here man.... one problem after another :( :huh:

 

 

cheers in advance...


Ian Harvie

Share this post


Link to post
Share on other sites

Having a hell of a time here.

 

I've just stumbled on STS and installed it and am learning the ropes - slow and sure.

 

the problem I have is that I have also the requirement to have french language pac installed.

 

Now When I click the french flag I get what would appear (to my untrained eye) to be the french version of the install page for osc.

 

The english works great - my text shows up no problem!

 

ALSO the layout of the page in french is ok - thats been picked up thru sts its just the text that's not translating

 

Any thoughts? help etc? Ive looked thru the support for the language pack but cant find anything..

 

TIA

Share this post


Link to post
Share on other sites

I'm missing something here.

 

I just downloaded the STS 1.8 and followed the directions as far as which files to replace. In the HOW TO USE is said just edit the sts_tempalte.html file.

 

My question is, what about the index.php file in the /catalog folder? Does the sts_template.html replace this?

 

Do I replace the index.php file with sts_template.html and change the file extension?

 

It seems that the HOW TO USE isn't complete. or maybe it is just me.

Share this post


Link to post
Share on other sites

On my home system, where I am starting to use OSC, I am getting this error.

 

Warning: main(includes/sts_restart_capture.php): failed to open stream: No such file or directory in c:\program files\apache group\apache\htdocs\catalog\includes\header.php on line 15

 

Fatal error: main(): Failed opening required 'includes/sts_restart_capture.php' (include_path='.;c:\php4\pear') in c:\program files\apache group\apache\htdocs\catalog\includes\header.php on line 15

Share this post


Link to post
Share on other sites

Hi.

 

This has been asked, but i will ask again hoping someone hear.

 

 

When we click tell a friend about a product, it will automaticly add that product to my cart. Before STS instalation, it was all fine.

 

 

Does somebody know what is going on?

 

 

Thank you people.

 

 

Bruno Marto

Share this post


Link to post
Share on other sites

Yet about tell a friend.

 

For all you guys experiencing problems with tell a friend: would you please see if the problem remains when the product you want to tell a friend have a review?

 

I was testing it and i added reviews to products. Then i went to tell a friend about the products i added reviews, and i did not had any problems.

For example, the only product that has review in the standart database is "there's something about mary".

Go and test that one.

 

For the developer of this contibution (or someone who know more about php than i): would you please look at this?

 

 

 

Thank you in advance people.

Share this post


Link to post
Share on other sites
I'm missing something here.

 

I just downloaded the STS 1.8 and followed the directions as far as which files to replace. In the HOW TO USE is said just edit the sts_tempalte.html file.

 

My question is, what about the index.php file in the /catalog folder? Does the sts_template.html replace this?

 

Do I replace the index.php file with sts_template.html and change the file extension?

 

It seems that the HOW TO USE isn't complete. or maybe it is just me.

No, you don't have to modify the index.html file. Just change the layout of the template file, sts_template.html and STS will manage the rest.

 

Note that STS is a layout tool, not a change-the-content tool. It is used to change the overall look of an OSC site, not change the contents of the pages it displays in the "content" section.

 

- 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

Share this post


Link to post
Share on other sites
If this has been covered previously my sincere apologies.

 

STS seems to be working well; however, I've discovered that the "more info" link used to explain the differences between visitor's and member's carts that is located on the initial checkout page comes in using my STS format in partial form with the standard text completely missing. There are no error messages.

 

This problem can be seen at sunsetgifts.com. I've also noticed what is apparently an identical situation at shorebreakonline.com/catalog, a store discussed within this thread several days ago. Since this is the only STS site I've looked at other than my own regarding these symptoms, the problem may well be widespread.

 

In viewing other sites not using STS, I've noticed that the resultant page is normally devoid of standard Oscommerce formatting and usually displays as simple text on a bare background.

 

I've no idea whether this problem is related to this contribution; but, I thought I'd seek help here first. Any assistance greatly appreciated.

 

Allen

Hi,

 

I fixed this problem awhile ago. In sts_display_output.php, there's a chunk of code that checks for popup windows, and if it is a popup window, it disables the template system for it. I had to add to the if...then to check for the info_shopping_cart popup as well.

 

I'm currently looking into the "tell a friend" problem. Anyone have a clue with this one?

 

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

Share this post


Link to post
Share on other sites
Hi.

 

This has been asked, but i will ask again hoping someone hear.

 

 

When we click tell a friend about a product, it will automaticly add that product to my cart. Before STS instalation, it was all fine.

 

 

Does somebody know what is going on?

 

 

Thank you people.

 

 

Bruno Marto

Hi,

 

I've been looking at this all day and have tracked the problem down to product_info.php and sts_display_output.php. It seems that sts_display_output.php is stripping out the </form> (and probably more tags) from $content that should be at the end of the main content page. Since the </form> isn't there, and the next <form> is Tell_a_friend, what actually happens when you click the email-icon on Tell_a_Friend is that it kicks off product_info.php instead of tell_a_friend.php.

 

To prove this for yourself: Do a "view source" at the page where the Tell_a_friend box is visable. If you do a search for "form" you'll see that there is no matching </form> for the "<form name="cart_quantity" action="http://localhost/catalog/product_info.php" line.

 

Looks like strip_content_tags() is a little buggy.

 

I'm looking into a fix... but it would be nice if the author would find the fix as I'm not yet totally familar with the code...

 

 

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

</td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Share this post


Link to post
Share on other sites
Hi.

 

This has been asked, but i will ask again hoping someone hear.

 

 

When we click tell a friend about a product, it will automaticly add that product to my cart. Before STS instalation, it was all fine.

 

 

Does somebody know what is going on?

 

 

Thank you people.

 

 

Bruno Marto

Hi,

 

I've been looking at this all day and have tracked the problem down to product_info.php and sts_display_output.php. It seems that sts_display_output.php is stripping out the </form> (and probably more tags) from $content that should be at the end of the main content page. Since the </form> isn't there, and the next <form> is Tell_a_friend, what actually happens when you click the email-icon on Tell_a_Friend is that it kicks off product_info.php instead of tell_a_friend.php.

 

To prove this for yourself: Do a "view source" at the page where the Tell_a_friend box is visable. If you do a search for "form" you'll see that there is no matching </form> for the "<form name="cart_quantity" action="http://localhost/catalog/product_info.php" line.

 

Looks like strip_content_tags() is a little buggy.

 

I'm looking into a fix... but it would be nice if the author would find the fix as I'm not yet totally familar with the code...

 

 

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

</td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Okay, I found the problem and a fix. The problem is in the strip_content_tags() function in sts_display_output.php.

 

The problem was that when the code was removing the "</td></tr>" at the end of the tableBox output, it didn't make allowances if a "<form>" tag came before a "<table>" tag.

 

The following is the original function and following that is my fix (changes highlighted in bold):

 

 

ORIGINAL:

 

// STRIP_CONTENT_TAGS() - Remove text before "body_text" and after "body_text_eof"

function strip_content_tags($tmpstr, $commentlabel) {

// Now lets remove the <tr><td> that the require puts in front of the tableBox

$tablestart = strpos($tmpstr, "<table");

$formstart = strpos($tmpstr, "<form");

 

// If there is a <form> tag before the <table> tag, keep it

if ($formstart !== false and $formstart < $tablestart) {

$tablestart = $formstart;

}

 

// If empty, return nothing

if ($tablestart < 1) {

return "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";

}

 

$tmpstr = substr($tmpstr, $tablestart); // strip off stuff before <table>

 

// Now lets remove the </td></tr> at the end of the tableBox output

// strrpos only works for chars, not strings, so we'll cheat and reverse the string and then use strpos

$tmpstr = strrev($tmpstr);

 

$tableend = strpos($tmpstr, strrev("</table>"), 1);

$tmpstr = substr($tmpstr, $tableend); // strip off stuff after <!-- body_text_eof //-->

 

// Now let's un-reverse it

$tmpstr = strrev($tmpstr);

 

// print "<hr>After cleaning tmpstr:" . strlen($tmpstr) . ": FULL=[". htmlspecialchars($tmpstr) . "]<hr>\n";

return "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";

}

 

 

FIXED VERSION:

 

// STRIP_CONTENT_TAGS() - Remove text before "body_text" and after "body_text_eof"

function strip_content_tags($tmpstr, $commentlabel) {

// Now lets remove the <tr><td> that the require puts in front of the tableBox

$tablestart = strpos($tmpstr, "<table");

$formstart = strpos($tmpstr, "<form");

 

// If there is a <form> tag before the <table> tag, keep it

if ($formstart !== false and $formstart < $tablestart) {

$tablestart = $formstart;

$formfirst = true; }

 

// If empty, return nothing

if ($tablestart < 1) {

return "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";

}

 

$tmpstr = substr($tmpstr, $tablestart); // strip off stuff before <table>

 

// Now lets remove the </td></tr> at the end of the tableBox output

// strrpos only works for chars, not strings, so we'll cheat and reverse the string and then use strpos

$tmpstr = strrev($tmpstr);

 

if ($formfirst == true) {

$tableend = strpos($tmpstr, strrev("</form>"), 1);

}

else {

$tableend = strpos($tmpstr, strrev("</table>"), 1);

}

$tmpstr = substr($tmpstr, $tableend); // strip off stuff after <!-- body_text_eof //-->

 

// Now let's un-reverse it

$tmpstr = strrev($tmpstr);

 

// print "<hr>After cleaning tmpstr:" . strlen($tmpstr) . ": FULL=[". htmlspecialchars($tmpstr) . "]<hr>\n";

return "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";

}

Share this post


Link to post
Share on other sites

Fatal error: Failed opening required 'STS_START_CAPTURE' (include_path='./:/usr/local/lib/php') in /home/music/musicplace-www/includes/application_top.php on line 586

 

I have had my MS2 site with STS1.8 working BEAUTIFULLY on BOTH my WIN XP development laptop and my remote testing server uploading through a very fast cable connection.

 

I've made a .tgz of my site (from WIN XP laptop using Powerzip) and uploaded it to my commercial server (linux redhat) through a dialup. I get the above error. I can't work it out!

 

The error is here -> http://www.musicplace.com.au/index_new.php

 

Any help would be GREATLY appreciated as I am now 1 week behind schedule.

 

Many thanks,

Rob

Share this post


Link to post
Share on other sites

dumb dumb dumb!!! Being lazy or more to the point worried that I would not get the configure.php configured properly on the remote server, I uploaded my site then went to catalog/install/index.php to get the script to write the configure file. Normally this would be fine BUT, STS hacks the configure.php file and the script writes a whole new configure.php file sooo.... that's why the following error:

Fatal error: Failed opening required 'STS_START_CAPTURE' (include_path='./:/usr/local/lib/php') in /home/music/musicplace-www/includes/application_top.php on line 586

 

Too easy!

 

Now I can rest and have a merry christmas waiting for Santa. Maybe he'll bring me something to keep the wolf away from the door!

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

×