Execute("update " . TABLE_EZPAGES . " set " . $status_field . " = '0' where pages_id = '" . $pages_id . "'"); } elseif ($status == '0') { return $db->Execute("update " . TABLE_EZPAGES . " set " . $status_field . " = '1' where pages_id = '" . $pages_id . "'"); } else { return -1; } } require('includes/application_top.php'); if (!isset($_SESSION['ez_sort_order'])) { $_SESSION['ez_sort_order'] = 0; } if (!isset($_GET['reset_ez_sort_order'])) { $reset_ez_sort_order = $_SESSION['ez_sort_order']; } if ($_GET['action'] == 'set_editor') { // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly. $action=''; zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN)); } $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (zen_not_null($action)) { switch ($action) { case 'set_ez_sort_order': $_SESSION['ez_sort_order'] = $_GET['reset_ez_sort_order']; $action=''; zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . ($_GET['ezID'] != '' ? '&ezID=' . $_GET['ezID'] : ''))); break; case 'setflag': if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) { zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['flag'])); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); } else { $messageStack->add(ERROR_UNKNOWN_STATUS_FLAG, 'error'); } zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'page_open_new_window': zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_open_new_window'); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'page_is_ssl': zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_is_ssl'); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'status_header': zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_header'); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'status_sidebox': zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_sidebox'); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'status_footer': zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_footer'); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'status_toc': zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_toc'); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); break; case 'insert': case 'update': if (isset($_POST['pages_id'])) $pages_id = zen_db_prepare_input($_POST['pages_id']); $pages_title = zen_db_prepare_input($_POST['pages_title']); $page_open_new_window = (int)$_POST['page_open_new_window']; $page_is_ssl = (int)$_POST['page_is_ssl']; $pages_html_text = zen_db_prepare_input($_POST['pages_html_text']); $alt_url = zen_db_prepare_input($_POST['alt_url']); $alt_url_external = zen_db_prepare_input($_POST['alt_url_external']); $pages_header_sort_order = (int)$_POST['header_sort_order']; $pages_sidebox_sort_order = (int)$_POST['sidebox_sort_order']; $pages_footer_sort_order = (int)$_POST['footer_sort_order']; $pages_toc_sort_order = (int)$_POST['toc_sort_order']; $toc_chapter = (int)$_POST['toc_chapter']; $status_header = ($pages_header_sort_order == 0 ? 0 : (int)$_POST['status_header']); $status_sidebox = ($pages_sidebox_sort_order == 0 ? 0 : (int)$_POST['status_sidebox']); $status_footer = ($pages_footer_sort_order == 0 ? 0 : (int)$_POST['status_footer']); $status_toc = ($pages_toc_sort_order == 0 ? 0 : (int)$_POST['status_toc']); $page_error = false; if (empty($pages_title)) { $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error'); $page_error = true; } if (empty($pages_html_text)) { } $zv_link_method_cnt = 0; if ($alt_url !='') { $zv_link_method_cnt++; } if ($alt_url_external !='') { $zv_link_method_cnt++; } if ($pages_html_text !='' and strlen(trim($pages_html_text)) > 6) { $zv_link_method_cnt++; } if ($zv_link_method_cnt > 1) { $messageStack->add(ERROR_MULTIPLE_HTML_URL, 'error'); $page_error = true; } if ($page_error == false) { $sql_data_array = array('pages_title' => $pages_title, 'page_open_new_window' => $page_open_new_window, 'page_is_ssl' => $page_is_ssl, 'alt_url' => $alt_url, 'alt_url_external' => $alt_url_external, 'status_header' => $status_header, 'status_sidebox' => $status_sidebox, 'status_footer' => $status_footer, 'status_toc' => $status_toc, 'header_sort_order' => $pages_header_sort_order, 'sidebox_sort_order' => $pages_sidebox_sort_order, 'footer_sort_order' => $pages_footer_sort_order, 'toc_sort_order' => $pages_toc_sort_order, 'toc_chapter' => $toc_chapter, 'pages_html_text' => $pages_html_text); if ($action == 'insert') { zen_db_perform(TABLE_EZPAGES, $sql_data_array); $pages_id = $db->insert_ID(); $messageStack->add(SUCCESS_PAGE_INSERTED, 'success'); } elseif ($action == 'update') { zen_db_perform(TABLE_EZPAGES, $sql_data_array, 'update', "pages_id = '" . (int)$pages_id . "'"); $messageStack->add(SUCCESS_PAGE_UPDATED, 'success'); } zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'ezID=' . $pages_id)); } else { if ($page_error == false) { $action = 'new'; } else { $_GET['pages_id'] = $pages_id; $_GET['ezID'] = $pages_id; $_GET['action'] = 'new'; $action = 'new'; $ezID = $pages_id; $page = $_GET['page']; } } break; case 'deleteconfirm': $pages_id = zen_db_prepare_input($_GET['ezID']); $db->Execute("delete from " . TABLE_EZPAGES . " where pages_id = '" . (int)$pages_id . "'"); $messageStack->add(SUCCESS_PAGE_REMOVED, 'success'); zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'])); break; } } ?> > <?php echo TITLE; ?>
'', 'page_open_new_window' => '', 'page_is_ssl' => '', 'pages_html_text' => '', 'alt_url' => '', 'alt_url_external' => '', 'header_sort_order' => '', 'sidebox_sort_order' => '', 'footer_sort_order' => '', 'toc_sort_order' => '', 'toc_chapter' => '', 'status_header' => '', 'status_sidebox' => '', 'status_footer' => '', 'status_toc' => '', 'page_open_new_window' => '', 'page_is_ssl' => '' ); $ezInfo = new objectInfo($parameters); if (isset($_GET['ezID'])) { $form_action = 'update'; $ezID = zen_db_prepare_input($_GET['ezID']); $page_query = "select * from " . TABLE_EZPAGES . " where pages_id = '" . $_GET['ezID'] . "'"; $page = $db->Execute($page_query); $ezInfo->objectInfo($page->fields); } elseif (zen_not_null($_POST)) { $ezInfo->objectInfo($_POST); } // set all status settings and switches if (!isset($ezInfo->status_header)) $ezInfo->status_header = '1'; switch ($ezInfo->status_header) { case '0': $is_status_header = false; $not_status_header = true; break; case '1': $is_status_header = true; $not_status_header = false; break; default: $is_status_header = true; $not_status_header = false; break; } if (!isset($ezInfo->status_sidebox)) $ezInfo->status_sidebox = '1'; switch ($ezInfo->status_sidebox) { case '0': $is_status_sidebox = false; $not_status_sidebox = true; break; case '1': $is_status_sidebox = true; $not_status_sidebox = false; break; default: $is_status_sidebox = true; $not_status_sidebox = false; break; } if (!isset($ezInfo->status_footer)) $ezInfo->status_footer = '1'; switch ($ezInfo->status_footer) { case '0': $is_status_footer = false; $not_status_footer = true; break; case '1': $is_status_footer = true; $not_status_footer = false; break; default: $is_status_footer = true; $not_status_footer = false; break; } if (!isset($ezInfo->status_toc)) $ezInfo->status_toc = '1'; switch ($ezInfo->status_toc) { case '0': $is_status_toc = false; $not_status_toc = true; break; case '1': $is_status_toc = true; $not_status_toc = false; break; default: $is_status_toc = true; $not_status_toc = false; break; } if (!isset($ezInfo->page_open_new_window)) $ezInfo->not_page_open_new_window = '1'; switch ($ezInfo->page_open_new_window) { case '0': $is_page_open_new_window = false; $not_page_open_new_window = true; break; case '1': $is_page_open_new_window = true; $not_page_open_new_window = false; break; default: $is_page_open_new_window = false; $not_page_open_new_window = true; break; } if (!isset($ezInfo->page_is_ssl)) $ezInfo->page_is_ssl = '1'; switch ($ezInfo->page_is_ssl) { case '0': $is_page_is_ssl = false; $not_page_is_ssl = true; break; case '1': $is_page_is_ssl = true; $not_page_is_ssl = false; break; default: $is_page_is_ssl = false; $not_page_is_ssl = true; break; } ?>
'0', 'text' => TEXT_SORT_CHAPTER_TOC_TITLE), array('id' => '1', 'text' => TEXT_SORT_HEADER_TITLE), array('id' => '2', 'text' => TEXT_SORT_SIDEBOX_TITLE), array('id' => '3', 'text' => TEXT_SORT_FOOTER_TITLE), array('id' => '4', 'text' => TEXT_SORT_PAGE_TITLE), array('id' => '5', 'text' => TEXT_SORT_PAGE_ID_TITLE) ); echo TEXT_SORT_CHAPTER_TOC_TITLE_INFO . zen_draw_form('set_ez_sort_order_form', FILENAME_EZPAGES_ADMIN, '', 'get') . '  ' . zen_draw_pull_down_menu('reset_ez_sort_order', $ez_sort_order_array, $reset_ez_sort_order, 'onChange="this.form.submit();"') . zen_hide_session_id() . ($_GET['page'] != '' ? zen_draw_hidden_field('page', $_GET['page']) : '') . zen_draw_hidden_field('action', 'set_ez_sort_order') . ''; ?> '; } ?>
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
pages_title, zen_set_field_length(TABLE_EZPAGES, 'pages_title'), true); ?>

