Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

FCK WYSIWYG HTML editor


spooks

Recommended Posts

You speak frensh dont you?

 

Could you explain what this means?

 

Juste une petite modification pour que le titre de 'home' ne s'affiche plus sur toutes les pages en lien avec 'index.php' mais seulement sur la page d'accueil.

 

Ce n'est pas le package complet.

Edited by Solan
Link to comment
Share on other sites

Well, I speak some, so no guarantee, I think it means:

 

Just a small change to the title of 'home' it no longer appears on all pages linked to 'index.php' but only on the home page.

 

This is not the complete package.

:)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi Spooks

thanks for your contribution.....

just a little question..... where are the instruccion?? i download the last one file in german and the other one complete, i was to look around in any file and folders but dont have found instruccions...

maybe i m a little stupid? thanks for ur help....

have a nice day

Link to comment
Share on other sites

open the text file in 2.7, installation instructions are there.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hello All,

 

I've just finished installing the latest version of FCK editor 2.6.3 + Spooks install version 2.7.

The editor works fine in Descriptions, Email and Newsletter manager.

Also after installing Spooks Mod for sending HTML Email the images are displayed perfectly in an HTML email created via the admin.

But, when i make an newsletter with the FCK editor and send it out then the images are not displayed?

When i look into the source of the message the images source only holds the folder and file info but not the full path including domainname.

 

Is there a way to get this fixed?

 

Many thanks in advance,

Richard

I am having the exact same problem. All works well in the editor, I can upload files just fine, but the path for the image when the Newsletter is sent does not contain the FULL path with "http://www.domain.com". The image src starts with /userfiles/images/filename.jpg

 

Thanks!

Link to comment
Share on other sites

I think this is already in this thread:

 

same issue that I fixed for Send Admin HTML e-mails http://addons.oscommerce.com/info/5806

 

Look at that & applty for newsletter.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I have read every post in this thread and did not see this addressed:

 

When the newsletter.php page copies records into the customers_temp table, when does it rewrite records into the customer_temp db? It seems once they are in there, it will only copy records again if the table is empty.

 

This is the code from newsletter.php

 

// copy e-mails to a temporary table if that table is empty

  $check_rows = tep_db_query("select * from " . TABLE_CUSTOMERS_TEMP);
  if (mysql_num_rows($check_rows) == 0) {

$copy_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

while($row = tep_db_fetch_array($copy_query)) {
	if (eregi('^[-a-z0-9._]+@([-a-z0-9_]+\.)+[a-z]{2,6}$',$row['customers_email_address'])) {
	tep_db_query("insert into " . TABLE_CUSTOMERS_TEMP . " (customers_firstname, customers_lastname, customers_email_address) VALUES ('" . addslashes($row['customers_firstname']) . "', '" . addslashes($row['customers_lastname']) . "', '" . $row['customers_email_address'] . "')");
	}
}
  //echo "copy done.<br>";
  } else {
	//echo "no copy done.<br>";
}

  // count e-mails in temp table

Link to comment
Share on other sites

you were talking of image link path broken, how does this relate to that?

 

My point of the emails is that in exactly the same way, image paths within the e-mails are broken, my contrib fixes that for them.

 

Is this your issue, or is there something else your on about now?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Sorry for the confusion... I have gone back through the files and was not able to make the changes to the newsletter that you did for the Admin email, I'm just not savvy enough for that. My next post was strictly a new question that I wonder if it had been addressed or was this by design for some reason?

Link to comment
Share on other sites

re-posting as per spooks advice, I pressed new topic instead of add reply.

Have spent all day on this install FCKeditor 1.2, I thought I finally got it working but when i tried to add new info page it looks ok in the editor, previews ok but then when you look at it on the site the text is in brackets and code - html markup?, when you go back to the edit the page it is the same there then as well. I tried listing a new product and the same thing happened. Ive tried to search for an answer on here and google but i cant find one. Any help would be appreciated.

Thanks

Link to comment
Share on other sites

I'm not sure you've got the right thread, what do you mean add new info page

 

did you mean product?

There are other contribs using fck, they all have their own threads

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Yesterday I posted this as a new topic, without any replies for assistance. I see now that perhaps I should have posted here.

 

Once again, any help would be much appreciated from any knowledgeable FCKeditor gurus.

 

I have a fresh install of latest osCommerce and am attempting to install FCKeditor 1.2 - I'm having problems and have spent hours reading the forums for help without success. Perhaps this is an easy fix someone can spot right away. Any help would be appreciated.

 

I am following instructions_to_install_in_version_osC_Update_060817 + RC1+RC2+RC2a

 

When I attempt to go to www.sitename.com/admin I get the following errors:

Warning: main(fckeditor/fckeditor.php) [function.main]: failed to open stream: No such file or directory in /home/xxxxxxx/public_html/admin/includes/functions/html_output.php on line 12

 

