Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

HTML Catalog Cleaner - Removes excess white space

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #61  
Old 02-10-2005, 02:43 AM
  Stephen Hatton's Avatar 
Stephen Hatton Stephen Hatton is offline
 

Senior Member
  
Join Date: Mar 2004
Location: Melbourne, Australia
Posts: 182
 

Default Need for SpEeD StrESS BuSTer ;)

Hi NuAlpha

While they are still developing the retail version of the Momentum Enerpak, maybe you would like a desktop tag/avitar like this:

http://www.eotr.com/Light4Life/product.php?productid=189&cat=0&page=1

Or maybe your own design?

(My preference is divided between:
http://www.eotr.com/Light4Life/product.php?productid=295&cat=0&page=1
and
http://www.eotr.com/Light4Life/product.php?productid=386&cat=0&page=1
)

For girls:
http://www.eotr.com/Light4Life/product.php?productid=278&cat=0&page=1


To cybrgman
I am using PHP 4.3.10
You may have some security issues with the older version. You may have to update yours.


For everyone I wish the following:
http://www.eotr.com/Light4Life/product.php?productid=193&cat=0&page=1



Regards
Ing. Stephen Hatton
__________________
Apache Linux V1.3.33
PERL version: 5.8.0
PHP version: 4.3.11
MySQL version: 4.0.22-standard
X-cart V4.0.17: Addons: X-PConfig, X-Giftreg, X-Fancycat, X-AOM
Reply With Quote
  #62  
Old 02-10-2005, 11:06 AM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Quote:
Originally Posted by cybrgman
Just an FYI

Doesn't work with PHP 4.2.2
Fatal error: Call to undefined function: file_get_contents()

I had such high hopes

I am suprised anyone is still using PHP 4.2.2. I would recommend upgrading to 4.3.10 if possible, if not...your solution is below.

Add the following to a file named "file_get_contents.php" and put it in the same directory as the catalog cleaning script.
Code:
<?php // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/3_0.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Aidan Lister <aidan@php.net> | // +----------------------------------------------------------------------+ // // $Id: file_get_contents.php,v 1.20 2004/11/14 16:10:50 aidan Exp $ /** * Replace file_get_contents() * * @category PHP * @package PHP_Compat * @link http://php.net/function.file_get_contents * @author Aidan Lister <aidan@php.net> * @version $Revision: 1.20 $ * @internal resource_context is not supported * @since PHP 5 * @require PHP 4.0.1 (trigger_error) */ if (!function_exists('file_get_contents')) { function file_get_contents($filename, $incpath = false, $resource_context = null) { if (false === $fh = fopen($filename, 'rb', $incpath)) { trigger_error('file_get_contents() failed to open stream: No such file or directory', E_USER_WARNING); return false; } clearstatcache(); if ($fsize = @filesize($filename)) { $data = fread($fh, $fsize); } else { $data = ''; while (!feof($fh)) { $data .= fread($fh, 8192); } } fclose($fh); return $data; } } ?>

Then add the following after the "register_shutdown_function" line:
Code:
require('file_get_contents.php');

This has been pulled from the PEAR package PHP_Compat.

And for anyone who is wondering, I am still working on version 2.0 of this script. Won't have the same title and cleaning the HTML catalog will be only a minor function compared to the overall feature pack I am adding to it. However, because this is taking so much work it could be one to two months down the line.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #63  
Old 02-10-2005, 03:33 PM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default

Thanks NuAlpha worked great, sweet mod

I never really thought about upgrading PHP versions (I'm on a dedicated box w/ redhat 9 btw)

What would be the benifit to upgrading versions .... if you don't mind my asking your opinion ?
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
Reply With Quote
  #64  
Old 02-10-2005, 05:23 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Quote:
Originally Posted by cybrgman
What would be the benifit to upgrading versions .... if you don't mind my asking your opinion ?

More features, less bugs, better security.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #65  
Old 04-01-2005, 02:27 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Hmmm, I applied this to my htaccess file in the store root:

Code:
php_flag zlib.output_compression On

which doubles the speed of my php pages (it needed it, even on a dedicated server!). With this line present, I get a blank page when I run the catalog cleaner. If I remove the line, it runs. I'm assuming there's a bit of conflict going on with this line in the script:

Code:
ini_set('zlib.output_compression', 'Off'); // Turn off zlib compression, if On, to prevent Mozilla output problems.

It's OK to remove the htaccess line when I run the cleaner script and then reinstate it. but I'm wondering if this compression causes problems with X-Cart in general? I'm basing this notion on the fact that the cleaner script switches it off for a reason

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #66  
Old 04-01-2005, 11:11 AM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

I'm not sure why it would be showing a blank page unless output buffering is occuring and the the browser is just waiting for the script to show everything before loading anything. I have also experienced server 500 errors when I enter PHP values into the .htaccess files instead of a local php.ini file.

The catalog cleaner switches it off because is can cause problems with the Mozilla browser when trying to show a steady output of data.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #67  
Old 04-01-2005, 04:03 PM
 
markwhoo markwhoo is offline
 

X-Adept
  
Join Date: Nov 2003
Posts: 799
 

Default

Quote:
Originally Posted by DanUK
Hmmm, I applied this to my htaccess file in the store root:

Code:
php_flag zlib.output_compression On

which doubles the speed of my php pages (it needed it, even on a dedicated server!). With this line present, I get a blank page when I run the catalog cleaner. If I remove the line, it runs. I'm assuming there's a bit of conflict going on with this line in the script:

Code:
ini_set('zlib.output_compression', 'Off'); // Turn off zlib compression, if On, to prevent Mozilla output problems.

It's OK to remove the htaccess line when I run the cleaner script and then reinstate it. but I'm wondering if this compression causes problems with X-Cart in general? I'm basing this notion on the fact that the cleaner script switches it off for a reason

Dan



Here is a fix for those of you seeing blank pages with items like catalog creation, cleaner mod, databse back up etc.

Add the followig code to the following files and you will not have issues any longer.

This code os to be added to the beginning of each of the php files. This will turn off the zlib compression that is causing the issues. If another file calls for the zlib compression, it will be used as normal via .htaccess file so no worries. I have had to do this myself due to these types of blank pages or what seemd to be lock ups. This has happened to me with the catalog creation, stock, custom and root. It has happened when trying to do a back up of database as well.

Code:
ini_set("zlib.output_compression","Off");

I have not had the problem with the cleaner file, but it should be the same issues.

Add this snippet of code after the <?php flag and it should make your problem disappear and all be normal.

xcart root: admin: db_backup.php
xcart root: admin: html_catalog.php
xcart root: admin: html_catalog_root.php


Hope this helps someone
__________________
vs 4.1.12
Reply With Quote
  #68  
Old 04-11-2005, 09:00 AM
  wowfundraising's Avatar 
wowfundraising wowfundraising is offline
 

Newbie
  
Join Date: Mar 2005
Posts: 8
 

Default questions...

From the initial post of this mod to now, is there an update of the mod that includes all the changes / bug-fixes that have been talked about in this thread? I may have just missed it... if so, sorry.

And... does squishing up the code effect anything for SEO at all?

-Scott
__________________
Version 4.0.12
Reply With Quote
  #69  
Old 04-11-2005, 02:48 PM
 
markwhoo markwhoo is offline
 

X-Adept
  
Join Date: Nov 2003
Posts: 799
 

Default Re: questions...

Quote:
Originally Posted by wowfundraising
From the initial post of this mod to now, is there an update of the mod that includes all the changes / bug-fixes that have been talked about in this thread? I may have just missed it... if so, sorry.

And... does squishing up the code effect anything for SEO at all?

-Scott

Better spidering, more speed / faster load time, yadda yaddda
__________________
vs 4.1.12
Reply With Quote
  #70  
Old 04-29-2005, 01:13 AM
  Owl's Avatar 
Owl Owl is offline
 

Advanced Member
  
Join Date: Mar 2003
Location: Sweden
Posts: 92
 

Default

you forgot one thing... it strips the spaces in the titles.... wich is NOT good for seo people
http://www.electripoint.com/catalog/HiFi-bass-speakers-p-1-c-270064317.html

look at the title, that is not good. Tho the mod itself is really good, speeds up the site alot..
__________________
-----------------------------------
4.2 rox...

http://www.fivestar.nu | www.nystil.se | www.hidealite.se
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:35 AM.

   

 
X-Cart forums © 2001-2020