Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] STS v4


Guest

Recommended Posts

Hi everybody,

 

I've spent like 4 desperate days in oscommerce , contributions and STS forums...

So, here is my quetions,

I want to use http://themeforest.net/item/software-ecommerce-site-full-01/full_screen_preview/19941 as an oscommerce design.

What I'm trying to find out is how much of this design could be transcribed into Oscommerce via the tags/templates used in STS?

I have read STS docs, and the beginner tutorial so I'm not entirely shooting in the dark.

 

(Please note that I have searched the forums as best as I can but since I don't know if I'm looking for a piece of code to paste into oscommerce pages, or a module, or something else I really don't know what to search for. I'd appreciate a link to appropriate thread/post for my questions instead of just saying "that has been answwered on the forums")

 

1- I have read on this very thread that ul_categories contribution lets you style the categories menu via CSS. Is there a way to do that via STS?

2- When you login to default oscommerce installation there is a product list table (or whatever you name it) . I really don't like that and want to modify it as I please. I want to make it more like the product list http://themeforest.net/item/software-ecommerce-site-full-01/full_screen_preview/19941 or something totally different. Is there a way to do something like that via STS ? If NOT, could you at least direct me to a STS friendly contribution or a tutorial for modifying the "look" of the product lists? (ul_categories for instance works great job styling the categories menu)

3- I am quite good at css/xhtml so I think STS is the right tool for me to come up with unique looking oscommerce sites without worrying too much about os_commerce code. Or am I wrong ?

 

Thank you in advance,

 

Greg Wee - Could you please share your template with me?

Link to comment
Share on other sites

What do you mean?

 

Means I'll have to either:

1. create additional tags in STS and then create a template to display the products in a "Grid" or

2. Install the Product Listings Enhancement Addon you linked me to in the previous post.

 

How do you create additional tags for STS? Any tutorials or step by step guide on how to do this?

Link to comment
Share on other sites

Means I'll have to either:

1. create additional tags in STS and then create a template to display the products in a "Grid" or

2. Install the Product Listings Enhancement Addon you linked me to in the previous post.

 

How do you create additional tags for STS? Any tutorials or step by step guide on how to do this?

I would instal the addon

 

To learn how to create tags, the best is you read the documentation and study the files in the includes/modules/sts_inc folder.There are also many examples in the forum here, like this

Link to comment
Share on other sites

Greg Wee - how do i remove that flower?

 

 

Why are you asking this question in the STS support thread? If you can't figure it out on your own, then you should contact the author of the template.

 

thumbsup.gif TIP: Did you try editing the actual template file to remove the flower image? Seems to me that if the template was created to be used in STS, that would be the first place I would be looking.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Hello all!

 

I have a quick question regarding UltraPics and STS with the product info content template activated in STS. Right now when I activate the content template UltraPics won't work (the extra images won't show up), if I deactivate the product info content template, UltraPics works again. In this thread(http://www.oscommerce.com/forums/topic/301023-sts-v458-htc/page__p__1243219entry1243219) bkellum wrote:

 

UltraPics also works great with STS. The issues arise if you decide to use the product info content template feature in STS. It is really not an issue but more of an extra step. If you want to use content templates as well as UltraPics, you will need to modify the sts_inc/product_info.php file. The modifications that are made to the stock product_info.php file need to be duplicated in the sts_inc/product_info.php file.

 

Do anyone know what I need to modify to make UltraPics work together with STS (I also use Lightbox, but that is working fine with STS product info content template activated, UltraPics is not working)?

Link to comment
Share on other sites

Do anyone know what I need to modify to make UltraPics work together with STS (I also use Lightbox, but that is working fine with STS product info content template activated, UltraPics is not working)?

 

What you need to do is to create $tags for the extra images. I did this for addon "additional images", you can take a look and do something similar for ultrapics

Link to comment
Share on other sites

What you need to do is to create $tags for the extra images. I did this for addon "additional images", you can take a look and do something similar for ultrapics

 

Sadly my knowledge is basic in this area so I don't know how I should do this. I tried looking over what you had created in the past but no lightbulb lit up for me. If I only could find the solution somehow, because I'm pretty sure this question has been asked before.

Edited by Maxiimilian
Link to comment
Share on other sites

Sadly my knowledge is basic in this area so I don't know how I should do this. I tried looking over what you had created in the past but no lightbulb lit up for me. If I only could find the solution somehow, because I'm pretty sure this question has been asked before.

 

I'm sorry but I never used ultrapics so I have no idea what it needs to create tags for this. I just had the idea that it could be very similar to additional images. What you need to do is to search the forum, the best via google site:www.oscommerce.com/forums [Contribution] STS v4 ultrapics or something like this

Link to comment
Share on other sites

I want to use http //themeforest.net/item/software-ecommerce-site-full-01/full_screen_preview/19941 as an oscommerce design.

What I'm trying to find out is how much of this design could be transcribed into Oscommerce via the tags/templates used in STS?

.

.

1- I have read on this very thread that ul_categories contribution lets you style the categories menu via CSS. Is there a way to do that via STS?

2- When you login to default oscommerce installation there is a product list table (or whatever you name it) . I really don't like that and want to modify it as I please. I want to make it more like the product list http //themeforest.net/item/software-ecommerce-site-full-01/full_screen_preview/19941 or something totally different. Is there a way to do something like that via STS ? If NOT, could you at least direct me to a STS friendly contribution or a tutorial for modifying the "look" of the product lists? (ul_categories for instance works great job styling the categories menu)

3- I am quite good at css/xhtml so I think STS is the right tool for me to come up with unique looking oscommerce sites without worrying too much about os_commerce code. Or am I wrong ?

 

You can do exactly the same, or even better, it depends on your design skills. You will need to get some addons to implement the additional functions, from there on you "wrap"the functions into tags that you can use in the templates

 

re1: I would recommend the "dynamenu" addon, you have a variety of display choices, you can change the menu type via admin and you can also use it for articles if you have that addon. It's 100% css based

re2: Use the "product listing" addon by sam (spooks). You also have many listing choices and it's independed from sts, so no conflicts. Even the listings there are still in tables, you can replace the <tr> etc stuff with <div>, make some more css definitions and control it also exclusively via css

re3: You are right

Link to comment
Share on other sites

Is there a way to do this in the current version?

 

 

In catalog/includes/classes/sts.php, find the following code:

// 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
 // Do not add pages here unless it is from the standard osC and really should be there. If you have a special page that you don't want with template,
 // Create a module sts_mypagename.php that returns an empty string as template filename, it will automatically switch off STS for this page.
if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "info_shopping_cart")) {
  $this->display_template_output = false;
  return;
}

Add the additional scriptname that you need STS to ingore so it will not add the header, footer, etc. For example: Your code would end up looking like this if you wanted STS to ignore the login.php script file:

	if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "login")|| strstr($scriptbasename, "info_shopping_cart")) {
  $this->display_template_output = false;
  return;
}

You can also add any other filenames if needed.

Hope this has helped,

Bill Kellum

 

Inside function sts I tried

 

    if (strstr($scriptbasename, "checkout")) {
	 $this->display_template_output = false;
} else if ((MODULE_STS_DEFAULT_STATUS == 'true') || ($this->display_debug_output == true))

     $this->display_template_output = true;

  else { 

    $this->display_template_output = false;

    return;

  }

 

But that didn't work.

 

TIA

Edited by Analog
Link to comment
Share on other sites

Hello all!

 

I have a quick question regarding UltraPics and STS with the product info content template activated in STS. Right now when I activate the content template UltraPics won't work (the extra images won't show up), if I deactivate the product info content template, UltraPics works again. In this thread(http://forums.oscomm...9entry1243219) bkellum wrote:

 

 

 

Do anyone know what I need to modify to make UltraPics work together with STS (I also use Lightbox, but that is working fine with STS product info content template activated, UltraPics is not working)?

 

 

You need to do a couple of things...

 

 

 

Update your includes/modules/sts_inc/product_info.php file by modifying the SQL querry to include the new image names like so:

// Get product information from products_id parameter

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

 

Also, add the following line of code to the same file above (includes/modules/sts_inc/product_info.php):

include(DIR_WS_MODULES . 'sts_inc/sts_additional_images.php');

 

Then, create a new PHP page that creates each of the new tags needed for your template. You should name this file sts_additional_images.php and upload it to includes/modules/sts_inc/ :

 

<?php

if (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_xl_1'] == '')) {

$template_pinfo['products_image_sm_1'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"');



}elseif(($product_info['products_image_sm_1'] != '') && ($product_info['products_image_xl_1'] != '')) {

$template_pinfo['products_image_sm_1'] ='<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_xl_1']) . '" rel="lightbox[product_images]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>';



}elseif(($products_info['products_image_sm_1'] == '') && ($product_info['products_image_xl_1'] != '')) {

$template_pinfo['products_image_sm_1'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_1'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"');



} else {

 	$template_pinfo['products_image_sm_1'] ='';

 } 





if (($product_info['products_image_sm_2'] != '') && ($product_info['products_image_xl_2'] == '')) {

 $template_pinfo['products_image_sm_2'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"');



} elseif(($product_info['products_image_sm_2'] != '') && ($product_info['products_image_xl_2'] != '')) {

 $template_pinfo['products_image_sm_2'] ='<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_xl_2']) . '" rel="lightbox[product_images]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>';

} elseif

 	(($products_info['products_image_sm_2'] == '') && ($product_info['products_image_xl_2'] != '')) {

 	 $template_pinfo['products_image_sm_2'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_2'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"');

}else{

 $template_pinfo['products_image_sm_2'] ='';

}





if (($product_info['products_image_sm_3'] != '') && ($product_info['products_image_xl_3'] == '')) {

 $template_pinfo['products_image_sm_3'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"');



} elseif

  	(($product_info['products_image_sm_3'] != '') && ($product_info['products_image_xl_3'] != '')) {

  	 $template_pinfo['products_image_sm_3'] ='<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_xl_3']) . '" rel="lightbox[product_images]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>';

} elseif

 	(($products_info['products_image_sm_3'] == '') && ($product_info['products_image_xl_3'] != '')) {

 	 $template_pinfo['products_image_sm_3'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_3'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"');

}else{

    $template_pinfo['products_image_sm_3'] =''; 

}	 





if (($product_info['products_image_sm_4'] != '') && ($product_info['products_image_xl_4'] == '')) {

 $template_pinfo['products_image_sm_4'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); 

} elseif

  	(($product_info['products_image_sm_4'] != '') && ($product_info['products_image_xl_4'] != '')) {

  	 $template_pinfo['products_image_sm_4'] ='<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_xl_4']) . '" rel="lightbox[product_images]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; 

} elseif

 	(($products_info['products_image_sm_4'] == '') && ($product_info['products_image_xl_4'] != '')) {

 	 $template_pinfo['products_image_sm_4'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_4'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); 

}else{

 $template_pinfo['products_image_sm_4'] ='';

} 





if (($product_info['products_image_sm_5'] != '') && ($product_info['products_image_xl_5'] == '')) {

 $template_pinfo['products_image_sm_5']= tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"');

} elseif

  	(($product_info['products_image_sm_5'] != '') && ($product_info['products_image_xl_5'] != '')) {

  	 $template_pinfo['products_image_sm_5'] ='<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_xl_5']) . '" target="_blank" rel="lightbox[product_images]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>';

} elseif

 	(($products_info['products_image_sm_5'] == '') && ($product_info['products_image_xl_5'] != '')) {

 	 $template_pinfo['products_image_sm_5'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_5'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"');

}else{

 $template_pinfo['products_image_sm_5'] ='';

}





if (($product_info['products_image_sm_6'] != '') && ($product_info['products_image_xl_6'] == '')) {

 $template_pinfo['products_image_sm_6'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"');



} elseif

  	(($product_info['products_image_sm_6'] != '') && ($product_info['products_image_xl_6'] != '')) {

  	 $template_pinfo['products_image_sm_6'] ='<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_xl_6']) . '" target="_blank" rel="lightbox[product_images]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>';



} elseif

 	(($products_info['products_image_sm_6'] == '') && ($product_info['products_image_xl_6'] != '')) {

 	 $template_pinfo['products_image_sm_6'] =tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_6'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"');



}else{

 $template_pinfo['products_image_sm_6'] ='';

}

?>

 

thumbsup.gif Then, in your content template (template_folder/content/product_info.php.html), add your new STS tags where you want them: For example:

$products_image_sm_1$

 

 

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Well I've gone ahead and installed STS 4.6 manually, on a not-too modified RC2a.

 

When I go to Admin > Modules to turn it on, I get this error:

 

Parse error: syntax error, unexpected T_DEFAULT in /home/www/blah/catalog/admin/modules.php on line 256

 

 

Here is my admin/modules.php - the line in question is just after the second STS edit, I've untabbed it to make it stick out a bit. Any help gratefully received.

 

<?php
/*
 $Id: modules.php 1802 2008-01-11 16:59:17Z hpdl $

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

 Copyright (c) 2008 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $set = (isset($HTTP_GET_VARS['set']) ? $HTTP_GET_VARS['set'] : '');

 if (tep_not_null($set)) {
   switch ($set) {

// START STS 4.1
case 'sts':
$module_type = 'sts';
$module_directory = DIR_FS_CATALOG_MODULES . 'sts/';
$module_key = 'MODULE_STS_INSTALLED';
define('HEADING_TITLE', HEADING_TITLE_MODULES_STS); 
break;
// END STS 4.1

     case 'shipping':
       $module_type = 'shipping';
       $module_directory = DIR_FS_CATALOG_MODULES . 'shipping/';
       $module_key = 'MODULE_SHIPPING_INSTALLED';
       define('HEADING_TITLE', HEADING_TITLE_MODULES_SHIPPING);
       break;
     case 'ordertotal':
       $module_type = 'order_total';
       $module_directory = DIR_FS_CATALOG_MODULES . 'order_total/';
       $module_key = 'MODULE_ORDER_TOTAL_INSTALLED';
       define('HEADING_TITLE', HEADING_TITLE_MODULES_ORDER_TOTAL);
       break;
     case 'payment':
     default:
       $module_type = 'payment';
       $module_directory = DIR_FS_CATALOG_MODULES . 'payment/';
       $module_key = 'MODULE_PAYMENT_INSTALLED';
       define('HEADING_TITLE', HEADING_TITLE_MODULES_PAYMENT);
       break;
   }
 }

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
   switch ($action) {
     case 'save':
       while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
         tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
       }
       tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));
       break;
     case 'install':
     case 'remove':
       $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
       $class = basename($HTTP_GET_VARS['module']);
       if (file_exists($module_directory . $class . $file_extension)) {
         include($module_directory . $class . $file_extension);
         $module = new $class;
         if ($action == 'install') {
           $module->install();
         } elseif ($action == 'remove') {
           $module->remove();
         }
       }
       tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class));
       break;
   }
 }
?>
<!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 TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr class="dataTableHeadingRow">
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MODULES; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SORT_ORDER; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
             </tr>
<?php
 $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
 $directory_array = array();
 if ($dir = @dir($module_directory)) {
   while ($file = $dir->read()) {
     if (!is_dir($module_directory . $file)) {
       if (substr($file, strrpos($file, '.')) == $file_extension) {
         $directory_array[] = $file;
       }
     }
   }
   sort($directory_array);
   $dir->close();
 }

 $installed_modules = array();
 for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
   $file = $directory_array[$i];

   include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file);
   include($module_directory . $file);

   $class = substr($file, 0, strrpos($file, '.'));
   if (tep_class_exists($class)) {
     $module = new $class;
     if ($module->check() > 0) {
       if ($module->sort_order > 0) {
         $installed_modules[$module->sort_order] = $file;
       } else {
         $installed_modules[] = $file;
       }
     }

     if ((!isset($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['module'] == $class))) && !isset($mInfo)) {
       $module_info = array('code' => $module->code,
                            'title' => $module->title,
                            'description' => $module->description,
                            'status' => $module->check(),
                            'signature' => (isset($module->signature) ? $module->signature : null));

       $module_keys = $module->keys();

       $keys_extra = array();
       for ($j=0, $k=sizeof($module_keys); $j<$k; $j++) {
         $key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_keys[$j] . "'");
         $key_value = tep_db_fetch_array($key_value_query);

         $keys_extra[$module_keys[$j]]['title'] = $key_value['configuration_title'];
         $keys_extra[$module_keys[$j]]['value'] = $key_value['configuration_value'];
         $keys_extra[$module_keys[$j]]['description'] = $key_value['configuration_description'];
         $keys_extra[$module_keys[$j]]['use_function'] = $key_value['use_function'];
         $keys_extra[$module_keys[$j]]['set_function'] = $key_value['set_function'];
       }

       $module_info['keys'] = $keys_extra;

       $mInfo = new objectInfo($module_info);
     }

     if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) {
       if ($module->check() > 0) {
         echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class . '&action=edit') . '\'">' . "\n";
       } else {
         echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
       }
     } else {
       echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class) . '\'">' . "\n";
     }
?>
               <td class="dataTableContent"><?php echo $module->title; ?></td>
               <td class="dataTableContent" align="right"><?php if (is_numeric($module->sort_order)) echo $module->sort_order; ?></td>
               <td class="dataTableContent" align="right"><?php if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
             </tr>
<?php
   }
 }

 ksort($installed_modules);
 $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_key . "'");
 if (tep_db_num_rows($check_query)) {
   $check = tep_db_fetch_array($check_query);
   if ($check['configuration_value'] != implode(';', $installed_modules)) {
     tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $installed_modules) . "', last_modified = now() where configuration_key = '" . $module_key . "'");
   }
 } else {
   tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Modules', '" . $module_key . "', '" . implode(';', $installed_modules) . "', 'This is automatically updated. No need to edit.', '6', '0', now())");
 }
?>
             <tr>
               <td colspan="3" class="smallText"><?php echo TEXT_MODULE_DIRECTORY . ' ' . $module_directory; ?></td>
             </tr>
           </table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
   case 'edit':
     $keys = '';
     reset($mInfo->keys);
     while (list($key, $value) = each($mInfo->keys)) {
       $keys .= '<b>' . $value['title'] . '</b><br>' . $value['description'] . '<br>';

       if ($value['set_function']) {
         eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
	// STS V4.6 drop start
       } else {
		if($key == 'MODULE_STS_TEMPLATE_FOLDER'){
			$dir_name = array();
			if ($handle = opendir('../'.MODULE_STS_TEMPLATES_FOLDER.'/')) {
			   while (false !== ($file = readdir($handle))) {
					$pos = strpos($file, ".");
					if($pos === false){
						$dir_name[] = array("id" => $file, "text" => $file);
						$i++;
					}
				}
				closedir($handle);
			}
			$keys .= tep_draw_pull_down_menu('configuration[MODULE_STS_TEMPLATE_FOLDER]', $dir_name, $value['value']);
		}else{
			$keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
		}
       }
	// STS V4.6 drop end
         $keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
       }
       $keys .= '<br><br>';
     }
     $keys = substr($keys, 0, strrpos($keys, '<br><br>'));

     $heading[] = array('text' => '<b>' . $mInfo->title . '</b>');

     $contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save'));
     $contents[] = array('text' => $keys);
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
default:
     $heading[] = array('text' => '<b>' . $mInfo->title . '</b>');

     if ($mInfo->status == '1') {
       $keys = '';
       reset($mInfo->keys);
       while (list(, $value) = each($mInfo->keys)) {
         $keys .= '<b>' . $value['title'] . '</b><br>';
         if ($value['use_function']) {
           $use_function = $value['use_function'];
           if (ereg('->', $use_function)) {
             $class_method = explode('->', $use_function);
             if (!is_object(${$class_method[0]})) {
               include(DIR_WS_CLASSES . $class_method[0] . '.php');
               ${$class_method[0]} = new $class_method[0]();
             }
             $keys .= tep_call_function($class_method[1], $value['value'], ${$class_method[0]});
           } else {
             $keys .= tep_call_function($use_function, $value['value']);
           }
         } else {
           $keys .= $value['value'];
         }
         $keys .= '<br><br>';
       }
       $keys = substr($keys, 0, strrpos($keys, '<br><br>'));

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=remove') . '">' . tep_image_button('button_module_remove.gif', IMAGE_MODULE_REMOVE) . '</a> <a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . (isset($HTTP_GET_VARS['module']) ? '&module=' . $HTTP_GET_VARS['module'] : '') . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');

       if (isset($mInfo->signature) && (list($scode, $smodule, $sversion, $soscversion) = explode('|', $mInfo->signature))) {
         $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' <b>' . TEXT_INFO_VERSION . '</b> ' . $sversion . ' (<a href="http://sig.oscommerce.com/' . $mInfo->signature . '" target="_blank">' . TEXT_INFO_ONLINE_STATUS . '</a>)');
       }

       $contents[] = array('text' => '<br>' . $mInfo->description);
       $contents[] = array('text' => '<br>' . $keys);
     } else {
       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=install') . '">' . tep_image_button('button_module_install.gif', IMAGE_MODULE_INSTALL) . '</a>');

       if (isset($mInfo->signature) && (list($scode, $smodule, $sversion, $soscversion) = explode('|', $mInfo->signature))) {
         $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' <b>' . TEXT_INFO_VERSION . '</b> ' . $sversion . ' (<a href="http://sig.oscommerce.com/' . $mInfo->signature . '" target="_blank">' . TEXT_INFO_ONLINE_STATUS . '</a>)');
       }

       $contents[] = array('text' => '<br>' . $mInfo->description);
     }
     break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '            <td width="25%" valign="top">' . "\n";

   $box = new box;
   echo $box->infoBox($heading, $contents);

   echo '            </td>' . "\n";
 }
?>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
 </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'); ?>

Edited by MattReid
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...