' . zen_draw_radio_field('page_open_new_window', '0', $not_page_open_new_window) . ' ' . TEXT_NO; ?>

' . zen_draw_radio_field('page_is_ssl', '0', $not_page_is_ssl) . ' ' . TEXT_NO; ?>

' . zen_draw_radio_field('status_header', '0', $not_status_header) . ' ' . TEXT_NO; ?>

header_sort_order, zen_set_field_length(TABLE_EZPAGES, 'header_sort_order'), false); ?>
  
' . zen_draw_radio_field('status_sidebox', '0', $not_status_sidebox) . ' ' . TEXT_NO; ?>

sidebox_sort_order, zen_set_field_length(TABLE_EZPAGES, 'sidebox_sort_order'), false); ?>
  
' . zen_draw_radio_field('status_footer', '0', $not_status_footer) . ' ' . TEXT_NO; ?>

footer_sort_order, zen_set_field_length(TABLE_EZPAGES, 'footer_sort_order'), false); ?>
   toc_chapter, zen_set_field_length(TABLE_EZPAGES, 'toc_chapter', '6'), false); ?>
' . zen_draw_radio_field('status_toc', '0', $not_status_toc) . ' ' . TEXT_NO; ?>

toc_sort_order, zen_set_field_length(TABLE_EZPAGES, 'toc_sort_order'), false); ?>
'; ?> '; ?> '; ?> '; ?>
Value = $ezInfo->pages_html_text ; $oFCKeditor->Width = '80%' ; $oFCKeditor->Height = '500' ; // $oFCKeditor->Create() ; $output = $oFCKeditor->CreateHtml() ; echo $output; } else { // using HTMLAREA or just raw "source" echo zen_draw_textarea_field('pages_html_text', 'soft', '100%', '40', $ezInfo->pages_html_text); } ?>
alt_url, 'size="100"'); echo '
' . TEXT_ALT_URL_EXPLAIN; ?>
alt_url_external, 'size="100"'); echo '
' . TEXT_ALT_URL_EXTERNAL_EXPLAIN; ?>
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
'' . $ezInfo->pages_title . ''); $contents = array('form' => zen_draw_form('pages', FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $ezInfo->pages_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
' . $ezInfo->pages_title . ''); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (is_object($ezInfo)) { $heading[] = array('text' => '' . TEXT_PAGE_TITLE . ' ' . $ezInfo->pages_title . ' | ' . TEXT_CHAPTER . ' ' . $ezInfo->toc_chapter . ''); $zv_link_method_cnt = 0; if ($ezInfo->alt_url !='') { $zv_link_method_cnt++; } if ($ezInfo->alt_url_external !='') { $zv_link_method_cnt++; } if ($ezInfo->pages_html_text !='' and strlen(trim($ezInfo->pages_html_text)) > 6) { $zv_link_method_cnt++; } if ($zv_link_method_cnt > 1) { $contents[] = array('align' => 'left', 'text' => zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) . '  ' . TEXT_WARNING_MULTIPLE_SETTINGS); } $contents[] = array('align' => 'left', 'text' => TEXT_ALT_URL . (empty($ezInfo->alt_url) ? ' ' . TEXT_NONE : '
' . $ezInfo->alt_url)); $contents[] = array('align' => 'left', 'text' => '
' . TEXT_ALT_URL_EXTERNAL . (empty($ezInfo->alt_url_external) ? ' ' . TEXT_NONE : '
' . $ezInfo->alt_url_external)); $contents[] = array('align' => 'left', 'text' => '
' . TEXT_PAGES_HTML_TEXT . '
' . substr(strip_tags($ezInfo->pages_html_text),0,100)); $contents[] = array('align' => 'left', 'text' => '
' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '


'); if ($ezInfo->date_scheduled) $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_SCHEDULED_AT_DATE, zen_date_short($ezInfo->date_scheduled))); if ($ezInfo->expires_date) { $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_EXPIRES_AT_DATE, zen_date_short($ezInfo->expires_date))); } elseif ($ezInfo->expires_impressions) { $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_EXPIRES_AT_IMPRESSIONS, $ezInfo->expires_impressions)); } if ($ezInfo->date_status_change) $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_STATUS_CHANGE, zen_date_short($ezInfo->date_status_change))); } break; } if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { echo ' ' . "\n"; } ?>
Execute($pages_query_raw); $check_count=1; if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) { while (!$check_page->EOF) { if ($check_page->fields['customers_id'] == $_GET['cID']) { break; } $check_count++; $check_page->MoveNext(); } $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS_EZPAGE)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) !=0 ? .5 : 0)),0); } else { $_GET['page'] = 1; } } $pages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $pages_query_raw, $pages_query_numrows); $pages = $db->Execute($pages_query_raw); while (!$pages->EOF) { if ((!isset($_GET['ezID']) || (isset($_GET['ezID']) && ($_GET['ezID'] == $pages->fields['pages_id']))) && !isset($ezInfo) && (substr($action, 0, 3) != 'new')) { $ezInfo_array = $pages->fields; $ezInfo = new objectInfo($ezInfo_array); } $zv_link_method_cnt = 0; if ($pages->fields['alt_url'] !='') { $zv_link_method_cnt++; } if ($pages->fields['alt_url_external'] !='') { $zv_link_method_cnt++; } if ($pages->fields['pages_html_text'] !='' and strlen(trim($pages->fields['pages_html_text'])) > 6) { $zv_link_method_cnt++; } if (isset($ezInfo) && is_object($ezInfo) && ($pages->fields['pages_id'] == $ezInfo->pages_id)) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?> MoveNext(); } ?>
 
1 ? zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) : '') . ' ' . $pages->fields['pages_id']; ?> fields['pages_title']; ?> fields['page_open_new_window'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> fields['page_is_ssl'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> fields['header_sort_order'] . ' ' . ($pages->fields['status_header'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> fields['sidebox_sort_order'] . ' ' . ($pages->fields['status_sidebox'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> fields['footer_sort_order'] . ' ' . ($pages->fields['status_footer'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> fields['toc_chapter']; ?> fields['toc_sort_order'] . ' ' . ($pages->fields['status_toc'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>   fields['pages_id'] == $ezInfo->pages_id)) ? 'ezID=' . $pages->fields['pages_id'] . '&action=new' : '') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?>fields['pages_id'] == $ezInfo->pages_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>
display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?> display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'ezID'))); ?>
' . zen_image_button('button_new_file.gif', IMAGE_NEW_PAGE) . ''; ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '