Zen Cart Logo
Forums / Addon Templates / Winchester Responsive

Winchester Responsive

Views: 443,030

Results 41 to 60 of 953
9 May 2014, 7:33 PM
#41
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Winchester Responsive

DivaVocals:

There are quite a few differences between the includes\classes\split_page_results.php file and the default one for Zen Cart v1.5.1.. As there are no code comments present, I am not sure which of these changes are related to one of the bundled modules.. Can you provide some insight as to what the changes are and for which bundled module do they relate to??

Just taking a guess it looks like these are the some of the changes made.. Not sure if the rest are differences between Zen Cart versions or other changes that are a result of template related mods..

Lines 44-48

if ($page == 'all') {
  $this->page_all = true;
  $override = $db->Execute($query);
  $max_rows = $override->RecordCount();
}
> 
> Lines 108-111
> ```
    if ((!$this->page_all) && ($this->number_of_pages > 1)) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . 'all', $request_type) . '" title=" ' . SHOW_ALL_TITLE . ' ">' . SHOW_ALL_BUTTON . '</a>########';
    elseif ($this->page_all) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters, $request_type) . '" title=" ' . SHOW_PAGEVIEW_TITLE . ' ">' . SHOW_PAGEVIEW_BUTTON . '</a>####';  

Lines 125-132

// page nn button - visa inte om alla sidor visas
if (!$this->page_all) {
for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {
  if ($jump_to_page == $this->current_page_number) {
    $display_links_string .= '##<strong class="current">' . $jump_to_page . '</strong>##';
  } else {
    $display_links_string .= '##<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a>##';
  }

The only changes I made to that file are the ones in this post for the view all link.  I started from a fresh 1.5.1 version of the file:

<http://www.zen-cart.com/showthread.php?38551-quot-View-All-quot-link&p=551915#post551915>



Thanks,

Anne
9 May 2014, 7:34 PM
#42
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

I'm loving the template too.

I wish my touch devices would love it :( but so far none of my Android devices or Windows devices play nice since most use the 768 px range which seems to be no-man's land.

9 May 2014, 7:44 PM
#43
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

RixStix:

I'm loving the template too.

I wish my touch devices would love it :( but so far none of my Android devices or Windows devices play nice since most use the 768 px range which seems to be no-man's land.

We will have to consult rbarbour about this. The template does work on both landscape and portrait tablets. Maybe it is the way that you have your devices configured that is not allowing the user agent to be detected by the php mobile detect script? See this:

http://code.google.com/p/php-mobile-detect

and what does this say when you visit on your tablet:

http://demo.mobiledetect.net/

Thanks,

Anne

9 May 2014, 8:22 PM
#44
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Winchester Responsive

picaflor-azul:

The only changes I made to that file are the ones in this post for the view all link. I started from a fresh 1.5.1 version of the file:

http://www.zen-cart.com/showthread.php?38551-quot-View-All-quot-link&p=551915#post551915

Thanks,

Anne

The split_page_results.php file that comes with your template appears to be EXACTLY the same as the one used in that post from 2008.. However, that split_page_results.php file appears to be a MUCH older version of the split_page_results.php file.

From the top of the file that comes with this template:

 * split_page_results Class.
 *
 * @package classes
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: split_page_results.php 3041 2006-02-15 21:56:45Z wilt $

From the v1.5.1 fileset (just downloaded a FRESH copy of v1.5.1 just to sure..

 * split_page_results Class.
 *
 * @package classes
 * @copyright Copyright 2003-2012 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: Ian Wilson  Fri Aug 17 17:54:58 2012 +0100 Modified in v1.5.1 $

Note the year for the file included with this template says 2006 vs 2012 from the v1.5.1 file..

9 May 2014, 8:30 PM
#45
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Winchester Responsive

DivaVocals:

The split_page_results.php file that comes with your template appears to be EXACTLY the same as the one used in that post from 2008.. However, that split_page_results.php file appears to be a MUCH older version of the split_page_results.php file.

From the top of the file that comes with this template:

  • split_page_results Class.
  • @package classes
  • @copyright Copyright 2003-2006 Zen Cart Development Team
  • @copyright Portions Copyright 2003 osCommerce
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: split_page_results.php 3041 2006-02-15 21:56:45Z wilt $
> 
> From the v1.5.1 fileset (just downloaded a FRESH copy of v1.5.1 just to sure..
> ```
 * split_page_results Class.
 *
 * @package classes
 * @copyright Copyright 2003-2012 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: Ian Wilson  Fri Aug 17 17:54:58 2012 +0100 Modified in v1.5.1 $

Note the year for the file included with this template says 2006 vs 2012 from the v1.5.1 file..

Looks like the file included is actually a v1.3.8 file.. Here's the v1.5.1 file with the changes incorporated:

<?php
/**
 * split_page_results Class.
 *
 * @package classes
 * @copyright Copyright 2003-2012 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: Ian Wilson  Fri Aug 17 17:54:58 2012 +0100 Modified in v1.5.1 $
 * Modified by Anne (Picaflor-Azul.com) Winchester Respnsive v1.0
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
/**
 * Split Page Result Class
 *
 * An sql paging class, that allows for sql reslt to be shown over a number of pages using  simple navigation system
 * Overhaul scheduled for subsequent release
 *
 * @package classes
 */
class splitPageResults extends base {
  var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name;

  /* class constructor */
  function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page', $debug = false, $countQuery = "") {
    global $db;
    $max_rows = ($max_rows == '' || $max_rows == 0) ? 20 : $max_rows;

    $this->sql_query = preg_replace("/\n\r|\r\n|\n|\r/", " ", $query);
    if ($countQuery != "") $countQuery = preg_replace("/\n\r|\r\n|\n|\r/", " ", $countQuery);
    $this->countQuery = ($countQuery != "") ? $countQuery : $this->sql_query;
    $this->page_name = $page_holder;