Warning: main(fckeditor/fckeditor.php) [function.main]: failed to open stream: No such file or directory in /home/xxxxxxx/public_html/admin/includes/functions/html_output.php on line 12

 

Fatal error: main() [function.require]: Failed opening required 'fckeditor/fckeditor.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxxxx/public_html/admin/includes/functions/html_output.php on line 12

 

----------------------------------

 

Instructions said to upload the files+directories in your root:

catalog/admin/fckeditor/

and

catalog/userfiles/

 

My configuration didn't have a /catalog directory, so I added it and followed directions.

 

---------------------------------

 

In /admin/categories.php I did the following:

 

replaced this:

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

with this:

<td class="main"><?php echo tep_draw_fckeditor('products_description[' . $languages[$i]['id'] . ']','600','300',(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

--------------------------------

 

In /admin/includes/functions/html_output.php

 

I added this line (which just happens to be the Line 12 referred to in error message):

require("fckeditor/fckeditor.php");

 

and I add this as instructed:

////

// Output a form textarea field w/ fckeditor

function tep_draw_fckeditor($name, $width, $height, $text) {

 

$oFCKeditor = new FCKeditor($name);

$oFCKeditor -> Width = $width;

$oFCKeditor -> Height = $height;

$oFCKeditor -> BasePath = 'fckeditor/';

$oFCKeditor -> Value = $text;

 

$field = $oFCKeditor->Create($name);

 

return $field;

}

 

----------------------------------------

 

Then in the root I created /userfiles and set to 777.

 

---------------------------------------

 

This part may be a problem. The instructions set to input the path to the /userfiles in

admin/fckeditor/editor/filemanager/connectors/php/config.php BUT THAT DOESN'T EXIST. Because the instructions said to upload into catalog/admin/fckeditor I FOUND THIS FILE IN

/catalog/admin/fckeditor/editor/filemanager/connectors/php/config.php

 

(I have both /admin and /catalog/admin directories - don't know if thats a problem)

 

I changed $Config['Enabled'] to = true ;

 

Made this change:

$Config['UserFilesPath'] = '/home/xxxxxxx/public_html/userfiles/'

 

(to obtain the userfilesabsolutepath opened the include/configure.php and copied the path from DIR_FS_CATALOG and added/userfiles/ after it)

 

--------------------------------

 

Any ideas? I have seen this topic discussed before but all the fixes suggested I have double-checked to make sure they were done right.

Link to comment
Share on other sites

The latest install per this contribution is 2.7, why are'nt you doing that.

 

If you are doing some other install I'm afraid you need to ask is the thread appropriate to that!

 

in any case if you have a root install, you don`t create catalog...

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I'm not sure you've got the right thread, what do you mean add new info page

 

did you mean product?

There are other contribs using fck, they all have their own threads

 

after installing fckeditor i tried both adding a new information page and a product listing. so is this the wrong thread for fckeditor?

Link to comment
Share on other sites

As stated at the start of this thread

 

This is the thread for fck editor as per Contribution at http://addons.oscommerce.com/info/2900.

 

Is that the install you did

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 2 weeks later...

I've installed this contribution following the 2.7 instructions and everything is exactly the same in the admin section apart from the newsletters page where I get:

 

Newsletter Manager

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from newsletters order by date_added desc limit -20, 20

 

[TEP STOP]

 

That is the only evidence of the contribution and I've tried allsorts to fix it with no luck. The website is a root style and the 'catalog' folder has a different name but I have changed the name where I see 'catalog'. Am I missing something obvious? TIA

Link to comment
Share on other sites

I've now read the thread and tried changing the things other people had a problem with. Now I just get text that says: 'Die angegebene Datei konnte nicht auf dem Server gefunden werden!'

 

It is a root type install, here as the code.

 

This is my config.php:

 

<?php
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
*  - GNU General Public License Version 2 or later (the "GPL")
*	http://www.gnu.org/licenses/gpl.html
*
*  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
*	http://www.gnu.org/licenses/lgpl.html
*
*  - Mozilla Public License Version 1.1 or later (the "MPL")
*	http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* Configuration file for the File Manager Connector for PHP.
*/

global $Config;

// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true;", you must be sure that only
//		authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = true;


// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/';

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Useful if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '';

// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true;

// Perform additional checks for image files.
// If set to true, validate image size (using getimagesize).
$Config['SecureImageUploads'] = true;

// What the user can do with this connector.
$Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder');

// Allowed Resource Types.
$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media');

// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
$Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js");

// After file is uploaded, sometimes it is required to change its permissions
// so that it was possible to access it at the later time.
// If possible, it is recommended to set more restrictive permissions, like 0755.
// Set to 0 to disable this feature.
// Note: not needed on Windows-based servers.
$Config['ChmodOnUpload'] = 0777;

// See comments above.
// Used when creating folders that does not exist.
$Config['ChmodOnFolderCreate'] = 0777;

/*
Configuration settings for each Resource Type

- AllowedExtensions: the possible extensions that can be allowed.
	If it is empty then any file type can be uploaded.
- DeniedExtensions: The extensions that won't be allowed.
	If it is empty then no restrictions are done here.

For a file to be uploaded it has to fulfill both the AllowedExtensions
and DeniedExtensions (that's it: not being denied) conditions.

- FileTypesPath: the virtual folder relative to the document root where
	these resources will be located.
	Attention: It must start and end with a slash: '/'

- FileTypesAbsolutePath: the physical path to the above folder. It must be
	an absolute path.
	If it's an empty string then it will be autocalculated.
	Useful if you are using a virtual directory, symbolic link or alias.
	Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
	Attention: The above 'FileTypesPath' must point to the same directory.
	Attention: It must end with a slash: '/'

 - QuickUploadPath: the virtual folder relative to the document root where
	these resources will be uploaded using the Upload tab in the resources
	dialogs.
	Attention: It must start and end with a slash: '/'

 - QuickUploadAbsolutePath: the physical path to the above folder. It must be
	an absolute path.
	If it's an empty string then it will be autocalculated.
	Useful if you are using a virtual directory, symbolic link or alias.
	Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
	Attention: The above 'QuickUploadPath' must point to the same directory.
	Attention: It must end with a slash: '/'

 	NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to
 	"userfiles" directory to maintain backwards compatibility with older versions of FCKeditor.
 	This is fine, but you in some cases you will be not able to browse uploaded files using file browser.
 	Example: if you click on "image button", select "Upload" tab and send image
 	to the server, image will appear in FCKeditor correctly, but because it is placed
 	directly in /userfiles/ directory, you'll be not able to see it in built-in file browser.
 	The more expected behaviour would be to send images directly to "image" subfolder.
 	To achieve that, simply change
		$Config['QuickUploadPath']['Image']			= $Config['httpdocs'];
		$Config['QuickUploadAbsolutePath']['Image']	= $Config['UserFilesAbsolutePath'];
	into:
		$Config['QuickUploadPath']['Image']			= $Config['FileTypesPath']['Image'];
		$Config['QuickUploadAbsolutePath']['Image'] 	= $Config['FileTypesAbsolutePath']['Image'];

*/

$Config['AllowedExtensions']['File']	= array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip');
$Config['DeniedExtensions']['File']		= array();
$Config['FileTypesPath']['File']		= $Config['UserFilesPath'] . '/';
$Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'';
$Config['QuickUploadPath']['File']		= $Config['UserFilesPath'];
$Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'];

$Config['AllowedExtensions']['Image']	= array('bmp','gif','jpeg','jpg','png');
$Config['DeniedExtensions']['Image']	= array();
$Config['FileTypesPath']['Image']		= $Config['UserFilesPath'] . 'images/';
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'images/';
$Config['QuickUploadPath']['Image'] = $Config['FileTypesPath']['Image'];
$Config['QuickUploadAbsolutePath']['Image'] = $Config['FileTypesAbsolutePath']['Image'];

$Config['AllowedExtensions']['Flash']	= array('swf','flv');
$Config['DeniedExtensions']['Flash']	= array();
$Config['FileTypesPath']['Flash']		= $Config['UserFilesPath'] . 'flash/';
$Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/';
$Config['QuickUploadPath']['Flash']		= $Config['UserFilesPath'];
$Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'];

$Config['AllowedExtensions']['Media']	= array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv');
$Config['DeniedExtensions']['Media']	= array();
$Config['FileTypesPath']['Media']		= $Config['UserFilesPath'] . 'media/';
$Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/';
$Config['QuickUploadPath']['Media']		= $Config['UserFilesPath'];
$Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'];?>

 

My html_output.php:

 

<?php
/*
 $Id: html_output.php,v 1.56 2003/07/09 01:15:48 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
  require("fckeditor/fckeditor.php");
////
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;

if (!tep_not_null($page)) {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}

if ($connection == 'NONSSL') {
  $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
} elseif ($connection == 'SSL') {
  if (ENABLE_SSL == true) {
	$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
  } else {
	$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
  }
} else {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
}

if (tep_not_null($parameters)) {
  $link .= $page . '?' . tep_output_string($parameters);
  $separator = '&';
} else {
  $link .= $page;
  $separator = '?';
}

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
  if (tep_not_null($SID)) {
	$_sid = $SID;
  } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
	if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
	  $_sid = tep_session_name() . '=' . tep_session_id();
	}
  }
}

if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
  while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

  $link = str_replace('?', '/', $link);
  $link = str_replace('&', '/', $link);
  $link = str_replace('=', '/', $link);

  $separator = '?';
}

if (isset($_sid)) {
  $link .= $separator . $_sid;
}

return $link;
 }

////
// The HTML image wrapper function
 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
  return false;
}

 if ($image_size = @getimagesize($src)) {
  if ((CONFIG_CALCULATE_IMAGE_SIZE == 'true' && $src != DIR_WS_IMAGES . 'pixel_black.gif' && $src != DIR_WS_IMAGES . 'pixel_trans.gif' && $src != DIR_WS_IMAGES . 'pixel_silver.gif' )) {
			if ( ($width) || ($height) ) {
					if ( $width=="100%" ) {
					  $width = $image_size[0];
					} elseif ( $height=="100%" ) {
					  $height = $image_size[1];
					} elseif ( $width==0 ) {
					  unset($width);
					} elseif ( $height==0 ) {
					  unset($height);
					}
					$src=thumbimage(DIR_FS_CATALOG . '/' .$src, $width, $height, 1, 1, DIR_FS_CATALOG . '/' . DIR_WS_IMAGES . 'imagecache');
					if ((($image_size[1]/$height) > ($image_size[0]/$width) ) && $height>0){
							 $width=ceil(($image_size[0]/$image_size[1])* $height);
					} elseif ($width>0) {
							 $height=ceil($width/($image_size[0]/$image_size[1]));
					}
			}
	   }
  } elseif (IMAGE_REQUIRED == 'false') {
	return '';
  }

// begin radders added
 $src = tep_image_resample($src,$width,$height);
//end radders added

// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) {
  $image .= ' title=" ' . tep_output_string($alt) . ' "';
}

/*
if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
  if ($image_size = @getimagesize($src)) {
	if (empty($width) && tep_not_null($height)) {
	  $ratio = $height / $image_size[1];
	  $width = $image_size[0] * $ratio;
	} elseif (tep_not_null($width) && empty($height)) {
	  $ratio = $width / $image_size[0];
	  $height = $image_size[1] * $ratio;
	} elseif (empty($width) && empty($height)) {
	  $width = $image_size[0];
	  $height = $image_size[1];
	}
  } elseif (IMAGE_REQUIRED == 'false') {
	return false;
  }
}
*/
if (tep_not_null($width) && tep_not_null($height)) {
  $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

$image .= '>';

return $image;
 }

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
 function tep_image_submit($image, $alt = '', $parameters = '') {
global $language;

$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

$image_submit .= '>';

return $image_submit;
 }

////
// Output a function button in the selected language
 function tep_image_button($image, $alt = '', $parameters = '') {
global $language;

return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
 }

////
// Output a separator either through whitespace, or with an image
 function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
return tep_image(DIR_WS_IMAGES . $image, '', $width, $height);
 }

////
// Output a form
 function tep_draw_form($name, $action, $method = 'post', $parameters = '') {
$form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"';

if (tep_not_null($parameters)) $form .= ' ' . $parameters;

$form .= '>';

return $form;
 }

////
// Output a form input field
 function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';

if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
  $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
} elseif (tep_not_null($value)) {
  $field .= ' value="' . tep_output_string($value) . '"';
}

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

return $field;
 }

////
// Output a form password field
 function tep_draw_password_field($name, $value = '', $parameters = 'maxlength="40"') {
return tep_draw_input_field($name, $value, $parameters, 'password', false);
 }

////
// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
 function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
$selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';

if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';

if ( ($checked == true) || ( isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ( ($GLOBALS[$name] == 'on') || (isset($value) && (stripslashes($GLOBALS[$name]) == $value)) ) ) ) {
  $selection .= ' CHECKED';
}

if (tep_not_null($parameters)) $selection .= ' ' . $parameters;

$selection .= '>';

return $selection;
 }

////
// Output a form checkbox field
 function tep_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {
return tep_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);
 }

////
// Output a form radio field
 function tep_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
return tep_draw_selection_field($name, 'radio', $value, $checked, $parameters);
 }

////
// Output a form textarea field
 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
  $field .= stripslashes($GLOBALS[$name]);
} elseif (tep_not_null($text)) {
  $field .= $text;
}

$field .= '</textarea>';

return $field;
 }
////
////
// Output a form textarea field w/ fckeditor
function tep_draw_fckeditor($name, $width, $height, $text) {

$oFCKeditor = new FCKeditor($name);
$oFCKeditor -> Width = $width;
$oFCKeditor -> Height = $height;
$oFCKeditor -> BasePath = 'fckeditor/';
$oFCKeditor -> Value = $text;
$field = $oFCKeditor->Create($name);

return $field;
}
////
// Output a form hidden field
 function tep_draw_hidden_field($name, $value = '', $parameters = '') {
$field = '<input type="hidden" name="' . tep_output_string($name) . '"';

if (tep_not_null($value)) {
  $field .= ' value="' . tep_output_string($value) . '"';
} elseif (isset($GLOBALS[$name])) {
  $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
}

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

return $field;
 }

////
// Hide form elements
 function tep_hide_session_id() {
global $session_started, $SID;

if (($session_started == true) && tep_not_null($SID)) {
  return tep_draw_hidden_field(tep_session_name(), tep_session_id());
}
 }

////
// Output a form pull down menu
 function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
$field = '<select name="' . tep_output_string($name) . '"';

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

for ($i=0, $n=sizeof($values); $i<$n; $i++) {
  $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
  if ($default == $values[$i]['id']) {
	$field .= ' SELECTED';
  }

  $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>';
}
$field .= '</select>';

if ($required == true) $field .= TEXT_FIELD_REQUIRED;

return $field;
 }

////
// Creates a pull-down list of countries
 function tep_get_country_list($name, $selected = '', $parameters = '') {
$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
$countries = tep_get_countries();

for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
  $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
}

return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
 }
// begin radders added
function tep_image_resample($src,$width,$height) {

	define(JPEGQUALITY, 90);
	define(ALLOWSQUASH,0.10);
	if ($src=='') {
			return $src;
	 }
	$i = @getimagesize( $src );   // 1-gif (ignore), 2-jpeg, 3-png

	if (!(($width == SMALL_IMAGE_WIDTH) && ($height == SMALL_IMAGE_HEIGHT))) {
			return $src; // can amend to work with other images
	 }
	if (!( ($i[2] == 3) || ($i[2] ==2))) {
			return $src;
	 }

	$file = eregi_replace( '\.([a-z]{3,4})$', "-{$width}x{$height}.\\1", $src );  // name of resampled image
	if (is_file( $file ) ) {		
			return $file;
	}

	$scr_w		 =  $i[0];
	$scr_h		 = $i[1];
	if (($scr_w * $scr_h * $width * $height) == 0) {
			return $src;
	 }

	$howsquashed = ($width / $height * $scr_h / $scr_w);
	if (((1 / (1 + ALLOWSQUASH)) < $howsquashed) && ($howsquashed < (1 + ALLOWSQUASH))) $simpleway='true';
	$scalefactor = min($width/$scr_w, $height/$scr_h);		  
	$scaled_w		= (int)($scr_w * $scalefactor);
	$scaled_h		 = (int)($scr_h * $scalefactor); 
	$offset_w		= max(0,round(($width - $scaled_w) / 2,0));
	$offset_h		 = max(0,round(($height - $scaled_h) / 2)); 
	 $dst = DIR_FS_CATALOG . '/' . $file; 
	   $dstim = @imagecreatetruecolor ($width, $height);
	$background_color = imagecolorallocate ($dstim, 255, 255, 255);
	imagefilledrectangle($dstim, 0, 0, $width, $height, $background_color);
	if ( $i[2] == 2) {
			$srcim = @ImageCreateFromJPEG ($src); // open
	}
	elseif ( $i[2] == 3) {
			$srcim		 = @ImageCreateFromPNG ($src);
	}
	if ($simpleway == 'true') {		
			imagecopyresampled ($dstim, $srcim, 0, 0, 0, 0, $width, $height, $scr_w, $scr_h);		
	}
	else {
			$intim = @imagecreatetruecolor ($width, $height); 
			imagecopyresampled ($intim, $srcim, $offset_w, $offset_h, 0, 0, $scaled_w, $scaled_h, $scr_w, $scr_h);
			imagecopy ( $dstim, $intim, $offset_w, $offset_h, $offset_w, $offset_h, $scaled_w, $scaled_h);
			imagedestroy ($intim);
	}
	if ( $i[2] == 2) {
			imagejpeg ($dstim , $dst , JPEGQUALITY);  
	}
	elseif ( $i[2] == 3) {
			imagepng ($dstim , $dst);
	}
	imagedestroy ($srcim);
	imagedestroy ($dstim);
	return $file;				 // Use the newly resampled image
}
// end radders added

function thumbimage ($image, $x, $y, $aspectratio, $resize, $cachedir){

	  /*##############################################
		  #		  - Thumbnail-Script v1.3 -		   #
		  # Generating thumbnails 'on-the-fly' with PHP  #
		  #											  #
		  #  (c) by Christian Lamine, FlashDreams OHG	#
		  #		  http://www.flashdreams.de/		  #
		  #											  #
		  #	   Modified by http://www.tse.at		  #
		  #	   Modified by [email protected]			   #
		  #											  #
		  # This script may be freely used, distributed  #
		  # and modified without any charge as long as   #
		  # this copyright information is included.	  #
		  #											  #
		  # Any commercial selling of this script is	 #
		  # forbidden.								   #
		  #											  #
		  # The author is not responsible for possible   #
		  # damage which may result from the application #
		  # of this script, neither direct nor indirect. #
		  # Use at your own risk!						#
		  ##############################################*/

 error_reporting(0);

 $types = array (1 => "gif", "jpeg", "png", "swf", "psd", "wbmp");
	 $not_supported_formats = array ("GIF"); // Write in capital Letters!!
 umask(0);
 !is_dir ($cachedir)
	 ? mkdir ($cachedir, 0777)
	 : system ("chmod 0777 ".$cachedir);

   (!isset ($x) || ereg ('^[0-9]{1,}$', $x, $regs)) &&
   (!isset ($y) || ereg ('^[0-9]{1,}$', $y, $regs)) &&
   (isset ($x) || isset ($y))
		? true
	  : DIE ('Fehlende(r) oder ungültige(r) Größenparameter!');

 !isset ($resize) || !ereg ('^[0|1]$', $resize, $regs)
	  ? $resize = 0
	  : $resize;

 !isset ($aspectratio) || !ereg ('^[0|1]$', $aspectratio, $regs)
	  ? isset ($x) && isset ($y)
			 ? $aspectratio = 1
			 : $aspectratio = 0
	  : $aspectratio;

 !isset ($image)
	  ? DIE ('Es wurde kein Bild angegeben!')
	  : !file_exists($image)
		   ? DIE ('Die angegebene Datei konnte nicht auf dem Server gefunden werden!')
		   : false;

 $imagedata = getimagesize($image);

 !$imagedata[2] || $imagedata[2] == 4 || $imagedata[2] == 5
	  ? DIE ('Bei der angegebenen Datei handelt es sich nicht um ein Bild!')
	  : false;

	 $imgtype="!(ImageTypes() & IMG_" . strtoupper($types[$imagedata[2]]) . ")";
 if ((eval($imgtype)) || (in_array(strtoupper(array_pop(explode('.', basename($image)))),$not_supported_formats))) {
		 $image = substr ($image, (strrpos (DIR_FS_CATALOG . '/', '/'))+1);
			 return $image;

 }

 if (!isset ($x)) $x = floor ($y * $imagedata[0] / $imagedata[1]);


 if (!isset ($y)) $y = floor ($x * $imagedata[1] / $imagedata[0]);

 if ($aspectratio && isset ($x) && isset ($y)) {
			if ((($imagedata[1]/$y) > ($imagedata[0]/$x) )){
					 $x=ceil(($imagedata[0]/$imagedata[1])* $y);
			} else {
					 $y=ceil($x/($imagedata[0]/$imagedata[1]));
			}
 }

 $thumbfile =  '/' . basename($image);
 if (file_exists ($cachedir.$thumbfile)) {
	  $thumbdata = getimagesize ($cachedir.$thumbfile);
	  $thumbdata[0] == $x && $thumbdata[1] == $y
		   ? $iscached = true
		   : $iscached = false;
 } else {
	  $iscached = false;
 }

 if (!$iscached) {
	  ($imagedata[0] > $x || $imagedata[1] > $y) || (($imagedata[0] < $x || $imagedata[1] < $y) && $resize)
		   ? $makethumb = true
		   : $makethumb = false;
 } else {
	  $makethumb = false;
 }



 if ($makethumb) {
	  $image = call_user_func("imagecreatefrom".$types[$imagedata[2]], $image);
	  if (function_exists("imagecreatetruecolor") && ($thumb = imagecreatetruecolor ($x, $y))) {
			imagecopyresampled ($thumb, $image, 0, 0, 0, 0, $x, $y, $imagedata[0], $imagedata[1]);
	  } else {
			$thumb = imagecreate ($x, $y);
			imagecopyresized ($thumb, $image, 0, 0, 0, 0, $x, $y, $imagedata[0], $imagedata[1]);
	  }
	  call_user_func("image".$types[$imagedata[2]], $thumb, $cachedir.$thumbfile);
	  imagedestroy ($image);
	  imagedestroy ($thumb);
	  $image = DIR_WS_IMAGES . 'imagecache' . $thumbfile;
 } else {
	  $iscached
		   ? $image = DIR_WS_IMAGES . 'imagecache' . $thumbfile
		   : $image = substr ($image, (strrpos (DIR_FS_CATALOG . '/', '/'))+1);
 }
return $image;

}

?>

 

And I am trying to get it to work with newsletters initially:

 

<?php
/*
 $Id: newsletters.php,v 1.17 2003/06/29 22:50:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/



 require('includes/application_top.php');

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
switch ($action) {
  case 'lock':
  case 'unlock':
	$newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
	$status = (($action == 'lock') ? '1' : '0');

	tep_db_query("update " . TABLE_NEWSLETTERS . " set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'");

	tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
	break;
  case 'insert':
  case 'update':
	if (isset($HTTP_POST_VARS['newsletter_id'])) $newsletter_id = tep_db_prepare_input($HTTP_POST_VARS['newsletter_id']);
	$newsletter_module = tep_db_prepare_input($HTTP_POST_VARS['module']);
	$title = tep_db_prepare_input($HTTP_POST_VARS['title']);
	$content = tep_db_prepare_input($HTTP_POST_VARS['content']);

	$newsletter_error = false;
	if (empty($title)) {
	  $messageStack->add(ERROR_NEWSLETTER_TITLE, 'error');
	  $newsletter_error = true;
	}

	if (empty($module)) {
	  $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
	  $newsletter_error = true;
	}

	if ($newsletter_error == false) {
	  $sql_data_array = array('title' => $title,
							  'content' => $content,
							  'module' => $newsletter_module);

	  if ($action == 'insert') {
		$sql_data_array['date_added'] = 'now()';
		$sql_data_array['status'] = '0';
		$sql_data_array['locked'] = '0';

		tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array);
		$newsletter_id = tep_db_insert_id();
	  } elseif ($action == 'update') {
		tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'");
	  }

	  tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $newsletter_id));
	} else {
	  $action = 'new';
	}
	break;
  case 'deleteconfirm':
	$newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);

	tep_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");

	tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page']));
	break;
  case 'delete':
  case 'new': if (!isset($HTTP_GET_VARS['nID'])) break;
  case 'send':
  case 'confirm_send':
	$newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);

	$check_query = tep_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");
	$check = tep_db_fetch_array($check_query);

	if ($check['locked'] < 1) {
	  switch ($action) {
		case 'delete': $error = ERROR_REMOVE_UNLOCKED_NEWSLETTER; break;
		case 'new': $error = ERROR_EDIT_UNLOCKED_NEWSLETTER; break;
		case 'send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
		case 'confirm_send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
	  }

	  $messageStack->add_session($error, 'error');

	  tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
	}
	break;
}
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
<?php
 if ($action == 'new') {
$form_action = 'insert';

$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = '/fckeditor/';
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>';
$oFCKeditor->Create();


$parameters = array('title' => '',
					'content' => '',
					'module' => '');

$nInfo = new objectInfo($parameters);

if (isset($HTTP_GET_VARS['nID'])) {
  $form_action = 'update';

  $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);

  $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
  $newsletter = tep_db_fetch_array($newsletter_query);

  $nInfo->objectInfo($newsletter);
} elseif ($HTTP_POST_VARS) {
  $nInfo->objectInfo($HTTP_POST_VARS);
}

$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$directory_array = array();
if ($dir = dir(DIR_WS_MODULES . 'newsletters/')) {
  while ($file = $dir->read()) {
	if (!is_dir(DIR_WS_MODULES . 'newsletters/' . $file)) {
	  if (substr($file, strrpos($file, '.')) == $file_extension) {
		$directory_array[] = $file;
	  }
	}
  }
  sort($directory_array);
  $dir->close();
}

for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
  $modules_array[] = array('id' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')), 'text' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')));
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr><?php echo tep_draw_form('newsletter', FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action); if ($form_action == 'update') echo tep_draw_hidden_field('newsletter_id', $nID); ?>
	<td><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><?php echo TEXT_NEWSLETTER_MODULE; ?></td>
		<td class="main"><?php echo tep_draw_pull_down_menu('module', $modules_array, $nInfo->module); ?></td>
	  </tr>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo TEXT_NEWSLETTER_TITLE; ?></td>
		<td class="main"><?php echo tep_draw_input_field('title', $nInfo->title, '', true); ?></td>
	  </tr>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main" valign="top"><?php echo TEXT_NEWSLETTER_CONTENT; ?></td>
		<td class="main"><?php echo tep_draw_fckeditor('content', 'soft', '600', '300', $nInfo->content); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main" align="right"><?php echo (($form_action == 'insert') ? tep_image_submit('button_save.gif', IMAGE_SAVE) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '  <a href="' . tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['nID']) ? 'nID=' . $HTTP_GET_VARS['nID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
	  </tr>
	</table></td>
  </form></tr>
<?php
 } elseif ($action == 'preview') {
$nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);

$newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = tep_db_fetch_array($newsletter_query);

$nInfo = new objectInfo($newsletter);
?>
  <tr>
	<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  </tr>
  <tr>
	<td><tt><?php echo nl2br($nInfo->content); ?></tt></td>
  </tr>
  <tr>
	<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  </tr>
<?php
 } elseif ($action == 'send') {
$nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);

$newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = tep_db_fetch_array($newsletter_query);

$nInfo = new objectInfo($newsletter);

include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
$module_name = $nInfo->module;
$module = new $module_name($nInfo->title, $nInfo->content);
?>
  <tr>
	<td><?php if ($module->show_choose_audience) { echo $module->choose_audience(); } else { echo $module->confirm(); } ?></td>
  </tr>
<?php
 } elseif ($action == 'confirm') {
$nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);

$newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = tep_db_fetch_array($newsletter_query);

$nInfo = new objectInfo($newsletter);

include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
$module_name = $nInfo->module;
$module = new $module_name($nInfo->title, $nInfo->content);
?>
  <tr>
	<td><?php echo $module->confirm(); ?></td>
  </tr>
<?php
 } elseif ($action == 'confirm_send') {
$nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);

$newsletter_query = tep_db_query("select newsletters_id, title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = tep_db_fetch_array($newsletter_query);

$nInfo = new objectInfo($newsletter);

include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
$module_name = $nInfo->module;
$module = new $module_name($nInfo->title, $nInfo->content);
?>
  <tr>
	<td><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'ani_send_email.gif', IMAGE_ANI_SEND_EMAIL); ?></td>
		<td class="main" valign="middle"><b><?php echo TEXT_PLEASE_WAIT; ?></b></td>
	  </tr>
	</table></td>
  </tr>
<?php
 tep_set_time_limit(0);
 flush();
 $module->send($nInfo->newsletters_id);
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><font color="#ff0000"><b><?php echo TEXT_FINISHED_SENDING_EMAILS; ?></b></font></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  </tr>
<?php
 } else {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr class="dataTableHeadingRow">
			<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NEWSLETTERS; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_MODULE; ?></td>
			<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SENT; ?></td>
			<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
		  </tr>
<?php
$newsletters_query_raw = "select newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from " . TABLE_NEWSLETTERS . " order by date_added desc";
$newsletters_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $newsletters_query_raw, $newsletters_query_numrows);
$newsletters_query = tep_db_query($newsletters_query_raw);
while ($newsletters = tep_db_fetch_array($newsletters_query)) {
if ((!isset($HTTP_GET_VARS['nID']) || (isset($HTTP_GET_VARS['nID']) && ($HTTP_GET_VARS['nID'] == $newsletters['newsletters_id']))) && !isset($nInfo) && (substr($action, 0, 3) != 'new')) {
	$nInfo = new objectInfo($newsletters);
  }

  if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) {
	echo '				  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '\'">' . "\n";
  } else {
	echo '				  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '\'">' . "\n";
  }
?>
			<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $newsletters['title']; ?></td>
			<td class="dataTableContent" align="right"><?php echo number_format($newsletters['content_length']) . ' bytes'; ?></td>
			<td class="dataTableContent" align="right"><?php echo $newsletters['module']; ?></td>
			<td class="dataTableContent" align="center"><?php if ($newsletters['status'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK); } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS); } ?></td>
			<td class="dataTableContent" align="center"><?php if ($newsletters['locked'] > 0) { echo tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED); } else { echo tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED); } ?></td>
			<td class="dataTableContent" align="right"><?php if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
		  </tr>
<?php
}
?>
		  <tr>
			<td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td class="smallText" valign="top"><?php echo $newsletters_split->display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?></td>
				<td class="smallText" align="right"><?php echo $newsletters_split->display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
			  </tr>
			  <tr>
				<td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'action=new') . '">' . tep_image_button('button_new_newsletter.gif', IMAGE_NEW_NEWSLETTER) . '</a>'; ?></td>
			  </tr>
			</table></td>
		  </tr>
		</table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
case 'delete':
  $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');

  $contents = array('form' => tep_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm'));
  $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
  $contents[] = array('text' => '<br><b>' . $nInfo->title . '</b>');
  $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  break;
default:
  if (is_object($nInfo)) {
	$heading[] = array('text' => '<b>' . $nInfo->title . '</b>');

	if ($nInfo->locked > 0) {
	  $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock') . '">' . tep_image_button('button_unlock.gif', IMAGE_UNLOCK) . '</a>');
	} else {
	  $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock') . '">' . tep_image_button('button_lock.gif', IMAGE_LOCK) . '</a>');
	}
	$contents[] = array('text' => '<br>' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added));
	if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . tep_date_short($nInfo->date_sent));
  }
  break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo '			<td width="25%" valign="top">' . "\n";

$box = new box;
echo $box->infoBox($heading, $contents);

echo '			</td>' . "\n";
 }
?>
	  </tr>
	</table></td>
  </tr>
<?php
 }
?>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

your sql error is nothing to do with this, it makes no sql changes at all.

 

 

 

Why try changes to something not detailed?? Alter categories that is & see how it works first.

 

You've made invalid alterations off your own bat, why????

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

your sql error is nothing to do with this, it makes no sql changes at all.

 

 

 

Why try changes to something not detailed?? Alter categories that is & see how it works first.

 

You've made invalid alterations off your own bat, why????

According to the text file it can be used to alter things other than categories. I need it to work with the newsletter but there are no instructions for this.

Link to comment
Share on other sites

yes it can, but since your strugling to work out how, do whats detailed first, then expand.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...