Page 15 of 35 FirstFirst ... 5131415161725 ... LastLast
Results 141 to 150 of 347
  1. #141
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Then it would seem to be a valuable feature to add the ability to select positions independently:)
    I haven't looked at the controlling code myself to know how big of a job that would be.

  2. #142
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Quote Originally Posted by gjh42 View Post
    Then it would seem to be a valuable feature to add the ability to select positions independently:)
    I haven't looked at the controlling code myself to know how big of a job that would be.
    LOL well seeing that you wrote the current controlling code.. But yes.. I agree.. Though in my defense I had not considered this as I was trying to solve a very specific layout need.. (not that I would know how to code the feature in anyway..)
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  3. #143
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Hmm... I had forgotten exactly which part of the code I had had a hand in:) Well then, I suppose I can have a look at it when I get time and see what it would involve. I didn't have anything to do with admin files, though.

  4. #144
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Quote Originally Posted by gjh42 View Post
    Hmm... I had forgotten exactly which part of the code I had had a hand in:) Well then, I suppose I can have a look at it when I get time and see what it would involve. I didn't have anything to do with admin files, though.
    You had a VERY instrumental hand in the current version sir (still grateful to you for that too..)
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #145
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    When first looking at the workings of this mod, I had in mind allowing individualized middlebox control, though I would have done it by defines rather than admin settings. I didn't pursue it at that time.

    With this challenge, I have poked into admin configuration settings for the first time (learning something about how they work along the way), and have a package of alterations that I think will do the job when applied in full to the files.
    install_middleboxes.sql
    PHP Code:

    //install_middleboxes.sql

    SET @mid4=0;
    SELECT (@mid4:=configuration_group_id) as mid4 
    FROM configuration_group
    WHERE configuration_group_title
    'Editable Centerboxes';
    DELETE FROM configuration WHERE configuration_group_id = @mid4;
    DELETE FROM configuration_group WHERE configuration_group_id = @mid4;

    INSERT INTO configuration_group VALUES (NULL'Editable Centerboxes''Settings for Editable Centerboxes''100''1');
    UPDATE configuration_group SET sort_order last_insert_id() WHERE configuration_group_id last_insert_id();
    SET @mid4=0;
    SELECT (@mid4:=configuration_group_id) as mid4 
    FROM configuration_group
    WHERE configuration_group_title
    'Editable Centerboxes';
    /*MIDDLEBOX_QTY becomes obsolete*/
    /*INSERT INTO configuration VALUES (NULL, 'Middleboxes - Number to Display', 'MIDDLEBOX_QTY', '3', 'Define the number of middleboxes to display. The module comes with 9 middleboxes.', @mid4, 49, now(), now(), NULL, 'zen_cfg_select_option(array(''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7'', ''8'', ''9''), ');
    INSERT INTO configuration VALUES (NULL, 'Middleboxes - Position', 'MIDDLEBOX_POSITION', '0', 'Positioning options for the middleboxes.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @mid4, 49, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');*/
    /*allow middleboxes on internal category listings if desired*/
    INSERT INTO configuration VALUES (NULL'Middleboxes - Homepage Only?''MIDDLEBOX_HOME''1''Display middleboxes on homepage only, or allow to display on internal categories pages?', @mid449now(), now(), NULL'zen_cfg_select_option(array(''0'', ''1''), ');
    INSERT INTO configuration VALUES (NULL'Middlebox 1 - Position''MIDDLEBOX_NUMBER_1''0''Location to display middlebox 1.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @mid449now(), now(), NULL'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL'Middlebox 2 - Position''MIDDLEBOX_NUMBER_2''0''Location to display middlebox 2.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @mid449now(), now(), NULL'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    /*repeat for 9 middleboxes*/ 
    tpl_index_default.php and tpl_index_categories.php
    PHP Code:
    <?php
    //test 20120109 - code for tpl_index_default.php and tpl_index_categories.php
    //replicate for each location changing == 1 to == 2 etc.
    if($this_is_home_page or !MIDDLEBOX_HOME) {//only in tpl_index_categories.php
    if (isset($middleboxes_group)) unset $middleboxes_group;
    for (
    $i=1$i<=9$i++) {
      if (
    constant('MIDDLEBOX_NUMBER_' $i) == 1$middleboxes_group[] = $i;
    }
    if (isset(
    $middleboxes_group)) {?>
    <!-- Begin Main Page Middleboxes Above Main Page Define -->
    <?php
    require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_middlebox_controller.php');
    ?> 
    <!-- End Main Page Middleboxes Above Main Page Define -->
    <?php }
    }
    //only in tpl_index_categories.php
    //test 
    ?>


    <?php if (MIDDLEBOX_POSITION == 1) {//original code for tpl_index_default.php and tpl_index_categories.php ?>
    <!-- Begin Main Page Middleboxes Above Main Page Define -->
    <?php
    if($this_is_home_page) require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_middlebox_controller.php');
    ?> 
    <!-- End Main Page Middleboxes Above Main Page Define -->
    <?php ?>
    /includes/templates/your_template/templates/tpl_middlebox_controller.php
    PHP Code:
    <?php /*
     *  /includes/templates/your_template/templates/tpl_middlebox_controller.php      test  gjh42 2010-09-20  20120109
     */
    ?>

    <div class="navColumnMiddleWrapper">
    <?php
    for($i=1$i<=sizeof($middleboxes_group); $i++) {
      
    $box_no $middleboxes_group[$i];
    ?>
    <div class="middleBoxContainer" id="middlebox_<?php echo $box_no?>">
    <h2 class="middleBoxHeading" id="middlebox<?php echo $box_no?>Heading"><?php echo constant('BOX_HEADING_MIDDLEBOX' $box_no); ?></h2>
    <div class="middleBoxContent" id="middlebox<?php echo $box_no?>Content">
    <?php require zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'constant('FILENAME_DEFINE_MIDDLEBOX_' $box_no), 'false');?>
    </div></div>
    <?php 
    }//for ?>
    </div>
    <br class="clearBoth" />
    PHP Code:
    <?php
    // in tpl_middlebox_x_default.php, the heading should not be <h1> which will already be on the page, 
    // but <h2> or <h3> like stock centerboxes
    ?>
            <h1 id='middlebox_1-heading'><?php echo HEADING_TITLE?></h1>
    <?php /*
     *  /includes/templates/your_template/templates/tpl_middlebox_controller.php      test  gjh42 2010-09-20  20120109
     */
    ?>
    To be honest, I am not clear on the relationship between tpl_middlebox_controller.php and tpl_middlebox_x_default.php, as they appear to produce duplicate content. Are the tpl_middlebox_x_default.php files actually ever active?
    Last edited by gjh42; 10 Jan 2012 at 04:13 AM.

  6. #146
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    This will allow each of nine middleboxes to be activated for one of the seven page positions. If 'Middleboxes - Homepage Only?' is set to 0, positions 4 through 7 would be able to display on internal category listing pages (useful when tpl_index_default is active on the homepage).
    The middleboxes active in each position will display in numeric order within that section.

    This line and its closing } are only needed in tpl_index_categories.php, since tpl_index_default.php is never used elsewhere than the homepage.
    PHP Code:
    if($this_is_home_page or !MIDDLEBOX_HOME) {//only in tpl_index_categories.php 
    I have not tested this code, so I would appreciate feedback on how it works when put into the files (and if it doesn't work, we can work on debugging:). Look over the SQL carefully, as I'm not sure I understand it well enough to have edited it correctly.

  7. #147
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Something that needs to be confirmed by testing is
    PHP Code:
      if (constant('MIDDLEBOX_NUMBER_' $i) == 1$middleboxes_group[] = $i
    For the first position, testing for a value == 1 might give misleading results, as simply being set can be interpreted by PHP as '1' or true. If it is 0, it should evaluate to false and not trigger for position 1. Just in case this fails, you could change that one test to === 1 (or maybe === '1' ) (precisely 1, not just "evaluates to 1"). Other values would not have the possibility of ambiguity.

  8. #148
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Noticed another mistake: This test needs to go from 0 to sizeof -1, as auto-indexed arrays start with item 0.
    PHP Code:
    for($i=1$i<=sizeof($middleboxes_group); $i++) { 
    PHP Code:
    for($i=0$i<=sizeof($middleboxes_group)-1$i++) { 
    or
    PHP Code:
    for($i=0$i<sizeof($middleboxes_group); $i++) { 

  9. #149
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Eyes crossing.. If I have some spare time this weekend, I might be able to test this.. Got three sites I'm working on and a singing gig Saturday night to rehearse for.. So I've got a LOT on my plate.. But I'll do my best..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  10. #150

    Default Re: Editable Home Page Centerboxes

    is there an update to this module so it can work with Zen cart 1.5 ?

 

 
Page 15 of 35 FirstFirst ... 5131415161725 ... LastLast

Similar Threads

  1. v154 Editable Invoices & Packing Slips [Support]
    By dbltoe in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 7 Oct 2015, 11:44 PM
  2. Admin-Editable Sidebox - Support Thread
    By kuroi in forum Addon Sideboxes
    Replies: 331
    Last Post: 29 Oct 2014, 04:15 AM
  3. Move Define Page Text to bottom of page, below centerboxes
    By AirsoftOutfitter in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Jul 2011, 02:13 AM
  4. Editable Home Page Centerboxes click-able links
    By colhemm in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 22 Feb 2011, 09:04 PM
  5. Image above centerboxes on main page
    By direwolf in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 May 2008, 06:40 PM

Posting Permissions

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