Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

When you visit my store and go to click on the "enlarge" graphic under a product the status bar reads:

 

java script:popupWindow('http://www.chefstores.com/popup_image.php?pID=341ℑ=0')

 

The page that opens does *not* display the image. Instead it displays the template (with no content)

 

Current Troubleshooting Notes:

 

When looking at html code (view source) that is generated on the popup_image.php page it looks *nothing* like what the php code from popup_image.php should have generated.

 

I have attached both popup_image.php and the (view source) html version popup_image.txt

 

My Store: http://www.chefstores.com

 

 

popup_image.php

 

<?php
/*
 $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $navigation->remove_current_page();

 $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_image_lrg, p.products_image_xl_1, p.products_image_xl_2, p.products_image_xl_3, p.products_image_xl_4, p.products_image_xl_5, p.products_image_xl_6 from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
 if (navigator.appName == 'Netscape') i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
 self.focus();
}
//--></script>
</head>
<body onload="resize();">
<?php
	   if (($HTTP_GET_VARS['image'] ==0) && ($products['products_image_lrg'] != '')) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_lrg'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } elseif ($HTTP_GET_VARS['image'] ==1) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_1'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } elseif ($HTTP_GET_VARS['image'] ==2) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_2'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } elseif ($HTTP_GET_VARS['image'] ==3) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_3'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } elseif ($HTTP_GET_VARS['image'] ==4) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_4'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } elseif ($HTTP_GET_VARS['image'] ==5) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_5'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } elseif ($HTTP_GET_VARS['image'] ==6) {
 echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_6'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 } else
 echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
 ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

 

 

popup_image.txt

 

<!-- Page layout by Simple Template System (STS) v2.01 on osCommerce 2.2-MS2 - http://www.diamondsea.com/sts/ -->
<!-- Using Template File [includes/sts_template.html) -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Chef Stores</title><base href="http://www.chefstores.com/">

<!-- start get_javascript(applicationtop2header) //-->

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

<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
<!--
.style1 {font-size: 11px}
-->
</style>
</head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" class="site_table">
 <tr>
<td><table width="100%"  height="162" cellpadding="0" cellspacing="0">
 <tr class="header"> 
<td width="240"><img src="images/vilords_left.jpg"></td>
<td align="right" valign="top" width="170"><a href="https://www.chefstores.com/account.php"><img src="images/header_account.gif" border="0" alt="My Account" title=" My Account " width="170" height="34"></a><a href="http://www.chefstores.com/shopping_cart.php"><img src="images/header_cart.gif" border="0" alt="Cart Contents" title=" Cart Contents " width="170" height="26"></a><a href="https://www.chefstores.com/checkout_shipping.php"><img src="images/header_checkout.gif" border="0" alt="Checkout" title=" Checkout " width="170" height="26"></a><img src="images/vilords_bottom.jpg"></td>
<td width="369"><img src="images/vilords_right.jpg"></td>
 </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
 <tr class="headerNavigation"> 
<td class="headerNavigation"><a href="http://www.chefstores.com" class="headerNavigation">Home</a> » <a href="http://www.chefstores.com/index.php" class="headerNavigation">Catalog</a></td>
<td class="headerNavigation"><div align="right"><a href=https://www.chefstores.com/account.php class="headerNavigation">My Account</a> 
	| <a href=http://www.chefstores.com/shopping_cart.php class="headerNavigation">Cart Contents</a> | <a href=https://www.chefstores.com/checkout_shipping.php class="headerNavigation">Checkout</a></div></td>
 </tr>
</table> 
<table width="100%"  cellpadding="0" cellspacing="0">
 <tr> 
<td  class="left" width="240" valign="top">

<!-- start searchbox //-->

<!-- end searchbox //-->


<!-- start categorybox //-->

<!-- end categorybox //-->


<!-- start manufacturerbox //-->

<!-- end manufacturerbox //-->


<!-- start cartbox //-->

<!-- end cartbox //-->


<!-- start orderhistorybox //-->

<!-- end orderhistorybox //-->


<!-- start bestsellersbox //-->

<!-- end bestsellersbox //-->


<!-- start specialfriendbox //-->

<!-- end specialfriendbox //-->


<!-- start reviewsbox //-->

<!-- end reviewsbox //-->


<!-- start informationbox //-->

<!-- end informationbox //-->


<!-- start languagebox //-->

<!-- end languagebox //-->

<br>
<br>
</td>
<td valign="top">
<table class="content" width="100%"  border="0" cellspacing="0" cellpadding="0">
 <tr>
<td><p style="color:#666666;">
<!-- start content //-->

<!-- end content //-->
</p></td>
 </tr>
 <tr>
<td><table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
	<td width="33%"> </td>
	<td width="33%"> </td>
	<td width="33%"><span class="left">
<!-- start maninfobox //-->

<!-- end maninfobox //-->
</span></td>
  </tr>
</table></td>
 </tr>
</table>
  </td>
 </tr>
</table>
</td>
 </tr>
</table>
<table width="780" background="images/bottom_back.jpg" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
<td align="right" class="copy"><div align="center"></div>
</td>
 </tr>
</table>
<table width="780" align="center"  cellpadding="0" cellspacing="0">
 <tr> 
<td><div align="center" class="style1"></div></td>
 </tr>
</table>
</body>
</html>

Share this post


Link to post
Share on other sites

To install it correctly, You will only need to download and install this and then this. :thumbsup:

 

The STS v4.1 by rigadin as well as the Index module v1.0.3 for STS4.

 

The two files between these two contributions have been known to cause problems such as double headers and php errors. ;)

 

Hope this helps,

 

Bill Kellum


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 cannot use my css tempate, the font size display on my page is to big, where can I put the modification to change it?

 

Thanks!

Share this post


Link to post
Share on other sites

I'd like to remove the new products from $content and make it its own tag so I can control where it appears - is this possible?

 

I'm using STS 3.0

Edited by mpm

For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

I have installed the login box contribution and was wondering how I could add it in using the sts system. I have tried using $loginbox and $loginbox.php

 

I was ment to add a require loginbox.php lint into coloumb right or left but as I am not uing them I never bothered. Whould this have any affect of will it not work with this system.

 

Thanks

Steven

Share this post


Link to post
Share on other sites

this contrib is quite nice. i'm having trouble figuring out how to do some CSS work since i can't find where the chunks of HTML that are included for, say, $content, originate. i need to add class tields to the tables that appear in the $content HTML.

 

thx for reading

Share this post


Link to post
Share on other sites

Hi Guys,

 

Need advice from you all.

I have customised my index.html and product_info.html as provided in the contribute, BUT how do i customise the product categories page such as "catalog/index.php?cPath=3_15".

 

How do i customise the page design?

Share this post


Link to post
Share on other sites
how do i customise the product categories page such as "catalog/index.php?cPath=3_15".

 

On the example you give, you would make a template, name it index.php_3_15.html and put it in the directory with your other templates.

Share this post


Link to post
Share on other sites

Please kindly enlight me how do i edit the $content in index.php.html?I did created the index.php_3_15.html, but i do not know how to customise the layout and design under the $content?

 

Thank you and best regards

Edited by Rolento

Share this post


Link to post
Share on other sites

Please kindly enlight me how do i edit the $content in index.php.html?I did created the index.php_3_15.html, but i do not know how to customise the layout and design under the $content?

For example the peoduct layout of index.php_3_15

 

 

Thank you and best regards

Share this post


Link to post
Share on other sites
Please kindly enlight me how do i edit the $content in index.php.html?I did created the index.php_3_15.html, but i do not know how to customise the layout and design under the $content?

For example the peoduct layout of index.php_3_15

 

Are you trying to modify the main page, the individual product page or the product category page? To change the content of the main page, go to Define Languages under Tools in admin. For the other two, you would create a template. You can do this in any HTML editor (Dreamweaver, Front Page). Insert placeholders for the different types of data where you want them in your template. You will find a list of placeholders in the document that came with the STS package.

Edited by charmdiva

Share this post


Link to post
Share on other sites
Are you trying to modify the main page, the individual product page or the product category page? To change the content of the main page, go to Define Languages under Tools in admin. For the other two, you would create a template. You can do this in any HTML editor (Dreamweaver, Front Page). Insert placeholders for the different types of data where you want them in your template. You will find a list of placeholders in the document that came with the STS package.

Hi Charmdiva

 

Thank you for your reply.

 

Yes, i want to redesign both the individual product page and the product category page.

I already got the template done up but i can't find the placeholder for inserting list of category?

 

Please advise me or is there any reference i can make to?

Share this post


Link to post
Share on other sites

I know this is a bit ancient but I am using sts2.01

 

I have it working perfectly with the product info html template on my local server, but every time I upload to my working server the info.product.php uses the default sts_template.html rather than the product_info.php.html which it uses quite happily on the localhost. The sts_templates folder is in place and contains the product_info.php.html file

 

Any Thoughts

 

Steve

Share this post


Link to post
Share on other sites

I already have a template I want to use and I have inserted my STS tags and everything is working great except for 1 thing - the search.

 

The template I'm using already had a search text box and a corresponding graphic search button...but when I insert the $searchbox tag it completely messes it up because it tries to insert another text box with its own image button.

 

What I need to know, is how do I use the existing search text box and search button?

Share this post


Link to post
Share on other sites
I know this is a bit ancient but I am using sts2.01

 

I have it working perfectly with the product info html template on my local server, but every time I upload to my working server the info.product.php uses the default sts_template.html rather than the product_info.php.html which it uses quite happily on the localhost. The sts_templates folder is in place and contains the product_info.php.html file

 

Any Thoughts

 

Steve

 

Off topic Steve, but did you get the log In Box working?

 

Thanks

Share this post


Link to post
Share on other sites
Off topic Steve, but did you get the log In Box working?

 

Thanks

 

2 things I sorted the problem using the 2.01 fix, although I cannot get the product info html to display the slave products whilst the sts template using"$content" will

 

And Yes the log in box does work

Share this post


Link to post
Share on other sites
2 things I sorted the problem using the 2.01 fix, although I cannot get the product info html to display the slave products whilst the sts template using"$content" will

 

And Yes the log in box does work

 

Thanks Steve for the reply. I figured that if you can get it to work I could, so I looked at the install again and worked through my problem. Bad side is that after I got it working I decided I didn't like it and have removed the tag from my page. Didn't delete the code just the tag in case I do decide to use it. Thanks again, Guy Fuller

Share this post


Link to post
Share on other sites

Hello folks, [sorry I posted this question in the wrong place] :rolleyes:

 

I've been told to ask here...I have a currencies box in the bottom left side of my shopping cart. I'm using STS but in my sts_template I've not added the $currenciesbox command. Anyone know any information on how to get rid of this currencies box??

 

http://www.trendypeople.fi/shop/index.php

 

Thanks! :thumbsup:

Share this post


Link to post
Share on other sites

Hi again!

 

I'm sure somebody knows the answer her?

 

Anyways here is some more info on my problem...

 

I've found out that the $languagebox is controlling the currencies box too. I need the language box without the currencies box with STS

 

I hope this helps.

 

Thanks again! :huh:

Share this post


Link to post
Share on other sites
I need the language box without the currencies box with STS

 

 

It would help if we could see the code for your STS template.

Share this post


Link to post
Share on other sites
It would help if we could see the code for your STS template.

 

Sorry about that...here is the code:

 

<html>

<head>

<!--$headcontent-->

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

<style type="text/css">

<!--

.style1 {font-size: 11px}

-->

</style>

<title></title>

</head>

<body topmargin="0" marginheight="0">

<table width="780" border="1" align="center" class="site_table" height="418" bordercolor="#0066CC" bordercolorlight="#0099FF" bgcolor="#0066CC" bordercolordark="#003399">

<tr>

<td colspan="2" height="74" width="780" align="center" valign="middle">

$cataloglogo</td>

</tr>

<tr>

<td height="25" colspan="2" width="780" align="center" valign="middle">

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

<tr class="headerNavigation" height="24">

<td class="headerNavigation" height="24" background="images/top_back.gif">$breadcrumbs</td>

<td class="headerNavigation" height="24">

<div align="right">$myaccount

| $cartcontents | $checkout</div>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height="174" width="148" align="left" valign="top" bgcolor="#0066CC">

<p>$searchbox

$categorybox

$manufacturerbox

$cartbox

$orderhistorybox

$specialfriendbox

$informationbox<br>

 

$languagebox</p>

</td>

<td width="632" height="174" align="center" valign="top" bgcolor="#0066CC">

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

<tr>

<td>

<p style="color:#666666;">$content</p>

</td>

</tr>

<tr>

<td>

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

<tr>

<td width="33%"> </td>

<td width="33%"> </td>

<td width="33%"><span class="left">$maninfobox </span></td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height="28" colspan="2" width="780" align="center" valign="middle">

<p>$footer</p>

</td>

</tr>

<tr>

<td height="10" colspan="2" width="780" align="center" valign="middle">

<p><font size="1" face="Verdana,Arial" color="#CCCCCC">Copyright ? 2004-2006 Trendy People. All rights reserved.</font></p>

</td>

</tr>

</table>

</body>

</html>[code]

 

I hope this helps!

Share this post


Link to post
Share on other sites

Fixed it you guys! All it was the language.php had currencies code combined! I removed the currencies code. Nothing to do with STS really :)

Share this post


Link to post
Share on other sites

hi,

 

how can i get this code to work in STS

 

<?php
echo '<a href=shopping_cart.php>view cart</a> (' . $cart->count_contents(). ')' . $currencies->format($cart->show_total());
?>

 

it displays the cart content like this "View Cart(0) $0.00"

 

it works fine when i add it to an original osc php file but when i try to use it in a template i get this error

 

"Fatal error: Call to a member function on a non-object in /home/pixelhub/public_html/includes/sts_templates/test/sts_template.php on line 48

"

 

can any one help me with this

 

Cheers

Craig

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

×