Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] HTML WYSIWYG Editor for Product Desc, MS1 2.2


Guest

Recommended Posts

  • Replies 557
  • Created
  • Last Reply

Top Posters In This Topic

@ ivan_nik

 

You may find what we did to be useful.  We simply replaced the following code:

 

define("IMAGE_DIR", trim(DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES));  

define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES));  

 

 

with:

 

define("IMAGE_DIR", trim(DIR_FS_CATALOG . "graphics/"));  

define("IMAGE_URL", trim(DIR_WS_CATALOG . "graphics/"));  

 

 

Then we created a directory called "graphics" (without quotes) in the catalog directory and set permissions on this new directory to 777.

 

Works sweet as.

Thanks for the awesome contribution.

 

Wiz

Link to comment
Share on other sites

ivan_nik,

 

MS1 used function: tep_get_uploaded_file, so if you get them errors -

You must have a newer version of oscommerce - maybe a cvs 2.2 snapshot .

 

try installing the HTML v1.7 categories.php file.

 

MS2 used a new upload class.

 

Cheers MaxiDVD

 

:lol:

Link to comment
Share on other sites

@MaxiDVD

 

tbegerow,

 

thats the problem!, you are trying to use version 1.6.6 that is for MS1 I realease a new version v1.7 for MS2 ONLY,

 

07/14/2003 - MS2 HTML WYSIWYG Editor, Product Desc, Email +  

http://www.oscommerce.com/community/contributions,1347

 

The 1.6.6 wont work on MS2.

 

Cheers Lee

 

Thanks for your tip i got confused with all them editors!?

i hav installed the constribution and replaced all the files,

but i still cant see no editor, not on one page in my admin.

i have checked that the cash is empty!!!

 

thies is driving me crazy <b>!!! HELP PLEASE !!!</b>

Link to comment
Share on other sites

tbegerow,

 

Note:

The Editors will only appear on Windows Internet Explorer 5.5 or above, if your using Netscape, Mozilla ect they wont show up.

 

Just some suggestions:

Have you inserted the SQL Script into your database?

Did you copy the entire HTMLArea Folder into your Admin Folder?

Are any errors presented?

 

Let me know.

Link to comment
Share on other sites

Note:  

The Editors will only appear on Windows Internet Explorer 5.5 or above, if your using Netscape, Mozilla ect they wont show up.  

 

Just some suggestions:  

Have you inserted the SQL Script into your database?  

Did you copy the entire HTMLArea Folder into your Admin Folder?  

Are any errors presented?  

 

Let me know.

i am using ie 6sp1

yes i have inserted the sql sript into database!

copied the folders.

no errors

 

funktions test

i allready got the editor to work (show up)

<b>on the product page</b> in admin i just noticed a error

i have got two fields for english and two field for german to input text

ervery thing shows (icons) up but does not work

<b>on the send emails page</b>

everything works exept for the image upload

<b>on the newsletter and define main page</b>

the same as above

 

any tips ???

 

Regards Thorsten

Link to comment
Share on other sites

The problem with the image uploader is, everyone has different servers , setups and configirations its just a matter of making a few changes to /htmlarea/includes/popups/config.inc.php

 

Its a path or permission problem, its very common if you look back through this forum you will find many solutions on making it function correctly,

 

Did you use the categories.php file in the zip file or did you modify your original one with the step by step instuctions?

 

Lee

Link to comment
Share on other sites

Hi, I have everything installed for 1.7 on MS2 and it's all working great except for one thing. I can upload images, but when I try to resize them when I upload them, using the "Resize to:" field, I get the folloing error:

 

[b]Warning:[/b] Cannot execute using backquotes in safemode

in [b]/usr/local/psa/home/vhosts/lillypadshop.com/httpdocs/admin/htmlarea/popups/lister.php[/b] on line [b]373[/b]

 

I haven't had any problems like this with any other part of my site. Do you have any suggestions or has anyone else ever encountered this problem? Thanks! :D

 

Keith

Link to comment
Share on other sites

Hi there

 

Sorry I wasn't very clear in my last post. The file I adjusted to enable the image upload for WYSIWYG contribution is:

admin/htmlarea/popups/config.inc.php

 

Hope this helps.

 

Cheers Wiz

 

 

You may find what we did to be useful. We simply replaced the following code:

 

define("IMAGE_DIR", trim(DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES));

define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES));

 

 

with:

 

define("IMAGE_DIR", trim(DIR_FS_CATALOG . "graphics/"));

define("IMAGE_URL", trim(DIR_WS_CATALOG . "graphics/"));

 

 

Then we created a directory called "graphics" (without quotes) in the catalog directory and set permissions on this new directory to 777.

 

Works sweet as.

Thanks for the awesome contribution.

 

Wiz

Link to comment
Share on other sites

I have MS2 and the 1.7 version but I am having a problem.

 

When I insert the MYSQl I get an error:

 

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )

VALUES (

 

'', 'PRODUCT DESCRIPTIONS use WYSIWYG HTMLAREA?', 'HTML_AREA_WYSIWYG_DISABLE', 'Enable', 'Enable/Disable WYSIWYG box', 112, 0, now( ) , now( ) , NULL , 'tep_cfg_select_option(array('Enable', 'Disable'),'

)

 

MySQL said:

 

 

You have an error in your SQL syntax near '`configuration` (`configuration_id`, `configuration_title`, `configuration_key`,' at line 1

 

 

I assume because of this when I view admin/categories.php I also get an error:

 

Line: 318

Char: 14

Error: 'HTML_AREA_WYSIWYG_DEBUG' is undefined

Code: 0

URL :blah/blah/admin/categories.php

 

I have reupped the 1.7 categories but I am getting the same error - any ideas?

 

Thanks

Link to comment
Share on other sites

Hi, I have everything installed for 1.7 on MS2 and it's all working great except for one thing. I can upload images, but when I try to resize them when I upload them, using the "Resize to:" field, I get the folloing error:

 

[b]Warning:[/b] Cannot execute using backquotes in safemode

in [b]/usr/local/psa/home/vhosts/lillypadshop.com/httpdocs/admin/htmlarea/popups/lister.php[/b] on line [b]373[/b]

 

Obviously your provider has set PHP to use safemode, which is quite restrictive but, well..., SAFER... :lol:

 

I am no expert in PHP's safemode, but from what I find in the PHP docs the shell_exec() command used in line 373 of admin/htmlarea/lister.php can not be used in safemode. You might try to replace shell_exec() by the exec() command and then install NETPBM in the 'safe_mode_exec_dir'. You can find out what this directory is by using phpinfo().

 

Don't forget to point your image manager to the new location of NETPBM by changing line 21 of admin/htmlarea/popups/config.inc.php

 

Hope that helps.

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

@ Wiz

define("IMAGE_DIR", trim(DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES));

define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES));

 

 

with:

 

define("IMAGE_DIR", trim(DIR_FS_CATALOG . "graphics/"));

define("IMAGE_URL", trim(DIR_WS_CATALOG . "graphics/"));

worked fin for me... that must of been the error!!!

 

@ MaxiDVD

thank you for your tips :wink: and great support !

everything is working perfect , well all the files that should be with thies constribution...

 

@ everybody !!!

i have got the information manager installed and also would like to use theWYSIWYG editor on thies page :roll: i have tried a few times to change the place of the code to find the right place, but no luck :cry:

the code looks like

<?PHP

 /*

 Module: Information Pages Unlimited

     File date: 2003/03/02

   Based on the FAQ script of adgrafics

     Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Released under the GNU General Public License

 */

?>

<tr class=pageHeading><td><?php echo $title ?></td></tr>

<?php echo tep_draw_textarea_field('description', '', '60', '10', "$edit[description]"); ?>

       <script language="Javascript1.2"><!-- // load htmlarea

// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Products Description HTML - Head

       _editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/";  // URL to htmlarea files

         var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);

          if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }

           if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }

            if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }

        <?php if (HTML_AREA_WYSIWYG_BASIC_PD == 'Basic'){ ?>  if (win_ie_ver >= 5.5) {

        document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');

        document.write(' language="Javascript1.2"></scr' + 'ipt>');

           } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

        <?php } else{ ?> if (win_ie_ver >= 5.5) {

        document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');

        document.write(' language="Javascript1.2"></scr' + 'ipt>');

           } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

        <?php }?>

// --></script>

<tr class="dataTableRow"><td><font color=red>

<?

echo QUEUE_INFORMATION_LIST;

$data=browse_information();

$no=1;

if (sizeof($data) > 0) {

 while (list($key, $val)=each($data)) {

 echo "$val[v_order], ";

 $no++;

 }

} 

?>

</font>

</td></tr>

<tr><td>

<table border="0" cellpadding=0 cellspacing=2">

<tr><td><?php echo QUEUE_INFORMATION;?> </td>

<td>

<?php if ($edit[v_order]) {$no=$edit[v_order];}; echo tep_draw_input_field('v_order', "$no", 'size=3 maxlength=4'); ?>

<?php  

echo VISIBLE_INFORMATION;

if ($edit[visible]==1) {

echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', INFORMATION_ID_ACTIVE); 

}else{

echo tep_image(DIR_WS_ICONS . 'icon_status_red.gif', INFORMATION_ID_DEACTIVE); 

}

?>

<?php if ($edit[visible]) {$checked= "checked";}; echo tep_draw_checkbox_field('visible', '1', "$checked") . VISIBLE_INFORMATION_DO; ?>

</td>

</tr>



<tr><td><?php echo TITLE_INFORMATION;?><br></td>

<td><?php echo tep_draw_input_field('info_title', "$edit[info_title]", 'maxlength=255'); ?></td>

</tr>



<tr><td><?php echo DESCRIPTION_INFORMATION;?><br>

</td>

<td>

</td>

</tr>

<tr><td></td>

<td align=right>

<?php

echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?>

</td>

</tr>

</table>

</form>

<?php

//MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Products Description HTML - </form>

  if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {} else { ?>

           <script language="JavaScript1.2" defer>

            var config = new Object();  // create new config object

            config.width = "<?php echo HTML_AREA_WYSIWYG_WIDTH; ?>px";

            config.height = "<?php echo HTML_AREA_WYSIWYG_HEIGHT; ?>px";

            config.bodyStyle = 'background-color: <?php echo HTML_AREA_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo HTML_AREA_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo HTML_AREA_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo HTML_AREA_WYSIWYG_FONT_SIZE; ?>pt;';

            config.debug = <?php echo HTML_AREA_WYSIWYG_DEBUG; ?>;

         <?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?>

         editor_generate('products_description[<?php echo $languages[$i]['id']; ?>]',config);

    <?php } } ?>

     </script>

</td></tr>

maybe some has got a :idea:

 

Reagrds Thorsten

Link to comment
Share on other sites

i changed the code a bit to get the Information_Manager Addon to work

(respeckt to all constributers out there) !!!

:roll: what time consuming i am getting square eyes !!!

i made the values in the database like

# NEW RECORDS FOR: WYSIWYG HTML AREA 1.7 for MS2

# HTML_WYSIWYG_SQL_Information_manager.sql

# Created by: MaxiDVD www.maxidvd.com.au addon for Information Manager by Innovation



INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'INFORMATION MANAGER use WYSIWYG HTMLAREA?', 'HTML_AREA_WYSIWYG_DISABLE_INFORMATION_MANAGER', 'Enable', 'Use WYSIWYG Area in Information Manager, 112, 20, now(), now(), NULL, 'tep_cfg_select_option(array('Enable', 'Disable'),');

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Information Manager Basic/Advanced Version?', 'HTML_AREA_WYSIWYG_BASIC_INFORMATION_MANAGER', 'Basic', 'Basic Features FASTER<br>Advanced Features SLOWER', 112, 21, now(), now(), NULL, 'tep_cfg_select_option(array('Basic', 'Advanced'),');

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Information Manager Layout Width', 'EMAIL_AREA_WYSIWYG_WIDTH', '505', 'How WIDE should the HTMLAREA be in pixels (default: 505)', 112, 25, now(), now(), NULL, '');

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Information Manager Layout Height', 'EMAIL_AREA_WYSIWYG_HEIGHT', '140', 'How HIGH should the HTMLAREA be in pixels (default: 140)', 112, 29, now(), now(), NULL, '');

and i have edited the information_form.php

to

<?PHP

 /*

 Module: Information Pages Unlimited

     File date: 2003/03/02

   Based on the FAQ script of adgrafics

     Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Released under the GNU General Public License

 */

?>

<tr class=pageHeading><td><?php echo $title ?></td></tr>

<tr class="dataTableRow"><td><font color=red>

<?

echo QUEUE_INFORMATION_LIST;

$data=browse_information();

$no=1;

if (sizeof($data) > 0) {

 while (list($key, $val)=each($data)) {

 echo "$val[v_order], ";

 $no++;

 }

} 

?>

</font>

</td></tr>

<tr><td>

<table border="0" cellpadding=0 cellspacing=2">

<tr><td><?php echo QUEUE_INFORMATION;?> </td>

<td>

<?php if ($edit[v_order]) {$no=$edit[v_order];}; echo tep_draw_input_field('v_order', "$no", 'size=3 maxlength=4'); ?>

<?php  

echo VISIBLE_INFORMATION;

if ($edit[visible]==1) {

echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', INFORMATION_ID_ACTIVE); 

}else{

echo tep_image(DIR_WS_ICONS . 'icon_status_red.gif', INFORMATION_ID_DEACTIVE); 

}

?>

<?php if ($edit[visible]) {$checked= "checked";}; echo tep_draw_checkbox_field('visible', '1', "$checked") . VISIBLE_INFORMATION_DO; ?>

</td>

</tr>



<tr><td><?php echo TITLE_INFORMATION;?><br></td>

<script language="Javascript1.2"><!-- // load htmlarea

// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2  (Information Manager addon by Innovation)<head>

     _editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/";  // URL to htmlarea files

       var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);

        if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }

         if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }

          if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }

      <?php if (HTML_AREA_WYSIWYG_BASIC_INFORMATION_MANAGER == 'Basic'){ ?>  if (win_ie_ver >= 5.5) {

      document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');

      document.write(' language="Javascript1.2"></scr' + 'ipt>');

         } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

      <?php } else{ ?> if (win_ie_ver >= 5.5) {

      document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');

      document.write(' language="Javascript1.2"></scr' + 'ipt>');

         } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

      <?php }?>

// --></script>

<td><?php echo tep_draw_input_field('info_title', "$edit[info_title]", 'maxlength=255'); ?></td>

</tr>



<tr><td><?php echo DESCRIPTION_INFORMATION;?><br>

</td>

<td>

           <td class="main" valign="top"><?php echo TEXT_INFORMATION_MANAGER_CONTENT; ?></td></td>

           <td class="main"><?php echo tep_draw_textarea_field('content', 'soft', '100%', '20', $nInfo->content); ?></td>

<?php if (HTML_AREA_WYSIWYG_DISABLE_INFORMATION_MANAGER == 'Enable') { ?>

<script language="JavaScript1.2" defer>

// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 HTML (Information Manager addon by Innovation)<body>

          var config = new Object();  // create new config object

          config.width = "<?php echo INFORMATION_MANAGER_WYSIWYG_WIDTH; ?>px";

          config.height = "<?php echo INFORMATION_MANAGER_WYSIWYG_HEIGHT; ?>px";

          config.bodyStyle = 'background-color: <?php echo HTML_AREA_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo HTML_AREA_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo HTML_AREA_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo HTML_AREA_WYSIWYG_FONT_SIZE; ?>pt;';

          config.debug = <?php echo HTML_AREA_WYSIWYG_DEBUG; ?>;

          editor_generate('content',config);

<?php }

// MaxiDVD Added  HTML is ON when WYSIWYG BOX Enabled, HTML is OFF when WYSIWYG Disabled

?>

</script>

</td>

</tr>

<tr><td></td>

<td align=right>

<?php

echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?>

</td>

</tr>

</table>

</form>

</td></tr>

 

the only problem is it makes it look like add_information.gif

and when i hit the insert button i get "You did not fill all necessary fields"

and it does not insert the page :cry:

can somebody help me out with that?

Link to comment
Share on other sites

@ tbegerow

 

I have it working with information pages unlimited,

<?php

/*

Module: Information Pages Unlimited

File date: 2003/03/02

Based on the FAQ script of adgrafics

Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Released under the GNU General Public License

*/

 

 

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . 'information.php');

 

function browse_information () {

global $languages_id;

$query="SELECT * FROM " . TABLE_INFORMATION . " WHERE languages_id=$languages_id ORDER BY v_order";

$daftar = mysql_db_query(DB_DATABASE, $query) or die("Information ERROR: ".mysql_error());$c=0;

while ($buffer = mysql_fetch_array($daftar)) {$result[$c]=$buffer;$c++;}

return $result;

}

 

function read_data ($information_id) {

$result=mysql_fetch_array(mysql_db_query(DB_DATABASE, "SELECT * FROM " . TABLE_INFORMATION . " WHERE information_id=$information_id"));

return $result;

}

 

