Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bootstrap3
#89
Here is the right working footer.inc.php. It works with or without displayed selection for other themes.

Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:      footer.inc.php
* @Package:   GetSimple
* @Action:    Bootstrap3 for GetSimple CMS
*
*****************************************************/
?>
    
 <hr>

      <footer>
        <p>Bootstrap3 for GetSimple CMS by <a href="http://www.rickparrish.ca">Rick Parrish</a> of <a href="http://www.randm.ca">R&amp;M Software</a> - <?php get_site_credits(); ?></p>
      </footer>

    </div> <!-- /container -->
    
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
   <!-- <script src="<?php get_theme_url(); ?>/js/jquery-3.3.1.min.js"></script> -->
    <script src="<?php get_theme_url(); ?>/js/jquery.cookie.js"></script>
    <script src="<?php get_theme_url(); ?>/js/jquery.tablesorter.min.js"></script>
    <script src="<?php get_theme_url(); ?>/js/bootstrap.min.js"></script>
    <script>
      if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
        var msViewportStyle = document.createElement("style")
        msViewportStyle.appendChild(
          document.createTextNode(
            "@-ms-viewport{width:auto!important}"
          )
        )
        document.getElementsByTagName("head")[0].appendChild(msViewportStyle)
      }
    </script>

    <?php
      if ($ThemeSettings->DisplayOtherThemes == "true") {
    ?>
          <script type="text/javascript">
          $(document).ready(function() {
            // If user selected a theme, load it
            if ($.cookie("theme")) {
              $("link.SelectedTheme").attr("href", $.cookie("theme"));
              HighlightTheme($.cookie("theme"));
            }

            // If user selected a navbar inversion, load it
            if ($.cookie("invert")) {
              if ($.cookie("invert") == "true") {
                $('#chkInvertNavigationBar').attr('checked','checked');
                SetInvert(true);
              } else {
                $('#chkInvertNavigationBar').removeAttr('checked');
                SetInvert(false);
              }
            }

            // User is selecting a new theme
            $("#ThemesMenu li a").click(function() {
              $("link.SelectedTheme").attr("href", $(this).attr('rel'));
              $.cookie("theme", $(this).attr('rel'), {expires: 365, path: '/'});
              HighlightTheme($.cookie("theme"));
              return false;
            });

            // User is selecting a new navbar inversion
            $("#chkInvertNavigationBar").change(function() {
              if (this.checked) {
                $.cookie("invert", "true", {expires: 365, path: '/'});
                SetInvert(true);
              } else {
                $.cookie("invert", "false", {expires: 365, path: '/'});
                SetInvert(false);
              }
            });

            // Prevent the menu from disappearing when selecting a navbar inversion
            $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
              e.stopPropagation();
            });
            
            // Allow sub menus
            // From http://stackoverflow.com/a/19076934/342378
            $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
              // Avoid following the href location when clicking
              event.preventDefault(); 
              // Avoid having the menu to close when clicking
              event.stopPropagation(); 
              // Store old class
              var OldClass = $(this).parent().attr("class");
              // Close all menus
              $('ul.dropdown-menu [data-toggle=dropdown]').parent().removeClass('open');
              // Restore old class
              $(this).parent().attr("class", OldClass);
              // Toggle the class to show or hide it
              $(this).parent().toggleClass('open');

              var menu = $(this).parent().find("ul");
              var menupos = $(menu).offset();

              if (menupos.left + menu.width() > $(window).width()) {
                  var newpos = -$(menu).width();
                  menu.css({ left: newpos });    
              } else {
                  var newpos = $(this).parent().width();
                  menu.css({ left: newpos });
              }
            });

          });
          
          function HighlightTheme(url) {
            $("#ThemesMenu li.current").attr("class", "");
            $("#ThemesMenu li a[rel='" + url + "']").parent().attr("class", "current active");
          }
          
          function SetInvert(invert) {
            if (invert) {
              $("#NavBar").removeClass("navbar-default").addClass("navbar-inverse");
            } else {
              $("#NavBar").addClass("navbar-default").removeClass("navbar-inverse");
            }
          }
        </script>
    <?php
      } else {
      ?>
      <script type="text/javascript">
                            
          $(document).ready(function() {           

            // Prevent the menu from disappearing when selecting a navbar inversion
            $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
              e.stopPropagation();
            });
            
            // Allow sub menus
            // From http://stackoverflow.com/a/19076934/342378
            $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
              // Avoid following the href location when clicking
              event.preventDefault(); 
              // Avoid having the menu to close when clicking
              event.stopPropagation(); 
              // Store old class
              var OldClass = $(this).parent().attr("class");
              // Close all menus
              $('ul.dropdown-menu [data-toggle=dropdown]').parent().removeClass('open');
              // Restore old class
              $(this).parent().attr("class", OldClass);
              // Toggle the class to show or hide it
              $(this).parent().toggleClass('open');

              var menu = $(this).parent().find("ul");
              var menupos = $(menu).offset();

              if (menupos.left + menu.width() > $(window).width()) {
                  var newpos = -$(menu).width();
                  menu.css({ left: newpos });    
              } else {
                  var newpos = $(this).parent().width();
                  menu.css({ left: newpos });
              }
            });

          });
          
          
        </script>
        <?php
      }
      

      if ($ThemeSettings->TrackingId != "") {
    ?>

      <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          ga('create', '<?php echo $ThemeSettings->TrackingId; ?>', 'auto');
          ga('send', 'pageview');

        </script>  
    
    <?php
      }
    ?>
            
    <?php get_footer(); ?>
  </body>
</html>
Reply


Messages In This Thread
Bootstrap3 - by Ree - 2013-11-14, 01:44:08
RE: Bootstrap3 - by shawn_a - 2013-11-14, 01:57:27
RE: Bootstrap3 - by Kolyok - 2013-11-14, 03:36:07
RE: Bootstrap3 - by stryker - 2013-11-14, 06:41:29
RE: Bootstrap3 - by shawn_a - 2013-11-14, 11:27:30
RE: Bootstrap3 - by stryker - 2013-11-14, 12:34:37
RE: Bootstrap3 - by Tzvook - 2014-01-11, 03:42:06
RE: Bootstrap3 - by shawn_a - 2013-11-15, 00:24:38
RE: Bootstrap3 - by Kolyok - 2013-11-15, 21:58:58
RE: Bootstrap3 - by dayllack - 2013-11-17, 10:55:09
RE: Bootstrap3 - by Ree - 2013-11-17, 11:20:49
RE: Bootstrap3 - by Kolyok - 2013-11-18, 01:29:00
RE: Bootstrap3 - by alex_d - 2013-11-18, 22:58:36
RE: Bootstrap3 - by n00dles101 - 2013-11-18, 23:53:59
RE: Bootstrap3 - by shawn_a - 2013-11-19, 00:18:47
RE: Bootstrap3 - by Ree - 2013-11-19, 00:54:16
RE: Bootstrap3 - by alex_d - 2013-11-19, 01:00:42
RE: Bootstrap3 - by alex_d - 2013-11-19, 01:29:09
RE: Bootstrap3 - by shawn_a - 2013-11-19, 02:48:14
RE: Bootstrap3 - by Ree - 2013-11-20, 04:32:22
RE: Bootstrap3 - by alex_d - 2013-11-25, 19:39:16
RE: Bootstrap3 - by Riianna - 2014-01-19, 05:17:08
RE: Bootstrap3 - by plutek - 2014-01-21, 08:13:34
RE: Bootstrap3 - by Ree - 2014-01-21, 10:42:50
RE: Bootstrap3 - by plutek - 2014-01-21, 13:07:33
RE: Bootstrap3 - by Ree - 2014-01-24, 00:25:21
RE: Bootstrap3 - by shawn_a - 2014-01-21, 11:03:48
RE: Bootstrap3 - by Rene - 2014-02-10, 23:19:32
RE: Bootstrap3 - by apt - 2014-02-14, 07:51:52
RE: Bootstrap3 - by lakaroth - 2014-02-16, 02:28:22
RE: Bootstrap3 - by Ree - 2014-02-18, 05:48:17
RE: Bootstrap3 - by apt - 2014-02-18, 07:11:40
RE: Bootstrap3 - by PrplHaz4 - 2014-02-28, 03:25:51
RE: Bootstrap3 - by snooze - 2014-03-15, 00:33:50
RE: Bootstrap3 - by Ree - 2014-03-15, 21:54:18
RE: Bootstrap3 - by alorence - 2014-05-08, 00:15:39
RE: Bootstrap3 - by Ree - 2014-05-08, 03:06:18
RE: Bootstrap3 - by kazu2015 - 2015-08-10, 00:47:56
RE: Bootstrap3 - by kazu2015 - 2015-08-10, 00:52:44
RE: Bootstrap3 - by wdburgdorf - 2014-06-24, 19:54:50
RE: Bootstrap3 - by Carlos - 2014-06-24, 20:11:44
RE: Bootstrap3 - by wdburgdorf - 2014-06-24, 20:16:18
RE: Bootstrap3 - by wakh - 2014-07-09, 05:03:33
RE: Bootstrap3 - by onapthanh - 2014-07-14, 18:22:06
RE: Bootstrap3 - by Ree - 2014-08-14, 05:42:35
RE: Bootstrap3 - by Mendex - 2014-08-16, 06:06:18
RE: Bootstrap3 - by harrisc - 2014-12-04, 17:22:43
RE: Bootstrap3 - by Ree - 2014-12-05, 02:30:33
RE: Bootstrap3 - by uhebeisen - 2015-03-27, 07:28:11
RE: Bootstrap3 - by wdburgdorf - 2015-03-27, 18:43:27
RE: Bootstrap3 - by Oleg06 - 2014-12-05, 03:35:30
RE: Bootstrap3 - by harrisc - 2015-04-16, 21:55:43
RE: Bootstrap3 - by Carlos - 2015-04-17, 00:16:40
RE: Bootstrap3 - by phimsexjavnet - 2015-04-17, 03:03:05
RE: Bootstrap3 - by harrisc - 2015-05-18, 23:09:44
RE: Bootstrap3 - by Oleg06 - 2015-05-18, 23:40:46
RE: Bootstrap3 - by harrisc - 2015-05-19, 09:36:50
RE: Bootstrap3 - by Oleg06 - 2015-05-19, 16:39:05
RE: Bootstrap3 - by harrisc - 2015-05-19, 18:14:56
RE: Bootstrap3 - by davetest - 2015-05-19, 21:26:03
RE: Bootstrap3 - by Carlos - 2015-08-10, 06:45:30
RE: Bootstrap3 - by kazu2015 - 2015-08-10, 18:51:50
RE: Bootstrap3 - by kazu2015 - 2015-08-10, 20:03:42
RE: Bootstrap3 - by Carlos - 2015-08-10, 23:40:47
RE: Bootstrap3 - by kazu2015 - 2015-08-11, 14:46:31
RE: Bootstrap3 - by pigsound - 2016-03-29, 23:49:46
RE: Bootstrap3 - by sremick - 2016-05-11, 00:23:17
RE: Bootstrap3 - by harrisc - 2016-05-11, 21:46:33
RE: Bootstrap3 - by sremick - 2016-05-11, 23:06:33
RE: Bootstrap3 - by pigsound - 2016-05-13, 03:01:26
RE: Bootstrap3 - by sremick - 2016-05-13, 06:17:08
RE: Bootstrap3 - by pigsound - 2016-05-17, 18:00:00
RE: Bootstrap3 - by pigsound - 2016-05-12, 02:36:59
RE: Bootstrap3 - by sremick - 2016-05-12, 07:30:36
RE: Bootstrap3 - by pigsound - 2016-05-12, 16:32:41
RE: Bootstrap3 - by pigsound - 2016-05-19, 16:42:11
RE: Bootstrap3 - by Inugami - 2016-07-29, 11:56:00
RE: Bootstrap3 - by Riianna - 2016-10-13, 18:52:33
RE: Bootstrap3 - by Carlos - 2016-10-15, 00:42:40
RE: Bootstrap3 - by Riianna - 2016-10-21, 11:23:40
RE: Bootstrap3 - by Wichtel - 2018-09-11, 19:25:03
RE: Bootstrap3 - by Carlos - 2018-09-11, 22:06:17
RE: Bootstrap3 - by Wichtel - 2018-09-11, 23:05:29
RE: Bootstrap3 - by Carlos - 2018-09-12, 04:56:33
RE: Bootstrap3 - by Wichtel - 2018-09-12, 08:37:54
RE: Bootstrap3 - by Wichtel - 2018-09-12, 10:27:14
RE: Bootstrap3 - by Wichtel - 2018-09-13, 00:02:40
RE: Bootstrap3 - by Wichtel - 2018-09-13, 00:57:57
RE: Bootstrap3 - by Wichtel - 2018-09-13, 01:47:47



Users browsing this thread: 1 Guest(s)