Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Please disregard - my error.

 

I just did a fresh OSC install using fantastico. I then installed STS Power Pack, and everything was workign just fine. The store loaded and that was fine.

 

I went back to the store a few minutes later and now it says:

 

Warning: require(includes/classes/sts.php) [function.require]: failed to open stream: No such file or directory in /home/chineseh/public_html/includes/application_top.php on line 499

Warning: require(includes/classes/sts.php) [function.require]: failed to open stream: No such file or directory in /home/chineseh/public_html/includes/application_top.php on line 499

Fatal error: require() [function.require]: Failed opening required 'includes/classes/sts.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/chineseh/public_html/includes/application_top.php on line 499

 

Any ideas?

Share this post


Link to post
Share on other sites
That would also depend on what other contributions you have installed on your shop. If this is a stock osC shop, then the modules/product_listing.php file would be what I think you would be interested in.

 

Thanks, i just tried simply commenting out

 

case 'PRODUCT_LIST_IMAGE':

$lc_align = 'center';

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';

}

break;

 

however if you look at www.wstech.com.au/catalog then you will notice that for whatever reason it has replaced the product images with the buy now button oO.... any clues?

Share this post


Link to post
Share on other sites
Can anyone tell me where or how I can add some HTML code to the $footer_text area.

 

I think the easiest way to do this would be to create a footer.php.html template and then add a PHP include in each template page that you wish to use this footer template in.

 

TIP: I have created a step by step to do the above and have made it available in the STS Power Pack download site (link 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
In addition i can't fiqure out using the AJAX stuff how to hide the content again?
Kyle, sorry but that is past the scope of this forum thread. Not that I am trying to keep some bit of knowledge away from you but it would take a lot of text to try to guide you step by step on how to use Ajax with osCommerce. I was hoping the link that I posted previously would guide you in the right direction. :thumbsup:

 

I am currently working on a project that has a category menu listing some of the categories on the main page with a link to the remaining categories. Since I do not want the entire page to refresh when the user clicks that link, I will be implementing the Ajax approach that was detailed in that tutorial that I posted for you. I will jot down my notes as I do this and will post back the results once completed. However, that part of the job is down the road so I can't make any promises that it will be done real soon. :-


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 think the easiest way to do this would be to create a footer.php.html template and then add a PHP include in each template page that you wish to use this footer template in.

 

TIP: I have created a step by step to do the above and have made it available in the STS Power Pack download site (link in my signature below).

 

Bill - thank you very much this is exactly wht I needed.

Share this post


Link to post
Share on other sites
2. what does sts detect in files when capture() is run to populate the $content in the template page? can this be emulated in other files.

 

I would like to provide this here for reference:

 

when the sts start capture function is run/called, the content information in a file such as index.php is saved into memory as a string.

the content information that is required is found between the "body_text" and "body_text_eof" comment tags.

therefore for sts to work, all the information before "body_text" and after "body_text_eof" is stripped away leaving only the information required.

 

the function that does this is called: // STRIP_CONTENT_TAGS(): function sts_strip_content_tags() and is found in includes/functions/sts.php

 

why do i want to know this? - any new page added to osc and used by sts to share a template [say sharing default across the whole site including files outside of osc catalog folder] must have the content start with <!-- body_text //--> and end with <!-- body_eof //-->

 

i will be testing newpages added outside of the osc catalog folder, and files located in other folders steming of off the site root.

i expect there to be a way of pointing to these external files and having their content captured in the same way as osc files.

 

because i do not yet have any files outside of osc of any significant value i am attempting to share the one sts template file across many 'donor' files so that later down the line when i have other folders and files i will not need to change each and every individual file or included header when a site style is changed. stylesheet.css is fine for the colours etc (im not expert at css yet) and will still be used.

 

Im not quite sure where this will lead but hopefully it will eventualy have value.

 

thanks

matt.

Share this post


Link to post
Share on other sites

just had a brain wave:

 

ws75.JPG

 

full size: http://www.bluegreentechnologies.com/ws.JPG

 

what i have been attempting to do above is to input additional information about products say in how to or diy worksheets into the osc shop framework.

ideally i would like a second dynamenu menu hovering over the top of the breadcrum trail as seen in the picture, but this would not be linked to the products directly as in the catagory listings. the horizontal menu would cover the topic areas but not the porducts.

 

the way i was attempting above was to link to external files and build the osc components arround the content through using the one sts default template for all pages, but the brain wave is to:

 

(1) point to one new page and have it load information like index depending on the 'catagory'/howto topic clicked.

 

(2) the easiest way to do this i can now see is to have this information loaded through a new BOX just like how dynamenu works, that replaces

the 'new products for janurary' etc.

 

(3) however as said above, i want the information fed from outside of the catalog directory instead of includes/boxes. the reason being that

includes/boxes is embedded in osc and not eassily accessible from root and for sepparation of topics with folders outside of osc.

 

im thinking this is much easier than the route above, any tips on pointing to folders outside of osc via sts & boxes type input would be highly appreciated. I hope repayment though a package download for everyone would be sufficient.

 

matt... cheers folks...

Share this post


Link to post
Share on other sites
James, have you created the box in the sts_user_code.php file so that you will have a STS tag for your custom login box? You will not want to insert the box PHP code directly in your HTML template. You should insert it in the sts_user_code.php file instead and then use a STS tag in your template where you want the box to appear.

 

 

I am trying to get the Extra Pages contribution to work. http://doowopden.com/shop

I have it working with STS by adding

require(DIR_WS_BOXES . 'extra_info_pages.php');

into the column_left.php in /httpdocs/shop/includes/modules/sts_inc/ but when I start to import products the content part of the page shifts down. I read in the manual about adding the box to the sts_user_code.php but cannot figure out what to copy or what to add. Can you give me a clue? Thanks

 

Cindy

Share this post


Link to post
Share on other sites
Have you tried turning STS off to see if your STS-disabled shop still has the same issues in IE? Also, if this is related to STS, it would have to do with either your stylesheet settings or the HTML table tags in your template that is causing the problem. Try your site without a link to your external stylesheet as well as commented out all inline styles to help troubleshoot.

 

thanks so much! ill give it a try.

Share this post


Link to post
Share on other sites

Admin will not show up AT ALL when I try to install STS over a clean install of OSC. My host, ixwebhosting.com, makes the admin of OSC go into the root of the webpage. Is this a common error? Are they setting up OSC incorrectly? I tried moving things around manually before configuring and it would just move everything back to how it was. "/catalog" and "/admin" in the same root dir. Please help I'm starting over and I just need to get STS in there so I can start designing my webpage around OSC.

Share this post


Link to post
Share on other sites
Admin will not show up AT ALL when I try to install STS over a clean install of OSC. My host, ixwebhosting.com, makes the admin of OSC go into the root of the webpage. Is this a common error? Are they setting up OSC incorrectly? I tried moving things around manually before configuring and it would just move everything back to how it was. "/catalog" and "/admin" in the same root dir. Please help I'm starting over and I just need to get STS in there so I can start designing my webpage around OSC.

 

this may not work... but worth a try...

 

try copying the admin folder into your catalog directory.

 

******* before doing the below stuff, backup the files mentioned i.e. make a copy in the same folder will do - this will help backtracking through the below instructions if it doesnt work.

******* also wait a couple of days - you may get a better solution from another member with better knowledge than myself ;o).

 

