Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

LoFi Version of Store


lokksta

Recommended Posts

Hi,

 

I've searched the forum and contribs but haven't found much on having a lofi version of osc (for dial-up users) aswell as a regular hifi version.

 

Kind of like how Invision Power Board (this forum, for example) has it's lofi version (http://www.oscommerce.com/forums/lofiversion/index.php/).

 

I am asking this because my store is graphically intensive and while it may be ok for customers with fast connections, I fear that any page of my store will take an age to load on dial-up.

 

So, does anyone know of anything, or even if it is possible? Would it be more hassle than it's worth?

 

Any ideas would be appreciated :thumbsup:

Link to comment
Share on other sites

So, does anyone know of anything, or even if it is possible?

It's not really difficult to create a LoFi version using output buffering and strip_tags, especially if you're using a template system which enables you to switch templates on the fly like the BTS (you can even do it without using buffering and strip_tags then.).

 

I had a LoFi version online once, but I was afraid it would be considered cloacking so I removed it again.

 

B.t.w it looks like this board does not show the LoFi i.s.o. the normal version to google, or does it?

Link to comment
Share on other sites

It's not really difficult to create a LoFi version using output buffering and strip_tags, especially if you're using a template system which enables you to switch templates on the fly like the BTS (you can even do it without using buffering and strip_tags then.).

 

I had a LoFi version online once, but I was afraid it would be considered cloacking so I removed it again.

 

B.t.w it looks like this board does not show the LoFi i.s.o. the normal version to google, or does it?

 

Thanks for your reply Paul.

 

I've seen a few lofi osc forum pages listed in a google search result, so I'm guessing it doesn't hide it.

 

What exactly do you mean by 'Cloaking'? And do you have any details/good resources for doing what you described, as I'm very interested.

 

Does the way you did it completely remove all images from the page?

 

Thanks,

Tom.

Link to comment
Share on other sites

Hi Tom,

 

Cloaking is aboat showing different content to search engines than to normal visitors. One random example page about the subject is: http://www.rankforsales.com/always-avoid-cloaking.html

Better search google yourself for more details about cloaking.

 

Does the way you did it completely remove all images from the page?

Using the PHP strip_tags function you can remove all tags of a kind or leave them all as they are. So all <img> tags (product images etc) could be removed that way for example, but you can't remove backgrounds set inside tags for example this way (as far as I know) if want to keep the table tags itself.

 

To start you could try this:

 

add:

<?php
// bof LoFi version
if ($_GET [LoFi] == 'true') {
 ob_start(); // start output buffering
}
// eof LoFi version
?>

just before the first <table> tag in includes_header.php

 

and in includes/footer.php add after the last table tag (or other HTML you might have there):

<?php
// bof LoFi version
if ($_GET [LoFi] == 'true') {
 $lofi_buffer = ob_get_contents(); // save buffer to $lofi_buffer
 ob_end_clean(); // stop  and empty buffer
 $lofi_output = strip_tags ($lofi_buffer, '<h1><h2><h3><h4><a><table><tr><td>');
 echo $lofi_output;
}
// eof LoFi version
?>

The added tags are the ones that you do not want to be stripped, the default is stripping all HTML tags.

 

Now you should be able to see a LoFi version (sort of :) , if I didn't make any typo's so try carefully!) by adding LoFi=true to the url (i.e.: index.php?LoFi=true or index.php?whatever=blalba&LoFi=true)

Link to comment
Share on other sites

Do you add the "&LoFi=true" (or "?LoFi=true" if it's the only parameter) to the url?

 

Currently you have to add it each time you've clicked something, since the value isn't stored yet.

Link to comment
Share on other sites

Thanks again Paul, it doesn't seem to make any difference though, am I doing something wrong?

Strange, are you sure you aren't using the STS, or another contribution that uses output buffering? Or maybe a caching contrib?

 

Another thing you could try is to remove the "if" condition (temporary).

So:

if ($_GET [LoFi] == 'true') {

change to:

// if ($_GET [LoFi] == 'true') {

 

}

change to:

// }

in both the header and footer file

 

And if that does not make any difference either, you can post your current header.php and footer.php file here.

Link to comment
Share on other sites

Strange, are you sure you aren't using the STS, or another contribution that uses output buffering? Or maybe a caching contrib?

 

Another thing you could try is to remove the "if" condition (temporary).

So:

if ($_GET [LoFi] == 'true') {

change to:

// if ($_GET [LoFi] == 'true') {

 

}

change to:

// }

in both the header and footer file

 

And if that does not make any difference either, you can post your current header.php and footer.php file here.

 

Hi Paul,

 

It works!! :D

 

I feel a bit stupid, as it wasn't working because I was using &LoFi=True instead of &LoFi=true (note the capital 'T' in true).

 

Thanks a lot for all your help.

 

Just a few others things though; do you know how to store the &LoFi=true so it doesn't have to be manually typed in to each url?

 

And the second thing, do you know if there is a way to allow certain images (I am thinking about pixel_trans.gif, as I use it a lot for layout and my page look stupid with it gone :)

Link to comment
Share on other sites

Glad it works after all :)

 

To remember the LoFi value you could add it to the session data, for example by adding this to the end of application_top.php (just before the last "?>"):

// bof LoFi
if ( ($_GET['LoFi'] == 'true') | ($_GET['LoFi'] == 'false') ) {
 $LoFi = $_GET['LoFi'];
 tep_session_register('LoFi');
} elseif (tep_session_is_registered('LoFi')) {
 $LoFi = $_SESSION['LoFi'];    
} else {    
 $LoFi = 'false';
}
// eof LoFi

 

And to do it right you should also replace the two (in the header and footer files) then:

if ($_GET [LoFi] == 'true') {

by:

if ($LoFi == 'true') {

(it will probably work without this change, but if you ever switch to register_globals off you wil have trouble)

 

 

And the second thing, do you know if there is a way to allow certain images (I am thinking about pixel_trans.gif

That's a bit tricky, a way to do that could be to replace those image tags by something else like:

<img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10">

to

{img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"}

before executing the strip_tags(), and replace it back afterwards.

This could be done using regular expressions, which I'm not good at I'm afraid :(

 

If I think of a better solution for those images I will post it here.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...