Jump to content

DiamondSea

Members
  • Content count

    249
  • Joined

  • Last visited

Everything posted by DiamondSea

  1. Simple Template System (STS) README.txt v1.3 Contribution Author: Brian Gallagher @ DiamondSea.com Contribution Author Email: brian@diamondsea.com ----------------------------------------------------------------------------- WHAT IT DOES: ----------------------------------------------------------------------------- Lets you create simple HTML templates to customize the look and feel of OSC. You simply create an HTML page that looks the way you want it to and put in placeholders for the various elements wherever you want to position them. For example, you would put "$cartbox" wherever on the page you want the Shopping Cart box to appear. Put "$categorybox" where you want the Categories box to appear. Put "$content" wherever you want the main page content (the central part where all the magic happens) to appear, etc. It does this by changing only a few /catalog/includes/ files, leaving all other files untouched, making it easy to add other contributions later. ----------------------------------------------------------------------------- BONUS FEATURES: Simple HEADER TAG CONTROLLER Integration ----------------------------------------------------------------------------- This contribution also allows you to use WebMakers.com's Header Tag Controller contribution without having to modify every file on the system. Just copy the Header Tag Controller's include files into place and STS will automatically add them to all pages without having to modify every PHP script in the /catalog/ directory. STS will auto-detect if Header Tag Controller is installed and use it if available. ----------------------------------------------------------------------------- HOW TO INSTALL: ----------------------------------------------------------------------------- Installation Instructions are found in the readme.txt file included in the package. Please read the readme.txt file for a list of installation instructions, new features, new variables and other enhancements to STS. ----------------------------------------------------------------------------- HOW TO USE: ----------------------------------------------------------------------------- Just modify the /catalog/includes/sts_template.html file to look however you want. Use stylesheet settings or HTML setting to provide a custom look and feel to your site and arrange elements wherever you like them. ----------------------------------------------------------------------------- SUPPORTED TAGS: ----------------------------------------------------------------------------- Here are the tags that are supported so far (more sure to come in later versions): $headcontent: Put this string in your <head> section so that it can insert the dynamic head content and javascript on pages that require it. This will probably require putting the $headcontent in the <head> section in the source code. It's a pain to do it this way, but it was the only way I could get it working. Sorry! <!--$headcontent--> : You can use this commented format of $headcontent to keep the word "$headcontent" from displaying in your web authoring software. NOTE: Do not put <title>...</title> tags in your header. It will be added as part of the $headcontent variable, along with the Description and Keywords meta tags if you have the WebMakers.com's Header Tag Controller contribution installed. $cataloglogo: The OSC logo and link $urlcataloglogo: The URL used by the $catalog logo. $myaccountlogo: The MyAccount graphic and link $urlmyaccountlogo: The URL used by the My Account function $cartlogo: The Cart graphic and link $urlcartlogo: The URL used by the Cart function $checkoutlogo: The Checkout graphic and link $urlcheckoutlogo: The URL used by the Checkout function $breadcrumbs: The "Top > Catalog > whatever..." breadcrumbs text and links $myaccount: The text version of "My Account" and link. Changes to "Logoff" if logged on. $urlmyaccount: The URL used by the MyAccount function. $cartcontents: The text version of the "Cart Contents" function. $urlcartcontents: The URL used by the MyAccount function. $checkout: The text version of the "Check Out" function. $urlcheckout: The URL used by the "Check Out" function. $categorybox: The Category box $manufacturerbox: The Manufacturer box $whatsnewbox: The What's New box $searchbox: The Search box $informationbox: The Information box $cartbox: The Shopping Cart box $maninfobox: The Manufacturer Info box (blank if not used on a page) $orderhistorybox: The Order History box (blank if not used on a page, ie: use not logged in) $bestsellersbox: The Best Sellers box $specialfriendbox: Either the Specials box or the Tell A Friend box (depending on page viewed) $reviewsbox: The Reviews box $languagebox: The Languages box $currenciesbox: The Currencies box $content: The main content of the page (the middle of the page) $date: The current date $numrequests: The "XXX requests Since DATE" text $counter: The page view counter $footer: The footer output from footer.php $banner: The banner output from footer.php $sid: The string for the Session ID in the format "SessionIdVarName=WhateverTheSessionIdIs" ----------------------------------------------------------------------------- DEBUGGING: ----------------------------------------------------------------------------- In the /catalog/includes/application_bottom.php file you can see the following settings (near the top of the file): $display_template_output = 1; $display_normal_output = 0; $display_debugging_output = 0; Display_Template_Output (the default setting) will cause it to display the template versions of the pages. Display_Normal_Output will cause it to display the non-template version of the pages. Display_Debugging_Output will cause it to display debugging information showing all of the blocks of data that it is using and how it translates them into template variables. You can use any or all of the settings in any combination. If you have both Normal and Template output, the Template output will be displayed first. ----------------------------------------------------------------------------- REMOTE DEBUGGING: ----------------------------------------------------------------------------- You can toggle the debugging options via URL options. You can use the following parameters in your URL to turn on/off options from your browser sts_template=1 Turns on the Template display sts_template=0 Turns off the Template display sts_normal=1 Turns on the Normal display sts_normal=0 Turns off the Normal display sts_debug=1 Turns on the Debugging display sts_debug=0 Turns off the Debugging display sts_version=1 Turns on Version Number display sts_version=0 Turns off Version Number display ----------------------------------------------------------------------------- SUPPORT: ----------------------------------------------------------------------------- For support, please post to this thread.
  2. DiamondSea

    [contribution] Simple Template System (sts)

    Sorry, I'm trying to keep up, but am plenty busy with my day to day workload to devote a whole lot of time on here... I'm trying.... :-) - Brian
  3. DiamondSea

    [contribution] Simple Template System (sts)

    I'd be happy to work on this if someone can point me to a site having this problem, and give me the Parse_Times from running it both with and without STS. - Brian
  4. DiamondSea

    [contribution] Simple Template System (sts)

    The changes you make in product_info.php you will also need to make in sts_product_info.php and assign the appropriate information to a template variable. Look at the difference between product_info.php and sts_product_info.php to see how it's done. - Brian
  5. DiamondSea

    [contribution] Simple Template System (sts)

    Use the $langid variable in your image path names. ie: /img/logo/banner-$langid.gif Then create banner-1.gif, banner-2.gif, etc, depending on the languages being used. The number for the LangID will come from your particular osC implementation. - Brian
  6. DiamondSea

    [contribution] Simple Template System (sts)

    I believe this is an osC problem, not an STS one. Sorry... - Brian
  7. DiamondSea

    [contribution] Simple Template System (sts)

    mcseay just pointed out a bug in the STS3beta2 templates: This should fix the problem. This is something that probably everybody will need to fix until the next version goes up. Sorry I missed this one! - Brian
  8. DiamondSea

    [contribution] Simple Template System (sts)

    In .../includes/sts_templates/*/sts_osc_javascript.js remove the first and last lines from the file: <script language="javascript"><!-- from the beginning and --></script> from the end. That will prevent the error messages. This will be fixed in the next release. - Brian
  9. DiamondSea

    [contribution] Simple Template System (sts)

    New Simple Template System (STS3) v3.00 Beta 2 Available: New: Manufacturer templates (and manufacturer bugfix from old versions) CHANGELOG.txt from v3.00 Beta 1 CHG: Change samples and live code in sts_user_code to use the defined $sts_block_name variable when assigning values to $template[] CHG: Detect and user Manufacturer templates when searching by manufacturer. Uses index.php_mfr.html for the default manufacturer template, or index.php_mfr_##.html (replace ## with manufacturer id) for per-manufacturer templates CHG: Added $templatepath / $templatedir variables for scripting directory location of template files in templates CHG: Modified .../sts_templates/osc/ templates to use $templatepath variables in templates to specify .js and .css files ADD: Created copy of .../sts_templates/osc/ in .../sts_templates/mysite/ for a play area, preserving /osc/ for testing CHG: Modify defaults in configure-SAMPLE.php to use "mysite" template directory CHG: Quick Install summary in README.txt ADD: sts_functions.php file for some extra routines that will be used later
  10. DiamondSea

    [contribution] Simple Template System (sts)

    The installation instructions are pretty much the same, except the layout of the template files has changed a bit. Best and easiest way to install: 1) Install Clean MS2.2 version 2) Test and see if it works 3) Go into /catalog/includes (or whatever you called it) 4) Extract all the STS3 files from the ZIP file, preserving the directory structure. 5) Copy the define statements from the end of configure-SAMPLE.php to your working configure.php file 6) Test and see if it works 7) Done. You can then start playing with the templates. I recommend creating/modifying your templates in this order, and one at a time: 1) sts_templates.html This sets the general look and feel for your entire site. This is the only required template. If you want to further customize your site, then you can also create: 2) index.php_0.html This is the template for the home page category 3) index.php_???.html These are the templates for specific categories, where ??? should be replaced by the categoryID or cPath for the category 4) product_info.php.html This is the generic product_info template. 5) product_info.php_c???.html This lets you set a product_info template by category (note the "c" before the "???"). ??? should be replaced by a category id or cPath. 6) product_info.php_???.html This lets you set a product_info template by product id. ??? should be replaced by the product id for the item. 7) index.php_mfr.html (New to the version 3.00b2) Lets you define a generic template for the "Search by Manufacturer" pages. 8) index.php_mfr_???.html (New to the version 3.00b2) This lets you define a manufacturer template by Manufacturer ID. - Brian
  11. DiamondSea

    [contribution] Simple Template System (sts)

    The installation instructions are pretty much the same, except the layout of the template files has changed a bit. Best and easiest way to install: 1) Install Clean MS2.2 version 2) Test and see if it works 3) Go into /catalog/includes (or whatever you called it) 4) Extract all the STS3 files from the ZIP file, preserving the directory structure. 5) Copy the define statements from the end of configure-SAMPLE.php to your working configure.php file 6) Test and see if it works 7) Done. You can then start playing with the templates - Brian
  12. DiamondSea

    [contribution] Simple Template System (sts)

    1. GZip compression worked when I tried it on my test site. 2. So far, just skipping the scan of the category tables unless $url_* or $urlcat_* are being used. If you can identify specific queries that should be optimized, I'll be happy to look into it more. In fact, that would be particularly useful seeing as other people are having different issues than I am with the sites I'm working on. - Brian
  13. DiamondSea

    [contribution] Simple Template System (sts)

    Why did you have to put it outside the sts directory? - Brian
  14. DiamondSea

    [contribution] Simple Template System (sts)

    I'd leave the /sts_templates/osc folder alone so you have a known-working reference point for debugging things later. Make a new directory (ie: /sts_templates/yoursite) and change the STS_TEMPLATE_DIR define in your configure.php file to match it. For the easiest debugging, make all files and links root-relative (ie: <img src="/path/to/image.jpg">) with a leading slash and not http:/ at the beginning. This will make the images show correctly when viewing the templates, in your HTML editor, and in both your regular and SSL versions of the pages. Make changes to the sts_template.html file first, which controls the entire site. After you get that working, then work on category or product templates after the basic one is working. If you are using Dreamweaver, you can even use the Dreamweaver templates feature to design your template pages' general design, if you want a handy way of managing all your STS template files. (Sounds confusing, but is pretty easy). - Brian
  15. DiamondSea

    [contribution] Simple Template System (sts)

    There should be new template files in /includes/sts_templates/osc/* if you unzipped it correctly. Also, make sure you have all the DEFINEs from the new configure-SAMPLE.php in your configure.php file. Add &sts_debug=1 to your URL in your browser when viewing a page and it will display the template files it is looking for and if it found any of them. That should help track down the error. - Brian
  16. DiamondSea

    [contribution] Simple Template System (sts)

    Thanks! Glad it's helpful! If I could just get someone to pay all my bills for me I'd be able to spend a lot more time here! :huh: - Brian
  17. DiamondSea

    [contribution] Simple Template System (sts)

    Also note that the ZIP file now contains subdirectories, so extract it with the appropriate options if needed to preserve the directory structure.
  18. DiamondSea

    [contribution] Simple Template System (sts)

    Okay, I put up a beta release for you to start playing with here: http://www.oscommerce.com/community/contributions,1524 This version moves all the templates files into a new directory structure which you can then switch in code by changing the STS_TEMPLATE_DIR to another directory, the default ("osc") template files have been changed to match the default site look in the product_info templates, and a product_info_debugging template has been added just for the heck of it. The osc Javascript has been moved to /includes/sts_templates/{TEMPLATE}/sts_osc_javascript.js so you can just include that as opposed to pasting stuff into your templates manually. Live PHP code now works in the template (just ignore the fact that they are still called with .html extensions). The category and product_info templating abilities has been improved to allow for heirarchial category templates (if there isn't a template for the current category, it will check to see if there is a template for the parent categories) and products (you can define a product_info template that will be applied to all items in particular categories. Don't have the finer detail level stuff done yet for making the boxes better, and recommend no longer using the $url_* and $urlcat_* tags, but making direct links (see changelog), and templates not yet switchable dynamically. Let me know if you run into any problems with it. CHANGELOG.txt: v3.00 ADD: Dynamic templating abilities with Inline PHP Code in template files CHG: Change template structure so all templates are encapsulated within their own directory under /includes/sts_templates/{TEMPLATE} ADD: New DEFINE in configure.php STS_TEMPLATE_DIR to control the directory to take the template from ADD: Ability to completely turn off STS processing with $no_sts=1 in /includes/application_top.php or as parameter ?no_sts=1 CHG: Move stock osC javascript functions to external file in /includes/sts_templates/{TEMPLATE}/sts_osc_javascript.js CHG: Only looks up $url_* and $urlcat_* variables if present in the template file CHG: Recommend not using $url_* and $urlcat_* variables. Recommend instead just using a direct link to the category with an $sid (ie: /index.php?cPath=10&$sid) ADD: variable $sysmsgs to contain various osCommerce system error messages (ie: bad perms on configuration.php, etc) ADD: Category and sub-category-based templates. (ie: if cPath=3_10, it will use the first template found of: index.php_3_10.html, index.php_10.html, index.php_3.html, index.php.html and sts_template.html) This allows per-category templates, as well as sub-category templates (categories below the templated one) ADD: Per-Product and Product-Category-based templates (ie: if cPath=3_10 and ProductID=12, it will use the first template found of: product_info.php_12.html, product_info.php_c3_10.html, product_info.php_c10.html, product_info.php_c3.html, product_info.php.html, sts_template.html). Note that the Per-Product templates for each category and subcategory have a "c" in front of them to distinguish them from the productID-based templates. ADD: $regularpricestrike variable for product_info.php.html which contains "<s>$regularprice</s>" if a specialprice is set ADD: Setting debugging info will show the template files being checked for and the one selected README.txt: The readme file has not yet been updated to reflect 3.00 changes Have fun! - Brian Gallagher
  19. DiamondSea

    [contribution] Simple Template System (sts)

    I'm trying to put in a few bug fixes from past versions and duplicating the old product_info.php look and feel in the default template. You want me to put up a beta release to play with in the meantime? :-) Also, if you're on the mailing list I'll be sending out when the official version come out. - Brian
  20. DiamondSea

    [contribution] Simple Template System (sts)

    STS should generally have the code to include the default oscommerce .CSS file, unless you are completely redefining every single tag. If you want your own custom styles, either modify the original osC CSS file, or include your own definitions after the osC CSS file has been included. - Brian
  21. DiamondSea

    [contribution] Simple Template System (sts)

    Whatever changes are made in product_info.php you will need to duplicate in /includes/sts_product_info.php and assign the HTML generated by the code to a template variable (such as $template['moreimages'] or $template['image2'] or however you choose to implement it. Then just use the variables you created ($moreimages, $image2, etc) in your template where you want it to appear. - Brian
  22. DiamondSea

    [contribution] Simple Template System (sts)

    This line was originally there to include the standard osC stylesheet in the template, but it was commented out because it was more flexible to simply put the stylesheet link into the template manually. That way you aren't bound to using the osC one. - Brian
  23. DiamondSea

    [contribution] Simple Template System (sts)

    Just FYI, I'm going to be releasing Simple Template System v3.00 (STS3) shortly that will have some powerful new features, including: - Inline PHP Coding (yes, you can now run PHP code IN YOUR TEMPLATES !) - Finer Tag Control (yes, you can make whatever box you want and put the content tag in it) - Improved Templating Options (multiple templates, switchable by URL options) - Improved Category Template options (heirarchial categories) - Improved Speed (streamlining some slow parts people have mentioned) - "Drag and Drop" Templates - Simply copy a new directory into /sts_templates/ and you've got a new live template on your site) - ...and I'm calling it STS3 so you can search for it in the forums! and a bunch of bug fixes (and hopefully few new ones dry.gif ) and assorted other new features that people have been wanting. I'm hoping to have this up within the week. If there's a particular thing you want addressed, mention it now cool.gif. Cheers! :thumbsup: - Brian
  24. DiamondSea

    STS Error After Moving Store

    It means that you don't have the STS "define" statements in your configure.php file. Look at the configure-sample.php file for a list of the variables that need to be in there, or consult the STS README.txt file. Should be a 10 second fix, just copy the lines into your configure.php: // STS: ADD: Define Simple Template System files define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php'); define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php'); define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php'); define('STS_TEMPLATE_DIR', DIR_WS_INCLUDES . 'sts_templates/'); define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html'); define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php'); define('STS_USER_CODE', DIR_WS_INCLUDES . 'sts_user_code.php'); define('STS_PRODUCT_INFO', DIR_WS_INCLUDES . 'sts_product_info.php'); // STS: EOADD - Brian
  25. DiamondSea

    [contribution] Simple Template System (sts)

    1) You need to copy the code that prints out the reviews into sts_product_info.php and put the require(STS_START_CAPTURE) and require(STS_STOP_CAPTURE) around it, and set the captured text to a template value. Look at how all the other variables are assigned in sts_product_info.php and you should see how to do it. 2) I thought I did, but I guess not. Please restate your question with more explanation of what you want to accomplish. (Don't repost the old one, I obviously didn't understand it the first time). - Brian
×