Jump to content
sunbound2

osC-2.3.1-simple-captcha-1.2 - captcha not working

Recommended Posts

Ive been trying to migrate our LAMP web server over to a WAMP server, main project post is here. http://forums.oscommerce.com/topic/396441-migrating-from-lamp-centos-to-windows-server-amp/

 

One of the things that broke during the migration was our captcha.

 

The validation_png.php file says "** Vargen Captcha **" near the top, but i cannot find anything about that module.

 

Ive since then tried to install osC-2.3.1-simple-captcha-1.2, with the same result as before... in IE the captcha box shoing up as a black box, in firefox, it looks like a little torn page. When i right clikc on it in firefox and choose "show picture" a page comes up saying "The image "http://localhost/includes/components/forms_rm/resources/validation_png.php" cannot be displayed because it conatains errors."

 

Ive checked the validation file, and everything i see looks fine... but then again, im still pretty green when it comes to this stuff.

 

If anyone has any suggestions, that would be great.

 

 

here is my validation.php file.

 

 

 

 

<?php

/** Vargen Captcha **

*

* Author: By Jesse G. Donat

* Coauthor: Daniel Olfelt

*

* Motto: Don't Be Evil

*

* April 24, 2009

*

**/

 

function generateValidationImage($rand) {

 

$width = 150;

$height = 40;

$fontSize = '12';

$font = dirname(__FILE__) .'C:\wamp\www\fonts\Iglesia-Light.ttf';

$font2 = dirname(__FILE__) .'C:\wamp\www\fonts\SG04.ttf';

$reduceReadability = 0;

$image = imagecreatetruecolor($width, $height);

imageantialias($image,true);

$bgColor = imagecolorallocate ($image, 255, 255, 255);

$textColor = imagecolorallocate ($image, 100, 100, 100);

$typeColor = imagecolorallocate ($image, 50, 50, 50);

$dotColor = imagecolorallocate($image, 200, 200, 200);

$lineColor = imagecolorallocate($image, 180, 180, 180);

 

 

imagefill($image,1,1,$bgColor);

imageColorTransparent($image, $bgColor);

 

// write the random text

$textbox = imagettfbbox($fontSize, 0, $font, $rand);

$left = 7;

 

//imagearc ( $image , 60, 7, 105, 25, 25 , 155 , $lineColor );

 

for($x = 0; $x<strlen($rand); $x++) {

for($y=0; $y<$reduceReadability; $y++) {

imagettftext($image, 14+rand(-12,0), rand(-20,20), $left+rand(-10,10), 25+rand(-10,10), $lineColor, $font, $rand[$x]);

}

imagettftext($image, 22, rand(-20,20), $left, 25, $textColor, $font, $rand[$x]);

$left+=20;

}

$randomSlant = rand(40,60);

$randomShift = rand(-4,4);

imagettftext($image, 10, $randomSlant, $left, 35+$randomShift, $typeColor, $font2, "TYPE");

imagettftext($image, 10, $randomSlant, $left+13, 35+$randomShift, $typeColor, $font2, "HERE");

imagettftext($image, 10, 0, $left+31, 22+$randomShift, $typeColor, $font2, ">");

imagettftext($image, 10, 0, $left+34, 22+$randomShift, $typeColor, $font2, ">");

 

 

// send several headers to make sure the image is not cached

// Date in the past

 

// imagefilter($image, IMG_FILTER_EDGEDETECT);

 

header("Expires: Mon, 23 Jul 1993 05:00:00 GMT");

 

// always modified

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

 

// HTTP/1.1

header("Cache-Control: no-store, no-cache, must-revalidate");

header("Cache-Control: post-check=0, pre-check=0", false);

 

// HTTP/1.0

header("Pragma: no-cache");

 

// send the content type header so the image is displayed properly

header('Content-type: image/png');

 

imagepng($image);

//imagedestroy($image);

 

/**/

}

 

function generateString($length) {

$string = '';

$characters = "abcdefghjkmnpqrstuv23456789";

 

for ($i=0;$i<$length;$i++) {

$char = $characters[mt_rand(0, strlen($characters)-1)];

$string .= $char;

}

 

return $string;

}

 

 

$length = 4;

$validation_code = strtolower(generateString($length));

#echo $validation_code;

 

require($cfg = dirname(__FILE__).'/../config.php');

 

chdir($ROOFL_Config['file_root'].$ROOFL_Config['web_catalog']);

 

$app_top = 'includes/application_top.php';

 

if (file_exists($app_top)) {

include_once($app_top);

} else {

session_start();

}

 

$_SESSION['security_code'] = $validation_code;

 

generateValidationImage($validation_code);

 

 

Share this post


Link to post
Share on other sites

You have all prerequisites installed, such as the GD library or whatever this is using for its graphics?

 

This looks suspicious:

