Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is the BASE tag really needed in osCommerce ?


bruyndoncx

Recommended Posts

About this line in template_top

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
I use the jquery tabs on my site and when upgrading to osC 2.3.4, the jquery library and jqueryui library are updated too.

 

When I do this to my site, I get weird resulta as the directory index pages is loaded into the tabbed interface, again and again ...

 

It is identified as a jquerybug, with the workaround being, remove the BASE tag.

So I wonder if I could just remove BASE tag from the site or if there is a real need for it somewhere.

http://bugs.jqueryui.com/ticket/7822

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I dont think it's needed, but not having it *might* cause issues in the tep_image type functions where the image could pull from http when it needs https and vice versa.

I think I'd prefer to keep it - but change it so that it doesn't depend on SSL and not ssl.

In other words, instead of it flipping from this:
 

<base href="http://yoursite.com/dir/" />

to this:
 

<base href="https://yoursite.com/dir/" />

Just have it always this:
 

<base href="//yoursite.com/dir/" />

I'll put it on the to-do list :-/

Link to comment
Share on other sites

There's another workaround in that bug report -- add this code to the head section of template_top.php, after the jQuery Javascript is called:

  <script type="text/javascript">
  // fix jQuery base tag bug
    $.fn.__tabs = $.fn.tabs;
    $.fn.tabs = function (a, b, c, d, e, f) {
      var base = location.href.replace(/#.*$/, '');
      $('ul>li>a[href^="#"]', this).each(function () {
        var href = $(this).attr('href');
        $(this).attr('href', base + href);
      });
      $(this).__tabs(a, b, c, d, e, f);
    };
  </script>

and your tabs will work again. Tested and working on osC 2.3.4.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@kymation

I'm unable to get the javascript to work. My setup is more complicated with head.js integration, plus, if I can solve it at the server end, I prefer that performance wise as my DOM is rather thick.

 

For product specifications to work, I have added to includes/modules/products_tabs.php

  $parsed_url_path = parse_url($_SERVER[REQUEST_URI], PHP_URL_PATH);
looked at this page for inpiration

http://stackoverflow.com/questions/6768793/get-the-full-url-in-php

 

and inserted it before the #tabs

<li><a href="<?php echo $parsed_url_path;?>#tabs-DESC" ...
This covers the basic case, now I'll have a closer look tomorrow for the border encoding cases.

Or perhaps my SEO url soluton already has a function for this - I'll need to have a closer look, but basically, spelling it out, works as well, just a little bit more place to make changes ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I don't understand why the Javascript doesn't work. However, if you have a fix that works for you, it doesn't matter. Your way has the advantage of not adding to the mass of Javascript that we all use these days, so it may be the better way to go.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@bruyndoncx

this example for an older version but you could use it. ;)

          $body_text = '<div id="tabs">
<ul>
<li><a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(), $request_type, false) .'#tabs-1">Nunc tincidunt</a></li>
<li><a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(), $request_type, false) . '#tabs-2">Proin dolor</a></li>
<li><a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(), $request_type, false) . '#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<p>I deleted <b>base tag</b> in the header, so the loop not come back in tabs.</p>
</div>
<div id="tabs-2">
<p>Or I leave base tag in header, but create an empty index.html. This is not good because all of the tabs contents show.</p>
</div>
<div id="tabs-3">
<p>Finaly we dont delete base tag, but give absolute links to tabs.</p>
<p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
</div>
</div>';

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@Gergely

Indeed, easy-peasy as that - but forgive my wandering mind at 1AM :DD

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

@@Gergely

Indeed, easy-peasy as that - but forgive my wandering mind at 1AM :DD

why didnt you sleep? We are coming.. :D

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@Gergely

Oh not afraid, "been there - done that" last year, just before it all was flooded :D

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I dont think it's needed, but not having it *might* cause issues in the tep_image type functions where the image could pull from http when it needs https and vice versa.

I'm pretty sure that it was added because pages were giving security errors under certain circumstances. For example, if you put a background image in CSS that pulled from an http URL. It allowed certain URLs to be expressed as relative URLs rather than absolute URLs.

 

I could have sworn that I remembered a forum thread about it, but I can't find it now. Maybe it was in the old bug system instead.

Always back up before making changes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...