Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Changing Boxes

This is a discussion on Changing Boxes within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; From the OSCdox Guide, in Exercise 4 Boxes: Adding New Boxes, it says: Finally, edit the file /catalog/includes/boxes/test.php to look ...

      
  1. #1
    Lurker
    Join Date
    Nov 2003
    Posts
    1
    Rep Power
    0


    Default Changing Boxes

    From the OSCdox Guide, in Exercise 4 Boxes: Adding New Boxes, it says:

    Finally, edit the file /catalog/includes/boxes/test.php to look like this:

    Code:
     <?php
      $info_box_contents = array();
      $info_box_contents[] = array('align' => 'left',
                                   'text'  => BOX_HEADING_TEST
                                  );
      new infoBoxHeading($info_box_contents, false, false);
      $info_box_contents = array();
      $info_box_contents[] = array('align' => 'left',<?php
      $boxHeading = BOX_HEADING_INFORMATION;
      $corner_left = 'square';
      $corner_right = 'square';
    
      $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>'.
                    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGES, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a>';//ICW ORDER TOTAL CREDIT CLASS/GV
    
      require(DIR_WS_TEMPLATES . TEMPLATENAME_BOX);
    ?>
                                   'text'  => '<a href="' . tep_href_link
     (FILENAME_TESTPAGE1, '', 'NONSSL') . '">' . BOX_TEST_LINK1 . '</a><br>' .
                                              '<a href="' . tep_href_link
     (FILENAME_TESTPAGE2, '', 'NONSSL') . '">' . BOX_TEST_LINK2 . '</a><br>' .
                                              '<a href="' . tep_href_link
     (FILENAME_TESTPAGE3, '', 'NONSSL') . '">' . BOX_TEST_LINK3 . '</a><br>' .
                                              '<a href="' . tep_href_link
     (FILENAME_TESTPAGE4, '', 'NONSSL') . '">' . BOX_TEST_LINK4 . '</a>'
    But the code in information.php actually looks like this:

    Code:
    <?php
      $boxHeading = BOX_HEADING_INFORMATION;
      $corner_left = 'square';
      $corner_right = 'square';
    
      $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>'.
                    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGES, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
                    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a>';//ICW ORDER TOTAL CREDIT CLASS/GV
    
      require(DIR_WS_TEMPLATES . TEMPLATENAME_BOX);
    ?>
    Is the documentation just old? I'm having a heck of a time, using the documentation and just adding boxes with links -- seem to be getting the always broken link syndrome, but not sure why...

    Thx

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,477
    Rep Power
    567


    Default

    If you look at the top category for that line of documentation, it is for MS2, not MS2-MAX. The code you have on your site is MS2-MAX code. Big difference. The MS2 docs are not old, but they are for a different build of oscommerce.

    The MS2-MAX docs are in progress.

    To explain a bit more about your code above, look in the /templates and /templates/content directories. That is where the HTML is. It has been moved out of the core PHP files and into template files for easier editing.

    Also, compare the differences in the code. Just paste the variables from the old format into the new format. They are not that different.

    That stuff actually looks like a mistake in the docs. I will have to fix that
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Active Member red_fraggle's Avatar
    Join Date
    Feb 2004
    Location
    wilmington, NC
    Posts
    343
    Rep Power
    8


    Default

    I am having a huge issue msasek, maybe you could help i wish to place another link in the information box which points to my forums URL the files im editing are

    /BOXES/INFORMATION.PHP

    which looked like this:


    $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>'.
    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGE S, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a>';//ICW ORDER TOTAL CREDIT CLASS/GV

    and i changed to this:

    $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>'.
    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGE S, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a>';//ICW ORDER TOTAL CREDIT CLASS/GV
    '<a href="'http:\/\/www.unabridgedbooks.com/forum/, '', 'NONSSL') . '"> ' . BOX_INFORMATION_FORUMS . '</a>';//link to forums added


    I also edited the english.php file from this:

    // information box text in includes/boxes/information.php
    define('BOX_HEADING_INFORMATION', 'Information');
    define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
    define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
    define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
    define('BOX_INFORMATION_CONTACT', 'Contact Us');

    To this :
    // information box text in includes/boxes/information.php
    define('BOX_HEADING_INFORMATION', 'Information');
    define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
    define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
    define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
    define('BOX_INFORMATION_CONTACT', 'Contact Us');
    define('BOX_INFORMATION_FORUMS', 'Forums');


    Am i going about this all the wrong way??


    Cliff...

  4. #4
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,477
    Rep Power
    567


    Default

    For adding new boxes and links, see this tutorial:

    http://oscdox.com/modules.php?op=mod...gNewBoxesToMax

    If all you want to do is add an external link to your page, you could do it by just adding the actual link and text instead of making a new define for it.

    So your code would look like this in information.php:

    Code:
    	'<a href="http://yourforums.com">Forums</a><br>' .
    And the link is added.
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  5. #5
    Active Member red_fraggle's Avatar
    Join Date
    Feb 2004
    Location
    wilmington, NC
    Posts
    343
    Rep Power
    8


    Default

    this code doesnt work, first if you dont escape the two forward slashes, it turns the rest orange which in dreamweaver means escaped and there fore not read.

    using the code as you have supplied doesnt work check www.unabridgedbooks.com/catalog and you'll see it doesnt even show up in the box.


    This is my code:
    $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>'.
    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGE S, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a>';//ICW ORDER TOTAL CREDIT CLASS/GV
    '<a href="http://www.unabridgedbooks.com/forum/">Forums</a><br>' .//link to forums added

    Is it not correct? please check URL.

    Cliff,,,

  6. #6
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,477
    Rep Power
    567


    Default

    Works fine for me... You have not properly coded the php. You have to change the postition of the ; to the last line of the array. I assumed that you knew basic php. Sorry. My link is correct, you just did not add it correctly.
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  7. #7
    Member
    Join Date
    Jan 2004
    Location
    edmonton, Alberta, Canada
    Posts
    62
    Rep Power
    0


    Default

    $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>'.
    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGE S, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a>';//ICW ORDER TOTAL CREDIT CLASS/GV
    '<a href="http://www.unabridgedbooks.com/forum/">Forums</a><br>' .//link to forums added
    Code should be
    $boxContent = '<a href="' . tep_href_link(FILENAME_SHIPPING) . '"> ' . BOX_INFORMATION_SHIPPING . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"> ' . BOX_INFORMATION_PRIVACY . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"> ' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"> ' . BOX_INFORMATION_CONTACT . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_CATALOG_PRODUCTS_WITH_IMAGE S, '', 'NONSSL') . '">' . BOX_CATALOG_PRODUCTS_WITH_IMAGES . '</a><br>' .
    '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '"> ' . BOX_INFORMATION_GV . '</a><br>' . //ICW ORDER TOTAL CREDIT CLASS/GV
    '<a href="http://www.unabridgedbooks.com/forum/">Forums</a><br>'; //link to forums added

    U had some spaces that were not correct and a ";" in the wrong place and also a "." where the ";" should be.

  8. #8
    Active Member red_fraggle's Avatar
    Join Date
    Feb 2004
    Location
    wilmington, NC
    Posts
    343
    Rep Power
    8


    Default

    to be honest i respect your work so much i thought you were infallible, i didnt even bother to look at syntax. when you said heres the code, that was good enough for me lol


    Cliff...

  9. #9
    Active Member red_fraggle's Avatar
    Join Date
    Feb 2004
    Location
    wilmington, NC
    Posts
    343
    Rep Power
    8


    Default

    and nope, dont know PHP very well, I am using this software to learn, mostly why. Plus i bought the books. shouldnt be long as i am smarter than a box of rocks.

    Cliff...

  10. #10
    Active Member red_fraggle's Avatar
    Join Date
    Feb 2004
    Location
    wilmington, NC
    Posts
    343
    Rep Power
    8


    Default

    regardless it is interesting to note that when i add this link to the top of the array, it works fine. but if added to the bottom of the array, and moving the semi-colon to the last line, it causes a parse error. WAIT, i need a period at the end of the line i moved the semi-colon from right?

    See i can learn PHP.....WOOOOT

Page 1 of 2 12 LastLast

Similar Threads

  1. change boxes background color now have double boxes
    By ANNIE11 in forum osCMax v1.7 General Mods Discussion
    Replies: 0
    Last Post: 08-22-2005, 08:16 PM
  2. Changing Boxes
    By dallibab in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 08-16-2004, 08:07 PM
  3. boxes and CSS
    By moisea in forum osCommerce 2.2 Modification Help
    Replies: 6
    Last Post: 01-08-2004, 06:59 AM
  4. Changing around info boxes...couple questions
    By stick00 in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 11-01-2003, 11:05 PM
  5. Help on boxes
    By noppie in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 07-21-2003, 09:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •