Guest Posted July 20, 2004 Share Posted July 20, 2004 Hi, can anyone help me with a problem that I have been trying to work out for 3 hours now. I would like to be able to add wysiwyg 1.7 to my page manager contribution. I have added the code but it does not seem to work/display the html box. I have changed : <tr> <td valign="top" class="main"><?php echo TEXT_PAGES_HTML_TEXT; ?></td> <td class="main"><?php echo tep_draw_textarea_field('pages_html_text', 'soft', '80', '20', $bInfo->pages_html_text); ?></td> </tr> to this : <tr> <td valign="top" class="main"><?php echo TEXT_PAGES_HTML_TEXT; ?></td> <td class="main"><?php echo tep_draw_textarea_field('pages_html_text', 'soft', '80', '20', $bInfo->pages_html_text); ?> <?php if (HTML_AREA_WYSIWYG_DISABLE_NEWSLETTER == 'Enable') { ?> <script language="JavaScript1.2" defer> // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 HTML Newsletter <body> var config = new Object(); // create new config object config.width = "<?php echo NEWSLETTER_EMAIL_WYSIWYG_WIDTH; ?>px"; config.height = "<?php echo NEWSLETTER_EMAIL_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> What have I done wrong? Quote Link to comment Share on other sites More sharing options...
Guest Posted August 6, 2004 Share Posted August 6, 2004 New file page_manager.php if you have installed HTMLAREA 1.7 : Replace with old file. <?php /* $Id: page_manager.php,v 1.73 2003/06/29 22:50:51 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); // Sets the status of a page function tep_set_page_status($pages_id, $status) { if ($status == '1') { return tep_db_query("update " . TABLE_PAGES . " set status = '1' where pages_id = '" . $pages_id . "'"); } elseif ($status == '0') { return tep_db_query("update " . TABLE_PAGES . " set status = '0' where pages_id = '" . $pages_id . "'"); } else { return -1; } } if (tep_not_null($action)) { switch ($action) { case 'setflag': if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { tep_set_page_status($HTTP_GET_VARS['bID'], $HTTP_GET_VARS['flag']); $messageStack->add_session(SUCCESS_PAGE_STATUS_UPDATED, 'success'); } else { $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error'); } tep_redirect(tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID'])); break; case 'insert': case 'update': if (isset($HTTP_POST_VARS['pages_id'])) $pages_id = tep_db_prepare_input($HTTP_POST_VARS['pages_id']); $pages_title = tep_db_prepare_input($HTTP_POST_VARS['pages_title']); $pages_html_text = tep_db_prepare_input($HTTP_POST_VARS['pages_html_text']); $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); $page_error = false; if (empty($pages_title)) { $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error'); $page_error = true; } if (empty($pages_html_text)) { } if ($page_error == false) { $sql_data_array = array('pages_title' => $pages_title, 'pages_html_text' => $pages_html_text, 'sort_order' => $sort_order); if ($action == 'insert') { $insert_sql_data = array('status' => '1'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_PAGES, $sql_data_array); $pages_id = tep_db_insert_id(); $messageStack->add_session(SUCCESS_PAGE_INSERTED, 'success'); } elseif ($action == 'update') { tep_db_perform(TABLE_PAGES, $sql_data_array, 'update', "pages_id = '" . (int)$pages_id . "'"); $messageStack->add_session(SUCCESS_PAGE_UPDATED, 'success'); } tep_redirect(tep_href_link(FILENAME_PAGE_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'bID=' . $pages_id)); } else { $action = 'new'; } break; case 'deleteconfirm': $pages_id = tep_db_prepare_input($HTTP_GET_VARS['bID']); tep_db_query("delete from " . TABLE_PAGES . " where pages_id = '" . (int)$pages_id . "'"); $messageStack->add_session(SUCCESS_PAGE_REMOVED, 'success'); tep_redirect(tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'])); 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> <script language="javascript"><!-- function popupImageWindow(url) { window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <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> <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'; $parameters = array('pages_title' => '', 'pages_html_text' => '', 'sort_order' =>'', 'status' =>''); $bInfo = new objectInfo($parameters); if (isset($HTTP_GET_VARS['bID'])) { $form_action = 'update'; $bID = tep_db_prepare_input($HTTP_GET_VARS['bID']); $page_query = tep_db_query("select pages_title, pages_html_text, status, sort_order from " . TABLE_PAGES . " where pages_id = '" . (int)$bID . "'"); $page = tep_db_fetch_array($page_query); $bInfo->objectInfo($page); } elseif (tep_not_null($HTTP_POST_VARS)) { $bInfo->objectInfo($HTTP_POST_VARS); } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr><?php echo tep_draw_form('new_page', FILENAME_PAGE_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('pages_id', $bID); ?> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo TEXT_PAGES_TITLE; ?></td> <td class="main"><?php echo tep_draw_input_field('pages_title', $bInfo->pages_title, '', true); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PAGES_SORT_ORDER; ?></td> <td class="main"><?php echo tep_draw_input_field('sort_order', $bInfo->sort_order, '', false); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td valign="top" class="main"><?php echo TEXT_PAGES_HTML_TEXT; ?></td> <td class="main"><?php echo tep_draw_textarea_field('pages_html_text', 'soft', '80', '20', $bInfo->pages_html_text); ?></td> <script language="JavaScript1.2" defer> // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 HTML Email - <body> var config = new Object(); // create new config object config.width = "650px"; config.height = "350px"; 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;'; editor_generate('pages_html_text',config); // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 HTML Email HTML - <body> </script> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></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="center"><?php echo TEXT_PAGES_PAGE_NOTE . '<br>'; ?></td> <td class="main" align="right" valign="top" nowrap><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). ' <a href="' . tep_href_link(FILENAME_PAGE_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['bID']) ? 'bID=' . $HTTP_GET_VARS['bID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> </tr> </table></td> </form></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" width="100%"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAGES; ?></td> <td class="dataTableHeadingContent"></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SORT_ORDER; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td> <td class="dataTableHeadingContent"></td> <td class="dataTableHeadingContent"></td> </tr> <?php $pages_query_raw = "select pages_id, pages_title, status, sort_order from " . TABLE_PAGES . " order by sort_order, pages_title"; $pages_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $pages_query_raw, $pages_query_numrows); $pages_query = tep_db_query($pages_query_raw); while ($pages = tep_db_fetch_array($pages_query)) { if ((!isset($HTTP_GET_VARS['bID']) || (isset($HTTP_GET_VARS['bID']) && ($HTTP_GET_VARS['bID'] == $pages['pages_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) { $bInfo_array = array_merge($pages, $info); $bInfo = new objectInfo($bInfo_array); } if (isset($bInfo) && is_object($bInfo) && ($pages['pages_id'] == $bInfo->pages_id)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $pages['pages_id']) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $pages['pages_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="java script:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '?page=' . $pages['pages_id'] . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Page') . '</a> ' . $pages['pages_title']; ?></td> <td class="dataTableContent" align="right"></td> <td class="dataTableContent"><?php echo $pages['sort_order']; ?></td> <td class="dataTableContent" align="center"> <?php if ($pages['status'] == '1') { echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Active', 10, 10) . ' <a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $pages['pages_id'] . '&action=setflag&flag=0') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', 'Set Inactive', 10, 10) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $pages['pages_id'] . '&action=setflag&flag=1') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', 'Set Active', 10, 10) . '</a> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10); } ?></td> <td class="dataTableContent" align="right"></td> <td class="dataTableContent" align="right"></td> </tr> <?php } ?> <tr> <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $pages_split->display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?></td> <td class="smallText" align="right"><?php echo $pages_split->display_links($pages_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_PAGE_MANAGER, 'action=new') . '">' . tep_image_button('button_new_file.gif', IMAGE_NEW_PAGE) . '</a>'; ?></td> </tr> </table></td> </tr> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'delete': $heading[] = array('text' => '<b>' . $bInfo->pages_title . '</b>'); $contents = array('form' => tep_draw_form('pages', FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->pages_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '<br><b>' . $bInfo->pages_title . '</b>'); if ($bInfo->pages_image) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (is_object($bInfo)) { $heading[] = array('text' => '<b>' . $bInfo->pages_title . '</b>'); $contents[] = array('align' => 'center', 'text' => '<br><br><a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->pages_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->pages_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br><br><br>'); if ($bInfo->date_scheduled) $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_SCHEDULED_AT_DATE, tep_date_short($bInfo->date_scheduled))); if ($bInfo->expires_date) { $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_EXPIRES_AT_DATE, tep_date_short($bInfo->expires_date))); } elseif ($bInfo->expires_impressions) { $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions)); } if ($bInfo->date_status_change) $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_STATUS_CHANGE, tep_date_short($bInfo->date_status_change))); } 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'); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.