then you will need to edit admin/includes/configure.php to reflect where admin is now located

 

use the admin tools to open configure.php

 

and find something like this:

 

define('DIR_WS_ADMIN', '/admin/'); // absolute path required

define('DIR_FS_ADMIN', 'C:/Program Files/Apache Group/Apache2/htdocs/admin/'); // absolute pate required

 

and add '/catalog/' in the right places, something like this:

 

define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required

define('DIR_FS_ADMIN', 'C:/Program Files/Apache Group/Apache2/htdocs/catalog/admin/'); // absolute pate required

 

if your host is running linux the paths will be slightly different. something like home/yourname/public_html/

 

fingers crossed

 

p.s. your host has put the admin folder outside of the catalog folder to make it harder for crackers (black hat 'hackers') to find and do damage to your site. It is a usefull adaption!

Share this post


Link to post
Share on other sites
Admin will not show up AT ALL when I try to install STS over a clean install of OSC. My host, ixwebhosting.com, makes the admin of OSC go into the root of the webpage. Is this a common error? Are they setting up OSC incorrectly? I tried moving things around manually before configuring and it would just move everything back to how it was. "/catalog" and "/admin" in the same root dir. Please help I'm starting over and I just need to get STS in there so I can start designing my webpage around OSC.

Eddie, some hosts just will not leave well enough alone! :blink:

  1. First of all, it might be worth your while to download the original osCommerce version 060817 and compare it with your current setup to make sure you have the most recent security fixes.
  2. Second, now that you have a copy of a stock osC, compare the catalog files with the files located in your root directory. What you are checking here is that your host may have just simply installed ALL of osC into your root directory and the "catalog" folder is not used. If this is the case, then follow the STS installation instructions for an osC shop in the root directory.
  3. Third, some hosts think it is better to separate the admin folder from the rest of the catalog files for security purposes. This is not necessary but some still do it. If this is the case in your scenario, just make all of the admin modifications to the files in your admin folder (meaning "admin/" and "admin/includes/" in the root or wherever it may be) and then make the catalog edits (meaning "includes/") in the catalog folder wherever or whatever that may be. NOTE: It does not have to be named "catalog". It could be named "myshop" or "eshop" or whatever.

Hope this helps clarify things for you...I feel your pain. :'(


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

Hey,

 

(Sorry for my worse English)

 

At first this is a great Template System and it was , until now, very easy to use.

 

Now i have a problem. I configured my Template, but when the login form is used the default Template is shown again. I don't know how to correct this.

 

The Main Page

 

The Login

 

It would be very nice if anyone could help me.

 

Greetings, Cygn

Share this post


Link to post
Share on other sites
Hey,

 

(Sorry for my worse English)

 

At first this is a great Template System and it was , until now, very easy to use.

 

Now i have a problem. I configured my Template, but when the login form is used the default Template is shown again. I don't know how to correct this.

 

The Main Page

 

The Login

 

It would be very nice if anyone could help me.

 

Greetings, Cygn

 

An Addition:

 

Whenever the index page is left the default template is used

Share this post


Link to post
Share on other sites
An Addition:

 

Whenever the index page is left the default template is used

What version of STS are you using? If this is version 4.5.2 (the most current version), then you appear to be missing some files from the contribution. Try reinstalling STS again.


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

Just wondering why i'm not able to click add to cart and view pictures?

 

I solved this before, i think it involved adding some javascript or something similar somewhere, just can't for the life of me remember where!

Share this post


Link to post
Share on other sites
What version of STS are you using? If this is version 4.5.2 (the most current version), then you appear to be missing some files from the contribution. Try reinstalling STS again.

 

 

I am using the newest STS version (4.5.2) and i reinstalled it (uploaded the files again) this is a clean osCommerce Install no other Add-Ons.

Share this post


Link to post
Share on other sites

I am moving a old Oscommerce setup to a new server.. It uses Oscom ver 2.2 ms 2 and STS-2_01

Everything works fine with the shop when I am testing, except that custom templates will not show up when I move around the catalog. If I try a "index?cPath=**" page that has a custom template attached to it...it will only use the default index.php_0.html and not the appropriate index.php_**.html template. BTW I can see the STS debug info (after changing $display_debugging_output in sts_display_output.php) and I am not getting any error messages from oscom.

 

I did have to add a .htaccess file in my catalog directory containing "php_flag register_globals on". I know I had to add it due to a PHP version change on the new server (from 4 to 5). Could the php version change be the problem? I would rather not downgrade to PHP version 4 or upgrade the sts/oscom code but any suggestions would be seriously appreciated :)

Share this post


Link to post
Share on other sites
I am moving a old Oscommerce setup to a new server.. It uses Oscom ver 2.2 ms 2 and STS-2_01

Everything works fine with the shop when I am testing, except that custom templates will not show up when I move around the catalog. If I try a "index?cPath=**" page that has a custom template attached to it...it will only use the default index.php_0.html and not the appropriate index.php_**.html template. BTW I can see the STS debug info (after changing $display_debugging_output in sts_display_output.php) and I am not getting any error messages from oscom.

 

I did have to add a .htaccess file in my catalog directory containing "php_flag register_globals on". I know I had to add it due to a PHP version change on the new server (from 4 to 5). Could the php version change be the problem? I would rather not downgrade to PHP version 4 or upgrade the sts/oscom code but any suggestions would be seriously appreciated :)

 

 

Seems to be a similiar Problem to mine!

Share this post


Link to post
Share on other sites

Hello folks.

 

I have a problem installing this STS.

 

When i have uploaded all the files, and go to: www.mysite.com/shop/database_setup.php it comes with the following error.:

 

Fatal error: Cannot redeclare tep_set_banner_status() (previously declared in /usr/home/web/web79785/shop/includes/functions/general.php:694) in /usr/home/web/web79785/shop/includes/functions/banner.php on line 23

 

As far as i can see my error is in the banner.php. But the problem is that im not that good at PHP, so maybe some of you guys could help me out.

 

My line 15-23 in banner.php looks like this:

 

// Sets the status of a banner
 function tep_set_banner_status($banners_id, $status) {
   if ($status == '1') {
     return tep_db_query("update " . TABLE_BANNERS . " set status = '1', date_status_change = now(), date_scheduled = NULL where banners_id = '" . (int)$banners_id . "'");
   } elseif ($status == '0') {
     return tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_status_change = now() where banners_id = '" . (int)$banners_id . "'");
   } else {
     return -1;
   }
 }

////

 

Hope to get some help :)

 

Thanks.

 

Kreller

Share this post


Link to post
Share on other sites

Kreller,

What version of STS are you trying to install? STS on its own does not make any changes to the database. It appears you are trying to install the STS & HTC bundle. Is this correct? If so, you may have a modified database structure that is conflicting with the database update in that HTC sql file. I would ask this question in the HTC forum and see what Jack would recommend.


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
Seems to be a similiar Problem to mine!
No, his appears to be totally unrelated since he is having a problem getting the correct "template" to show as you are not even getting the template but the standard osC.

 

I still feel this is an installation issue. Did you upload the files/folders keeping the file/folder structure intact? Also: Did you configure the STS Modules according to the installation instructions?


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

×