$warning=tep_image(DIR_WS_ICONS . 'warning.gif', WARNING_INFORMATION);

 

function error_message($error) {

global $warning;

switch ($error) {

case "20":return "<tr class=messageStackError><td>$warning ." . ERROR_20_INFORMATION . "</td></tr>";break;

case "80":return "<tr class=messageStackError><td>$warning " . ERROR_80_INFORMATION . "</td></tr>";break;

default:return $error;

}

}

 

?>

<!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="Javascript1.2"><!-- // load htmlarea

//MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.5 <head>

_editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/"; // URL to htmlarea files

var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);

if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }

if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }

if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }

<?php if (HTML_AREA_WYSIWYG_BASIC_PD == 'Basic'){ ?> if (win_ie_ver >= 5.5) {

document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');

document.write(' language="Javascript1.2"></scr' + 'ipt>');

} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

<?php } else{ ?> if (win_ie_ver >= 5.5) {

document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');

document.write(' language="Javascript1.2"></scr' + 'ipt>');

} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

<?php }?>

// --></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- 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%">

<tr><td align=right class="mainheading"><?php echo $language; ?>  </td></tr>

<?

switch($adgrafics_information) {

 

case "Added":

$data=browse_information();

$no=1;

if (sizeof($data) > 0) {while (list($key, $val)=each($data)) {$no++; } } ;

$title="" . ADD_QUEUE_INFORMATION . " #$no";

echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, 'adgrafics_information=AddSure');

include('information_form.php');

break;

 

case "AddSure":

function add_information ($data) {

global $languages_id;

$query ="INSERT INTO " . TABLE_INFORMATION . " VALUES(null, '$data[visible]', '$data[v_order]', '$data[info_title]', '$data[description]','$languages_id')";

mysql_db_query(DB_DATABASE, $query) or die ("Information ERROR: ".mysql_error());

}

if ($v_order && $info_title && $description) {

if ((INT)$v_order) {

add_information($HTTP_POST_VARS);

$data=browse_information();

$title="" . tep_image(DIR_WS_ICONS . 'confirm_red.gif', CONFIRM_INFORMATION) .SUCCED_INFORMATION . ADD_QUEUE_INFORMATION . " $v_order ";

include('information_list.php');

} else {$error="20";}

} else {$error="80";}

 

break;

 

case "Edit":

if ($information_id) {

$edit=read_data($information_id);

 

$data=browse_information();

$button=array("Update");

$title="" . EDIT_ID_INFORMATION . " $information_id";

//echo form("$PHP_SELF?adgrafics_information=Update", $hidden);

echo "<tr class=pageHeading><td align=center>";

echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, 'adgrafics_information=Update');

echo tep_draw_hidden_field('information_id', "$information_id");

include('information_form.php');

} else {$error="80";}

break;

 

case "Update":

function update_information ($data) {

mysql_db_query(DB_DATABASE, "UPDATE " . TABLE_INFORMATION . " SET info_title='$data[info_title]', description='$data[description]', visible='$data[visible]', v_order=$data[v_order] WHERE information_id=$data[information_id]") or die ("update_information: ".mysql_error());

}

if ($information_id && $description && $v_order) {

if ((INT)$v_order) {

update_information($HTTP_POST_VARS);

$data=browse_information();

$title="$confirm " . UPDATE_ID_INFORMATION . " $information_id " . SUCCED_INFORMATION . "";

include('information_list.php');

} else {$error="20"; }

} else {$error="80";}

break;

 

case 'Visible':

function tep_set_information_visible($information_id, $visible) {

if ($visible == '1') {

return tep_db_query("update " . TABLE_INFORMATION . " set visible = '0' where information_id = '" . $information_id . "'");

} else{

return tep_db_query("update " . TABLE_INFORMATION . " set visible = '1' where information_id = '" . $information_id . "'");

}

}

tep_set_information_visible($information_id, $visible);

$data=browse_information();

if ($visible == '1') { $vivod=DEACTIVATION_ID_INFORMATION;

}else{$vivod=ACTIVATION_ID_INFORMATION;}

$title="ID: $information_id $confirm $vivod";

include('information_list.php');

break;

 

case "Delete":

if ($information_id) {

$delete=read_data($information_id);

$data=browse_information();

$title="" . DELETE_CONFITMATION_ID_INFORMATION . " $information_id";

echo "<tr class=pageHeading><td align=center><br><br>$title</td></tr>";

echo "<tr><td></td></tr><tr><td align=center><br><br>";

echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, "adgrafics_information=DelSure&information_id=$val[information_id]");

echo tep_draw_hidden_field('information_id', "$information_id");

echo tep_image_submit('button_delete.gif', IMAGE_DELETE);

echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

echo "</form></td></tr>";

} else {$error="80";}

break;

 

 

case "DelSure":

function delete_information ($information_id) {

mysql_db_query(DB_DATABASE, "DELETE FROM " . TABLE_INFORMATION . " WHERE information_id=$information_id");

}

if ($information_id) {

delete_information($information_id);

$data=browse_information();

$title="$confirm " . DELETED_ID_INFORMATION . " $information_id " . SUCCED_INFORMATION . "";

include('information_list.php');

} else {$error="80";}

break;

default:

$data=browse_information();

$title="" . MANAGER_INFORMATION . "";

include('information_list.php');

}

if ($error) {

$content=error_message($error);

echo $content;

$data=browse_information();

$no=1;

if (sizeof($data) > 0) {while (list($key, $val)=each($data)) {$no++; } } ;

$title="" . ADD_QUEUE_INFORMATION . " $no";

echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, 'adgrafics_information=AddSure');

include('information_form.php');

}

?>

</script>

</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'); ?>

 

Cheers MaxiDVD :lol:

Link to comment
Share on other sites

oh and the other part, information_form.php

 

<?PHP

/*

Module: Information Pages Unlimited

File date: 2003/03/02

Based on the FAQ script of adgrafics

Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Released under the GNU General Public License

*/

?>

<tr class=pageHeading><td><?php echo $title ?></td></tr>

<tr class="dataTableRow"><td class="main"><font color=red>

<?

echo QUEUE_INFORMATION_LIST;

$data=browse_information();

$no=1;

if (sizeof($data) > 0) {

while (list($key, $val)=each($data)) {

echo "$val[v_order], ";

$no++;

}

}

?>

</font>

</td></tr>

 

 

<tr><td class="formAreaTitle">

<table border="0" cellpadding="0" cellspacing="2">

 

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

<tr>

<td class="formAreaTitle"><?php echo STATUS_INFORMATION;?></td>

<?php if ($edit[visible] ==1) {

;?>

<td class="main"><?php echo tep_draw_radio_field('visible', '1', "checked") . ' ' . INFORMATION_ACTIVE . ' ' . tep_draw_radio_field('visible', '0') . ' ' . INFORMATION_DEACTIVE; ?></td>

<?php } else { ;?>

<td class="main"><?php echo tep_draw_radio_field('visible', '1') . ' ' . INFORMATION_ACTIVE . ' ' . tep_draw_radio_field('visible', '0', "checked") . ' ' . INFORMATION_DEACTIVE; ?></td>

<?php

}

;?>

</tr>

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

<tr>

<td class="formAreaTitle"><?php echo QUEUE_INFORMATION;?></td>

<td class="formAreaTitle">

<?php if ($edit[v_order]) {$no=$edit[v_order];}; echo tep_draw_input_field('v_order', "$no", 'size=3 maxlength=4'); ?>

</td>

</tr>

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

<tr>

<td class="formAreaTitle"><?php echo TITLE_INFORMATION;?><br></td>

<td class="formAreaTitle"><?php echo tep_draw_input_field('info_title', "$edit[info_title]", 'size=42 maxlength=255'); ?></td>

</tr>

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

<tr>

<td class="formAreaTitle" valign="top"><?php echo DESCRIPTION_INFORMATION;?><br></td>

<td><?php echo tep_draw_textarea_field('description', '', '60', '10', "$edit[description]"); ?></td>

</tr>

 

 

 

<tr><td></td>

<td align=right>

<?php

echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?>

</td>

</tr>

</table>

</form>

