Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36
  1. #11
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by mc12345678 View Post
    Was going to ask if you were okay with the vertical list created or not, looks like not. Are you hard pressed for the horizontal alphabetization or would vertically alphabetized be sufficient? (Obviously ideal would be able to handle both.)

    The first part of the provided solution is somewhat browser dependent as it currently uses internal links to shift the page to the selected "letter" but not all browsers (versions within browser) support that unfortunately. As to the manufacturer link being clickable, the information is present in the query and just need to generate a correct link using zen_html_ref as the function to return the formatted link and wrap the manufacturer with the html for a link.
    The vertical link in the header does not show all manufacturers if that is what you are referring to. As for the horizontal use, I would prefer that. I would like it to be able to count the number of manufacturers that start with lets say "A" (35), divide by 3 (11.66), round up (12), and make the three rows consisting of 12,12, and 11. also, I need to separate the each list as the section for letter "B" runs right up against the last listing of "A", and so on.

  2. #12
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Modified code works great except for one thing. Each letter at the top of the page A B C... ends up looking like this:

    http://tacticaloffense.com/store/J

    instead of moving down the page to the letter "J"

    ALso, I would like to ditch the numbers of 0-9 and just replace it with the # sign.

    Also, "About Us" plugin works great!!!

    http://tacticaloffense.com/store/ind...ufacturers_map

    is the new page
    Last edited by clint6998; 9 Mar 2016 at 06:44 PM.

  3. #13
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Need help with a query

    I thank @lat9 @mc12345678

    Sorry, I kinda threw this together waiting in an airport trying to get back home

    The below code will achieve the layout your going for, inherits @mc12345678 manufacturer links and changes the anchor tags to properly "goto" correct location on page.

    Removing 0-9 and combining all numeric results will take some additional coding, I literally just walked in my door and will look at it a little more.

    I like the website btw, can I ask what influenced your decision in going with bootstrap?

    PHP Code:
    <?php
        
    echo '<div id="alphanumericWrapper">';
        echo 
    'Manufacturers ';
        for (
    $i=65$i<91$i++) {
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a>';
        }
        for (
    $i=48$i<58$i++) {
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a>';
        }
        echo 
    '</div>';

    echo 
    '<br class="clearBoth" />';


    $manufacturers_query "SELECT distinct manufacturers_id, manufacturers_name FROM " TABLE_MANUFACTURERS " ORDER BY manufacturers_name"

    $manufacturers $db->Execute($manufacturers_query);

    while (!
    $manufacturers->EOF) {

        if (
    $initial !== strtoupper(substr($manufacturers->fields['manufacturers_name'], 01))) {
            
    $initial strtoupper(substr($manufacturers->fields['manufacturers_name'], 01));

            echo 
    '<br class="clearBoth" />';
            echo 
    '<a name="'.$initial.'" class="bold bigger defaultColor">' $initial '</a>';
            echo 
    '<br class="clearBoth" />';
        }

    echo 
    '<div style="width: 33.3%; float: left;"><a href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' . (int) $manufacturers->fields['manufacturers_id'], $request_type) . '">' $manufacturers->fields['manufacturers_name'] . '</a></div>';


          
    $manufacturers->MoveNext();
        }

            echo 
    '<br class="clearBoth" />';
    ?>

    Quote Originally Posted by clint6998 View Post
    Modified code works great except for one thing. Each letter at the top of the page A B C... ends up looking like this:

    http://tacticaloffense.com/store/J

    instead of moving down the page to the letter "J"

    ALso, I would like to ditch the numbers of 0-9 and just replace it with the # sign.

    Also, "About Us" plugin works great!!!

    http://tacticaloffense.com/store/ind...ufacturers_map

    is the new page

  4. #14
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by rbarbour View Post
    I thank @lat9 @mc12345678

    Sorry, I kinda threw this together waiting in an airport trying to get back home

    The below code will achieve the layout your going for, inherits @mc12345678 manufacturer links and changes the anchor tags to properly "goto" correct location on page.

    Removing 0-9 and combining all numeric results will take some additional coding, I literally just walked in my door and will look at it a little more.

    I like the website btw, can I ask what influenced your decision in going with bootstrap?

    PHP Code:
    <?php
        
    echo '<div id="alphanumericWrapper">';
        echo 
    'Manufacturers ';
        for (
    $i=65$i<91$i++) {
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a>';
        }
        for (
    $i=48$i<58$i++) {
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a>';
        }
        echo 
    '</div>';

    echo 
    '<br class="clearBoth" />';


    $manufacturers_query "SELECT distinct manufacturers_id, manufacturers_name FROM " TABLE_MANUFACTURERS " ORDER BY manufacturers_name"

    $manufacturers $db->Execute($manufacturers_query);

    while (!
    $manufacturers->EOF) {

        if (
    $initial !== strtoupper(substr($manufacturers->fields['manufacturers_name'], 01))) {
            
    $initial strtoupper(substr($manufacturers->fields['manufacturers_name'], 01));

            echo 
    '<br class="clearBoth" />';
            echo 
    '<a name="'.$initial.'" class="bold bigger defaultColor">' $initial '</a>';
            echo 
    '<br class="clearBoth" />';
        }

    echo 
    '<div style="width: 33.3%; float: left;"><a href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' . (int) $manufacturers->fields['manufacturers_id'], $request_type) . '">' $manufacturers->fields['manufacturers_name'] . '</a></div>';


          
    $manufacturers->MoveNext();
        }

            echo 
    '<br class="clearBoth" />';
    ?>
    Thank you all for all of your help!!!

    Code is almost there but not quite. I still need them broken up by alpha. Right no it just runs them all together.

    Didnt really decide on bootstrap. Had an older site that needed to be updated badly. it was not responsive and the graphics just werent cutting it for me anymore so I found a clean looking template and I am trying to make it my own.

  5. #15
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    If this gives you a better idea of what I am looking for, lets use the above example.

    I would like it to be able to count the number of manufacturers that start with lets say "A" (35), divide by 3 (11.66), round up (12), and make three columns consisting of 12,12, and 11. also, I need to separate the each list as the section for letter "B" runs right up against the last listing of "A", and so on.

    So I need 4 div tags. first div tag to have the "A" in it with line break or header tag. Divs 2-4 would nest inside div 1 and have a class called "manufacturersList" or something like that. I could then set the css to float divs 2-4 so that as the screen gets smaller, it adapts to the screen size.

    Hope this is not too much trouble.

    http://tacticaloffense.com/store/ind...ufacturers_map

    Thanks,

    Clint

  6. #16
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Need help with a query

    That's exactly what the changes I made do.

    make sure their is a break before and after alpha character, doesn't look like you copied that part looking at your view source:
    PHP Code:
            echo '<br class="clearBoth" />';
            echo 
    '<a name="'.$initial.'" class="bold bigger defaultColor">' $initial '</a>';
            echo 
    '<br class="clearBoth" />'

    Quote Originally Posted by clint6998 View Post
    If this gives you a better idea of what I am looking for, lets use the above example.

    I would like it to be able to count the number of manufacturers that start with lets say "A" (35), divide by 3 (11.66), round up (12), and make three columns consisting of 12,12, and 11. also, I need to separate the each list as the section for letter "B" runs right up against the last listing of "A", and so on.

    So I need 4 div tags. first div tag to have the "A" in it with line break or header tag. Divs 2-4 would nest inside div 1 and have a class called "manufacturersList" or something like that. I could then set the css to float divs 2-4 so that as the screen gets smaller, it adapts to the screen size.

    Hope this is not too much trouble.

    http://tacticaloffense.com/store/ind...ufacturers_map

    Thanks,

    Clint

  7. #17
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Need help with a query

    Also doesn't look like you added the last break either


    PHP Code:
          $manufacturers->MoveNext();
        }

            echo 
    '<br class="clearBoth" />'
    Quote Originally Posted by clint6998 View Post
    If this gives you a better idea of what I am looking for, lets use the above example.

    I would like it to be able to count the number of manufacturers that start with lets say "A" (35), divide by 3 (11.66), round up (12), and make three columns consisting of 12,12, and 11. also, I need to separate the each list as the section for letter "B" runs right up against the last listing of "A", and so on.

    So I need 4 div tags. first div tag to have the "A" in it with line break or header tag. Divs 2-4 would nest inside div 1 and have a class called "manufacturersList" or something like that. I could then set the css to float divs 2-4 so that as the screen gets smaller, it adapts to the screen size.

    Hope this is not too much trouble.

    http://tacticaloffense.com/store/ind...ufacturers_map

    Thanks,

    Clint

  8. #18
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by rbarbour View Post
    Also doesn't look like you added the last break either


    PHP Code:
          $manufacturers->MoveNext();
        }

            echo 
    '<br class="clearBoth" />'
    Its all there. Here is what I have in the define editor:

    PHP Code:
    <?php 
        
    echo '<div id="alphanumericWrapper">'
        echo 
    'Manufacturers '
        for (
    $i=65$i<91$i++) { 
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a>'
        } 
        for (
    $i=48$i<58$i++) { 
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a>'
        } 
        echo 
    '</div>'

    echo 
    '<br class="clearBoth" />'


    $manufacturers_query "SELECT distinct manufacturers_id, manufacturers_name FROM " TABLE_MANUFACTURERS " ORDER BY manufacturers_name";  

    $manufacturers $db->Execute($manufacturers_query); 

    while (!
    $manufacturers->EOF) { 

        if (
    $initial !== strtoupper(substr($manufacturers->fields['manufacturers_name'], 01))) { 
            
    $initial strtoupper(substr($manufacturers->fields['manufacturers_name'], 01)); 

            echo 
    '<br class="clearBoth" />'
            echo 
    '<a name="'.$initial.'" class="bold bigger defaultColor">' $initial '</a>'
            echo 
    '<br class="clearBoth" />'
        } 

    echo 
    '<div style="width: 33.3%; float: left;"><a href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' . (int) $manufacturers->fields['manufacturers_id'], $request_type) . '">' $manufacturers->fields['manufacturers_name'] . '</a></div>'


          
    $manufacturers->MoveNext(); 
        } 

            echo 
    '<br class="clearBoth" />'
    ?>

  9. #19
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Need help with a query

    It works perfectly in a vanilla install.

    The beauty of foundation and bootstrap frameworks, don't think anyone realizes how bad they effect things.

    I added the following CSS to achieve the same look on your site. Adding classes would help clean it up a little but I really don't think it's gonna matter for bootstraps CSS files are so large anyways.

    Sorry, just ranting.

    Code:
    div#alphanumericWrapper { width:100%; margin: 1em; }
    div#alphanumericWrapper a{ padding: 0 0.2em; }
    a.bold.bigger.defaultColor { display:block; clear:both; color:#000;font-weight:bold; }
    div#manufacturers_map.centerColumn>div { display:inline-block; clear:both; }

  10. #20
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by rbarbour View Post
    It works perfectly in a vanilla install.

    The beauty of foundation and bootstrap frameworks, don't think anyone realizes how bad they effect things.

    I added the following CSS to achieve the same look on your site. Adding classes would help clean it up a little but I really don't think it's gonna matter for bootstraps CSS files are so large anyways.

    Sorry, just ranting.

    Code:
    div#alphanumericWrapper { width:100%; margin: 1em; }
    div#alphanumericWrapper a{ padding: 0 0.2em; }
    a.bold.bigger.defaultColor { display:block; clear:both; color:#000;font-weight:bold; }
    div#manufacturers_map.centerColumn>div { display:inline-block; clear:both; }
    Looks pretty good after the css. Might need just a little more tweaking of it. I do have one concern though. When you click a letter, it does go down to it as it should, however, it removes everything above it so you can't scroll back up. ANy ideas on that?

    Thanks,

    Clint

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  2. Need help creating SQL query...
    By DigitalShadow in forum General Questions
    Replies: 2
    Last Post: 22 Jun 2011, 02:05 PM
  3. Need help with a mySQL Query
    By jeffmic in forum General Questions
    Replies: 3
    Last Post: 19 Dec 2010, 02:21 PM
  4. Need help with SQL query. Want to make membership that expires.
    By TecBrat in forum Managing Customers and Orders
    Replies: 1
    Last Post: 18 Jun 2010, 03:43 PM
  5. Need help w/ SQL query in phpMyAdmin
    By audradh in forum General Questions
    Replies: 17
    Last Post: 16 Nov 2009, 01:05 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