OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Sts Mega Power Pack
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Templates and Images
Pages: 1, 2
mig7
hi all,

i installed the STS mega power pack and got some problems. the dynamenu doesnt work well and the subcategory appears at the bottom of the page. whats wrong with that? anyone can help? really appreciate it..

thanks.
MatthewRitchie
QUOTE (mig7 @ Jun 27 2007, 04:54 AM) *
hi all,

i installed the STS mega power pack and got some problems. the dynamenu doesnt work well and the subcategory appears at the bottom of the page. whats wrong with that? anyone can help? really appreciate it..

thanks.


geepers!

what other contribs do you have? walk us through what you did.

did you get the update file too? some code was missing but dynamenu should be fine, it is here but this aint your computer so not too helpfull.

Dynamenu comes as packed from that contribution, all i have done is integrate it as the instructions suggest. bkellum's instructions to get sts working with dynamenu found at sts power pack contrib page may help as i have only taken one of the suggested roots here. ie echo footer in application bottom.

Oh! have you put the sts variable somewhere on your page, it looks something like $dmbox. it could be that you do not have this and the application bottom code is the only piece being processed.

tell us a little more about your install and what else you have and perhaps we can work it out.

matt
mig7
im working on the ++ version now and i'll let u know if i find any problems.

thanks. great contribution mate!
MatthewRitchie
DISCOVERED: PROBLEM WITH ADMIN ADD NEW CATAGORIES BUTTON.

this may or may not have anything to do with the contributions installed because everything on the development server works fine as opposed to the live shop remote server. it is similar to the problems with the multi bundle. ie there was missing code in the general.php file (from memory) which was for the good working of htc.

I will back track some to find the problem. let me know here if this is found by anyone else.

matt.
MatthewRitchie
If you have the sts external pages templates - setup instructions/contribution from:
http://www.oscommerce.com/community/contributions,5245

you will remember an addition to functions/html_output.php which uses an ifelse test for location of the file in the root directory of the server or in the catalog directory.

as promised here is the update that should allow you to use sts with any file in any directory
--- as long as you make sure to adapt the includes/requires to application top in each file.

hopefully you should see waht i am trying to do here. you may need to play a little with this!

/**********************************************************
*** mjr addition for external sts templated pages ***
**********************************************************/

// Full path to file should be defined before the file name in filenames.php
// beginning with a forward slash.
//
// External file paths and names must be defined in filenames.php so that osc pages
// can use the variables too.
//
// e.g.
// define('FILENAME_CONTACT', '/about_us/jobs/contact.php' );

//
// connection parameters as set in sts_user_code.php:
//
// ext = external file outside osc
// sslext
// nonssl
// ssl
//
// if connection == ext { // for normal unsecured external pages
// }elseif connection == sslext { // for external pages needing ssl cover
// }elseif connection == nonssl { // for normal unsecured osc pages
// }elseif connection == ssl { // for osc pages needing ssl
// }

/**********************************************************/

//NEW --------------------------------------------------------------

if ($connection == 'EXT') {

$link = HTTP_SERVER; // get the rest of the path from filenames.php

}elseif ($connection == 'SSLEXT') {

if (ENABLE_SSL == true) {

$link = HTTPS_SERVER;

} else {

$link = HTTP_SERVER;

}

//ORIGINAL --------------------------------------------------------

}elseif ($connection == 'NONSSL') {

$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

} elseif ($connection == 'SSL') {

if (ENABLE_SSL == true) {

$link = HTTPS_SERVER . DIR_WS_HTTP_CATALOG;

} else {

$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

}

} else {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font>
<br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
}

/**********************************************************/
MatthewRitchie
your sts_user_code.php page links should look like

$sts->template['Home'] = '<a href=' . tep_href_link(FILENAME_HOME, '', 'EXT') . ' class="headerNavigation">' . 'Home' . '</a>';

for home.php in root defined as:

define('FILENAME_HOME', '/Home.php' );
MatthewRitchie
correction, '/home.php' in define breaks it so do:

if ($connection == 'EXT') {

$link = HTTP_SERVER . '/';

}elseif ($connection == 'SSLEXT') {

if (ENABLE_SSL == true) {

$link = HTTPS_SERVER . '/';

} else {

$link = HTTP_SERVER . '/';

}

note the . '/' additions
MatthewRitchie
YOU WILL STILL NEED TO USE
IF (DRINAME($_SERVER[PHP_SELF]))
ETC
MatthewRitchie
Update: vertical + horizontal dynamenus now working under sts. contrib package expected this evening 21stJuly07 british summer time.
Kaleb008
I would first like to say thanks for this very interesting contribution. I am building a site for my distribution company and I am confused where to find the path for includes/functions/html_output.php in filenames.php. I know this is probably simple but the help is greatly appreciated
MatthewRitchie
what i normally do is to splash as many <?php echo 'stuff'; ?> commands throughout the code i am trying to adapt so that i can visually see want the code is or is-not building.

NOTE: THE QUESTION ABOVE RELATES TO STS EXTERNAL PAGES TEMPLATES.

the path for includes/functions/html_output.php in filenames.php - incorrect. the paths are built from varaibles created in configure.php when links are built in the php engine and outputted to the screen. the function used is tep_href_ bla bla bla at the top of the file html_output.php. the trick is to put into this function other if else loops so that you get the desired html href results.

since sts builds new page links from your programming input in sts_user_code.php i have created two more parameters to pass to the tep_href function. these tell the function to do something different when building page links if your pages are outside the catalog folder and if they too need to be handled specially for ssl.

I myself here, need a little revision of what i have done so far as the new harry potter book and familly visites have distracted me for a while.
after doing so i hope to have a revised bundle ready for you all.

this will be:

reg globals
sts
htc
new dynamenu - dynamenu gone nuts bonkers - multiple dropdowns, flyouts, trees etc all on the same page......
sts external pages templates
thats it for now...

problems that need solved:

new dynamenu - session ids need to be built into multi-dynamenu links
and all the other menu layout options still need to be added!

sts external pages templates - currently: in every new folder you make for new pages, you need to copy and paste a local sts 'templates' folder. i need to reprogram classes sts.php so that you can choose between having one local templates folder in each new folder, or only two sts templates folders, one in root for every external file and one in catalog/ for the shop files only. i think this can be done but i will be removing the choice in the module setup in admin. perhaps.

by the way. all external template default files containg a switching code that alows the one single default template in catalog/templates to be used. the switch is currently situated in configure.php. turn 'on' or 'off'.

as you can see i have given myself a lot of extra work so please be patient. ;o)

spread the love - especially to iraq. by them all the harry potter series and they will fixed up for a few weeks without bombs and bullets flying around.


matt
MatthewRitchie
New sts mega power pack bundle comming your way tomorrow monday,13 aug 2007. very simple setup! whats in it:

register globals
sts
htc
multiple flyouts/dropdowns/treemenus/plainmenus - dynamenu
sts external pages templates

now comes with straight forward - zero manual editing - installation build of configuration file.

every page in each unique external folder is customizable with main page template files and boxes templates
the above feature can be switched off via config to use only one template for everything.

remaining problems

dynamenu additional menu links are not built with tep_href() osc function so are not compliant with sessions. however sts_user_code are compliant with sessions. external pages keep sessions info.

bla bla bla etc etc more to do!

i reitterate! very very very simple setup!

matthew john ritchie
bkellum
QUOTE (MatthewRitchie @ Aug 12 2007, 03:34 PM) *
New sts mega power pack bundle comming your way tomorrow monday,13 aug 2007. very simple setup! whats in it:

register globals
sts
htc
multiple flyouts/dropdowns/treemenus/plainmenus - dynamenu
sts external pages templates

now comes with straight forward - zero manual editing - installation build of configuration file.

every page in each unique external folder is customizable with main page template files and boxes templates
the above feature can be switched off via config to use only one template for everything.

remaining problems

dynamenu additional menu links are not built with tep_href() osc function so are not compliant with sessions. however sts_user_code are compliant with sessions. external pages keep sessions info.

bla bla bla etc etc more to do!

i reitterate! very very very simple setup!

matthew john ritchie
Matthew, you may want to consider removing the Register Global contribution from your Mega Pack since new users who have the latest osCommerce installed will not need it.

http://forums.oscommerce.com/index.php?s=&...t&p=1110788
MatthewRitchie
Thanks for the Heads Up Bill, I had not heard of the new version till now. As a backup to this, I will likely devote a special page to oscommerce on my site. this will go nicely with a humungus list of open source programs i have to edit and post. I shall keep a copy of each of the downloads as they come out and hopefully i will be able to redo some of the work here for new versions. however it goes those past versions of osc will continue to be arround untill time dictates that the problems have been sufficiently ironed out. I am personallly still on the quest of a superdooper ERP cart system but am just to lazy at the moment to go and learn JAVA so i can use the Apache Foundations Cart and Erp system called OPEN FOR BUSINESS. OFBIZ.
MatthewRitchie
STS_M_P_P_V2 MatthewRitchie 14 Aug 2007

THE ZIP FILE IS TOO BIG FOR UPLOAD TO OSC BUT YOU CAN GET IT HERE:

STS_M_P_P_V2.zip

Contribution Contents:

(1) Register Globals --- VV 1.5

(2) STSv4.5.2
(3) and HTCv2.6.3 Bundle

(4) DYNAMENU_GONE_NUTS_BONKERS

(5) Sts_External_Pages_Templates

FULLY WORKING EASY INSTALL.

THE INSTRUCTIONS FOR INSTALL AND USE ARE ON OSC HERE:
http://www.oscommerce.com/community/contributions,5245
Kaleb008
Matthew,

After going trought most of the steps to install this new contribution I get the following error once I turn on STS.

LayersMenu Error: setImgdir: /Program Files/Apache Group/Apache2/htdocs/shop/images/ is not a directory

My paths all seem correct in configure.php, and dm_header.php, any input would be appreciated
MatthewRitchie
QUOTE (Kaleb008 @ Aug 15 2007, 04:48 PM) *
Matthew,

After going trought most of the steps to install this new contribution I get the following error once I turn on STS.

LayersMenu Error: setImgdir: /Program Files/Apache Group/Apache2/htdocs/shop/images/ is not a directory

My paths all seem correct in configure.php, and dm_header.php, any input would be appreciated


I assume your catalog folder is called 'shop' and you are using oscommerce ms 2.2ms2-060817.

normally when this happens all you need to do is tweek the defined DM_SETDIRROOT or the other variables, say images directory or DIR_WS_HTTP_CATALOG in the configure.php. Often this is caused by a missing forward slahs or a typo.

first make sure the images folder exists. this shouldnt have come up as the configure file should be written correctly through install.

put in the c: before the first forward slash in config and see what happens.

your config should look something like this:

/* --------------------------------------------------------------------------------------------------------------------- */

define('CATALOG_DIR_NAME', 'catalog'); // The folder in which osc has been installed.

/* --------------------------------------------------------------------------------------------------------------------- */
if (dirname($_SERVER['PHP_SELF']) == '/catalog'){
/* --------------------------------------------------------------------------------------------------------------------- */

define('DIR_WS_HTTP_CATALOG', '/catalog/' );
define('DIR_WS_HTTPS_CATALOG', '/catalog/' );

define('DIR_WS_IMAGES', 'images/' );
define('DIR_WS_INCLUDES', 'includes/' );

define('STYLESHEET', 'stylesheet.css' );
define('dmSTYLESHEET', 'bonkers_dynamenu.css' );

define('DM_SETDIRROOT', './' );

/* --------------------------------------------------------------------------------------------------------------------- */
}else{
/* --------------------------------------------------------------------------------------------------------------------- */

define('DIR_WS_HTTP_CATALOG', '/catalog' );
define('DIR_WS_HTTPS_CATALOG', '/catalog' );

define('DIR_WS_IMAGES', '/catalog/images/' );
// define('DIR_WS_INCLUDES', 'catalog/includes/' );

define('STYLESHEET', 'catalog/stylesheet.css' );
define('dmSTYLESHEET', 'catalog/bonkers_dynamenu.css' );

define('DM_SETDIRROOT', 'C:/Program Files/Apache Group/Apache2/htdocs/catalog' );

/* --------------------------------------------------------------------------------------------------------------------- */
}// end if-else
/* --------------------------------------------------------------------------------------------------------------------- */

define('DM_INCLUDES_FUNCTIONS', 'includes/functions/');


define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', false); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'localhost');
define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '');

// define('DIR_WS_HTTP_CATALOG', '/catalog/');
// define('DIR_WS_HTTPS_CATALOG', '');

// define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

// define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', 'C:/Program Files/Apache Group/Apache2/htdocs/catalog/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
MatthewRitchie
!!!!!!!!!!!!!! ah, could be this, ... i didnt remember this in the build...

top of boxes/dm_header.php

// allow subcatagories to flyout or dropdown.

$show_full_tree = true;

// set paths

$myDirPath = '/Program Files/Apache Group/Apache2/htdocs/';


set the above path only, correct to your system!!!!!!!!!!!!!!!!!!!!!!!!!!!!

also:

$mid->setImgdir($myDirPath . 'shop/images/');
$mid->setImgwww($myWwwPath . 'shop/images/');

$mid->setIcondir($myDirPath . 'shop/images/');
$mid->setIconwww($myWwwPath . 'shop/images/');

change relating paths. ie replace shop with your catalog folder name..... use CATALOG_DIR_NAME defined variable

I over looked this, thus it is still set to my system. lol
Kaleb008
Many thank for the input. I re-started from scratch just to be sure I installed correctly, and both times I installed the first time you view the catalog you receive the following warnings.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /catalog/includes/configure.php:151) in /catalog/includes/functions/sessions.php on line 98

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /catalog/includes/configure.php:151)in /catalog/includes/functions/sessions.php on line 98

Just delete the white spaces at the end of configure.php to get rid of them.

Hope this makes someone's life a little easier.
MatthewRitchie
QUOTE (Kaleb008 @ Aug 15 2007, 08:38 PM) *
Many thank for the input. I re-started from scratch just to be sure I installed correctly, and both times I installed the first time you view the catalog you receive the following warnings.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /catalog/includes/configure.php:151) in /catalog/includes/functions/sessions.php on line 98

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /catalog/includes/configure.php:151)in /catalog/includes/functions/sessions.php on line 98

Just delete the white spaces at the end of configure.php to get rid of them.

Hope this makes someone's life a little easier.


Hi Joshua

Thanks for that. never had the problem myself. just wondering if you were using the same database or made a new db each time. i have had similar warnings when trying to repopulate /rebuild an already existing db or when i redo the database_setup.php. because this info already exists the php engine doesnt like it too much.

matt
MatthewRitchie
QUOTE
change relating paths. ie replace shop with your catalog folder name..... use CATALOG_DIR_NAME defined variable


CATALOG_DIR_NAME: this may need the inclusion of configure.php in the dm_header.php file eventhough config is included later in the donor file read by sts to populate the template.
Kaleb008
QUOTE (MatthewRitchie @ Aug 15 2007, 08:11 PM) *
Hi Joshua

Thanks for that. never had the problem myself. just wondering if you were using the same database or made a new db each time. i have had similar warnings when trying to repopulate /rebuild an already existing db or when i redo the database_setup.php. because this info already exists the php engine doesnt like it too much.

matt


looks like I was re-populating, lol I will try this again
gkittell
QUOTE (MatthewRitchie @ Aug 15 2007, 05:11 PM) *
Hi Joshua

Thanks for that. never had the problem myself. just wondering if you were using the same database or made a new db each time. i have had similar warnings when trying to repopulate /rebuild an already existing db or when i redo the database_setup.php. because this info already exists the php engine doesnt like it too much.

matt

hi matt, great contribution.

i have spent the day installing it on RC1 as that is what was available on the oscommerce site and i had already made many mods and was reluctant to take my site back to ground zero i wish someone would build a top ten list of mods to make before any others... probably would become pretty political. anyway, it can become a bit of a house of cards when one's knowledge is limited to just enough to break things.

i too am having these errors and removing white spaces ( a suggestion i found from way back too) did not work for me. i am not sure i can re-do the database given that i have made mods already. however, if you are really sure about that approach, i will restore the original...

i manually installed the powerpack and excluded the globals as i was concerned about conflicts given that this is RC1.

any thoughts on what i should do at this point would be appreciated. thanks.
gkittell
QUOTE (gkittell @ Aug 15 2007, 10:48 PM) *
hi matt, great contribution.

i have spent the day installing it on RC1 as that is what was available on the oscommerce site and i had already made many mods and was reluctant to take my site back to ground zero i wish someone would build a top ten list of mods to make before any others... probably would become pretty political. anyway, it can become a bit of a house of cards when one's knowledge is limited to just enough to break things.

i too am having these errors and removing white spaces ( a suggestion i found from way back too) did not work for me. i am not sure i can re-do the database given that i have made mods already. however, if you are really sure about that approach, i will restore the original...

i manually installed the powerpack and excluded the globals as i was concerned about conflicts given that this is RC1.

any thoughts on what i should do at this point would be appreciated. thanks.



OK mea culpa. thought to remove spaces before final line, not after. FIXED! so please never mind that first posting of mine.

however, i do get the following error on the index page:

Template file does not exist: [templates/sts_template.html;headertags.php]

this error goes away when i change the Default template file under the STS Modules, Default from:

sts_template.html;headertags.php

back to:

sts_template.html

i can live wth this but i think i will be missing some effectiveness of the HTC contribution.
did i misunderstand your installation instructions? as mentioned earlier, i tried to skip the gobal issues as i do have the later release of OScommerce.

thanks for any help you can provide.
MatthewRitchie
QUOTE (gkittell @ Aug 16 2007, 03:04 AM) *
OK mea culpa. thought to remove spaces before final line, not after. FIXED! so please never mind that first posting of mine.

however, i do get the following error on the index page:

Template file does not exist: [templates/sts_template.html;headertags.php]

this error goes away when i change the Default template file under the STS Modules, Default from:

sts_template.html;headertags.php

back to:

sts_template.html

i can live wth this but i think i will be missing some effectiveness of the HTC contribution.
did i misunderstand your installation instructions? as mentioned earlier, i tried to skip the gobal issues as i do have the later release of OScommerce.

thanks for any help you can provide.


default setup:

just incase i mistyped or copied something accross here is what it should be:

Files for normal template
Files to include for a normal template, separated by semicolon

sts_user_code.php;headertags.php

what i think you have done is:

Default template file
Name of the default template file

sts_template.html;headertags.php

headertags.php is a file to be included the same way as sts_user_code whereas sts_template.html is the actual template file that you edit depending upon you particular layout/design/style etc

i believe that if you check this and admend you will have things working properly including htc

matt
MatthewRitchie
QUOTE (gkittell @ Aug 16 2007, 02:48 AM) *
hi matt, great contribution.

i have spent the day installing it on RC1 as that is what was available on the oscommerce site and i had already made many mods and was reluctant to take my site back to ground zero i wish someone would build a top ten list of mods to make before any others... probably would become pretty political. anyway, it can become a bit of a house of cards when one's knowledge is limited to just enough to break things.

i too am having these errors and removing white spaces ( a suggestion i found from way back too) did not work for me. i am not sure i can re-do the database given that i have made mods already. however, if you are really sure about that approach, i will restore the original...

i manually installed the powerpack and excluded the globals as i was concerned about conflicts given that this is RC1.

any thoughts on what i should do at this point would be appreciated. thanks.


please keep us updated on your rc1 install as i have not attempted it yet, however there is much code in the register globals contrib, dispersed accross many files and it would be a right pig to remove it all. better still i can give you all the additional contribs together without reglobs but it will take a couple of days filtering through it myself.

this contrib is currently UNTESTED OR IS NOT BUILD FOR RC1. the reason being, i only heard about rc1 yesterday approx and had virtually completed this contrib for the previous version of osc. sorry a little behind the times still myself.
MatthewRitchie
THE VERSION OF OSC WHICH THIS CONTRIB WORKS WELL WITH -

oscommerce-2.2ms2-060817.zip

UPGRADE INFO FROM 060817 TO RC1

000 --- 001 CODE UPGRADE TO RC1 - osc22rc1_upgrade.html.zip
gkittell
QUOTE (MatthewRitchie @ Aug 16 2007, 03:24 PM) *
please keep us updated on your rc1 install as i have not attempted it yet, however there is much code in the register globals contrib, dispersed accross many files and it would be a right pig to remove it all. better still i can give you all the additional contribs together without reglobs but it will take a couple of days filtering through it myself.

this contrib is currently UNTESTED OR IS NOT BUILD FOR RC1. the reason being, i only heard about rc1 yesterday approx and had virtually completed this contrib for the previous version of osc. sorry a little behind the times still myself.


so far, i am having some trouble with the dynamenu portion but i believe it is my error with configuring the proper root directory in the configure.php file. my hosting service, siteground, only shows me my root directory and then into pubic_html etc... but again, that is something i will investigate further.

as i mentioned, i installed your contribution manually using winmerge. i tried to avoid any changes that were GLOBAL in nature, no pun intended...

however, i am not familiar with all of the changes in RC1, nor am i anywhere near the comptency level required to understand all of the implications. i have to say that this site can be frustrating as it like joining a long running soap opera and not understanding the history.

for example, i installed the STS v4.5.2 / Dynamenu combination manually. now i see that i should have used v4.5.3 STS

i will continue to test, but boy, i have affected so many files at this point.... at least i backed everything up first!

thanks for your help so far.
gkittell
QUOTE (MatthewRitchie @ Aug 16 2007, 03:17 PM) *
default setup:

just incase i mistyped or copied something accross here is what it should be:

Files for normal template
Files to include for a normal template, separated by semicolon

sts_user_code.php;headertags.php

what i think you have done is:

Default template file
Name of the default template file

sts_template.html;headertags.php

headertags.php is a file to be included the same way as sts_user_code whereas sts_template.html is the actual template file that you edit depending upon you particular layout/design/style etc

i believe that if you check this and admend you will have things working properly including htc

matt


yes, you are ban on matt. thanks again.
gkittell
QUOTE (gkittell @ Aug 18 2007, 11:14 AM) *
so far, i am having some trouble with the dynamenu portion but i believe it is my error with configuring the proper root directory in the configure.php file. my hosting service, siteground, only shows me my root directory and then into pubic_html etc... but again, that is something i will investigate further.

as i mentioned, i installed your contribution manually using winmerge. i tried to avoid any changes that were GLOBAL in nature, no pun intended...

however, i am not familiar with all of the changes in RC1, nor am i anywhere near the comptency level required to understand all of the implications. i have to say that this site can be frustrating as it like joining a long running soap opera and not understanding the history.

for example, i installed the STS v4.5.2 / Dynamenu combination manually. now i see that i should have used v4.5.3 STS

i will continue to test, but boy, i have affected so many files at this point.... at least i backed everything up first!

thanks for your help so far.


alright, i am going to start again and install your powerpack contribution on to my modifed RC1 configuration. i will avoid globals and see how it goes. i hope it will be of some assistance to others and it is chance for me to contribute some time (if not expertise...) to the OScommerce community. i will keep you posted on my progress. wish me luck!
MatthewRitchie
QUOTE (gkittell @ Aug 18 2007, 03:43 PM) *
alright, i am going to start again and install your powerpack contribution on to my modifed RC1 configuration. i will avoid globals and see how it goes. i hope it will be of some assistance to others and it is chance for me to contribute some time (if not expertise...) to the OScommerce community. i will keep you posted on my progress. wish me luck!


good luck... ;o)

for anyone else... the contribution will work as is with the old version of osc named ms2.2 060817.

to find your.... as quoted above...

so far, i am having some trouble with the dynamenu portion but i believe it is my error with configuring the proper root directory in the configure.php file. my hosting service, siteground, only shows me my root directory and then into pubic_html etc... but again, that is something i will investigate further.


try making up a new php file and put into it something like this:

<?php
echo '<br>****************************************************************************';
echo '<br>Variables for sts_external_pages_templates setup';
echo '<br>Please see your catalog/includes/configure.php file.';
echo '<br>****************************************************************************';

$catalog_dir_name = substr(dirname(getenv('SCRIPT_NAME')), 1, -8);
ECHO '<bR>catalog_dir_name = '.$catalog_dir_name;

$script_filename = getenv('PATH_TRANSLATED');
if (empty($script_filename)) {
$script_filename = getenv('SCRIPT_FILENAME');
}
$script_filename = str_replace('\\', '/', $script_filename);
$script_filename = str_replace('//', '/', $script_filename);
$dir_fs_www_root_array = explode('/', dirname($script_filename));
$dir_fs_www_root = array();
for ($i=0, $n=sizeof($dir_fs_www_root_array)-1; $i<$n; $i++) {
$dir_fs_www_root[] = $dir_fs_www_root_array[$i];
}