</td></tr> <?php if (HTML_AREA_WYSIWYG_DISABLE_DEFINE == 'Disable') {} else { ?>

<script language="JavaScript1.2" defer>

// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.6.5 Products Description HTML - Body

var config = new Object(); // create new config object

config.width = "<?php echo DEFINE_MAINPAGE_WYSIWYG_WIDTH; ?>px";

config.height = "<?php echo DEFINE_MAINPAGE_WYSIWYG_HEIGHT; ?>px";

config.bodyStyle = 'background-color: <?php echo HTML_AREA_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo HTML_AREA_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo HTML_AREA_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo HTML_AREA_WYSIWYG_FONT_SIZE; ?>pt;';

config.debug = <?php echo HTML_AREA_WYSIWYG_DEBUG; ?>;

// More Configs can added here:

// Dreamscape added Dynamic Language Function

editor_generate('description',config);

<?php } ?>

Link to comment
Share on other sites

Lee, you are da man! These two contribs are both fantastic and they really do belong together. I'm lovin it! Thanks for the cool contrib!

 

Now, for a question for anyone who wants to tackle it. I've got both of these contribs up and running and they are working great. However, instead of an "information" box at the bottom of my column, I'm opting to use this as a "navigation" box at the top of the column. Only problem is, I can't figure out how to get a link to the homepage (default.php) at the top of the list in the information unlimited box.

 

I know it goes somewhere in this code from the information.php file in catalog/includes/boxes:

 

<?php



 // Retrieve information from Info table

 $informationString = "";

 

// joles

//$sql=mysql_query('SELECT information_id, info_title FROM ' . TABLE_INFORMATION .' WHERE visible='1' ORDER BY v_order')

$sql=mysql_query('SELECT information_id, languages_id, info_title FROM ' . TABLE_INFORMATION .' WHERE visible='1' and languages_id ='.$languages_id.' ORDER BY v_order')



   or die(mysql_error());    

 while($row=mysql_fetch_array($sql)):  

$filename_information = tep_href_link(FILENAME_INFORMATION) . (stristr(tep_href_link(FILENAME_INFORMATION), '?')?'&':'?') . 'info_id=' . $row['information_id'];

$informationString .= '<a href="' . $filename_information . '">' . $row['info_title'] . '</a><br>';

 endwhile;



$info_box_contents[] = array('text' =>	$informationString .

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

 $info_box_contents = array();

   $info_box_contents[] = array('text' =>	$informationString .                             	 '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');



 new infoBox($info_box_contents);

?>

 

But I'm not quite sure how to get it to show up. I want it to be a constant thing like the way the "contact us" link is always at the bottom of the list.

 

Thanks

Beau

Link to comment
Share on other sites

Should be like this

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">Home Page</a><br>' .

$informationString .

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

 

new infoBox($info_box_contents);

 

Cheers MaxiDVD :lol:

Link to comment
Share on other sites

Lee,

 

Doh! That's the one thing I didn't try! I tried using the line beginning with $textstring and replacing with the mainpage link code but that didn't work. If you can't tell, I'm a php loser. Anyway, thanks for the tip, I'll go try it now. I just realized that I should have put this post in another thread. Sorry about that. I was just so hyped about having both of these contribs running together that I got carried away!

 

Thanks again,

Beau

Link to comment
Share on other sites

I'm having trouble getting this to work on a secure server. My admin area works fine unless the option to have WYSIWYG running is on. When it is enabled, I get a notification on the categories page and the other pages withing the WYSIWYG editor, that says that some items on the page are non secure. Is there a setting to change to make everything load from my secure SSL server? Thanks! :D

 

Keith

Link to comment
Share on other sites

Hi xtreemsurf

 

About 5-6 pages back in this thread you find we discussed this issue and may help you with your problem.

 

MaxiDVD :lol:

Link to comment
Share on other sites

Hi xtreemsurf

 

About 5-6 pages back in this thread you find we discussed this issue and may help you with your problem.

 

MaxiDVD  :lol:

 

Thank you for the advice! I had been searching through this thread for something on SSL, but I guess I must have missed it. I tried the fix out and it worked great! Thanks again! :D

 

Keith

Link to comment
Share on other sites

I installed a the new Osc 2.2 MS3 and WYSIWYG HTMLArea MS2 v1.7 on my server.

 

All the boxes in the admin have the old text area and on the main page a have this :

 

Warning: Failed opening 'includes/languages/english/FILENAME_DEFINE_MAINPAGE' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site30/fst/var/www/html/index.php on line 307

 

I made an new installation of Oscommerce 2.2 MS2 and after this contribution like in the (_Easy_MS2_ Installation).

 

My web site is neomuzik.com

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...