    if ($debug) {
      echo '<br /><br />';
      echo 'original_query=' . $query . '<br /><br />';
      echo 'original_count_query=' . $countQuery . '<br /><br />';
      echo 'sql_query=' . $this->sql_query . '<br /><br />';
      echo 'count_query=' . $this->countQuery . '<br /><br />';
    }
    if (isset($_GET[$page_holder])) {
      $page = $_GET[$page_holder];
    } elseif (isset($_POST[$page_holder])) {
      $page = $_POST[$page_holder];
    } else {
      $page = '';
    }

// BOF View All Changes 1 of 3
    if ($page == 'all') {
      $this->page_all = true;
      $override = $db->Execute($query);
      $max_rows = $override->RecordCount();
    }
// EOF View All Changes 1 of 3

    if (empty($page) || !is_numeric($page)) $page = 1;
    $this->current_page_number = $page;

    $this->number_of_rows_per_page = $max_rows;

    $pos_to = strlen($this->countQuery);

    $query_lower = strtolower($this->countQuery);
    $pos_from = strpos($query_lower, ' from', 0);

    $pos_group_by = strpos($query_lower, ' group by', $pos_from);
    if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;

    $pos_having = strpos($query_lower, ' having', $pos_from);
    if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;

    $pos_order_by = strpos($query_lower, ' order by', $pos_from);
    if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;

    if (strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) {
      $count_string = 'distinct ' . zen_db_input($count_key);
    } else {
      $count_string = zen_db_input($count_key);
    }
    $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
    if ($debug) {
      echo 'count_query=' . $count_query . '<br /><br />';
    }
    $count = $db->Execute($count_query);

    $this->number_of_rows = $count->fields['total'];

    $this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);

    if ($this->current_page_number > $this->number_of_pages) {
      $this->current_page_number = $this->number_of_pages;
    }

    $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

    // fix offset error on some versions
    if ($offset <= 0) { $offset = 0; }

    $this->sql_query .= " limit " . ($offset > 0 ? $offset . ", " : '') . $this->number_of_rows_per_page;
  }

  /* class functions */

  // display split-page-number-links
  function display_links($max_page_links, $parameters = '') {
    global $request_type;
    if ($max_page_links == '') $max_page_links = 1;

    $display_links_string = '';

    $class = '';

    if (zen_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';
// BOF View All Changes 2 of 3
    if ((!$this->page_all) && ($this->number_of_pages > 1)) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . 'all', $request_type) . '" title=" ' . SHOW_ALL_TITLE . ' ">' . SHOW_ALL_BUTTON . '</a>    ';
    elseif ($this->page_all) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters, $request_type) . '" title=" ' . SHOW_PAGEVIEW_TITLE . ' ">' . SHOW_PAGEVIEW_BUTTON . '</a>  ';  
// EOF View All Changes 2 of 3

    // previous button - not displayed on first page
    if ($this->current_page_number > 1) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a>  ';

    // check if number_of_pages > $max_page_links
    $cur_window_num = intval($this->current_page_number / $max_page_links);
    if ($this->current_page_number % $max_page_links) $cur_window_num++;

    $max_window_num = intval($this->number_of_pages / $max_page_links);
    if ($this->number_of_pages % $max_page_links) $max_window_num++;

    // previous window of pages
    if ($cur_window_num > 1) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';

// BOF View All Changes 3 of 3
    // page nn button - visa inte om alla sidor visas
    if (!$this->page_all) {
    for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {
      if ($jump_to_page == $this->current_page_number) {
        $display_links_string .= ' <strong class="current">' . $jump_to_page . '</strong> ';
      } else {
        $display_links_string .= ' <a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a> ';
      }
// EOF View All Changes 3 of 3
      }
    }

    // next window of pages
    if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a> ';

    // next button
    if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= ' <a href="' . zen_href_link($_GET['main_page'], $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT . '</a> ';

    if ($display_links_string == ' <strong class="current">1</strong> ') {
      return ' ';
    } else {
      return $display_links_string;
    }
  }

  // display number of total products found
  function display_count($text_output) {
    $to_num = ($this->number_of_rows_per_page * $this->current_page_number);
    if ($to_num > $this->number_of_rows) $to_num = $this->number_of_rows;

    $from_num = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

    if ($to_num == 0) {
      $from_num = 0;
    } else {
      $from_num++;
    }

    if ($to_num <= 1) {
      // don't show count when 1
      return '';
    } else {
      return sprintf($text_output, $from_num, $to_num, $this->number_of_rows);
    }
  }
}
9 May 2014, 9:48 PM
#46
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

picaflor-azul:

and what does this say when you visit on your tablet:

http://demo.mobiledetect.net/

Android 8" and 10" Tablets detected as tablets.
Android 7" tablet detected as mobile.
Windows 8.1 Pro tablet is detected as desktop.
Windows 8.1 RT tablet detected as tablet.

Some issues are related to screenwidth, not tablet/desktop because they exist either on tablet or desktop with width resized to the 768 width step.
Some issue related to the buttons mentioned earlier that have expected functionality but designed functionality is 'do nothing' and require a tap on the teeny arrows instead. Nothing you can do about the built-in feature that do not function as expected by other users.

Core zencart functionality works fine with a tap.
Responsive functionality requires tap and hold to function in some cases which causes confusion when some buttons are tap only functionality and some are tap and hold.
Tap and hold functionality, when used on Windows tablets, opens a typical 'right-click' window instead of expected action.

9 May 2014, 11:06 PM
#47
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

RixStix:

Android 8" and 10" Tablets detected as tablets.
Android 7" tablet detected as mobile.
Windows 8.1 Pro tablet is detected as desktop.
Windows 8.1 RT tablet detected as tablet.

Some issues are related to screenwidth, not tablet/desktop because they exist either on tablet or desktop with width resized to the 768 width step.
Some issue related to the buttons mentioned earlier that have expected functionality but designed functionality is 'do nothing' and require a tap on the teeny arrows instead. Nothing you can do about the built-in feature that do not function as expected by other users.

Core zencart functionality works fine with a tap.
Responsive functionality requires tap and hold to function in some cases which causes confusion when some buttons are tap only functionality and some are tap and hold.
Tap and hold functionality, when used on Windows tablets, opens a typical 'right-click' window instead of expected action.

Its weird because the layout problems you have are with the responsive_default.css and not the tablet layout. Your user agent is not being detected. I rearranged elements in the header on this width in the responsive_default.css. Take a look at the demo:

http://www.zenlyzen.com/responsive-zen-cart-templates/index.php?main_page=index&template_switch_id=winchester_responsive

If you want to make the arrows bigger just change the font size on line 309 of the stylesheet.css file.

To add the changed layout just add this to the bottom of the portrait tablet section in the responsive_default.css file:

.fa-user{display:none;}
.fa-search{float:right;}

and change line 322 to:

#menu{width:45%;}

Thanks,

Anne

9 May 2014, 11:52 PM
#48
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

picaflor-azul:

Your user agent is not being detected.

I do not understand that comment. Do you mean corrupted file upload? Incorrect setup on my part? Glitch in UA detection software?

Using the useragent test link, I get:[INDENT=2]Android Galaxy Tab 3 8 inch (Chrome browser)
This is a tablet. Your UA is Mozilla/5.0 (Linux; Android 4.2.2; SM-T310 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Safari/537.36

Android Generic Tab 7 inch (Chrome browser)
This is a phone. Your UA is Mozilla/5.0 (Linux; Android 4.2.2; DX752 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.170 Mobile Safari/537.36

Android Galaxy Tab 3 8 inch (FireFox browser)
This is a tablet. Your UA is Mozilla/5.0 (Android; Tablet; rv:29.0) Gecko/29.0 Firefox/29.0

Android Galaxy Tab 3 8 inch (Samsung browser)
This is a . Your UA is Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; SM-T310 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30

Android Galaxy Tab 3 8 inch (lastpass browser)
This is a computer. Your UA is Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16

WINDOWS 8.1RT
This is a tablet. Your UA is Mozilla/5.0 (Windows NT 6.3; ARM; Trident/7.0; Touch; rv:11.0) like Gecko
[/INDENT]

picaflor-azul:

I rearranged elements in the header on this width in the responsive_default.css. Take a look at the demo:

http://www.zenlyzen.com/responsive-zen-cart-templates/index.php?main_page=index&template_switch_id=winchester_responsive

HUGE DIFFERENCE :smile:

picaflor-azul:

If you want to make the arrows bigger just change the font size on line 309 of the stylesheet.css file.

To add the changed layout just add this to the bottom of the portrait tablet section in the responsive_default.css file:

.fa-user{display:none;}
.fa-search{float:right;}

> 
> and change line 322 to:
> 
> ```
#menu{width:45%;}

I'll take a look at that.

I understand the MSFT jumble of browser combinations is a far out back-burner issue, possibly even off the stove.

10 May 2014, 12:55 AM
#49
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Winchester Responsive

Found an issue with the auto installer. For folks (like me) who do use table prefixes for their Zen Cart tables, the autoinstaller hardcodes some of the table names without the prefix. Besides strange errors I get that stop the auto-installer from finishing, this causes the flexible footer menu to not display, generated a bunch of other error messages AND prevented the template from displaying properly.. (I presume from the incomplete install - there is no error message when the install fails)

One more thing.. that middle section of the "ZCA Responsive Template Switch" was failing until I removed it. I'm guessing that it was meant to make sure that the "show_box_min_width" column did not already exist, but I got an error saying that the user (sean @ localhost) was not authorized to make this change.

Changed this:

// ZCA Responsive Template Switch
$db->Execute("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
(NULL, '<b>ACTIVATE Responsive Template</b>', 'COLUMN_WIDTH', '1', 'Column Width - Left Boxes &<br /> Column Width - Right Boxes<br /><b>DO NOT WORK WITH</b><br />(1)Responsive Template Settings<br /><br /><b>Use</b><br />Column Width - Left &<br /> Column Width - Right<br /><br /><br /> 0 = Use Default Template Settings<br />1 = Use Responsive Template Settings<br />', '19', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\'),');");

$sql=mysql_query(
         "SELECT show_box_min_width FROM layout_boxes");

if (!$sql){

  mysql_query("ALTER TABLE layout_boxes ADD show_box_min_width TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER layout_box_status_single;");


}ELSE{
 }

To:

// ZCA Responsive Template Switch
$db->Execute("ALTER TABLE " . TABLE_LAYOUT_BOXES . " ADD show_box_min_width TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER layout_box_status_single;");

$db->Execute("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
(NULL, '<b>ACTIVATE Responsive Template</b>', 'COLUMN_WIDTH', '1', 'Column Width - Left Boxes &<br /> Column Width - Right Boxes<br /><b>DO NOT WORK WITH</b><br />(1)Responsive Template Settings<br /><br /><b>Use</b><br />Column Width - Left &<br /> Column Width - Right<br /><br /><br /> 0 = Use Default Template Settings<br />1 = Use Responsive Template Settings<br />', '19', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\'),');");

Changed this:

// Flexible Footer Menu
$db->Execute("CREATE TABLE IF NOT EXISTS flexible_footer_menu (
  page_id int(11) NOT NULL AUTO_INCREMENT,
  language_id int(11) NOT NULL DEFAULT '1',
  page_title varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
  page_url varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  col_header varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  col_image varchar(254) CHARACTER SET utf8 NOT NULL DEFAULT '',
  col_html_text text CHARACTER SET utf8,
  status int(1) NOT NULL DEFAULT '0',
  col_sort_order int(11) NOT NULL DEFAULT '0',
  col_id int(11) NOT NULL DEFAULT '0',
  date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  last_update datetime DEFAULT NULL,
  PRIMARY KEY (`page_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=29;");

$db->Execute("INSERT  IGNORE INTO flexible_footer_menu (page_id, language_id, page_title, page_url, col_header, col_image, col_html_text, status, col_sort_order, col_id, date_added, last_update) VALUES
(3, 1, 'Home', 'index.php?main_page=', '', '', '', 1, 11, 1, '0000-00-00 00:00:00', '2014-04-15 12:23:45'),
(5, 1, 'Featured', 'index.php?main_page=featured_products', '', '', '', 1, 12, 1, '2013-06-24 07:45:26', '2014-04-15 12:25:49'),
(6, 1, '', '', 'Shop', '', '', 1, 1, 1, '2013-06-24 09:03:26', '2014-04-15 13:05:43'),
(8, 1, 'Specials', 'index.php?main_page=specials', '', '', '', 1, 13, 1, '2013-06-24 09:11:56', '2014-04-15 12:25:28'),
(9, 1, 'New Arrivals', 'index.php?main_page=products_new', '', '', '', 1, 14, 1, '2013-06-24 09:12:50', '2014-04-15 12:26:11'),
(10, 1, 'View All', 'index.php?main_page=products_all', '', '', '', 1, 15, 1, '2013-06-24 09:14:04', '2014-04-15 13:03:06'),
(11, 1, '', '', 'Customer Service', '', '', 1, 21, 2, '2013-06-24 09:15:49', '2014-04-15 15:00:16'),
(12, 1, 'About Us', 'index.php?main_page=about_us', '', '', '', 1, 24, 2, '2013-06-24 09:18:43', '2014-04-15 15:03:23'),
(14, 1, 'Gift Certificate FAQ', 'index.php?main_page=gv_faq', '', '', '', 1, 26, 2, '2013-06-24 09:19:40', '2014-04-15 15:02:42'),
(15, 1, 'Discount Coupons', 'index.php?main_page=discount_coupon', '', '', '', 1, 28, 2, '2013-06-24 09:20:12', '2014-04-15 15:04:14'),
(16, 1, 'Newsletter Unsubscribe', 'index.php?main_page=unsubscribe', '', '', '', 1, 28, 2, '2013-06-24 09:21:30', '2014-04-15 15:04:46'),
(18, 1, 'Contact Us', 'index.php?main_page=contact_us', '', '', '', 1, 23, 2, '2013-06-24 09:32:08', '2014-04-15 15:01:46'),
(19, 1, 'Shipping and Returns', 'index.php?main_page=shippinginfo', '', '', '', 1, 22, 2, '2013-06-24 09:32:33', '2014-04-15 15:01:33'),
(23, 1, 'My Account', 'index.php?main_page=account', '', '', '', 1, 25, 2, '2013-06-24 09:35:02', '2014-04-15 15:03:47'),
(25, 1, '', '', 'Share and Connect', '', '', 1, 4, 4, '2013-06-24 09:36:48', '2013-06-24 14:45:35'),
(26, 1, '', '', '', '', '<a href=\"https://www.facebook.com/Custom.Zen.Cart.Design\" target=\"_blank\"><i class=\"fa fa-facebook\"></i></a><a href=\"https://twitter.com/picaflorazul\" target=\"_blank\"><i class=\"fa fa-twitter\"></i></a><a href=\"http://www.pinterest.com/picaflorazul\" target=\"_blank\"><i class=\"fa fa-pinterest\"></i></a><a href=\"https://www.youtube.com/user/ZenCartEasyHelp\" target=\"_blank\"><i class=\"fa fa-youtube\"></i></a><a href=\"\" target=\"_blank\"><i class=\"fa fa-instagram\"></i></a>', 1, 41, 4, '2013-06-24 09:44:30', '2014-04-25 09:26:24');");

$db->Execute("SELECT @sortorder:=max(sort_order) FROM admin_pages;");
$db->Execute("INSERT IGNORE INTO " . TABLE_ADMIN_PAGES . " (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES
('flexibleFooterMenu', 'BOX_TOOLS_FLEXIBLE_FOOTER_MENU', 'FILENAME_FLEXIBLE_FOOTER_MENU', '', 'tools', 'Y', @sortorder+1);");

To this:

// Flexible Footer Menu
$db->Execute("CREATE TABLE IF NOT EXISTS " . TABLE_FLEXIBLE_FOOTER_MENU . " (
  page_id int(11) NOT NULL AUTO_INCREMENT,
  language_id int(11) NOT NULL DEFAULT '1',
  page_title varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
  page_url varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  col_header varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  col_image varchar(254) CHARACTER SET utf8 NOT NULL DEFAULT '',
  col_html_text text CHARACTER SET utf8,
  status int(1) NOT NULL DEFAULT '0',
  col_sort_order int(11) NOT NULL DEFAULT '0',
  col_id int(11) NOT NULL DEFAULT '0',
  date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  last_update datetime DEFAULT NULL,
  PRIMARY KEY (`page_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=29;");

$db->Execute("INSERT  IGNORE INTO " . TABLE_FLEXIBLE_FOOTER_MENU . " (page_id, language_id, page_title, page_url, col_header, col_image, col_html_text, status, col_sort_order, col_id, date_added, last_update) VALUES
(3, 1, 'Home', 'index.php?main_page=', '', '', '', 1, 11, 1, '0000-00-00 00:00:00', '2014-04-15 12:23:45'),
(5, 1, 'Featured', 'index.php?main_page=featured_products', '', '', '', 1, 12, 1, '2013-06-24 07:45:26', '2014-04-15 12:25:49'),
(6, 1, '', '', 'Shop', '', '', 1, 1, 1, '2013-06-24 09:03:26', '2014-04-15 13:05:43'),
(8, 1, 'Specials', 'index.php?main_page=specials', '', '', '', 1, 13, 1, '2013-06-24 09:11:56', '2014-04-15 12:25:28'),
(9, 1, 'New Arrivals', 'index.php?main_page=products_new', '', '', '', 1, 14, 1, '2013-06-24 09:12:50', '2014-04-15 12:26:11'),
(10, 1, 'View All', 'index.php?main_page=products_all', '', '', '', 1, 15, 1, '2013-06-24 09:14:04', '2014-04-15 13:03:06'),
(11, 1, '', '', 'Customer Service', '', '', 1, 21, 2, '2013-06-24 09:15:49', '2014-04-15 15:00:16'),
(12, 1, 'About Us', 'index.php?main_page=about_us', '', '', '', 1, 24, 2, '2013-06-24 09:18:43', '2014-04-15 15:03:23'),
(14, 1, 'Gift Certificate FAQ', 'index.php?main_page=gv_faq', '', '', '', 1, 26, 2, '2013-06-24 09:19:40', '2014-04-15 15:02:42'),
(15, 1, 'Discount Coupons', 'index.php?main_page=discount_coupon', '', '', '', 1, 28, 2, '2013-06-24 09:20:12', '2014-04-15 15:04:14'),
(16, 1, 'Newsletter Unsubscribe', 'index.php?main_page=unsubscribe', '', '', '', 1, 28, 2, '2013-06-24 09:21:30', '2014-04-15 15:04:46'),
(18, 1, 'Contact Us', 'index.php?main_page=contact_us', '', '', '', 1, 23, 2, '2013-06-24 09:32:08', '2014-04-15 15:01:46'),
(19, 1, 'Shipping and Returns', 'index.php?main_page=shippinginfo', '', '', '', 1, 22, 2, '2013-06-24 09:32:33', '2014-04-15 15:01:33'),
(23, 1, 'My Account', 'index.php?main_page=account', '', '', '', 1, 25, 2, '2013-06-24 09:35:02', '2014-04-15 15:03:47'),
(25, 1, '', '', 'Share and Connect', '', '', 1, 4, 4, '2013-06-24 09:36:48', '2013-06-24 14:45:35'),
(26, 1, '', '', '', '', '<a href=\"https://www.facebook.com/Custom.Zen.Cart.Design\" target=\"_blank\"><i class=\"fa fa-facebook\"></i></a><a href=\"https://twitter.com/picaflorazul\" target=\"_blank\"><i class=\"fa fa-twitter\"></i></a><a href=\"http://www.pinterest.com/picaflorazul\" target=\"_blank\"><i class=\"fa fa-pinterest\"></i></a><a href=\"https://www.youtube.com/user/ZenCartEasyHelp\" target=\"_blank\"><i class=\"fa fa-youtube\"></i></a><a href=\"\" target=\"_blank\"><i class=\"fa fa-instagram\"></i></a>', 1, 41, 4, '2013-06-24 09:44:30', '2014-04-25 09:26:24');");

$db->Execute("SELECT @sortorder:=max(sort_order) FROM " . TABLE_ADMIN_PAGES . " ;");
$db->Execute("INSERT IGNORE INTO " . TABLE_ADMIN_PAGES . " (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES
('flexibleFooterMenu', 'BOX_TOOLS_FLEXIBLE_FOOTER_MENU', 'FILENAME_FLEXIBLE_FOOTER_MENU', '', 'tools', 'Y', @sortorder+1);");
10 May 2014, 1:09 AM
#50
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

Apparently I just proved how difficult it is to find the bottom of the portrait tablet section in the responsive_default.css file

:(

picaflor-azul:

To add the changed layout just add this to the bottom of the portrait tablet section in the responsive_default.css file:

.fa-user{display:none;}
.fa-search{float:right;}

> 
> and change line 322 to:
> 
> ```
#menu{width:45%;}
10 May 2014, 2:09 PM
#51
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

DivaVocals:

Found an issue with the auto installer. For folks (like me) who do use table prefixes for their Zen Cart tables, the autoinstaller hardcodes some of the table names without the prefix. Besides strange errors I get that stop the auto-installer from finishing, this causes the flexible footer menu to not display, generated a bunch of other error messages AND prevented the template from displaying properly.. (I presume from the incomplete install - there is no error message when the install fails)

One more thing.. that middle section of the "ZCA Responsive Template Switch" was failing until I removed it. I'm guessing that it was meant to make sure that the "show_box_min_width" column did not already exist, but I got an error saying that the user (sean @ localhost) was not authorized to make this change.

Changed this:

// ZCA Responsive Template Switch
$db->Execute("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
(NULL, '<b>ACTIVATE Responsive Template</b>', 'COLUMN_WIDTH', '1', 'Column Width - Left Boxes &<br /> Column Width - Right Boxes<br /><b>DO NOT WORK WITH</b><br />(1)Responsive Template Settings<br /><br /><b>Use</b><br />Column Width - Left &<br /> Column Width - Right<br /><br /><br /> 0 = Use Default Template Settings<br />1 = Use Responsive Template Settings<br />', '19', NULL, NOW(), NULL, 'zen_cfg_select_option(array('0', '1'),');");

$sql=mysql_query(
"SELECT show_box_min_width FROM layout_boxes");

if (!$sql){

mysql_query("ALTER TABLE layout_boxes ADD show_box_min_width TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER layout_box_status_single;");

}ELSE{
}

> 
> To:
> ```
// ZCA Responsive Template Switch
$db->Execute("ALTER TABLE " . TABLE_LAYOUT_BOXES . " ADD show_box_min_width TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER layout_box_status_single;");

$db->Execute("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
(NULL, '<b>ACTIVATE Responsive Template</b>', 'COLUMN_WIDTH', '1', 'Column Width - Left Boxes &<br /> Column Width - Right Boxes<br /><b>DO NOT WORK WITH</b><br />(1)Responsive Template Settings<br /><br /><b>Use</b><br />Column Width - Left &<br /> Column Width - Right<br /><br /><br /> 0 = Use Default Template Settings<br />1 = Use Responsive Template Settings<br />', '19', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\'),');");

Changed this:

// Flexible Footer Menu
$db->Execute("CREATE TABLE IF NOT EXISTS flexible_footer_menu (
page_id int(11) NOT NULL AUTO_INCREMENT,
language_id int(11) NOT NULL DEFAULT '1',
page_title varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
page_url varchar(255) CHARACTER SET utf8 DEFAULT NULL,
col_header varchar(64) CHARACTER SET utf8 DEFAULT NULL,
col_image varchar(254) CHARACTER SET utf8 NOT NULL DEFAULT '',
col_html_text text CHARACTER SET utf8,
status int(1) NOT NULL DEFAULT '0',
col_sort_order int(11) NOT NULL DEFAULT '0',
col_id int(11) NOT NULL DEFAULT '0',
date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
last_update datetime DEFAULT NULL,
PRIMARY KEY (page_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=29;");

$db->Execute("INSERT IGNORE INTO flexible_footer_menu (page_id, language_id, page_title, page_url, col_header, col_image, col_html_text, status, col_sort_order, col_id, date_added, last_update) VALUES
(3, 1, 'Home', 'index.php?main_page=', '', '', '', 1, 11, 1, '0000-00-00 00:00:00', '2014-04-15 12:23:45'),
(5, 1, 'Featured', 'index.php?main_page=featured_products', '', '', '', 1, 12, 1, '2013-06-24 07:45:26', '2014-04-15 12:25:49'),
(6, 1, '', '', 'Shop', '', '', 1, 1, 1, '2013-06-24 09:03:26', '2014-04-15 13:05:43'),
(8, 1, 'Specials', 'index.php?main_page=specials', '', '', '', 1, 13, 1, '2013-06-24 09:11:56', '2014-04-15 12:25:28'),
(9, 1, 'New Arrivals', 'index.php?main_page=products_new', '', '', '', 1, 14, 1, '2013-06-24 09:12:50', '2014-04-15 12:26:11'),
(10, 1, 'View All', 'index.php?main_page=products_all', '', '', '', 1, 15, 1, '2013-06-24 09:14:04', '2014-04-15 13:03:06'),
(11, 1, '', '', 'Customer Service', '', '', 1, 21, 2, '2013-06-24 09:15:49', '2014-04-15 15:00:16'),
(12, 1, 'About Us', 'index.php?main_page=about_us', '', '', '', 1, 24, 2, '2013-06-24 09:18:43', '2014-04-15 15:03:23'),
(14, 1, 'Gift Certificate FAQ', 'index.php?main_page=gv_faq', '', '', '', 1, 26, 2, '2013-06-24 09:19:40', '2014-04-15 15:02:42'),
(15, 1, 'Discount Coupons', 'index.php?main_page=discount_coupon', '', '', '', 1, 28, 2, '2013-06-24 09:20:12', '2014-04-15 15:04:14'),
(16, 1, 'Newsletter Unsubscribe', 'index.php?main_page=unsubscribe', '', '', '', 1, 28, 2, '2013-06-24 09:21:30', '2014-04-15 15:04:46'),
(18, 1, 'Contact Us', 'index.php?main_page=contact_us', '', '', '', 1, 23, 2, '2013-06-24 09:32:08', '2014-04-15 15:01:46'),
(19, 1, 'Shipping and Returns', 'index.php?main_page=shippinginfo', '', '', '', 1, 22, 2, '2013-06-24 09:32:33', '2014-04-15 15:01:33'),
(23, 1, 'My Account', 'index.php?main_page=account', '', '', '', 1, 25, 2, '2013-06-24 09:35:02', '2014-04-15 15:03:47'),
(25, 1, '', '', 'Share and Connect', '', '', 1, 4, 4, '2013-06-24 09:36:48', '2013-06-24 14:45:35'),
(26, 1, '', '', '', '', '<a href="https://www.facebook.com/Custom.Zen.Cart.Design" target="_blank"><i class="fa fa-facebook"></i></a><a href="https://twitter.com/picaflorazul" target="_blank"><i class="fa fa-twitter"></i></a><a href="http://www.pinterest.com/picaflorazul" target="_blank"><i class="fa fa-pinterest"></i></a><a href="https://www.youtube.com/user/ZenCartEasyHelp" target="_blank"><i class="fa fa-youtube"></i></a><a href="" target="_blank"><i class="fa fa-instagram"></i></a>', 1, 41, 4, '2013-06-24 09:44:30', '2014-04-25 09:26:24');");

$db->Execute("SELECT @sortorder:=max(sort_order) FROM admin_pages;");
$db->Execute("INSERT IGNORE INTO " . TABLE_ADMIN_PAGES . " (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES
('flexibleFooterMenu', 'BOX_TOOLS_FLEXIBLE_FOOTER_MENU', 'FILENAME_FLEXIBLE_FOOTER_MENU', '', 'tools', 'Y', @sortorder+1);");

> 
> To this:
> ```
// Flexible Footer Menu
$db->Execute("CREATE TABLE IF NOT EXISTS " . TABLE_FLEXIBLE_FOOTER_MENU . " (
  page_id int(11) NOT NULL AUTO_INCREMENT,
  language_id int(11) NOT NULL DEFAULT '1',
  page_title varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
  page_url varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  col_header varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  col_image varchar(254) CHARACTER SET utf8 NOT NULL DEFAULT '',
  col_html_text text CHARACTER SET utf8,
  status int(1) NOT NULL DEFAULT '0',
  col_sort_order int(11) NOT NULL DEFAULT '0',
  col_id int(11) NOT NULL DEFAULT '0',
  date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  last_update datetime DEFAULT NULL,
  PRIMARY KEY (`page_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=29;");

$db->Execute("INSERT  IGNORE INTO " . TABLE_FLEXIBLE_FOOTER_MENU . " (page_id, language_id, page_title, page_url, col_header, col_image, col_html_text, status, col_sort_order, col_id, date_added, last_update) VALUES
(3, 1, 'Home', 'index.php?main_page=', '', '', '', 1, 11, 1, '0000-00-00 00:00:00', '2014-04-15 12:23:45'),
(5, 1, 'Featured', 'index.php?main_page=featured_products', '', '', '', 1, 12, 1, '2013-06-24 07:45:26', '2014-04-15 12:25:49'),
(6, 1, '', '', 'Shop', '', '', 1, 1, 1, '2013-06-24 09:03:26', '2014-04-15 13:05:43'),
(8, 1, 'Specials', 'index.php?main_page=specials', '', '', '', 1, 13, 1, '2013-06-24 09:11:56', '2014-04-15 12:25:28'),
(9, 1, 'New Arrivals', 'index.php?main_page=products_new', '', '', '', 1, 14, 1, '2013-06-24 09:12:50', '2014-04-15 12:26:11'),
(10, 1, 'View All', 'index.php?main_page=products_all', '', '', '', 1, 15, 1, '2013-06-24 09:14:04', '2014-04-15 13:03:06'),
(11, 1, '', '', 'Customer Service', '', '', 1, 21, 2, '2013-06-24 09:15:49', '2014-04-15 15:00:16'),
(12, 1, 'About Us', 'index.php?main_page=about_us', '', '', '', 1, 24, 2, '2013-06-24 09:18:43', '2014-04-15 15:03:23'),
(14, 1, 'Gift Certificate FAQ', 'index.php?main_page=gv_faq', '', '', '', 1, 26, 2, '2013-06-24 09:19:40', '2014-04-15 15:02:42'),
(15, 1, 'Discount Coupons', 'index.php?main_page=discount_coupon', '', '', '', 1, 28, 2, '2013-06-24 09:20:12', '2014-04-15 15:04:14'),
(16, 1, 'Newsletter Unsubscribe', 'index.php?main_page=unsubscribe', '', '', '', 1, 28, 2, '2013-06-24 09:21:30', '2014-04-15 15:04:46'),
(18, 1, 'Contact Us', 'index.php?main_page=contact_us', '', '', '', 1, 23, 2, '2013-06-24 09:32:08', '2014-04-15 15:01:46'),
(19, 1, 'Shipping and Returns', 'index.php?main_page=shippinginfo', '', '', '', 1, 22, 2, '2013-06-24 09:32:33', '2014-04-15 15:01:33'),
(23, 1, 'My Account', 'index.php?main_page=account', '', '', '', 1, 25, 2, '2013-06-24 09:35:02', '2014-04-15 15:03:47'),
(25, 1, '', '', 'Share and Connect', '', '', 1, 4, 4, '2013-06-24 09:36:48', '2013-06-24 14:45:35'),
(26, 1, '', '', '', '', '<a href=\"https://www.facebook.com/Custom.Zen.Cart.Design\" target=\"_blank\"><i class=\"fa fa-facebook\"></i></a><a href=\"https://twitter.com/picaflorazul\" target=\"_blank\"><i class=\"fa fa-twitter\"></i></a><a href=\"http://www.pinterest.com/picaflorazul\" target=\"_blank\"><i class=\"fa fa-pinterest\"></i></a><a href=\"https://www.youtube.com/user/ZenCartEasyHelp\" target=\"_blank\"><i class=\"fa fa-youtube\"></i></a><a href=\"\" target=\"_blank\"><i class=\"fa fa-instagram\"></i></a>', 1, 41, 4, '2013-06-24 09:44:30', '2014-04-25 09:26:24');");

$db->Execute("SELECT @sortorder:=max(sort_order) FROM " . TABLE_ADMIN_PAGES . " ;");
$db->Execute("INSERT IGNORE INTO " . TABLE_ADMIN_PAGES . " (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES
('flexibleFooterMenu', 'BOX_TOOLS_FLEXIBLE_FOOTER_MENU', 'FILENAME_FLEXIBLE_FOOTER_MENU', '', 'tools', 'Y', @sortorder+1);");

Great catch! Thank you for posting. Once the template is approved I'll be able to post an update ;)

Thanks,

Anne

10 May 2014, 2:11 PM
#52
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

RixStix:

Apparently I just proved how difficult it is to find the bottom of the portrait tablet section in the responsive_default.css file

:(

Look around 76 in the responsive_tablet.css file. Put the additions within the final }

Thanks,

Anne

10 May 2014, 2:21 PM
#53
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

DivaVocals:

Looks like the file included is actually a v1.3.8 file.. Here's the v1.5.1 file with the changes incorporated:

<?php /** * split_page_results Class. * * @package classes * @copyright Copyright 2003-2012 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version GIT: $Id: Author: Ian Wilson Fri Aug 17 17:54:58 2012 +0100 Modified in v1.5.1 $ * Modified by Anne (Picaflor-Azul.com) Winchester Respnsive v1.0 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } /** * Split Page Result Class * * An sql paging class, that allows for sql reslt to be shown over a number of pages using simple navigation system * Overhaul scheduled for subsequent release * * @package classes */ class splitPageResults extends base { var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name; /* class constructor */ function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page', $debug = false, $countQuery = "") { global $db; $max_rows = ($max_rows == '' || $max_rows == 0) ? 20 : $max_rows; $this->sql_query = preg_replace("/\n\r|\r\n|\n|\r/", " ", $query); if ($countQuery != "") $countQuery = preg_replace("/\n\r|\r\n|\n|\r/", " ", $countQuery); $this->countQuery = ($countQuery != "") ? $countQuery : $this->sql_query; $this->page_name = $page_holder; if ($debug) { echo '<br /><br />'; echo 'original_query=' . $query . '<br /><br />'; echo 'original_count_query=' . $countQuery . '<br /><br />'; echo 'sql_query=' . $this->sql_query . '<br /><br />'; echo 'count_query=' . $this->countQuery . '<br /><br />'; } if (isset($_GET[$page_holder])) { $page = $_GET[$page_holder]; } elseif (isset($_POST[$page_holder])) { $page = $_POST[$page_holder]; } else { $page = ''; } // BOF View All Changes 1 of 3 if ($page == 'all') { $this->page_all = true; $override = $db->Execute($query); $max_rows = $override->RecordCount(); } // EOF View All Changes 1 of 3 if (empty($page) || !is_numeric($page)) $page = 1; $this->current_page_number = $page; $this->number_of_rows_per_page = $max_rows; $pos_to = strlen($this->countQuery); $query_lower = strtolower($this->countQuery); $pos_from = strpos($query_lower, ' from', 0); $pos_group_by = strpos($query_lower, ' group by', $pos_from); if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by; $pos_having = strpos($query_lower, ' having', $pos_from); if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having; $pos_order_by = strpos($query_lower, ' order by', $pos_from); if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by; if (strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) { $count_string = 'distinct ' . zen_db_input($count_key); } else { $count_string = zen_db_input($count_key); } $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from)); if ($debug) { echo 'count_query=' . $count_query . '<br /><br />'; } $count = $db->Execute($count_query); $this->number_of_rows = $count->fields['total']; $this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page); if ($this->current_page_number > $this->number_of_pages) { $this->current_page_number = $this->number_of_pages; } $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1)); // fix offset error on some versions if ($offset <= 0) { $offset = 0; } $this->sql_query .= " limit " . ($offset > 0 ? $offset . ", " : '') . $this->number_of_rows_per_page; } /* class functions */ // display split-page-number-links function display_links($max_page_links, $parameters = '') { global $request_type; if ($max_page_links == '') $max_page_links = 1; $display_links_string = ''; $class = ''; if (zen_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&'; // BOF View All Changes 2 of 3 if ((!$this->page_all) && ($this->number_of_pages > 1)) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . 'all', $request_type) . '" title=" ' . SHOW_ALL_TITLE . ' ">' . SHOW_ALL_BUTTON . '</a>########'; elseif ($this->page_all) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters, $request_type) . '" title=" ' . SHOW_PAGEVIEW_TITLE . ' ">' . SHOW_PAGEVIEW_BUTTON . '</a>####'; // EOF View All Changes 2 of 3 // previous button - not displayed on first page if ($this->current_page_number > 1) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a>####'; // check if number_of_pages > $max_page_links $cur_window_num = intval($this->current_page_number / $max_page_links); if ($this->current_page_number % $max_page_links) $cur_window_num++; $max_window_num = intval($this->number_of_pages / $max_page_links); if ($this->number_of_pages % $max_page_links) $max_window_num++; // previous window of pages if ($cur_window_num > 1) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>'; // BOF View All Changes 3 of 3 // page nn button - visa inte om alla sidor visas if (!$this->page_all) { for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) { if ($jump_to_page == $this->current_page_number) { $display_links_string .= '##<strong class="current">' . $jump_to_page . '</strong>##'; } else { $display_links_string .= '##<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a>##'; } // EOF View All Changes 3 of 3 } } // next window of pages if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>##'; // next button if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= '##<a href="' . zen_href_link($_GET['main_page'], $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT . '</a>##'; if ($display_links_string == '##<strong class="current">1</strong>##') { return '##'; } else { return $display_links_string; } } // display number of total products found function display_count($text_output) { $to_num = ($this->number_of_rows_per_page * $this->current_page_number); if ($to_num > $this->number_of_rows) $to_num = $this->number_of_rows; $from_num = ($this->number_of_rows_per_page * ($this->current_page_number - 1)); if ($to_num == 0) { $from_num = 0; } else { $from_num++; } if ($to_num <= 1) { // don't show count when 1 return ''; } else { return sprintf($text_output, $from_num, $to_num, $this->number_of_rows); } } } ``` Thank you for posting this ;) You will also need to change line 76 of the includes/languages/winchester_responsive/english.php file to: ``` define('SHOW_PAGEVIEW_BUTTON', 'View Less'); ``` Thanks, Anne
10 May 2014, 3:31 PM
#54
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

I just caught a spelling error which is causing problems in includes/templates/winchester_responsive/css/stylesheet.css line 411:

.review-write-left{float:left;width:40%;text-align:center;}

Thanks,

Anne

10 May 2014, 7:43 PM
#55
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

TNX for all the pointers on where to make edits. Things are looking much better.

picaflor-azul:

Its weird because the layout problems you have are with the responsive_default.css and not the tablet layout. Your user agent is not being detected. I rearranged elements in the header on this width in the responsive_default.css. Take a look at the demo:

http://www.zenlyzen.com/responsive-zen-cart-templates/index.php?main_page=index&template_switch_id=winchester_responsive

Try this on any touch device ( I have only tried on Android 8" GalaxyTab 3 and desktop 25"/mouse with similar results)

Tap Categories down-arrow
Swipe/Scroll down the list so that you can select one of the lower, off-screen categories

As soon as your finger leaves the screen when you get the lower categories within view, the menu disappears making it impossible to select any category that is not within view on the initial dropdown.

Ditto if subcategory list is longer than the screen is tall.

10 May 2014, 8:17 PM
#56
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

RixStix:

TNX for all the pointers on where to make edits. Things are looking much better.

Try this on any touch device ( I have only tried on Android 8" GalaxyTab 3 and desktop 25"/mouse with similar results)

Tap Categories down-arrow
Swipe/Scroll down the list so that you can select one of the lower, off-screen categories

As soon as your finger leaves the screen when you get the lower categories within view, the menu disappears making it impossible to select any category that is not within view on the initial dropdown.

Ditto if subcategory list is longer than the screen is tall.

Take a look at the jquery demo here and let me know if it has the same behaviour:

http://adnantopal.github.io/slimmenu/#

Thanks,

Anne

10 May 2014, 8:40 PM
#57
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

picaflor-azul:

Take a look at the jquery demo here and let me know if it has the same behaviour:

http://adnantopal.github.io/slimmenu/#

Thanks,

Anne

The example there doesn't have a list as long as a zencart demo using the default data.

I can swipe/scroll the screen in the github example using touch without the menu collapsing.

So, no, the menu does not appear to collapse when a finger is lifted as it does in the Winchester demo

10 May 2014, 8:43 PM
#58
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Winchester Responsive

RixStix:

The example there doesn't have a list as long as a zencart demo using the default data.

I can swipe/scroll the screen in the github example using touch without the menu collapsing.

So, no, the menu does not appear to collapse when a finger is lifted as it does in the Winchester demo

Ok, thank you for the info ;) It will help me to trouble shoot.

Thanks,

Anne

10 May 2014, 8:54 PM
#59
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

If there is anything that I can do to help, please let me know.

It is the weekend and even software folks deserve a break.

10 May 2014, 11:27 PM
#60
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Winchester Responsive

Top Specials Bar. Is this by design or a glitch? Our initial thought was to use this bar to highlight a link to an EZ page that would explain new features or functionality in an attempt to help customers get acquainted with a new look. Then, migrate to SPECIALS.

Quitting time today, so will pick up here tomorrow.

/*bof top specials*/ 
define('HEADER_TITLE_SPECIALS','<a href="index.php?main_page=specials">Specials</a>'); 
define('HEADER_TITLE_TOP_TEXT','FREE Shipping on all orders over $50.00!');

The HEADER_TITLE_SPECIALS link only appears on desktop displays and is removed when width steps down from full width or possibly tablets. GalaxyTab 8 and 10 inch. Both are 1280 x 800. 10inch displays both 'defines' in landscape. 8 inch only displays HEADER_TITLE_TOP_TEXT in landscape. Do not have any means to test Apple devices.

The HEADER_TITLE_TOP_TEXT is displayed on all tablet devices that I can test but has no clickable link due to the above.