$dir_fs_www_root = implode('/', $dir_fs_www_root) . '/';
$dm_root = $dir_fs_www_root;
$dm_root = substr($dm_root, 0, 0);
echo '<br>dm root = '.$dm_root;

echo '<br>****************************************************************************';
?>
essentially what you want to do is echo to the screen the full root path. there are examples of this being done through the install files. the above code i adopted and placed in install/templates/pages/install_7.php so that the defined variable in configure has the correct setting.

as for dm_header.php in dynamenu, because i have already done the variable build, you then need define it in configure.php or another file say path.php(after install) then put this varaible name in the correct place in dm_header.php as mentioned above.

to start with --- the variable name you need is $dm_root in the example above.

$dm_root = substr($dm_root, 0, -1); ------
-------substr() will cut bits out from the start and end but ive set this to 0,0 so nothing will get cut. so dont worry about that.

this is only a very quick write up but should give you an idea of how to go about it. the above code will therefore need some tinkering but tinkering is what makes us learn so have fun....

matt
MatthewRitchie
.SQL FILES what are they all about?

ive been playing again and have come across a nifty technique of editing all your product info altogether reasonably easilly. when uploaded to mysql via phpmyadmin all your products are edited within 0.3 seconds...... depending on the size of your catalog of course.

what ive done is from admin, download a backup of your catalog. make a copy as it is. take the copy and edit it through admin tools - this separates it out with spaces so you can read it easilly. what you have here is a full backup of you catalog. now go through it an cutout everything not related to your products. essentially there are three table builds you need...

products
product_descriptions
products_to_catagories.

something like that.

edit and make readable without deleating any necessary ():"@ bla bla bla code stuff. now you have one file from which to update everything to do with your products. follow the layout and you shouldnt go wrong.... test on new osc install on localhost and new populaTED DB so you dont distroy anything first. easy update the prices, description etc. i.e. everything you would do through many admin clicks but all thourgh one file

next copy and paste your new sql code into myphpadmin under the sql tab i believe, and hey presto updated products.

though you might like to play with this one..... ;o)

matt
MatthewRitchie
above is harder if your catalog is really really really really really really really really really really really really really BIG!

oh and yea - you need to drop the tables first before reloading product info - i think - because it will try to reload over already existing data which may through up loadsa horrid errors.

p.s. dont ask me for a contrib for this..... ;o)

p.p.s been watching DOCTOR WHO which is cool and im quite hiped --- thus the spelling mistakes ;o0
MatthewRitchie
looke ere --- OSCOMMERCE/STS_M_P_P_V2.zip 155 --- THATS 155 DOWNLOADS OF MY CONTRIB TO DATE

COOL! AWSTATS!

see it pays to have contribs on your own server! you can see how many people are interested! have fun all.... ;o)
gkittell
QUOTE (gkittell @ Aug 18 2007, 11:43 AM) *
alright, i am going to start again and install your powerpack contribution on to my modifed RC1 configuration. i will avoid globals and see how it goes. i hope it will be of some assistance to others and it is chance for me to contribute some time (if not expertise...) to the OScommerce community. i will keep you posted on my progress. wish me luck!


Hi Matt,

here's an update of my progress with installation on RC1:

i'm afraid that having used a modified OScommerce that my results may not be truly representational....
i manually installed your contribution and excluded all the GLOBAL fixes.

GLOBALS portion: not applicable

STS: installed and working well except for a conflict with another contribution (country-state selector) that does not refresh properly. this is a known issue with STS and i am still working on it. it is supposed to have something to do with the formcheck.js.php not being used by STS. refresh works fine when STS is not installed. could STS being using its own form for refreshing?

STS_EXTERNAL:
"home" directory in root needs to be changed to "Home" in order to work properly.

not clear on final path.php as i installed manually. have had some trouble with path resolution on application_top.php when accessed from the root directory
rather than the "catalog" directory. modifications to application_top.php creating errors... again, dependent on the path.php final look. you mentioned in your installation instructions that path.php would change(?) unsure about this point. will review your latest posting about this.

DYNAMENU
menu boxes appear but do not appear as drop downs. just as a more regular looking menu tree. could be something i am doing.
bkellum
QUOTE (MatthewRitchie @ Aug 16 2007, 01:17 PM) *
default setup:

just incase i mistyped or copied something accross here is what it should be:

Files for normal template
Files to include for a normal template, separated by semicolon

sts_user_code.php;headertags.php

what i think you have done is:

Default template file
Name of the default template file

sts_template.html;headertags.php

headertags.php is a file to be included the same way as sts_user_code whereas sts_template.html is the actual template file that you edit depending upon you particular layout/design/style etc

i believe that if you check this and admend you will have things working properly including htc

matt

This is actually incorrect...

In order for STS and HTC to be configured properly in the STS Modules, it should be setup as the following:

For example:
For the Default module, you have a parameter named “Files for normal template”. By default it contains only “sts_user_code.php”. If you modify this parameter to “sts_user_code.php;headertags.php”, you will have Header Tags Controller working for all of the pages using the default template.

Do the same for the other STS modules below:
For the Index module, the parameter is called “Files for index.php template”.
For Product Info module, there are 2 parameters:
“Files for normal template”
“Files for content template”.
MatthewRitchie
QUOTE (gkittell @ Aug 24 2007, 05:39 PM) *
STS_EXTERNAL:
"home" directory in root needs to be changed to "Home" in order to work properly.

yup! forgot to mention it but is easilly ammended in filenames.php - from memory i believe i put in Home.php. YUP AGAIN just checked:
define('FILENAME_HOME', 'Home.php' );

QUOTE
not clear on final path.php as i installed manually. have had some trouble with path resolution on application_top.php when accessed from the root directory rather than the "catalog" directory. modifications to application_top.php creating errors... again, dependent on the path.php final look. you mentioned in your installation instructions that path.php would change(?) unsure about this point. will review your latest posting about this.


[[[me: ive kept osc deliberately separate because root will soon get very messy with loads of files. by keeping root organised as you would with your my_documents or home/burt folders it makes site planing and "cleanup" much easier]]]

path.php is updated during the install process as you can see in install/templates/pages/install_7.php.
prior to install it will only serve to allow the configuration file to be read. ie it does exactly what application top does i.e.
require(includes/configure.php)
after install it should be:
define('CATALOG_DIR_NAME', 'catalog');
this is to make sure that your catalog directories name is correctly inserted is the right files to make externatl pages templates work.

from what you say above it sounds like you are putting all you catalog folder files into the root folder ie htdocs(apache) for instance.
you will therefore have to jiggle all the files relating to external templates to make sure the paths are being created correctly. my suggestions of adding your own debug code will helf extensively. i believe i left some in place in the sts_template.html file.

if all files including the osc files are in root you shouldnt need the fixes to html_output.php, application top.php and others that are using the ifelse(is this the catalog folder? yes do){this}otherwise{make your links flow from root} statements that amend the paths appropriately. if you edit these out you should be able to simply use amendments to the filename.php defined filenames so that the these point to the correct folders and files.

because you have likely installed into htdocsroot. configure.php has no reference to /catalog/ or /shop/ etc and you dont need to learn how to juggle 'behind my back' like i did.

define('CATALOG_DIR_NAME', 'catalog'); is part of the juggling act and you may be able to dispense with it.

QUOTE
DYNAMENU menu boxes appear but do not appear as drop downs. just as a more regular looking menu tree. could be something i am doing.


paths in boxes/dm_header.php need editing relative for root - also image directory/icons etc paths need editing to reflect the relative paths to your catalog/images directory. this should resolve the dm problems. normally flyouts dont work because the dm_footer is not outputed but i have done this at the bottom of application bottom. other methods did not work quite as well. the other reason for flyouts not working is the absolute and relative paths as mentioned in dm_header above.
MatthewRitchie
Dynamenu external pages links are now covered by the session!

here is the trick:

this is the code that creates your sessions compliant links:
. tep_href_link(FILENAME_DOWNLOADS, '', 'EXT') .
tip: you can copy and paste the above from includes/modules/sts_inc/sts_user_code.php

hence it needs to be used with-in the code/.txt that builds the navigation layers in dynamenu; reminder - they look like this at the moment:

.|Home|http://bluegreentechnologies.com/index.php|Home
.|Company|http://bluegreentechnologies.com/Home.php|About Us
..|About Us|http://bluegreentechnologies.com/Company/About_Us.php|About Us
..|Contact Us|http://bluegreentechnologies.com/Company/contact.php|Contact Us
..|Technical Info|http://bluegreentechnologies.com/Company/Technical_Info.php|Technical Info
..|Downloads|http://bluegreentechnologies.com/Company/Downloads.php|Downloads

but adding tep href to layersmenu-horizontal-1.txt doesnt work because it is not a php file. i did try with changing it to .php and doing the recode but it was not liked!

however you can do this:

goto ---> boxes/dm_header.php

change this
// $mid->setMenuStructureFile(DIR_WS_FUNCTIONS . 'dynamenu/layersmenu-horizontal-1.txt.php');
to this:

$navmenu =

".|Index|" . tep_href_link(FILENAME_HOME_INDEX, '', 'EXT') . "|Index\n".
".|Home|" . tep_href_link(FILENAME_HOME, '', 'EXT') . "|Home\n".
".|Company|" . tep_href_link(FILENAME_ABOUT_US, '', 'EXT') . "|About Us\n".
"..|About Us|" . tep_href_link(FILENAME_ABOUT_US, '', 'EXT') . "|About Us\n".
"..|Contact Us|" . tep_href_link(FILENAME_CONTACT, '', 'EXT') . "|Contact Us\n".
"..|Technical Info|" . tep_href_link(FILENAME_TECH_INFO, '', 'EXT') . "|Technical Info\n".
"..|Downloads|" . tep_href_link(FILENAME_DOWNLOADS, '', 'EXT') . "|Downloads\n";

$mid->setMenuStructureString($navmenu);

and all your links will be sessions compliant!

a neet trick ;o)

matt
MatthewRitchie
does it sometimes seem like i am typing this to myself? hello where is everybody ;o) feel free to simply say hi to let me know this is of help to you.
cheers
matt
chemjul2005
Hi,

I installed the megapowerpack today and when I entered the admin-panel all seemed to be ok. STS and Headertag section was there. I activated STS and than I went to the Headertags, filled the tags and tried to set Title etc for index. But it doesnt change! No warnings (after the initial chmod-warnings which i solved). I can't find the development or documents folder that is talked about in README configuration.txt. Am I missing something? Is there another configuration-round that I missed? is the zip-file not complete?

I have been trying to get this HTC and STS combination going for 2 days now. Don't know anymore where to look next.

TIA
gina
bkellum
QUOTE (chemjul2005 @ Sep 7 2007, 12:44 PM) *
Hi,

I installed the megapowerpack today and when I entered the admin-panel all seemed to be ok. STS and Headertag section was there. I activated STS and than I went to the Headertags, filled the tags and tried to set Title etc for index. But it doesnt change! No warnings (after the initial chmod-warnings which i solved). I can't find the development or documents folder that is talked about in README configuration.txt. Am I missing something? Is there another configuration-round that I missed? is the zip-file not complete?

I have been trying to get this HTC and STS combination going for 2 days now. Don't know anymore where to look next.

TIA
gina
Gina,
I am not the author of the MegaPack but I am an author of STS & HTC bundle. Lets take a look at a few things....
  1. Does everything appear to work except the Page Title and Descriptions for the index page?
  2. If #1 is not your issue, Does your metatags appear to be working as you have set them up in the Header Tags Admin page control settings?
For #1, STS does not add the HTC title code automatically. This is by design since STS allows the designer to create specific category and product templates in which the designer could add whatever "flare" he/she desired.

If you prefer to do it the HTC way, you will need to add the HTC code for the catalog/index.php file (only this file) as follows:

Find the following lines in index.php

Around line 70:

Find

CODE


    if ($category_depth == 'nested') {
    $category_query = 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 . "'");
and replace with

CODE


    if ($category_depth == 'nested') {
    $category_query = tep_db_query("select cd.categories_name, c.categories_image, cd.categories_htc_title_tag, cd.categories_htc_description 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 . "'");
=============================================
Around line 78:

Find

CODE


    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
    <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
   </tr>
and replace it with

CODE
           <td><h1><?php echo $category['categories_htc_title_tag']; ?></h1></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
           <?php if (tep_not_null($category['categories_htc_description'])) { ?>
          <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
          <tr>
           <td><h2><?php echo $category['categories_htc_description']; ?></h2></td>
          </tr>
          <?php } ?>
=============================================
Around line 247:

Find

CODE


    ?>
    <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>
and replace it with

CODE


    if (isset($HTTP_GET_VARS['manufacturers_id']))
      $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
    else
      $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");

    $htc = tep_db_fetch_array($db_query);
    ?>
    <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><h1><?php echo $htc['htc_title']; ?></h1></td>

Around line 298

Find

CODE
   <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  </tr>
REPLACE with

CODE
           <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, $category['categories_htc_title_tag'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>          
          <?php if (tep_not_null($htc['htc_description'])) { ?>
          <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
          <tr>
           <td colspan="2"><h2><?php echo $htc['htc_description']; ?></h2></td>
          </tr>
          <?php } ?>


For issue #2, Have you run the Fill Tags routine inside the HTC admin?

Hope the above helped you out,
chemjul2005
Hi Bill,

I was so focused on getting HTC to work (I got the STS working separately a few weeks ago) that I didn't check the STS part. Turns out that isn't working either. But I am confused about the "STS-way"and the "HTC-way". I just want to be able to have 2 or 3 templates for the whole shop STS-style AND be able to have an adjustable title, description and keyword-tag either inserted by me or generated based on what product is showing. And not only in english, also in dutch. I thought I could do that with HTC and STS together. So I think I need the STS-way, not the HTC-way. I will try to get your bundle working (again). Don't be surprised if I am back in a few days with new questions wink.gif

Thanks again.

Gina
bkellum
QUOTE (chemjul2005 @ Sep 8 2007, 02:04 AM) *
Hi Bill,

I was so focused on getting HTC to work (I got the STS working separately a few weeks ago) that I didn't check the STS part. Turns out that isn't working either. But I am confused about the "STS-way"and the "HTC-way". I just want to be able to have 2 or 3 templates for the whole shop STS-style AND be able to have an adjustable title, description and keyword-tag either inserted by me or generated based on what product is showing. And not only in english, also in dutch. I thought I could do that with HTC and STS together. So I think I need the STS-way, not the HTC-way. I will try to get your bundle working (again). Don't be surprised if I am back in a few days with new questions wink.gif

Thanks again.

Gina
The confusing part comes in when HTC tries to do more than it should (in my opinion). What I mean is, HTC should focus on metatag data regarding search engines and such and leave design alone (to a template engine such as STS). Keep in mind, both contributions play a very important role and I use both to accomplish what I need from each.
If you want to use HTC in all its glory, then you will need to add the code I mentioned above. This will allow you to add your titles and descriptions via the HTC admin just as other non-sts users do.
If you want to use HTC just for the keyword search engine tags, then leave the above code alone and then use STS to place your titles and descriptions per specific template pages. The STS User Manual has a hack available to insert dynamic page titles according to category & product. It is basically the same thing that HTC does in the above code. I put this in the manual a long time ago to replace the stock osC titles that screwed with the overall design of the templates. Titles such as "What's New" and "Let's see what we have here", etc.

Overview: Using HTC to handle your titles and descriptions is not a "bad" thing but it just adds more to the STS $content tag. With that said, STS "will" automatically add the HTC keyword and description metadata without the extra code above by placing the <!--$headcontent--> in the head of each of your template pages. What I mean here is it adds the "invisible" keyword tags that is not seen in the browser but is picked up by the search engines. Search engines will also pick up text within your template page itself.

Also, I can not vouch for the integrity of the STS version that is included in the mega pack since I have not had a chance to test it. If all you are wanting is STS and HTC to work together, then I would suggest that you install the latest STS/HTC bundle that I have available on the STS Power Pack site (a site that lists available STS add-ons and STS tips) or use my STS/HTC step by step install guide (see link in my signature below).
kenji815
I"m getting this error after I install oscommerce-2.2ms2-060817 into public_html/catalog_test and the STS MEGA ++

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/XXX/public_html/catalog_test/includes/configure.php:151) in /home/XXX/public_html/catalog_test/includes/functions/sessions.php on line 98

what am i doing wrong?
MatthewRitchie
QUOTE (kenji815 @ Sep 28 2007, 05:41 PM) *
I"m getting this error after I install oscommerce-2.2ms2-060817 into public_html/catalog_test and the STS MEGA ++

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/XXX/public_html/catalog_test/includes/configure.php:151) in /home/XXX/public_html/catalog_test/includes/functions/sessions.php on line 98

what am i doing wrong?


i may be wrong but....

This is saying that there is a descrepancy in the functioning of a function, probably because a defined variable which you will find the the file configure.php does not relate correctly to the variable call in a function located in the sessions.php.

you may want to open the two files and see what resides on these two lines mentioned.

it seems that the problem is to do with the addin header tags contribution. unfortunately I am not well self taught on this contribution yet. but look for code relating to header tags.

depending on which contribution pack you have down loaded (you may have a much older contrib) the problem may have been resolved already. or there may be an answer under the header tags contrib threads. let me know what the file name is so i can pin down the problem better.

matt
MatthewRitchie
QUOTE (kenji815 @ Sep 28 2007, 05:41 PM) *
I"m getting this error after I install oscommerce-2.2ms2-060817 into public_html/catalog_test and the STS MEGA ++

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/XXX/public_html/catalog_test/includes/configure.php:151) in /home/XXX/public_html/catalog_test/includes/functions/sessions.php on line 98

what am i doing wrong?


Hi kenji815

i am back at it again here. i have just been doing a new site rebuild and what a nightmare working on the remote server.!#?

I have com across the same problem as you have above and will try to resolve it and bring you an answer. so far i think it may be to do with how or more to the point when the database_setup.php is done for headertags. i will try a couple of different techniques and see what i can come up with.

matt
MatthewRitchie
QUOTE (kenji815 @ Sep 28 2007, 05:41 PM) *
I"m getting this error after I install oscommerce-2.2ms2-060817 into public_html/catalog_test and the STS MEGA ++

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/XXX/public_html/catalog_test/includes/configure.php:151) in /home/XXX/public_html/catalog_test/includes/functions/sessions.php on line 98

what am i doing wrong?


Hi again,

Yup, found the problem to the above warning message. I dont know why it should matter but you will see when you make the edits.

open [catalog]shop/includes/configure.php

scroll down to the very bottom and you will see extra line spaces below the closing '?>'.

delete these and the problem will vanish into the eather. weird ey!

i think this has been mentioned before in this thread but here it is again just in case.

p.s. i built this contrib with all osc catalog files in a folder called 'shop' hence you will get errors in the external files such as index.php, Home.php and also files in the Company folder. you may get around this the easy way by doing the same, i.e. put your osc catalog files in a folder called 'shop' or you may open the external files and edit in you catalog folder name.
this is also the case for the dynamenu files as i have mentioned above but reitterated here again too.

dm_header and dm_treemenu in the includes/boxes folder

two changes needed

(1) change $myDirPath = '/home/****/public_html/'; to your directory path,
it may look like this for microsoft servers:
$myDirPath = '/Program Files/Apache Group/Apache2/htdocs/';

(2) change 'shop' in
$mid->setImgdir($myDirPath . 'shop/images/');
$mid->setImgwww($myWwwPath . 'shop/images/');
$mid->setIcondir($myDirPath . 'shop/images/');
$mid->setIconwww($myWwwPath . 'shop/images/');
to your catalog folder name.

if you need to restart an install be sure to replace catalog/admin/includes/configure.php and catalog/includes/configure.php with the installation files respectively, this allows the first install screen to open rather than going back to the catalog shop front index.php.

hope these tips help

matt
bkellum
QUOTE (MatthewRitchie @ Oct 9 2007, 01:51 PM) *
p.s. i built this contrib with all osc catalog files in a folder called 'shop' hence you will get errors in the external files such as index.php, Home.php and also files in the Company folder. you may get around this the easy way by doing the same, i.e. put your osc catalog files in a folder called 'shop' or you may open the external files and edit in you catalog folder name.
this is also the case for the dynamenu files as i have mentioned above but reitterated here again too.

Matt,
thumbsup.gif You could solve the confusion in those files by dynamically calling for the catalog folder name which is already defined in the core osCommerce code. OsCommerce is designed in such a way that once a variable is defined such as the catalog in configure.php, you can call for it in any file without having to manually add the catalog name every time you edit those files. Call for the defined catalog and then it will grab the correct one every time.

Simple example:
CODE
echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">


Hope this helps you out,
MatthewRitchie
QUOTE (bkellum @ Oct 9 2007, 10:31 PM) *
Matt,
thumbsup.gif You could solve the confusion in those files by dynamically calling for the catalog folder name which is already defined in the core osCommerce code. OsCommerce is designed in such a way that once a variable is defined such as the catalog in configure.php, you can call for it in any file without having to manually add the catalog name every time you edit those files. Call for the defined catalog and then it will grab the correct one every time.

Simple example:
CODE
echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">


Hope this helps you out,


I would like to take this opportunity to elabourate some on the workings of my contribs here.... especially sts_external_template_pages.

The majority of my contribs use the config file extensively in this way as you say, however the external template pages need to call the configure.php via applicationtop.php directly before they can use the contained defined variables. i.e. for templates to work externally to the catalog folder the files must call applicationtop via an inclued or require statement. at present there is no function in the install process that will write these path variables because firstly i have only supplied very basic external files for de'monster'ation and secondly i have only gone one folder deep but when new folders goind three/four deep, each new folder will need a local template folder like the sts ones i have provided, as well as an osc layout file. ]the layout file is in which someone would build there ''new page'' acording to the body text areas as done in osc.] in each layout file 'newpage' one would need to edit the path to applicationtop.php found in osc/cat/includes.

example: considder the file www[root]/company/about_us.php

note my catalog folder is called 'shop'

define('DIR_WS_INCLUDES', '../shop/includes/' );------------just predefines where to find the includes folder - it is here because there is no facility for pointing to varying degrees of folder depth outside catalog [this is done ok for www[root] in configure.php - see the if else statement but things get complicated from one folder deep onwards.....]

define('STYLESHEET', '../shop/stylesheet.css' );--------not really needed because is done in sts_template.html - redundant?

include('../shop/includes/application_top.php'); ----- important for templates to work externally to osc catalog folder, the '../' points to the parent directory i.e. www[root]

require('lang_en_About_Us.php'); --------- language file for new external pages is in the same folder --- these are only necessary for defined variables such as HEADING_TITLE and TEXT_INFORMATION but these could be illiminated altogether if desired. p.s. i had problems trying to use the osc includes/languages folder using config defined path variables but it should be an easy work around if desired.

$breadcrumb->add(NAVBAR_TITLE, tep_href_link('../'.FILENAME_ABOUT_US)); --- see includes/filenames.php for filename structure - i.e. putting partial paths infront of the file name so that the breadcrum links work correctly. also note the '../' pointing to www[root] as viewed from the catalog folder.

apart from the above the layout file is the same as a standard osc file - you need to keep things like:

<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->

and

<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->

and

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->

so that all the boxes etc work externally to osc. i experimented a lot! with reducing the files down as much as possible but things started to go very wrong when i removed too much.

your file content must go between the following tags:
<!-- body_text //-->
<!-- body_text_eof //-->
this is so that sts can pick up the correct pieces and regurgitate them correctly.

within the above body text comment tags, sts will chop out everything before the '<table' and after '</table>' so you need atleast one table written into the content script, which is not a problem because it is osc standard practice.

finally you still need <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> at the very bottom so that dynamenu etc works flawlessly.

ONE MINOR POINT ---

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

YOUR WARNINGS FOR SAY THE INSTALL FOLDER STILL PRESENT AND CONFIG.PHP NOT SET WITH CORRECT PERMISSIONS WILL NOT SHOW ON EXTERNAL PAGES - I DONT KNOW WHY! i tried removing the above because i thought it as redundant but things cocked up again! still dont ask! please ;o)

below is the full file for reference..........

matt
MatthewRitchie
www[root]/company/about_us.php

QUOTE
<?php
/*
$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

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

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/
define('DIR_WS_INCLUDES', '../shop/includes/' );
define('STYLESHEET', '../shop/stylesheet.css' );
include('../shop/includes/application_top.php');
require('lang_en_About_Us.php');
$breadcrumb->add(NAVBAR_TITLE, tep_href_link('../'.FILENAME_ABOUT_US));

?>
<!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>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="catalog/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- 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="0">
<tr>
<td><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_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo TEXT_INFORMATION; ?></td>
</tr>
<tr>
<td class="main" align=center>

<br><br>Many Thanks for visiting.

<P>Matthew John Ritchie.
<br>www.BlueGreenEnterprises.com

<P><P>Site went live: 5th of May 2007

</td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></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'); ?>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.