Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

This is a dumb question but how do i upload the header.sql file? Im REALLY new at this stuff... and trying teach myself as I go... But I have no idea where to start with the sql stuff... i can do html... but newbie to php also... :( thanks sherriz :ph34r:

Share this post


Link to post
Share on other sites
This is a dumb question but how do i upload the header.sql file? Im REALLY new at this stuff... and trying teach myself as I go... But I have no idea where to start with the sql stuff... i can do html... but newbie to php also... :( thanks sherriz :ph34r:

Are you using cPanel? If so, go to "MySQL Databases" scroll all the way down on that page, click on "phpMyAdmin" then find your osc databases in the drop-down menu on the left, and then click the SQL tab toward the top and then click browse and then find your file and then hit Go.

 

Hopefully that helps. Sorry for the long sentence that I wrote, even though it is not really a sentence.

Share this post


Link to post
Share on other sites

Hi all.. this is my first post on this forum .. so let me know how it goes for you..

 

I have read countless threads and contributions to enable the categories and subcategories to display in title of the page. All of them i had problems with and struggled through until i came up with the following answer. Please bare in mind that i am a complete noob to both OSC and PHP but thought i'd post to possibley help.. no matter how dirty my solution.

 

BTW i have the STS installed also

 

ok here goes

 

in index.php find the following at around line 67

 

 <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

replace with

 

<td class="pageHeading"><?php echo $category['categories_name']; ?></td>

 

then find at about line 227

 

    }
   }
?>

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php

 

and replace with

 

    }
   }
?>
<?php
$category_query1 = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category1 = tep_db_fetch_array($category_query1);
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo $category1['categories_name']; ?></td>
<?php

 

 

Hope this works for you if it's what you are looking for....

 

Like i said i'm a complete noob in both OSC and PHP.

 

the above solution was a combination of loads of peoples contributions and thread posts which with a lot of trial and error you can finally get there.. Thanks to everyone :)

 

Sorry but i doubt if i will be able to answer any questions about this if it doesn't work.. i just know it works for me :P

Share this post


Link to post
Share on other sites

Can someone tell me how to get my product templates to be the same as whichever category the product appears in? If you check out my site,

 

www.unlimitedperfumes.com

 

You will see what I mean. Once you get to one of the product pages, it reverts back to the "Home" tab being highlited, as opposed to the "Women's" or "Men's" depending on which category the product is in. Does anyone have any suggestions?

 

JP

Share this post


Link to post
Share on other sites

Love the STS template system, couple of things though, I cant get the other templates to display in my sts_template directory, just the standard template shows for all my pages, Im using the sts contribution with support for header tags etc. which brings me onto question number 2. my BOF: Generated Meta Tags only show up on the main page, on all other pages such as product info, there are no meta tags :huh: anyone know why this happens?

Share this post


Link to post
Share on other sites

Will STS work with MS3 right out of the box ? This is probably the only concern I have about this contrib.

I have a store that has lots of contribs installed (around 7), and I am thinking of modifying the stock look of os commerce.

 

Can anybody offer a suggestion on how to do this in the shortest time possible ?

Share this post


Link to post
Share on other sites
Love the STS template system, couple of things though, I cant get the other templates to display in my sts_template directory, just the standard template shows for all my pages, Im using the sts contribution with support for header tags etc. which brings me onto question number 2. my BOF: Generated Meta Tags only show up on the main page, on all other pages such as product info, there are no meta tags :huh: anyone know why this happens?

For question 1, is the folder called sts_template, or sts_templates? It needs to be sts_templates. Question 2, don't know. Sorry

Share this post


Link to post
Share on other sites

Just tried the 25 Aug 2004 - STS 2.01 Bug fixes but page-specific templates still not working. If I revert back to the sts 2.00 sts_display_output.php they work but then I lose the meta tags and header tag options. Any ideas?

 

Cheers..

Share this post


Link to post
Share on other sites
Can someone tell me how to get my product templates to be the same as whichever category the product appears in?  If you check out my site,

 

www.unlimitedperfumes.com

 

You will see what I mean.  Once you get to one of the product pages, it reverts back to the "Home" tab being highlited, as opposed to the "Women's" or "Men's" depending on which category the product is in.  Does anyone have any suggestions?

 

JP

Sounds like your having the same problem I am, the product info template doesn't seem to be kicking in and its reverting to the default sts index template. Try deleting the product_info.php.html and if there is no change your having the same prob as me..

Edited by Vince76

Share this post


Link to post
Share on other sites
Just tried the 25 Aug 2004 - STS 2.01 Bug fixes but page-specific templates still not working. If I revert back to the sts 2.00 sts_display_output.php they work but then I lose the meta tags and header tag options. Any ideas?

 

Cheers..

I should have been a little more specific, when I say page specific templates not working I mean product_info.php.html specifically. I can delete that file and there is no change even though I have applied the latest fix..

Share this post


Link to post
Share on other sites

Ok Fixed it! All I did was revert back to the original code for override popup window section.

 

Replaced

/*  /////////////////////////////////////  ERROR FIXED by Walo /////////////
/////////////////////////////////////////  ERROR FIXED by Walo /////////////
/////////////////////////////////////////  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'];
// Returns file name without path nor parameters
$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);
$scriptname1 = 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 ($scriptname1 != false || $scriptname2 != false) {
$display_normal_output = 1;
$display_template_output = 0;
}

 

With original version

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

 

Seems to work fine for me now.

 

Cheers..

Share this post


Link to post
Share on other sites
Love the STS template system, couple of things though, I cant get the other templates to display in my sts_template directory, just the standard template shows for all my pages, Im using the sts contribution with support for header tags etc. which brings me onto question number 2. my BOF: Generated Meta Tags only show up on the main page, on all other pages such as product info, there are no meta tags  :huh: anyone know why this happens?

For question 1, is the folder called sts_template, or sts_templates? It needs to be sts_templates. Question 2, don't know. Sorry

The dir is named sts_templates

Share this post


Link to post
Share on other sites

Can anyone give some ideas on how to add contributions to sts. I been going all day without success. I have been through 80 pages of this thread but no answers. I have tried searching the forums and google, and even experimenting myself with poor results.

 

I am trying to use, EZfeilds, master products, and text feild option attributes with sts but can't seem to get anything working.

 

Is there a special way we are supposed to go about adding contribs to sts? Could someone write up maybe some short docs as to what kind of things we need to think about when trying to use contribs with sts?

 

Sts is a great idea but it's not much good if us php noobs can't use it with other contribs. I'd prefer to lose cosmetics over functionality anyday but would be nice to have both ;-)

 

cheers..

Share this post


Link to post
Share on other sites
Can anyone give some ideas on how to add contributions to sts. I been going all day without success. I have been through 80 pages of this thread but no answers. I have tried searching the forums and google, and even experimenting myself with poor results.

 

I am trying to use, EZfeilds, master products, and text feild option attributes with sts but can't seem to get anything working.

 

Is there a special way we are supposed to go about adding contribs to sts? Could someone write up maybe some short docs as to what kind of things we need to think about when trying to use contribs with sts?

 

Sts is a great idea but it's not much good if us php noobs can't use it with other contribs. I'd prefer to lose cosmetics over functionality anyday but would be nice to have both ;-)

 

cheers..

Well, I have never used those contributions, but I have about 10 others installed. How are you doing it? Are you just putting the files up that are in the contribution? Most of the contributions come with advanced instructions that tell you exactly what needs to be put where. So, you actually have to copy and paste code into your files that are already up in order for them to work. It can take some time to do this however. If you are already doing this, then I really don't know what is going on.

Share this post


Link to post
Share on other sites

Adding contributions can be tricky. The easiest way to do it is to make a list of the files that have been modified by contributions as you add them and then compare that list so you have a decent idea which files are virgin osc in your store.

 

Given that some of the contribs use files that are slightly out of date as well you really, really need some way to find the differences in them. I'm sure the folks here all have their favs and can suggest some. I'm on a Mac and use BBedit to diff my files.

 

Keep in mind that as you add contributions you WILL, at some point, run into a contrib that steps on another and WILL have to combine code. Not for the faint of heart but overall if you're persistent, have a little experience with php and can deal with sifting through many, many posts you'll probably find an answer or pointer here on the forums.

 

Hope that helps a bit and good luck!

 

Iggy


Everything's funny but nothing's a joke...

Share this post


Link to post
Share on other sites

i can create a "product specific templates" in sts. did this method can apply to index & catagories pages??? because sts isnt support mutil-language in index & catagories pages at this moment?

Share this post


Link to post
Share on other sites
i can create a "product specific templates" in sts. did this method can apply to index & catagories pages??? because sts isnt support mutil-language in index & catagories pages at this moment?

 

Hi Brian or Anyone,

 

Please help me, I hang in this stage for the loooooooooooong time :(

Many Thanks

Share this post


Link to post
Share on other sites
i can create a "product specific templates" in sts. did this method can apply to index & catagories pages??? because sts isnt support mutil-language in index & catagories pages at this moment?

 

Hi Brian or Anyone,

 

Please help me, I hang in this stage for the loooooooooooong time :(

Many Thanks

STS supports the default OSC language settings, and you can further control how your template displays images by using the $langid variable in your file names.

 

For example, if you want a button that says "Shopping Cart" in various languages, in your template file where you would normally have

 

<img src="images/cart_button.gif"> (or whatever you call it)

 

change it to be

 

<img src="images/cart_button-$langid.gif">

 

and then create the graphics $cart_button-1.gif for English, $cart_button-2.gif for German, $cart_button-3.gif for French, etc. The numbers should match the LANGID variables in your database.

 

Hope this helps.

 

- Brian

Edited by DiamondSea

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

Hi Brian,

 

Thank you for your very fast respond.

 

I've hear this method before, but I think this is not a suitable solution for my request.

 

Because I want to creat the template like amazon.com.

2.gif

i think this solution cant create a hyper link for both language.

 

I hope you have a other solution to solve the problem.

 

 

Many Thanks

Share this post


Link to post
Share on other sites

Hi Brian,

 

Since you're in here I'm hoping I can pick your brain as well. Are there plans to incorporate some of the individual product_info.php template solutions into STS or is there a particular method you'd recommend or have used?

 

Thanks!

Iggy


Everything's funny but nothing's a joke...

Share this post


Link to post
Share on other sites
Has anybody worked out how to get it using a different theme for each product category yet?

I really want to know that too. any one can help? thanks.

Share this post


Link to post
Share on other sites
Hi Brian,

 

Thank you for your very fast respond.

 

I've hear this method before, but I think this is not a suitable solution for my request.

 

Because I want to creat the template like amazon.com.

2.gif

i think this solution cant create a hyper link for both language.

 

I hope you have a other solution to solve the problem.

 

 

Many Thanks

You could do this, just have the graphics in the menu as button1-$langid.gif", button2-$langid.gif etc.

 

The graphics would then appear in whatever language you want, and they would go to the same URL/links regardless of the language, since OSC is multi-language by default.

 

Of course, if you really want a different language for each page, just make your links like <a href="thispage-$langid.html"> or <a href="thatspage-$langid.php"> or whatever you want.

 

- 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

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

×