$font = dirname(__FILE__) .'C:\wamp\www\fonts\Iglesia-Light.ttf';
$font2 = dirname(__FILE__) .'C:\wamp\www\fonts\SG04.ttf';

At the very least, you'll have to take dirname(__FILE__). out if you're going to hard code the entire file location.

 

Then near the bottom, you have

require($cfg = dirname(__FILE__).'/../config.php');

and

$app_top = 'includes/application_top.php';

You may have to change / to \ here.

Share this post


Link to post
Share on other sites

I beleieve so... on the server info page, it says under "gd"...

 

 

gd

GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.4.3 GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version 6b PNG Support enabled libPNG Version 1.2.46 WBMP Support enabled XBM Support enabled

Directive Local Value Master Value gd.jpeg_ignore_warning 0 0

 

 

 

I changed the "suspicious" lines from

 

$font = dirname(__FILE__) .'C:\wamp\www\fonts\Iglesia-Light.ttf';

$font2 = dirname(__FILE__) .'C:\wamp\www\fonts\SG04.ttf';

 

to

 

$font = dirname(__FILE__) .'/fonts/';

$font2 = dirname(__FILE__) .'/fonts/';

 

 

and

 

require($cfg = dirname(__FILE__).'/../config.php');

 

to

 

require($cfg = dirname(__FILE__).'\..\config.php');

 

and

 

$app_top = 'includes/application_top.php';

 

to

 

$app_top = 'includes\application_top.php';

 

 

 

and i get the same result.

 

 

 

Anything else I can try?

 

 

I did try to see if it made a difference before changing the / to \, and it didn't change either.

Edited by sunbound2

Share this post


Link to post
Share on other sites

Either

$font = 'C:\wamp\www\fonts\Iglesia-Light.ttf';
$font2 = 'C:\wamp\www\fonts\SG04.ttf';

or

$font = dirname(__FILE__) .'fonts\Iglesia-Light.ttf';
$font2 = dirname(__FILE__) .'fonts\SG04.ttf';

 

If the fonts\ directory is the directory below validation.php, use something in the style of the first.

Share this post


Link to post
Share on other sites

Hmmm,

 

I tried both, and got the same result.

 

Anything else that could be throwing this off? As I mentioned before, this was previously hosted on a LAMP server; migrated to a WAMP. I know there are a few things that didn't work right off the bat. Wondering if there is some monkey with a wrench somewhere in the files.

 

Anything else i can post/provide that might help this work out a little more?

 

Your help is appreciated.

Share this post


Link to post
Share on other sites

Everything else in that file looks OS-independent. Do you have error reporting suppressed in php.ini or elsewhere? Have you looked in the hosting logs for error messages? You've checked that the resulting paths (to the font files, etc.) are correct in Windows? Is there any chance that it's upstream of this file?

Share this post


Link to post
Share on other sites

1) In my PHP.ini file, it looks like ALL errors are to be shown. my PHP_error.log file was always empty before, but i added the path to my log file on line "Log errors to specified file." it was empty before (i thought that was odd at first when i saw that, whats the point of it being on, when it doesn't know where to put it? i wonder where its been keeping the logs, if not here... maybe just dumping it?). Anyways, not my php_error.log is filling with stack traces and PHP warnings.

 

I'm seeing things about assuming an undefined constant (DIR_WS_CATALOG - assumed 'DIR_WS_CATALOG')

"Notice: Constant HTTP_COOKIE_DOMAIN already defined"

 

This one gives me a clue though...

 

"Warning: imagettfbbox() [<a href='function.imagettfbbox'>function.imagettfbbox</a>]: Could not read font in C:\wamp\www\includes\components\forms_rm\resources\validation_png.php on line 34".

 

line 34 says

"$textbox = imagettfbbox($fontSize, 0, $font, $rand);

$left = 7;

 

 

 

and "PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not read font in C:\wamp\www\includes\components\forms_rm\resources\validation_png.php on line 43"

 

Line 43 says "

imagettftext($image, 22, rand(-20,20), $left, 25, $textColor, $font, $rand[$x]);

$left+=20;

 

It also mentiones the next few lines, but im not sure whats wrong about them...

 

 

 

 

2) hosting logs? This server is going to be locally hosted, so im not sure specifically what logs your talking about. I'm running WAMPserver.

 

The apache access.log is running, I am seeing things like ajax request, and im not sure if that was install on the LAMP server... in starting the instalation for that, i dont think it was installed, as im not seeing the lines in the code that are mentioned in the directions. I guess i just found another possible issue, or rabbit hole do dove down.

 

 

in the Apache error log, im seeing entries like this though...

 

"[error] [client 127.0.0.1] PHP 1. {main}() C:\\wamp\\www\\information.php:0, referer: http://localhost/information.php/headingtitle-i-1?osCsid=1rlcp31n836na6bi01jk2d6327"

 

I'm guessing that the "\\" are a problem. :D

 

I'll go digging for that entry in one of the many (what seems like) um-teen thousand configuration files... :D

 

 

3) upstream? as in the font file saved on another server and accessed remotely or over the network? no, its saved locally on the same hard drive. C:\wamp\www\includes\components\forms_rm\resources\fonts. I could see where that could cause problems if it where though.

Edited by sunbound2

Share this post


Link to post
Share on other sites

Those "\\" errors where from the end of the day on the 28th BTW. Not sure what changed sine then. I'll try to replicate them.

 

I also noticed that the timestamp is set up different in diffferent logs. My Apache logs are in Central (local) time, while in the PHP logs, they are UTC. Could that throw something off? One part being configured for one time, and another for something different? Should i change them to match?

Edited by sunbound2

Share this post


Link to post
Share on other sites

I'm seeing things about assuming an undefined constant (DIR_WS_CATALOG - assumed 'DIR_WS_CATALOG')

"Notice: Constant HTTP_COOKIE_DOMAIN already defined"

That means you messed up your configure.php file(s) and you're now missing the define for DIR_WS_CATALOG. Don't ignore this!!!

 

"Warning: imagettfbbox() [<a href='function.imagettfbbox'>function.imagettfbbox</a>]: Could not read font in C:\wamp\www\includes\components\forms_rm\resources\validation_png.php on line 34".

 

line 34 says

"$textbox = imagettfbbox($fontSize, 0, $font, $rand);

$left = 7;

I already told you how $font and $font2 should look. Go back and read my post again, and check your work.

 

"[error] [client 127.0.0.1] PHP 1. {main}() C:\\wamp\\www\\information.php:0, referer: http://localhost/information.php/headingtitle-i-1?osCsid=1rlcp31n836na6bi01jk2d6327"

 

I'm guessing that the "\\" are a problem. :D

Whether the string is delimited by ' or ", \\ is what you should be using. It collapses in the final string to just \. Check if you're giving \\\\, which would collapse only to \\ in the final string.

 

I'll go digging for that entry in one of the many (what seems like) um-teen thousand configuration files... :D

There are two configuration files.

Share this post


Link to post
Share on other sites

I guess there are only two technically configuration files... it seems like everything is a configuration file... (information.php, application_top.php, etc...) but yeas, your right... only to real configuration files.... my heads just spinning that's all.

 

Thanks for all your help... I did something and my Apache service wouldn't start, couldnt figure out what went wrong because the error log wouldn't update, so i had to restore from a daily backup. Once i get back to the same point i was at earlier in the day, ill update this post with results.

Share this post


Link to post
Share on other sites

HALLELUJAH!!!

 

my captcha works now! THANK YOU! THANK YOU! THANK YOU!

 

I was getting to the point with the "undefined constant DIR_WS_CATALOG" thing because it WAS defined. The line read...

 

//define('DIR_FS_CATALOG', preg_replace("/\/$/", "C:/wamp/www/", $_SERVER["DOCUMENT_ROOT"]) . DIR_WS_CATALOG);

 

 

I commented that out, and just wrote...

 

define('DIR_FS_CATALOG', 'C:/wamp/www/');

 

Is there anything i needed to keep in that line i commented out that might cause problems later on?

 

 

 

I also commented out the HTTP and HTTPS cookie dine lines, and the captcha worked!

 

 

unfortunately, when i opened the PHP error log, i found...

 

PHP Deprecated: Function split() is deprecated in C:\wamp\www\includes\components\forms_rm\lib\classes\class.email.php on line 44

 

 

line 44 of that file states...

 

list($name, $domain) = split('@', $string);

 

 

 

Two steps forward, one step back so far...

 

Thanks for your help!

Share this post


Link to post
Share on other sites

Thank you sir! may i have another?! :-

 

 

now I'm getting error...

 

Notice: Undefined index: info_id in C:\wamp\www\information.php on line 3

 

starting at line 3 of that file i find

 

if($_GET['info_id'] == 1){

$_GET['info_id'] = 0;

}

 

 

I'm not sure what wrong or what its supposed to be...

Share this post


Link to post
Share on other sites

In this file I'm finding Mention of a tool (ez_pages) that i cannot get to work on this server, although it works on the original LAMP server... It was installed by the original page builders. I'm unsure how to uninstall this tool/mod or how to get it to work. I'm thinking EZ_pages is a custom mod from zen-cart.

 

Could that be causing this error?

Edited by sunbound2

Share this post


Link to post
Share on other sites

Zen Cart? If your installation is ZC, you're not going to get useful information from the osC site -- ZC forked many years ago.

 

The $_GET['info_id'] not defined (missing index) means that it's demanding that there be an ...&info_id=n... in the Query String, but it's missing. The immediate fix would be to add a check that $_GET['info_id'] is set (if (isset($_GET['info_id'])...) before using it, and take some default action if it isn't. However, that still leaves you with an unchecked Query String ('GET') value that someone might use for mischief. Is this more crap from ZC?

Share this post


Link to post
Share on other sites

Nope, the installation isn't zen-cart. The only reason i brought that up was because the only information i could get about EZ_pages was from zen-cart. Nothing else points in that direction. The version of OSC I'm using is 2.3.3

Share this post


Link to post
Share on other sites

Most of these files have not changed from when they where running on the LINUX stack... makes me wonder why are they issues now? custom code that doesn't work well in outside of linux?

 

unfortunately, what your telling me is over my head at the moment. Add a check? I'm not sure how to do that. what would be the default action? I cant tell you where the information.php file came from because it was part of the original server. Someone told me that the information.PHP file was from information pages (and it looks similar to EZ_pages), and i just modified the file during the information pages installation.

 

 

I'm wondering now if I should start a new post on the information pages support page... if there is one.

Share this post


Link to post
Share on other sites

There are probably x 2 main information page add ons and of course your EZ pages so you really do need to isolate / find what is actually installed and either reinstall properly or remove completly

 

To do this you would need to download the files and compare if it is the EZ-pages may be a bit complicated as it would have been probably custom coded.

 

The information manager will install a information.php at top level and a includes/classes/information.php + he will add the defies to includes/filename.php and includes/database.php he will also add a bit of code to the index.php and will change the /includes/modules/boxes/bm_information.php (if on 2.3.)

 

A standard install does not have an information.php

 

So check if you have one and maybe post the code that would maybe help see what you have actually installed (or partly installed)

 

Of course there will also be admin changes as well but get to that later important first to find out what is installed

 

Have you checked your admin if there is a link to an info manager??

 

regards

Joli


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Thanks for the response Joli, And everything youve helped me with so far MrPhil,

 

I would like to have one, or the other (preferable EZ_pages because weve used it before, but considering its being a PITA right now, id settle for whatever works. Right now its only partly working (i can turn pages on and off, but not edit them), (I think its also somehow screwing up my SEO urls). If i could uninstall, or just turn it off (then transport the database info to information pages, that would be great.

 

I do have the information pages showing up in the admin side, and i can create and turn the pages on/off but those changes aren't reflected in the live site. (they are polar opposites... I can edit the pages that don't show up in information pages, and i cant edit the pages that do show up in EZ_pages... oh if i had hair id be pulling it out by now.)

 

I'm a bit confused... maybe my brain isn't quite switched on yet. I think your asking to see the code from Includes/filename.php, includes/database.php(i have a database_tables.php), index.php. and /includes/modules/boxes/bm_information.php. is that right? I'll post whatever is needed, I just want to be sure what your asking first.

Share this post


Link to post
Share on other sites

Hard to help if it is ez pages as mentioned before it is to the best of my knowledge a zen cart module (EZ-Pages module that was included in the Zen Cart v1.3.0 release.)

 

As it is pre installed in zen cart and your previous site builders must have done a custom install it will not be easy to remove simply because no one can know what they have done..!!

 

sorry meant database_tables.php I only suggested to post the files so we could possibly see what was installed that is resolved now as it seems certain that it is ez pages.

 

Now the question is how to remove or repair I think repair you would be on your own as mentioned no one can now what has been done.

As regards remove you will have to search through your files and remove the codes for the ez pages by comparing with an original 2.3.3 (I think you mentioned that was your version)

 

I would tip that the first error

 

if($_GET['info_id'] == 1){

$_GET['info_id'] = 0;

}

 

The code call would be in index.php I would also tip that your filenames.php and database_tables.php has the defines which you could try commenting out.

 

If you rename any information.php to information.php_old you will maybe see in your error logs where the next call is coming from.

Tedious but needs to be done same thing would go for admin.

 

If you can access the information text / html back up so you can use later .

 

If you decide to remove I would recommend installing

http://addons.oscommerce.com/info/1026

version SLiCK_303 27 May 2011

 

As this will do what you want.

 

PS: you will also have to drop the information database tables from ez pages and use the ones from the contribution.

 

Regards

Joli

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

I actually have Information Pages Unlimited v2.05 A for OSC v2.3.1 installed, you want me to reverse those changes and install the one release just before that from SLiCK?

 

 

code from my...

 

Includes/filenames.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2012 osCommerce

 

Released under the GNU General Public License

*/

 

// define the filenames used in the project

define('FILENAME_ACCOUNT', 'account.php');

define('FILENAME_ACCOUNT_EDIT', 'account_edit.php');

define('FILENAME_ACCOUNT_HISTORY', 'account_history.php');

define('FILENAME_ACCOUNT_HISTORY_INFO', 'account_history_info.php');

define('FILENAME_ACCOUNT_NEWSLETTERS', 'account_newsletters.php');

define('FILENAME_ACCOUNT_NOTIFICATIONS', 'account_notifications.php');

define('FILENAME_ACCOUNT_PASSWORD', 'account_password.php');

define('FILENAME_ADDRESS_BOOK', 'address_book.php');

define('FILENAME_ADDRESS_BOOK_PROCESS', 'address_book_process.php');

define('FILENAME_ADVANCED_SEARCH', 'advanced_search.php');

#define('FILENAME_ADVANCED_SEARCH_RESULT', 'search.php');

define('FILENAME_ADVANCED_SEARCH_RESULT', 'advanced_search_result.php');

define('FILENAME_ALSO_PURCHASED_PRODUCTS', 'also_purchased_products.php');

define('FILENAME_CHECKOUT_CONFIRMATION', 'checkout_confirmation.php');

define('FILENAME_CHECKOUT_PAYMENT', 'checkout_payment.php');

define('FILENAME_CHECKOUT_PAYMENT_ADDRESS', 'checkout_payment_address.php');

define('FILENAME_CHECKOUT_PROCESS', 'checkout_process.php');

define('FILENAME_CHECKOUT_SHIPPING', 'checkout_shipping.php');

define('FILENAME_CHECKOUT_SHIPPING_ADDRESS', 'checkout_shipping_address.php');

define('FILENAME_CHECKOUT_SUCCESS', 'checkout_success.php');

define('FILENAME_CONTACT_US', 'contact_us.php');

define('FILENAME_CONDITIONS', 'conditions.php');

define('FILENAME_COOKIE_USAGE', 'cookie_usage.php');

define('FILENAME_CREATE_ACCOUNT', 'create_account.php');

define('FILENAME_CREATE_ACCOUNT_SUCCESS', 'create_account_success.php');

define('FILENAME_DEFAULT', 'index.php');

define('FILENAME_DOWNLOAD', 'download.php');

define('FILENAME_INFORMATION', 'information.php');

define('FILENAME_INFO_SHOPPING_CART', 'info_shopping_cart.php');

define('FILENAME_LOGIN', 'login.php');

define('FILENAME_LOGOFF', 'logoff.php');

define('FILENAME_NEW_PRODUCTS', 'new_products.php');

define('FILENAME_PASSWORD_FORGOTTEN', 'password_forgotten.php');

define('FILENAME_PASSWORD_RESET', 'password_reset.php');

define('FILENAME_POPUP_IMAGE', 'popup_image.php');

define('FILENAME_POPUP_SEARCH_HELP', 'popup_search_help.php');

define('FILENAME_PRIVACY', 'privacy.php');

define('FILENAME_PRODUCT_INFO', 'product_info.php');

//define('FILENAME_PRODUCT_LISTING', 'product_listing.php');

define('FILENAME_PRODUCT_LISTING', 'product_listing_ajax.php');

define('FILENAME_PRODUCT_REVIEWS', 'product_reviews.php');

define('FILENAME_PRODUCT_REVIEWS_INFO', 'product_reviews_info.php');

define('FILENAME_PRODUCT_REVIEWS_WRITE', 'product_reviews_write.php');

define('FILENAME_PRODUCTS_NEW', 'products_new.php');

define('FILENAME_REDIRECT', 'redirect.php');

define('FILENAME_REVIEWS', 'reviews.php');

define('FILENAME_SHIPPING', 'shipping.php');

define('FILENAME_SITEMAP', 'sitemap.php');

define('FILENAME_SHOPPING_CART', 'shopping_cart.php');

define('FILENAME_SITE_SEARCH', 'site_search.php');

define('FILENAME_SPECIALS', 'specials.php');

define('FILENAME_SSL_CHECK', 'ssl_check.php');

define('FILENAME_TELL_A_FRIEND', 'tell_a_friend.php');

define('FILENAME_UPCOMING_PRODUCTS', 'upcoming_products.php');

 

// BOF: Information Pages Unlimited

define('FILENAME_INFORMATION', 'information.php');

// EOF: Information Pages Unlimited

 

 

 

?>

 

 

 

includes/database_tables.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

// define the database table names used in the project

define('TABLE_ACTION_RECORDER', 'action_recorder');

define('TABLE_ADDRESS_BOOK', 'address_book');

define('TABLE_ADDRESS_FORMAT', 'address_format');

define('TABLE_ADMINISTRATORS', 'administrators');

define('TABLE_BANNERS', 'banners');

define('TABLE_BANNERS_HISTORY', 'banners_history');

define('TABLE_CATEGORIES', 'categories');

define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');

define('TABLE_CONFIGURATION', 'configuration');

define('TABLE_CONFIGURATION_GROUP', 'configuration_group');

define('TABLE_COUNTER', 'counter');

define('TABLE_COUNTER_HISTORY', 'counter_history');

define('TABLE_COUNTRIES', 'countries');

define('TABLE_CURRENCIES', 'currencies');

define('TABLE_CUSTOMERS', 'customers');

define('TABLE_CUSTOMERS_BASKET', 'customers_basket');

define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');

define('TABLE_CUSTOMERS_INFO', 'customers_info');

define('TABLE_LANGUAGES', 'languages');

define('TABLE_MANUFACTURERS', 'manufacturers');

define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');

define('TABLE_ORDERS', 'orders');

define('TABLE_ORDERS_PRODUCTS', 'orders_products');

define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes');

define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');

define('TABLE_ORDERS_STATUS', 'orders_status');

define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');

define('TABLE_ORDERS_TOTAL', 'orders_total');

define('TABLE_PRODUCTS', 'products');

define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');

define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');

define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');

define('TABLE_PRODUCTS_IMAGES', 'products_images');

define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');

define('TABLE_PRODUCTS_OPTIONS', 'products_options');

define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');

define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');

define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');

define('TABLE_REVIEWS', 'reviews');

define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');

define('TABLE_SESSIONS', 'sessions');

define('TABLE_SPECIALS', 'specials');

define('TABLE_TAX_CLASS', 'tax_class');

define('TABLE_TAX_RATES', 'tax_rates');

define('TABLE_GEO_ZONES', 'geo_zones');

define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');

define('TABLE_WHOS_ONLINE', 'whos_online');

define('TABLE_ZONES', 'zones');

define('TABLE_EZPAGES', 'ezpages');

define('TABLE_EZPAGES_DESCRIPTION', 'ezpages_description');

define('TABLE_SEO_URLS', 'seo_urls');

define('TABLE_SEO_HISTORY', 'seo_history');

define('TABLE_SEO_301S', 'seo_301s');

 

// BOF: Information Pages Unlimited

define('TABLE_INFORMATION', 'information');

// EOF: Information Pages Unlimited

 

?>

 

 

index.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// the following cPath references come from application_top.php

$category_depth = 'top';

if (isset($cPath) && tep_not_null($cPath)) {

$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

$categories_products = tep_db_fetch_array($categories_products_query);

if ($categories_products['total'] > 0) {

$category_depth = 'products'; // display products

} else {

$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");

$category_parent = tep_db_fetch_array($category_parent_query);

if ($category_parent['total'] > 0) {

$category_depth = 'nested'; // navigate through the categories

} else {

$category_depth = 'products'; // category has no products, but display the 'no products' message

}

}

}

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

 

require(DIR_WS_INCLUDES . 'template_top.php');

 

if ($category_depth == 'nested') {

$category_query = tep_db_query("select cd.categories_name, c.categories_image, cd.description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

?>

<div class="breadcrumb_trail"><?php echo '  ' . $breadcrumb->trail(' » '); ?></div>

<h1><?php echo $category['categories_name']; ?></h1>

 

<div class="contentContainer">

<div class="contentText">

 

<div class="cat_description">

 

<?php

 

if (!empty($category['categories_image'])) {

echo '<div id="piGal" class="picR"><a href="' . tep_href_link(DIR_WS_IMAGES . $category['categories_image'], '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />Click to Enlarge</a></div>';

}

 

echo stripslashes(stripslashes($category['description'])); ?>

<script type="text/javascript">

$("#piGal a[rel^=fancybox]").fancybox({

cyclic: true

});

</script>

 

 

</div>

<table border="0" width="100%" cellspacing="5" cellpadding="5">

<tr>

<?php

if (isset($cPath) && strpos('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

if ($categories['total'] < 1) {

// do nothing, go through the loop

} else {

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

break; // we've found the deepest category the customer is in

}

}

} else {

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

 

}

 

$number_of_categories = tep_db_num_rows($categories_query);

 

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)){

 

$rows++;

 

$cPath_new = tep_get_path($categories['categories_id']);

 

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

 

 

echo '<td align="center" class="smallText box_back" height="146" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br /><span>' . $categories['categories_name'] . '</span></a></td>' . "\n";

 

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

 

echo '</tr>' . "\n";

 

echo '<tr>' . "\n";

 

}

}

 

// needed for the new products module shown below

$new_products_category_id = $current_category_id;

?>

</tr>

</table>

 

<br />

 

<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>

 

</div>

</div>

 

<?php

} elseif ($category_depth == 'products' || (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id']))) {

// create column list

$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,

'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,

'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,

'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,

'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,

'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,

'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 

asort($define_list);

 

$column_list = array();

reset($define_list);

while (list($key, $value) = each($define_list)) {

if ($value > 0) $column_list[] = $key;

}

 

$select_column_list = '';

 

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

switch ($column_list[$i]) {

case 'PRODUCT_LIST_MODEL':

$select_column_list .= 'p.products_model, ';

break;

case 'PRODUCT_LIST_NAME':

$select_column_list .= 'pd.products_name, ';

break;

case 'PRODUCT_LIST_MANUFACTURER':

$select_column_list .= 'm.manufacturers_name, ';

break;

case 'PRODUCT_LIST_QUANTITY':

$select_column_list .= 'p.products_quantity, ';

break;

case 'PRODUCT_LIST_IMAGE':

$select_column_list .= 'p.products_image, ';

break;

case 'PRODUCT_LIST_WEIGHT':

$select_column_list .= 'p.products_weight, ';

break;

}

}

 

// show the products of a specified manufacturer

if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) {

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only a specific category

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

} else {

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

}

} else {

// show the products in a given categorie

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only specific catgeory

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} else {

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

}

}

 

if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

$HTTP_GET_VARS['sort'] = $i+1 . 'a';

$listing_sql .= " order by pd.products_name";

break;

}

}

} else {

$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

$sort_order = substr($HTTP_GET_VARS['sort'], 1);

 

switch ($column_list[$sort_col-1]) {

case 'PRODUCT_LIST_MODEL':

$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

case 'PRODUCT_LIST_NAME':

$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');

break;

case 'PRODUCT_LIST_MANUFACTURER':

$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

case 'PRODUCT_LIST_QUANTITY':

$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

case 'PRODUCT_LIST_IMAGE':

$listing_sql .= " order by pd.products_name";

break;

case 'PRODUCT_LIST_WEIGHT':

$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

case 'PRODUCT_LIST_PRICE':

$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

}

}

 

$catname = HEADING_TITLE;

if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) {

$image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

$image = tep_db_fetch_array($image);

$catname = $image['catname'];

} elseif ($current_category_id) {

$image = tep_db_query("select c.categories_image, cd.description, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

$image = tep_db_fetch_array($image);

$catname = $image['catname'];

$description = $image['description'];

$picture = $image['categories_image'];

}

 

?>

<div class="breadcrumb_trail"><?php echo '  ' . $breadcrumb->trail(' » '); ?></div>

<h1><?php echo $catname; ?></h1>

 

<div id="printNav">

<a href="<?php echo tep_href_link('html2pdf/html2ps.php', 'url=' . urlencode(preg_replace('%^'. preg_quote(DIR_WS_CATALOG) .'%', '', tep_href_link(FILENAME_DEFAULT , 'cPath=' . $cPath . '&nothumbs=1')))); ?>" target="_blank" rel="nofollow"><img src="images/site/pdficon_small.gif" width="17" height="17" alt="Download PDF of this page" title="Download PDF of this page"></a> 

 

<a href="javascript:void(window.print());"><img src="images/site/printer_small.gif" width="17" height="17" alt="Print this page" title="Print this page"></a><br>

</div>

 

<div class="contentContainer">

 

<?php

 

if (!empty($picture)) {

echo '<div id="piGal" class="picR"><a href="' . tep_href_link(DIR_WS_IMAGES . $picture, '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $picture, $catname, SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />Click to Enlarge</a></div>';

}

?>

<script type="text/javascript">

$("#piGal a[rel^=fancybox]").fancybox({

cyclic: true

});

</script>

 

<?php

if($description != ''){

 

 

echo $description;

}

 

// optional Product List Filter

if (PRODUCT_LIST_FILTER > 0) {

if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) {

$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";

} else {

$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";

}

$filterlist_query = tep_db_query($filterlist_sql);

 

if (tep_db_num_rows($filterlist_query) > 1) {

echo '<div>' . tep_draw_form('filter', tep_href_link( FILENAME_DEFAULT ), 'get') . '<p align="right">' . TEXT_SHOW . ' ';

if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) {

echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);

$options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));

} else {

echo tep_draw_hidden_field('cPath', $cPath);

$options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));

}

echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);

while ($filterlist = tep_db_fetch_array($filterlist_query)) {

$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);

}

echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');

echo tep_hide_session_id() . '</p></form></div>' . "\n";

}

}

 

 

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);

?>

 

</div>

 

<?php

} else { // default page

 

 

$category_depth = 'top';

 

if($category_depth == 'top' && !isset($_GET['manufacturers_id'])) {

 

$properPageName = tep_href_link(FILENAME_DEFAULT);

 

$EZPAGES_VISIBLE = false;

 

$body_class = "body_home";

 

$sql = tep_db_query("SELECT e.ezpages_status as visible, ed.ezpages_name, ed.ezpages_description, ezpages_head_title_tag, ezpages_head_desc_tag, ezpages_head_keywords_tag FROM " . TABLE_EZPAGES . " e inner join " . TABLE_EZPAGES_DESCRIPTION . " ed on e.ezpages_id = ed.ezpages_id WHERE e.ezpages_status = 1 AND e.ezpages_id = 1 and ed.language_id = " . (int)$languages_id) or die(mysql_error());

$row = tep_db_fetch_array($sql);

if ($row['visible'] == '1') $EZPAGES_VISIBLE = true;

$EZPAGES_TITLE = stripslashes($row['ezpages_name']);

$EZPAGES_DESCRIPTION = stripslashes($row['ezpages_description']);

$EZPAGES_META_TITLE = stripslashes($row['ezpages_head_title_tag']);

$EZPAGES_META_DESC = stripslashes($row['ezpages_head_desc_tag']);

$EZPAGES_META_KEYWORDS = stripslashes($row['ezpages_head_keywords_tag']);

}

?>

 

<!--h1><?php echo $EZPAGES_TITLE; ?></h1-->

<!--h1><?php echo HEADING_TITLE; ?></h1-->

 

<div class="contentContainer">

<div class="contentText homeText" align="center">

<?php echo '<div style="margin-bottom: 0px;">' . $EZPAGES_DESCRIPTION . '</div>'; ?>

<?php #echo tep_customer_greeting(); ?>

</div>

 

<?php

if (tep_not_null(TEXT_MAIN)) {

?>

 

<div class="contentText">

<?php echo TEXT_MAIN; ?>

</div>

 

<?php

}

 

#include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

#include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

?>

 

</div>

 

<?php

}

 

 

 

 

 

 

 

 

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

 

 

/includes/modules/boxes/bm_information.php

 

<?php

/*

$Id$

adapted for Information Pages Unlimited v2.05

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

class bm_information {

var $code = 'bm_information';

var $group = 'boxes';

var $title;

var $description;

var $sort_order;

var $enabled = false;

 

function bm_information() {

$this->title = MODULE_BOXES_INFORMATION_TITLE;

$this->description = MODULE_BOXES_INFORMATION_DESCRIPTION;

 

if ( defined('MODULE_BOXES_INFORMATION_STATUS') ) {

$this->sort_order = MODULE_BOXES_INFORMATION_SORT_ORDER;

$this->enabled = (MODULE_BOXES_INFORMATION_STATUS == 'True');

 

$this->group = ((MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');

}

}

 

function execute() {

global $oscTemplate;

 

 

 

// BOF: Information Pages Unlimited

require_once(DIR_WS_FUNCTIONS . 'information.php');

// EOF: Information Pages Unlimited

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_INFORMATION_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

tep_information_show_category(1) .

// ' <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOXES_INFORMATION_BOX_SHIPPING . '</a><br />' .

// ' <a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . MODULE_BOXES_INFORMATION_BOX_PRIVACY . '</a><br />' .

// ' <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' .

' <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a>' .

' </div>' .

'</div>';

 

$oscTemplate->addBlock($data, $this->group);

}

 

function isEnabled() {

return $this->enabled;

}

 

function check() {

return defined('MODULE_BOXES_INFORMATION_STATUS');

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_INFORMATION_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_INFORMATION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

return array('MODULE_BOXES_INFORMATION_STATUS', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'MODULE_BOXES_INFORMATION_SORT_ORDER');

}

}

?>

 

 

 

 

I will start commenting out anything that references ez pages

 

 

I'm not sure what you mean by "If you can access the information text / html back up so you can use later", sorry.

 

 

Thank you for your help with this. Everything you guys can do is greatly appreciated. :thumbsup:

Edited by sunbound2

Share this post


Link to post
Share on other sites

After commenting out the EZ_pages stuff from those files (only two of them had stuff), the website fails... that was expected... something is still looking for that information. the error i get on the page is "1146 - Table 'marlin.table_ezpages' doesn't exist

 

Select e.ezpages_id as id, ed.ezpages_name as name, e.passthru as is_passthru, 0 as is_header, e.target as target, e.ezpages_parent_category as parent_id From TABLE_EZPAGES e Inner Join TABLE_EZPAGES_DESCRIPTION ed On e.ezpages_id = ed.ezpages_id And ed.language_id = 1 Where e.ezpages_status = 1 AND e.ezpages_nav_status = 1 Order By parent_id, sort_order, ezpages_name"

 

and its correct, that table doesn't exist in my database.

 

I'm not seeing the

 

if($_GET['info_id'] == 1){

 

code in my index.php file.

Share this post


Link to post
Share on other sites

I'm running a findstr right now for ezpages in my PHP files right now... I'm hoping to find an answer in there somewhere.

 

PS. Thanks for the Tip about the command MrPhil... looking back, it seems you have been helping me with this project since the beginning. I owe you a beer after this! :beers:

Share this post


Link to post
Share on other sites

no SORRY any from slick will do the ones above are buggy.

 

I mean if you have a lot of written content you do not want to rewrite so save before you delete anything you should find in the written content in the database.


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Remove and watch the bracket }

 

Line 305 - 323 remove not sure if you still need below you will have to test as your file has been modified

 

$category_depth = 'top';

 

if($category_depth == 'top' && !isset($_GET['manufacturers_id'])) {

 

line 326 remove

 

line 331 remove

 

can not see the code changes for the new info pages add on in index guess you have not done yet


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×