Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Admin page registration for updated mod

    I am converting the Editable Centerboxes mod for v1.5.0 compatibility while improving it, and testing on my local XAMPP installation. I believe I have written the SQL correctly for admin page registration, but the new item is not appearing in the Configuration dropdown. All of the db fields are populated as expected (and matching related ones as I believe they should) in admin_pages, configuration and configuration_group tables. If I navigate directly to the configuration group, all of the new settings are there and work correctly.

    Can anyone see anything in this SQL that would not work properly? Or is there yet something else that needs to be done for this to work?

    Code:
    # Clears out any pre-existing Middleboxes configuration settings
    SELECT @middleboxesid:=configuration_group_id FROM configuration_group WHERE configuration_group_title= 'Editable Centerboxes';
    DELETE FROM configuration WHERE configuration_group_id = @middleboxesid;
    DELETE FROM configuration_group WHERE configuration_group_id = @middleboxesid;
    DELETE FROM admin_pages WHERE language_key='BOX_CONFIGURATION_EDITABLE_CENTERBOXES';
    
    # Insert New Middleboxes Configuration Group (will be indexed differently to any old one cleared out above)
    INSERT INTO configuration_group VALUES (NULL, 'Editable Centerboxes', 'Settings for Editable Centerboxes', '100', '1');
    SET @middleboxesid = LAST_INSERT_ID();
    UPDATE configuration_group SET sort_order = @middleboxesid WHERE configuration_group_id = @middleboxesid;
    # Register the pages for Admin Access Control
    INSERT INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order)
    VALUES ('configEditableCenterboxes','BOX_CONFIGURATION_EDITABLE_CENTERBOXES','FILENAME_CONFIGURATION',CONCAT('gID=',@middleboxesid),'configuration','Y',@middleboxesid);
    
    INSERT INTO configuration VALUES (NULL, 'Middleboxes - Homepage Only', 'MIDDLEBOX_HOME', '1', 'Display middleboxes on homepage only, or allow to display on internal categories pages?<br /><br />0=All, 1=Home', @middleboxesid, 49, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 1 - Location', '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', @middleboxesid, 51, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 2 - Location', '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', @middleboxesid, 52, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 3 - Location', 'MIDDLEBOX_NUMBER_3', '0', 'Location to display middlebox 3.<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', @middleboxesid, 53, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 4 - Location', 'MIDDLEBOX_NUMBER_4', '0', 'Location to display middlebox 4.<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', @middleboxesid, 54, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 5 - Location', 'MIDDLEBOX_NUMBER_5', '0', 'Location to display middlebox 5.<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', @middleboxesid, 55, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 6 - Location', 'MIDDLEBOX_NUMBER_6', '0', 'Location to display middlebox 6.<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', @middleboxesid, 56, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 7 - Location', 'MIDDLEBOX_NUMBER_7', '0', 'Location to display middlebox 7.<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', @middleboxesid, 57, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 8 - Location', 'MIDDLEBOX_NUMBER_8', '0', 'Location to display middlebox 8.<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', @middleboxesid, 58, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    INSERT INTO configuration VALUES (NULL, 'Middlebox 9 - Location', 'MIDDLEBOX_NUMBER_9', '0', 'Location to display middlebox 9.<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', @middleboxesid, 59, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
    The last row in the admin_pages table looks like this:
    configEditableCenterboxes BOX_CONFIGURATION_EDITABLE_CENTERBOXES FILENAME_CONFIGURATION gID=31 configuration Y 31

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Admin page registration for updated mod

    I believe the problem would be the need to use something like:
    zen_cfg_select_option(array(\'0\', \'1\', \'2\')
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Admin page registration for updated mod

    Hmm, yes, I recall seeing things like that in other SQL patches - I basically copied those insert statements from the existing version of this mod. But the configuration settings when I access them directly work fine. How would the configuration table inserts affect the admin_pages registration?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Admin page registration for updated mod

    Can you check if you have the define setup somewhere for:
    BOX_CONFIGURATION_EDITABLE_CENTERBOXES

    I ran your code and it appears to come up as written, don't know if it works as required, but I cannot see it until I add a define for the:
    BOX_CONFIGURATION_EDITABLE_CENTERBOXES
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Admin page registration for updated mod

    Aha! I didn't see any documentation anywhere that that needed to be defined. So this is a constant that is fed into and used by the db instead of one that is created by it. It should be defined in a language file like
    define('BOX_CONFIGURATION_EDITABLE_CENTERBOXES', 'Editable Centerboxes');
    Going off to try it.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Admin page registration for updated mod

    Just add it to a file in the:
    /your_secret_admin/includes/extra_datafiles
    Last edited by Ajeh; 8 Feb 2012 at 05:52 PM.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Admin page registration for updated mod

    Still not working. Is there a particular place it needs to be defined? I tried it in /includes/extra_datafiles/middlebox_filenames.php,
    /includes/languages/english/extra_definitions/YOUR_TEMPLATE/middlebox_defines.php
    and
    /includes/languages/english/extra_definitions/middlebox_definitions.php

    Does it need to be defined before the SQL patch is run?

    Ah yes, of course, define it in admin :)

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

    Default Re: Admin page registration for updated mod

    Worked like a charm!

    It would be a good thing for this to be mentioned where page registration is explained...

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

    Default Re: Admin page registration for updated mod

    Quote Originally Posted by gjh42 View Post
    Worked like a charm!

    It would be a good thing for this to be mentioned where page registration is explained...
    Nods in agreement..

    I had a devil of a time updating Ty Package Tracker because of this missing VITAL nugget of information in the page registration thread.. I finally downloaded another updated mod to figure out what the issue was..
    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. #10
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Admin page registration for updated mod

    Quote Originally Posted by gjh42 View Post
    Still not working. Is there a particular place it needs to be defined? I tried it in /includes/extra_datafiles/middlebox_filenames.php,
    /includes/languages/english/extra_definitions/YOUR_TEMPLATE/middlebox_defines.php
    and
    /includes/languages/english/extra_definitions/middlebox_definitions.php

    Does it need to be defined before the SQL patch is run?

    Ah yes, of course, define it in admin :)
    Glenn, you saved me from jumping off the Sydney Harbour Bridge!

    Been stuffing around with a smiliar problem for hours on end trying to get 'Category Specific Access Restriction' updated and working for v1.5.1 - and it's just a lousy simple language define that stopped me in my tracks!!

    Thanks again / Frank

 

 

Similar Threads

  1. Recently Updated 1.3.9 to 1.5 but admin blank page
    By taprile in forum Upgrading to 1.5.x
    Replies: 4
    Last Post: 30 Jan 2015, 07:36 PM
  2. Admin Page Registration for 3rd Party Modules
    By conor in forum Upgrading to 1.5.x
    Replies: 49
    Last Post: 9 Feb 2012, 10:12 PM
  3. Admin Page Registration
    By Website Rob in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 25 Oct 2011, 09:46 PM
  4. Replies: 2
    Last Post: 15 Aug 2011, 11:46 PM
  5. I fiddled with the mod: Restructured Add Product Page for Admin v1.02
    By Feznizzle in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 24 May 2010, 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR