// $Id: news.php 2007-05-10 rikreations require('includes/application_top.php'); require('includes/functions/news_general.php'); $action = ((isset($_POST['action'])) ? $_POST['action'] : ((isset($_GET['action'])) ? $_GET['action'] : false)); if ($action) { switch ($action) { case 'setflag': if ((isset($_GET['flag'])) && (($_GET['flag'] == '0') || ($_GET['flag'] == '1')) && (isset($_GET['aID']))) { news_set_article_status($_GET['aID'], $_GET['flag']); } break; case 'setorder': if ((isset($_GET['order'])) && (($_GET['order'] == 'up') || ($_GET['order'] == 'down')) && (isset($_GET['aID']))) { news_set_article_sortorder($_GET['aID'], $_GET['order']); } break; case 'delete_article_confirm': if (isset($_POST['article_id']) && zen_not_null($_POST['article_id'])) { news_remove_article($_POST['article_id']); } zen_redirect(zen_href_link(FILENAME_NEWS)); break; case 'insert_article': case 'update_article': if (($_POST['edit_x']) || ($_POST['edit_y'])) { $action = 'new_article'; } else { $article_id = zen_db_prepare_input($_GET['aID']); $authors_id = zen_db_prepare_input($_POST['authors_id']); $news_image = (($_POST['news_image'] == 'none') ? '' : zen_db_prepare_input($_POST['news_image'])); $news_image_two = (($_POST['news_image_two'] == 'none') ? '' : zen_db_prepare_input($_POST['news_image_two'])); $date_published = ((zen_not_null($_POST['news_date_published'])) ? zen_db_prepare_input($_POST['news_date_published']) : zen_db_prepare_input(date('Y-m-d'))); $news_status = zen_db_prepare_input($_POST['news_status']); $sort_order = ((zen_not_null($_POST['sort_order'])) ? zen_db_prepare_input($_POST['sort_order']) : news_get_next_sortorder($date_published)); $sql_data_array = array( 'authors_id' => $authors_id, 'news_image' => $news_image, 'news_image_two' => $news_image_two, 'news_date_published' => $date_published, 'news_status' => $news_status, 'sort_order' => $sort_order, ); if ($action == 'insert_article') { $insert_sql_data = array('news_date_added' => 'now()'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); zen_db_perform(TABLE_NEWS_ARTICLES, $sql_data_array); $article_id = $db->Insert_ID(); } elseif ($_GET['action'] == 'update_article') { $update_sql_data = array('news_last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); zen_db_perform(TABLE_NEWS_ARTICLES, $sql_data_array, 'update', 'article_id = \'' . (int)$article_id . '\''); } foreach (zen_get_languages() as $lang) { $news_article_name = zen_db_prepare_input($_POST['news_article_name'][$lang['id']]); $news_article_text = zen_db_prepare_input($_POST['news_article_text'][$lang['id']]); $news_article_shorttext = zen_db_prepare_input($_POST['news_article_shorttext'][$lang['id']]); $news_article_url = zen_db_prepare_input($_POST['news_article_url'][$lang['id']]); $news_article_url_text = zen_db_prepare_input($_POST['news_article_url_text'][$lang['id']]); $news_article_url_2 = zen_db_prepare_input($_POST['news_article_url_2'][$lang['id']]); $news_article_url_2_text = zen_db_prepare_input($_POST['news_article_url_2_text'][$lang['id']]); $news_article_url_3 = zen_db_prepare_input($_POST['news_article_url_3'][$lang['id']]); $news_article_url_3_text = zen_db_prepare_input($_POST['news_article_url_3_text'][$lang['id']]); $news_article_url_4 = zen_db_prepare_input($_POST['news_article_url_4'][$lang['id']]); $news_article_url_4_text = zen_db_prepare_input($_POST['news_article_url_4_text'][$lang['id']]); $news_article_url_store = zen_db_prepare_input($_POST['news_article_url_store'][$lang['id']]); $news_article_url_store_2 = zen_db_prepare_input($_POST['news_article_url_store_2'][$lang['id']]); $news_article_url_store_misc = zen_db_prepare_input($_POST['news_article_url_store_misc'][$lang['id']]); $news_article_url_store_misc_text = zen_db_prepare_input($_POST['news_article_url_store_misc_text'][$lang['id']]); $news_article_url_store_misc_2 = zen_db_prepare_input($_POST['news_article_url_store_misc_2'][$lang['id']]); $news_article_url_store_misc_2_text = zen_db_prepare_input($_POST['news_article_url_store_misc_2_text'][$lang['id']]); $news_image_text = zen_db_prepare_input($_POST['news_image_text'][$lang['id']]); $news_image_text_two = zen_db_prepare_input($_POST['news_image_text_two'][$lang['id']]); $sql_data_array = array( 'news_article_name' => $news_article_name, 'news_article_text' => $news_article_text, 'news_article_shorttext' => $news_article_shorttext, 'news_article_url' => $news_article_url, 'news_article_url_text' => $news_article_url_text, 'news_article_url_2' => $news_article_url_2, 'news_article_url_2_text' => $news_article_url_2_text, 'news_article_url_3' => $news_article_url_3, 'news_article_url_3_text' => $news_article_url_3_text, 'news_article_url_4' => $news_article_url_4, 'news_article_url_4_text' => $news_article_url_4_text, 'news_article_url_store' => $news_article_url_store, 'news_article_url_store_2' => $news_article_url_store_2, 'news_article_url_store_misc' => $news_article_url_store_misc, 'news_article_url_store_misc_text' => $news_article_url_store_misc_text, 'news_article_url_store_misc_2' => $news_article_url_store_misc_2, 'news_article_url_store_misc_2_text' => $news_article_url_store_misc_2_text, 'news_image_text' => $news_image_text, 'news_image_text_two' => $news_image_text_two, ); if ($action == 'insert_article') { $insert_sql_data = array('article_id' => $article_id, 'language_id' => $lang['id']); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); zen_db_perform(TABLE_NEWS_ARTICLES_TEXT, $sql_data_array); } elseif ($action == 'update_article') { zen_db_perform(TABLE_NEWS_ARTICLES_TEXT, $sql_data_array, 'update', 'article_id = \'' . (int)$article_id . '\' and language_id = \'' . (int)$lang['id'] . '\''); } } zen_redirect(zen_href_link(FILENAME_NEWS, 'aID=' . $article_id)); } break; } } // check if the news sm image directory exists if (is_dir(DIR_FS_CATALOG_IMAGES . 'news/images_small/')) { if (!is_writeable(DIR_FS_CATALOG_IMAGES . 'news/images_small/')) { $messageStack->add(ERROR_NEWS_IMAGE_SM_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add(ERROR_NEWS_IMAGE_SM_DIRECTORY_DOES_NOT_EXIST, 'error'); } // check if the news med image directory exists if (is_dir(DIR_FS_CATALOG_IMAGES . 'news/images_med/')) { if (!is_writeable(DIR_FS_CATALOG_IMAGES . 'news/images_med/')) { $messageStack->add(ERROR_NEWS_IMAGE_MED_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add(ERROR_NEWS_IMAGE_MED_DIRECTORY_DOES_NOT_EXIST, 'error'); } // start page output echo ''. "\n" . '' . '' . '' . '' . TITLE . '' . '' . '' . '' . '' . ''; if ($editor_handler != '') include ($editor_handler); echo '' . '' . '
' . ''; require(DIR_WS_INCLUDES . 'header.php'); echo '' . '' . '' . '' . '' . '' . '' . '' . '
' . ''; if ($action == 'new_article') { if ((isset($_GET['aID'])) && (!$_POST)) { $news = $db->Execute("select n.article_id, n.authors_id, n.news_image, n.news_image_two, n.news_date_added, n.news_last_modified, date_format(n.news_date_published, '%Y-%m-%d') as news_date_published, n.news_status, n.sort_order, nt.news_article_name, nt.news_article_text, nt.news_article_shorttext, nt.news_article_url, nt.news_article_url_text, nt.news_article_url_2, nt.news_article_url_2_text, nt.news_article_url_3, nt.news_article_url_3_text, nt.news_article_url_4, nt.news_article_url_4_text, nt.news_article_url_store, nt.news_article_url_store_2, nt.news_article_url_store_misc, nt.news_article_url_store_misc_text, nt.news_article_url_store_misc_2, nt.news_article_url_store_misc_2_text, nt.news_image_text, nt.news_image_text_two from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on (n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "') where n.article_id = '" . (int)$_GET['aID'] . "'"); $nInfo = new objectInfo($news->fields); } elseif ($_POST) { $nInfo = new objectInfo($_POST); $news_article_name = $_POST['news_article_name']; $news_article_text = $_POST['news_article_text']; $news_article_shorttext = $_POST['news_article_shorttext']; $news_article_url = $_POST['news_article_url']; $news_article_url_text = $_POST['news_article_url_text']; $news_article_url_2 = $_POST['news_article_url_2']; $news_article_url_2_text = $_POST['news_article_url_2_text']; $news_article_url_3 = $_POST['news_article_url_3']; $news_article_url_3_text = $_POST['news_article_url_3_text']; $news_article_url_4 = $_POST['news_article_url_4']; $news_article_url_4_text = $_POST['news_article_url_4_text']; $news_article_url_store = $_POST['news_article_url_store']; $news_article_url_store_2 = $_POST['news_article_url_store_2']; $news_article_url_store_misc = $_POST['news_article_url_store_misc']; $news_article_url_store_misc_text = $_POST['news_article_url_store_misc_text']; $news_article_url_store_misc_2 = $_POST['news_article_url_store_misc_2']; $news_article_url_store_misc_2_text = $_POST['news_article_url_store_misc_2_text']; $news_image_text = $_POST['news_image_text']; $news_image_text_two = $_POST['news_image_text_two']; $news_image = $_POST['news_image']; $news_image_two = $_POST['news_image_two']; } else { $nInfo = new objectInfo(array()); } $authors_array = array(); $authors = $db->Execute("select authors_id, author_name from " . TABLE_NEWS_AUTHORS . " order by author_name"); while (!$authors->EOF) { $authors_array[] = array( 'id' => $authors->fields['authors_id'], 'text' => $authors->fields['author_name'], ); $authors->MoveNext(); } $languages = zen_get_languages(); switch ($nInfo->news_status) { case '0': $in_status = false; $out_status = true; break; case '1': default: $in_status = true; $out_status = false; break; } echo '' . '' . '' . '' . '' . ''; } elseif ($_GET['action'] == 'new_article_preview') { if ($_POST) { $nInfo = new objectInfo($_POST); $news_article_name = $_POST['news_article_name']; $news_article_text = $_POST['news_article_text']; $news_article_shorttext = $_POST['news_article_shorttext']; $news_article_url = $_POST['news_article_url']; $news_article_url_text = $_POST['news_article_url_text']; $news_article_url_2 = $_POST['news_article_url_2']; $news_article_url_2_text = $_POST['news_article_url_2_text']; $news_article_url_3 = $_POST['news_article_url_3']; $news_article_url_3_text = $_POST['news_article_url_3_text']; $news_article_url_4 = $_POST['news_article_url_4']; $news_article_url_4_text = $_POST['news_article_url_4_text']; $news_article_url_store = $_POST['news_article_url_store']; $news_article_url_store_2 = $_POST['news_article_url_store_2']; $news_article_url_store_misc = $_POST['news_article_url_store_misc']; $news_article_url_store_misc_text = $_POST['news_article_url_store_misc_text']; $news_article_url_store_misc_2 = $_POST['news_article_url_store_misc_2']; $news_article_url_store_misc_2_text = $_POST['news_article_url_store_misc_2_text']; $news_image_text = $_POST['news_image_text']; $news_image_text_two = $_POST['news_image_text_two']; if ($news_image = new upload('news_image')) { $news_image->set_destination(DIR_FS_CATALOG_IMAGES . 'news/images_small/'); if ($news_image->parse() && $news_image->save()) { if ($news_image->filename != 'none' && $news_image->filename != '') { $news_image_name = 'news/images_small/' . $news_image->filename; } else { // remove when set to none if ($news_image->filename == 'none') { $news_image_name = ''; } } } else { $news_image_name = $_POST['previous_image']; } } if ($news_image_two = new upload('news_image_two')) { $news_image_two->set_destination(DIR_FS_CATALOG_IMAGES . 'news/images_med/'); if ($news_image_two->parse() && $news_image_two->save()) { if ($news_image_two->filename != 'none' && $news_image_two->filename != '') { $news_image_name_two = 'news/images_med/' . $news_image_two->filename; } else { // remove when set to none if ($news_image_two->filename == 'none') { $news_image_name_two = ''; } } } else { $news_image_name_two = $_POST['previous_image_two']; } } } else { $news = $db->Execute("select n.article_id, n.authors_id, nt.language_id, nt.news_article_name, nt.news_article_text, nt.news_article_shorttext, nt.news_article_url, nt.news_image_text, nt.news_image_text_two, n.news_image, n.news_image_two, n.news_date_added, n.news_last_modified, n.news_date_published, n.news_status from " . TABLE_NEWS_ARTICLES . " n, " . TABLE_NEWS_ARTICLES_TEXT . " nt where n.article_id = '" . (int)$_GET['aID'] . "' and n.article_id = nt.article_id"); $nInfo = new objectInfo($news->fields); $news_image_name = $nInfo->news_image; $news_image_name_two = $nInfo->news_image_two; } $form_action = ((isset($_GET['aID']) && (zen_not_null($_GET['aID']))) ? 'update_article' : 'insert_article'); echo zen_draw_form($form_action, FILENAME_NEWS, '&aID=' . $_GET['aID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); $languages = zen_get_languages(); foreach ($languages as $i => $lang) { if ($_GET['read'] == 'only') { $nInfo->news_article_name = news_get_news_article_name($nInfo->article_id, $lang['id']); $nInfo->news_article_text = news_get_news_article_text($nInfo->article_id, $lang['id']); $nInfo->news_article_shorttext = news_get_news_article_shorttext($nInfo->article_id, $lang['id']); $nInfo->news_article_url = news_get_news_article_url($nInfo->article_id, $lang['id']); $nInfo->news_article_url_text = news_get_news_article_url_text($nInfo->article_id, $lang['id']); $nInfo->news_article_url_2 = news_get_news_article_url_2($nInfo->article_id, $lang['id']); $nInfo->news_article_url_2_text = news_get_news_article_url_2_text($nInfo->article_id, $lang['id']); $nInfo->news_article_url_3 = news_get_news_article_url_3($nInfo->article_id, $lang['id']); $nInfo->news_article_url_3_text = news_get_news_article_url_3_text($nInfo->article_id, $lang['id']); $nInfo->news_article_url_4 = news_get_news_article_url_4($nInfo->article_id, $lang['id']); $nInfo->news_article_url_4_text = news_get_news_article_url_4_text($nInfo->article_id, $lang['id']); $nInfo->news_article_url_store = news_get_news_article_url_store($nInfo->article_id, $lang['id']); $nInfo->news_article_url_store_2 = news_get_news_article_url_store_2($nInfo->article_id, $lang['id']); $nInfo->news_article_url_store_misc = news_get_news_article_url_store_misc($nInfo->article_id, $lang['id']); $nInfo->news_article_url_store_misc_text = news_get_news_article_url_store_misc_text($nInfo->article_id, $lang['id']); $nInfo->news_article_url_store_misc_2 = news_get_news_article_url_store_misc_2($nInfo->article_id, $lang['id']); $nInfo->news_article_url_store_misc_2_text = news_get_news_article_url_store_misc_2_text($nInfo->article_id, $lang['id']); $nInfo->news_image_text = news_get_news_image_text($nInfo->article_id, $lang['id']); $nInfo->news_image_text_two = news_get_news_image_text_two($nInfo->article_id, $lang['id']); } else { $nInfo->news_article_name = zen_db_prepare_input($news_article_name[$lang['id']]); $nInfo->news_article_text = zen_db_prepare_input($news_article_text[$lang['id']]); $nInfo->news_article_shorttext = zen_db_prepare_input($news_article_shorttext[$lang['id']]); $nInfo->news_article_url = zen_db_prepare_input($news_article_url[$lang['id']]); $nInfo->news_article_url_text = zen_db_prepare_input($news_article_url_text[$lang['id']]); $nInfo->news_article_url_2 = zen_db_prepare_input($news_article_url_2[$lang['id']]); $nInfo->news_article_url_2_text = zen_db_prepare_input($news_article_url_2_text[$lang['id']]); $nInfo->news_article_url_3 = zen_db_prepare_input($news_article_url_3[$lang['id']]); $nInfo->news_article_url_3_text = zen_db_prepare_input($news_article_url_3_text[$lang['id']]); $nInfo->news_article_url_4 = zen_db_prepare_input($news_article_url_4[$lang['id']]); $nInfo->news_article_url_4_text = zen_db_prepare_input($news_article_url_4_text[$lang['id']]); $nInfo->news_article_url_store = zen_db_prepare_input($news_article_url_store[$lang['id']]); $nInfo->news_article_url_store_2 = zen_db_prepare_input($news_article_url_store_2[$lang['id']]); $nInfo->news_article_url_store_misc = zen_db_prepare_input($news_article_url_store_misc[$lang['id']]); $nInfo->news_article_url_store_misc_text = zen_db_prepare_input($news_article_url_store_misc_text[$lang['id']]); $nInfo->news_article_url_store_misc_2 = zen_db_prepare_input($news_article_url_store_misc_2[$lang['id']]); $nInfo->news_article_url_store_misc_2_text = zen_db_prepare_input($news_article_url_store_misc_2_text[$lang['id']]); $nInfo->news_image_text = zen_db_prepare_input($news_image_text[$lang['id']]); $nInfo->news_image_text_two = zen_db_prepare_input($news_image_text_two[$lang['id']]); } echo '' . '' . '' . '' . '' . ''; } if ($_GET['read'] == 'only') { if ($_GET['origin']) { $pos_params = strpos($_GET['origin'], '?', 0); if ($pos_params != false) { $back_url = substr($_GET['origin'], 0, $pos_params); $back_url_params = substr($_GET['origin'], $pos_params + 1); } else { $back_url = $_GET['origin']; $back_url_params = ''; } } else { $back_url = FILENAME_NEWS; $back_url_params = 'aID=' . $nInfo->article_id; } echo '' . '' . ''; } else { //// // repost data echo '' . '' . '' . ''; } } else { //// // article listing page $dropdown_days_array = array( array( 'id' => '7', 'text' => '7 days', ), array( 'id' => '15', 'text' => '15 days', ), array( 'id' => '30', 'text' => '30 days', ), array( 'id' => '45', 'text' => '45 days', ), array( 'id' => '60', 'text' => '60 days', ), array( 'id' => '90', 'text' => '90 days', ), array( 'id' => '120', 'text' => '120 days', ), array( 'id' => '180', 'text' => '180 days', ), array( 'id' => '365', 'text' => '365 days', ), ); if (isset($_GET['search']) && zen_not_null($_GET['search'])) { $date = date('Y-m-d'); $date_selector = $db->Execute("select n.news_date_published from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on (n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "') where nt.news_article_name like '%" . $_GET['search'] . "%' group by n.news_date_published DESC"); // too few search results; search in article text as well if ($date_selector->RecordCount() < 5) { $date_selector = $db->Execute("select n.news_date_published from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on (n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "') where nt.news_article_name like '%" . $_GET['search'] . "%' OR nt.news_article_text like '%" . $_GET['search'] . "%' OR nt.news_article_shorttext like '%" . $_GET['search'] . "%' group by n.news_date_published DESC"); $news = $db->Execute("select n.article_id, n.authors_id, nt.news_article_name, n.news_image, n.news_image_two, n.news_date_added, n.news_last_modified, n.news_date_published, n.news_status, n.sort_order from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on (n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "') where nt.news_article_name like '%" . $_GET['search'] . "%' OR nt.news_article_text like '%" . $_GET['search'] . "%' OR nt.news_article_shorttext like '%" . $_GET['search'] . "%' order by n.news_date_published DESC, n.sort_order"); } else { $news = $db->Execute("select n.article_id, n.authors_id, nt.news_article_name, n.news_image, n.news_image_two, n.news_date_added, n.news_last_modified, n.news_date_published, n.news_status, n.sort_order from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on (n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "') where nt.news_article_name like '%" . $_GET['search'] . "%' order by n.news_date_published DESC, n.sort_order"); } while (!$date_selector->EOF) { $date_selector_array[] = array('date' => $date_selector->fields['news_date_published']); $date_selector->MoveNext(); } } elseif ( (isset($_GET['date_published_from']) && zen_not_null($_GET['date_published_from'])) || (isset($_GET['date_published_to']) && zen_not_null($_GET['date_published_to'])) ) { if (!zen_not_null($_GET['date_published_to'])) { $_GET['date_published_to'] = date('Y-m-d'); } $date_selector = $db->Execute("select news_date_published from " . TABLE_NEWS_ARTICLES . " where news_date_published >= '" . $_GET['date_published_from'] . "' and news_date_published <= '" . $_GET['date_published_to'] . "' group by news_date_published desc"); while (!$date_selector->EOF) { $date_selector_array[] = array('date' => $date_selector->fields['news_date_published']); $date_selector->MoveNext(); } $news = $db->Execute("select n.article_id, n.authors_id, nt.news_article_name, n.news_image, n.news_image_two, n.news_date_added, n.news_last_modified, n.news_date_published, n.news_status, n.sort_order from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "' where n.news_date_published >= '" . $_GET['date_published_from'] . "' and n.news_date_published <= '" . $_GET['date_published_to'] . "' order by n.news_date_published DESC, n.sort_order"); } else { $date = date('Y-m-d'); $pastdays = ((isset($_GET['pastdays'])) ? (int)$_GET['pastdays'] : 7); $date_selector = $db->Execute("select news_date_published from " . TABLE_NEWS_ARTICLES . " where news_date_published <= '" . $date . "' group by news_date_published DESC limit " . $pastdays); while (!$date_selector->EOF) { $date_selector_array[] = array('date' => $date_selector->fields['news_date_published']); $date_selector->MoveNext(); } $news = $db->Execute("select n.article_id, n.authors_id, nt.news_article_name, n.news_image, n.news_image_two, n.news_date_added, n.news_last_modified, n.news_date_published, n.news_status, n.sort_order from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on n.article_id = nt.article_id and nt.language_id = '" . (int)$_SESSION['languages_id'] . "' where n.news_date_published >= '" . $date_selector_array[$pastdays-1]['date'] . "' and n.news_date_published <= '" . $date_selector_array[0]['date'] . "' order by n.news_date_published DESC, n.sort_order"); } echo '' . ''. '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; } echo '
' . zen_draw_form('new_article', FILENAME_NEWS, 'aID=' . $_GET['aID'] . '&action=new_article_preview', 'post', 'enctype="multipart/form-data"') . '' . '' . '' . '' . '' . '
' . TEXT_NEW_NEWS . '' . zen_draw_hidden_field('news_date_added', (($nInfo->news_date_added) ? $nInfo->news_date_added : date('Y-m-d'))) . zen_image_submit('button_preview.gif', IMAGE_PREVIEW) . '  ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '
' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; // News Article Headline, Summary, & Content input // • Start langauge support foreach ($languages as $i => $lang) { echo '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; // News Article Headline, Summary, & Content input // • HTML Editors support for summary input if ($_SESSION['html_editor_preference_status']=='FCKEDITOR') { echo ''; } elseif ($_SESSION['html_editor_preference_status']=='HTMLAREA') { echo ''; } else { echo ''; } echo '' . '' . '' . ''; // News Article Headline, Summary, & Content input // • HTML Editors support for content input if ($_SESSION['html_editor_preference_status']=='FCKEDITOR') { echo ''; } elseif ($_SESSION['html_editor_preference_status']=='HTMLAREA') { echo ''; } else { echo ''; } echo '' . ''; } echo '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; foreach ($languages as $i => $lang) { if ($i == 0) { echo '' . '' . '' . ''; } echo '' . '' . '' . ''; } echo '' . '' . ''; // News Article Links // • Start language support $dropdown_products = $db->Execute("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$lang['id'] . "' order by pd.products_name"); $dropdown_products_array[] = array( 'id' => '', 'text' => TEXT_PLEASE_SELECT, ); while (!$dropdown_products->EOF) { $dropdown_products_array[] = array( 'id' => $dropdown_products->fields['products_id'], 'text' => $dropdown_products->fields['products_name'], ); $dropdown_products->MoveNext(); } foreach ($languages as $i => $lang) { // News Article Links // • Start product links echo '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; } echo '' . '' . '' . '
' . TEXT_NEWS_STATUS . '' . TEXT_NEWS_AUTHOR . '' . TEXT_NEWS_DATE_PUBLISHED . ' (YYYY-MM-DD)' . TEXT_NEWS_SORT_ORDER . '  
' . zen_draw_radio_field('news_status', '1', $in_status) . ' ' . TEXT_NEWS_AVAILABLE . zen_draw_radio_field('news_status', '0', $out_status) . ' ' . TEXT_NEWS_NOT_AVAILABLE . '' . zen_draw_pull_down_menu('authors_id', $authors_array, $nInfo->authors_id) . '' . zen_draw_input_field('sort_order', $nInfo->sort_order, 'size="5"') . '  
' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lang['directory'] . '/images/' . $lang['image'], $lang['name']) . '  ' . TEXT_NEWS_TEXT . '
' . TEXT_NEWS_HEADLINE . '' . zen_draw_input_field('news_article_name[' . $lang['id'] . ']', (($news_article_name[$lang['id']]) ? stripslashes($news_article_name[$lang['id']]) : news_get_news_article_name($nInfo->article_id, $lang['id'])), 'style="width: 100%"') . ' 
' . TEXT_NEWS_SUMMARY . ''; $oFCKeditor = new FCKeditor('news_article_shorttext[' . $lang['id'] . ']') ; $oFCKeditor->Value = (($news_article_shorttext[$lang['id']]) ? stripslashes($news_article_shorttext[$lang['id']]) : news_get_news_article_shorttext($nInfo->article_id, $lang['id'])); $oFCKeditor->Width = '97%' ; $oFCKeditor->Height = '150' ; $output = $oFCKeditor->CreateHtml() ; echo '
' . $output . '
' . zen_draw_textarea_field('news_article_shorttext[' . $lang['id'] . ']', 'soft', '70', '10', (($news_article_shorttext[$lang['id']]) ? stripslashes($news_article_shorttext[$lang['id']]) : news_get_news_article_shorttext($nInfo->article_id, $lang['id'])), 'style="width: 100%"') . '' . zen_draw_textarea_field('news_article_shorttext[' . $lang['id'] . ']', 'soft', '70', '5', (($news_article_shorttext[$lang['id']]) ? stripslashes($news_article_shorttext[$lang['id']]) : news_get_news_article_shorttext($nInfo->article_id, $lang['id'])), 'style="width: 100%"') . ' 
' . TEXT_NEWS_CONTENT . '
' . TEXT_NEWS_CONTENT_PREVIEW . '
'; $oFCKeditor = new FCKeditor('news_article_text[' . $lang['id'] . ']') ; $oFCKeditor->Value = (($news_article_text[$lang['id']]) ? stripslashes($news_article_text[$lang['id']]) : news_get_news_article_text($nInfo->article_id, $lang['id'])); $oFCKeditor->Width = '97%' ; $oFCKeditor->Height = '400' ; $output = $oFCKeditor->CreateHtml() ; echo '
' . $output . '
' . zen_draw_textarea_field('news_article_text[' . $lang['id'] . ']', 'soft', '70', '20', (($news_article_text[$lang['id']]) ? stripslashes($news_article_text[$lang['id']]) : news_get_news_article_text($nInfo->article_id, $lang['id'])), 'style="width: 100%"') . '' . zen_draw_textarea_field('news_article_text[' . $lang['id'] . ']', 'soft', '70', '15', (($news_article_text[$lang['id']]) ? stripslashes($news_article_text[$lang['id']]) : news_get_news_article_text($nInfo->article_id, $lang['id'])), 'style="width: 100%"') . ' 
 
' . TEXT_NEWS_IMAGE_ONE . '' . TEXT_NEWS_IMAGE_TWO . '
' . news_draw_file_field('news_image') . '
' . zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $nInfo->news_image . zen_draw_hidden_field('previous_image', $nInfo->news_image) . '
' . news_draw_file_field('news_image_two') . '
' . zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $nInfo->news_image_two . zen_draw_hidden_field('previous_image_two', $nInfo->news_image_two) . '
' . zen_draw_separator('pixel_trans.gif', '24', '1') . '  ' . TEXT_NEWS_IMAGE_SUBTITLE . '' . zen_draw_separator('pixel_trans.gif', '24', '1') . '  ' . TEXT_NEWS_IMAGE_SUBTITLE_TWO . '
' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lang['directory'] . '/images/' . $lang['image'], $lang['name']) . ' ' . zen_draw_input_field('news_image_text[' . $lang['id'] . ']', (($news_image_text[$lang['id']]) ? stripslashes($news_image_text[$lang['id']]) : news_get_news_image_text($nInfo->article_id, $lang['id'])), 'style="width: 90%"') . '' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lang['directory'] . '/images/' . $lang['image'], $lang['name']) . ' ' . zen_draw_input_field('news_image_text_two[' . $lang['id'] . ']', (($news_image_text_two[$lang['id']]) ? stripslashes($news_image_text_two[$lang['id']]) : news_get_news_image_text_two($nInfo->article_id, $lang['id'])), 'style="width: 90%"') . '
 
' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lang['directory'] . '/images/' . $lang['image'], $lang['name']) . '  ' . TEXT_NEWS_LINKS . ' ' . TEXT_NEWS_URL_WITHOUT_HTTP . '
' . TEXT_NEWS_URL . '' . zen_draw_input_field('news_article_url[' . $lang['id'] . ']', (($news_article_url[$lang['id']]) ? stripslashes($news_article_url[$lang['id']]) : news_get_news_article_url($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_TEXT . '' . zen_draw_input_field('news_article_url_text[' . $lang['id'] . ']', (($news_article_url_text[$lang['id']]) ? stripslashes($news_article_url_text[$lang['id']]) : news_get_news_article_url_text($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
' . TEXT_NEWS_URL_2 . '' . zen_draw_input_field('news_article_url_2[' . $lang['id'] . ']', (($news_article_url_2[$lang['id']]) ? stripslashes($news_article_url_2[$lang['id']]) : news_get_news_article_url_2($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_2_TEXT . '' . zen_draw_input_field('news_article_url_2_text[' . $lang['id'] . ']', (($news_article_url_2_text[$lang['id']]) ? stripslashes($news_article_url_2_text[$lang['id']]) : news_get_news_article_url_2_text($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
' . TEXT_NEWS_URL_3 . '' . zen_draw_input_field('news_article_url_3[' . $lang['id'] . ']', (($news_article_url_3[$lang['id']]) ? stripslashes($news_article_url_3[$lang['id']]) : news_get_news_article_url_3($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_3_TEXT . '' . zen_draw_input_field('news_article_url_3_text[' . $lang['id'] . ']', (($news_article_url_3_text[$lang['id']]) ? stripslashes($news_article_url_3_text[$lang['id']]) : news_get_news_article_url_3_text($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
' . TEXT_NEWS_URL_4 . '' . zen_draw_input_field('news_article_url_4[' . $lang['id'] . ']', (($news_article_url_4[$lang['id']]) ? stripslashes($news_article_url_4[$lang['id']]) : news_get_news_article_url_4($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_4_TEXT . '' . zen_draw_input_field('news_article_url_4_text[' . $lang['id'] . ']', (($news_article_url_4_text[$lang['id']]) ? stripslashes($news_article_url_4_text[$lang['id']]) : news_get_news_article_url_4_text($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
' . TEXT_NEWS_URL_STORE . '' . zen_draw_pull_down_menu('news_article_url_store[' . $lang['id'] . ']', $dropdown_products_array, (($news_article_url_store[$lang['id']]) ? $news_article_url_store[$lang['id']] : news_get_news_article_url_store($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_STORE_2 . '' . zen_draw_pull_down_menu('news_article_url_store_2[' . $lang['id'] . ']', $dropdown_products_array, (($news_article_url_store_2[$lang['id']]) ? $news_article_url_store_2[$lang['id']] : news_get_news_article_url_store_2($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
' . TEXT_NEWS_URL_STORE_MISC . '' . zen_draw_input_field('news_article_url_store_misc[' . $lang['id'] . ']', (($news_article_url_store_misc[$lang['id']]) ? stripslashes($news_article_url_store_misc[$lang['id']]) : news_get_news_article_url_store_misc($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_STORE_MISC_TEXT . '' . zen_draw_input_field('news_article_url_store_misc_text[' . $lang['id'] . ']', (($news_article_url_store_misc_text[$lang['id']]) ? stripslashes($news_article_url_store_misc_text[$lang['id']]) : news_get_news_article_url_store_misc_text($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
' . TEXT_NEWS_URL_STORE_MISC_2 . '' . zen_draw_input_field('news_article_url_store_misc_2[' . $lang['id'] . ']', (($news_article_url_store_misc_2[$lang['id']]) ? stripslashes($news_article_url_store_misc_2[$lang['id']]) : news_get_news_article_url_store_misc_2($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '' . TEXT_NEWS_URL_STORE_MISC_2_TEXT . '' . zen_draw_input_field('news_article_url_store_misc_2_text[' . $lang['id'] . ']', (($news_article_url_store_misc_2_text[$lang['id']]) ? stripslashes($news_article_url_store_misc_2_text[$lang['id']]) : news_get_news_article_url_store_misc_2_text($nInfo->article_id, $lang['id'])), 'style="width: 100%;"') . '
 
' . '' . '' . '' . '' . '
' . zen_image_submit('button_preview.gif', IMAGE_PREVIEW) . '  ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '
' . '' . '
' . '' . '' . '' . '' . '' . '' . ''. '' . '
' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lang['directory'] . '/images/' . $lang['image'], $lang['name']) . '' . '' . '' . '' . '' . '
' . $nInfo->news_article_name . '
' . '
' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '
' . '' . '' . '' . '' . '' . '' . '' . '' . '' . ''; if ($nInfo->news_article_url) { echo '' . '' . ''; } if ($nInfo->news_article_url_2) { echo '' . '' . ''; } if ($nInfo->news_article_url_3) { echo '' . '' . ''; } if ($nInfo->news_article_url_4) { echo '' . '' . ''; } if ($nInfo->news_article_url_store) { echo '' . '' . ''; } if ($nInfo->news_article_url_store_2) { echo '' . '' . ''; } if ($nInfo->news_article_url_store_misc) { echo '' . '' . ''; } if ($nInfo->news_article_url_store_misc_2) { echo '' . '' . ''; } echo '
' . TEXT_NEWS_AUTHOR . ' ' . news_get_news_authors_name($nInfo->authors_id) . '
' . TEXT_NEWS_DATE_PUBLISHED . ' ' . zen_date_long($nInfo->news_date_published) . '
' . TEXT_NEWS_DATE_ADDED . ' ' . zen_date_long($nInfo->news_date_added) . '
' . TEXT_NEWS_URL . ' ' . sprintf(TEXT_NEWS_ARTICLE_LINK, $nInfo->news_article_url, $nInfo->news_article_url_text) . '
' . TEXT_NEWS_URL_2 . ' ' . sprintf(TEXT_NEWS_ARTICLE_LINK, $nInfo->news_article_url_2, $nInfo->news_article_url_2_text) . '
' . TEXT_NEWS_URL_3 . ' ' . sprintf(TEXT_NEWS_ARTICLE_LINK, $nInfo->news_article_url_3, $nInfo->news_article_url_3_text) . '
' . TEXT_NEWS_URL_4 . ' ' . sprintf(TEXT_NEWS_ARTICLE_LINK, $nInfo->news_article_url_4, $nInfo->news_article_url_4_text) . '
' . TEXT_NEWS_URL_STORE . ' ' . zen_get_products_name($nInfo->news_article_url_store) . '
' . TEXT_NEWS_URL_STORE_2 . ' ' . zen_get_products_name($nInfo->news_article_url_store_2) . '
' . TEXT_NEWS_URL_STORE_MISC . ' ' . sprintf(TEXT_NEWS_ARTICLE_STORE_LINK, zen_catalog_href_link($nInfo->news_article_url_store_misc), $nInfo->news_article_url_store_misc_text) . '
' . TEXT_NEWS_URL_STORE_MISC_2 . ' ' . sprintf(TEXT_NEWS_ARTICLE_STORE_LINK, zen_catalog_href_link($nInfo->news_article_url_store_misc_2), $nInfo->news_article_url_store_misc_2_text) . '
' . '
' . zen_draw_separator('pixel_trans.gif', '1', '10') . '
' . TEXT_NEWS_SUMMARY . '
' . (($news_image_name) ? zen_image(DIR_WS_CATALOG_IMAGES . $news_image_name, $nInfo->news_image_text, '', '', 'align="right" hspace="5" vspace="5"') : '') . $nInfo->news_article_shorttext . '
' . zen_draw_separator('pixel_trans.gif', '1', '10') . '
' . TEXT_NEWS_CONTENT . '
' . (($news_image_name_two) ? zen_image(DIR_WS_CATALOG_IMAGES . $news_image_name_two, $nInfo->news_image_text_two, '', '', 'align="right" hspace="5" vspace="5"') : '') . $nInfo->news_article_text . '
' . '
' . '
' . zen_draw_separator('pixel_trans.gif', '1', '10') . '
' . zen_image_button('button_back.gif', IMAGE_BACK) . '
'; foreach ($_POST as $key => $value) { if (!is_array($_POST[$key])) { echo zen_draw_hidden_field($key, htmlspecialchars(stripslashes($value))); } } foreach (zen_get_languages() as $lang) { echo zen_draw_hidden_field('news_article_name[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_name[$lang['id']]))); echo zen_draw_hidden_field('news_article_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_text[$lang['id']]))); echo zen_draw_hidden_field('news_article_shorttext[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_shorttext[$lang['id']]))); echo zen_draw_hidden_field('news_article_url[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_text[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_2[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_2[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_2_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_2_text[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_3[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_3[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_3_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_3_text[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_4[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_4[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_4_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_4_text[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_store[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_store[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_store_2[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_store_2[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_store_misc[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_store_misc[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_store_misc_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_store_misc_text[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_store_misc_2[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_store_misc_2[$lang['id']]))); echo zen_draw_hidden_field('news_article_url_store_misc_2_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_article_url_store_misc_2_text[$lang['id']]))); echo zen_draw_hidden_field('news_image_text[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_image_text[$lang['id']]))); echo zen_draw_hidden_field('news_image_text_two[' . $lang['id'] . ']', htmlspecialchars(stripslashes($news_image_text_two[$lang['id']]))); } echo zen_draw_hidden_field('news_image', stripslashes($news_image_name)); echo zen_draw_hidden_field('news_image_two', stripslashes($news_image_name_two)); echo zen_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  '; if (isset($_GET['aID']) && (zen_not_null($_GET['aID']))) { echo zen_image_submit('button_update.gif', IMAGE_UPDATE); } else { echo zen_image_submit('button_insert.gif', IMAGE_INSERT); } echo '  ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '' . '
' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '' . '
Legend
' . TEXT_NEWS_LEGEND_PREVIEW . '' . TEXT_NEWS_LEGEND_MOVE_UP . '' . TEXT_NEWS_LEGEND_MOVE_DOWN . '' . TEXT_NEWS_LEGEND_STATUS_OFF . '' . TEXT_NEWS_LEGEND_STATUS_ON . '' . TEXT_NEWS_LEGEND_COMMENTS . '' . TEXT_NEWS_LEGEND_EDIT . '' . TEXT_NEWS_LEGEND_DELETE . '' . TEXT_NEWS_LEGEND_INFO . '
' . zen_image(DIR_WS_IMAGES . 'icon_news_preview.gif', ICON_PREVIEW) . '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_up_active.gif', IMAGE_ICON_MOVE_UP) . '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_down_active.gif', IMAGE_ICON_MOVE_DOWN) . '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' . zen_image(DIR_WS_IMAGES . 'icon_comments.gif', ICON_COMMENTS) . '' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '
' . '
' . zen_draw_separator('pixel_trans.gif', '1', '10') . '
' . zen_draw_form('search', FILENAME_NEWS, '', 'get') . '' . '' . '' . '' . '' . '
' . HEADING_TITLE . '' . HEADING_TITLE_SEARCH . ' ' . zen_draw_input_field('search', $_GET['search']) . '
' . '' . '' . '' . '' . '' . '' . '
' . zen_draw_form('goto_date', FILENAME_NEWS, '', 'get') . HEADING_TITLE_GOTO_FROM . ' ' . ' ' . HEADING_TITLE_GOTO_TO . '  ' . '' . '' . zen_draw_form('displaydays', FILENAME_NEWS, '', 'get') . HEADING_TITLE_SEARCH_PASTDAYS . zen_draw_pull_down_menu('pastdays', $dropdown_days_array, $pastdays, 'onchange="this.form.submit();"') . '' . '
' . '' . '' . ''; $heading = array(); $contents = array(); switch ($action) { case 'delete_article': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_NEWS . ''); $contents = array('form' => zen_draw_form('delete_article', FILENAME_NEWS, 'action=delete_article_confirm') . zen_draw_hidden_field('article_id', $nInfo->article_id)); $contents[] = array('text' => TEXT_DELETE_NEWS_INTRO); $contents[] = array('text' => '
' . $nInfo->news_article_name . ''); $contents[] = array('text' => '
' . TEXT_DELETE_IMAGE_INTRO); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (($article_count > 0) || (isset($_GET['search']))) { if (is_object($nInfo)) { $heading[] = array('text' => '' . news_get_news_article_name($nInfo->article_id, $languages_id) . ''); $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_news_comments.gif', IMAGE_NEWS_COMMENTS) . '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ''); $contents[] = array('text' => '
' . TEXT_DATE_ADDED . ' ' . zen_date_short($nInfo->news_date_added)); if (zen_not_null($nInfo->news_last_modified)) { $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($nInfo->news_last_modified)); } $contents[] = array('text' => TEXT_NEWS_DATE_PUBLISHED . ' ' . zen_date_short($nInfo->news_date_published)); $contents[] = array('text' => '
' . zen_info_image($nInfo->news_image, $nInfo->news_article_name) . '
' . $nInfo->news_image); } else { $heading[] = array('text' => '' . TEXT_INFO_HEADING_ARTICLE_NOT_FOUND . ''); $contents[] = array('text' => TEXT_ARTICLE_NOT_FOUND); } } else { $heading[] = array('text' => '' . NO_NEWS_ITEMS . ''); $contents[] = array('text' => TEXT_NO_NEWS); } break; } if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { $box = new box; echo ''; } echo '' . '
' . ''; $date_group = 0; $article_count = 0; while (!$news->EOF) { $article_count++; if ($news->fields['news_date_published'] == $date_selector_array[$date_group]['date']) { echo '' . '' . '' . '' . '' . '' . ''; $date_group++; } if ( ((!isset($_GET['aID'])) || ($_GET['aID'] == $news->fields['article_id'])) && (!$nInfo) && (substr($_GET['action'], 0, 4) != 'new_') ) { $nInfo = new objectInfo($news->fields); } if ( (is_object($nInfo)) && ($news->fields['article_id'] == $nInfo->article_id) ) { echo ''; } else { echo ''; } echo '' . '' . '' . '' . '' . ''; $news->MoveNext(); } echo '
' . sprintf(TABLE_HEADING_NEWS, zen_date_long($date_selector_array[$date_group]['date'])) . '' . TABLE_HEADING_AUTHOR . '' . TABLE_HEADING_SORT_ORDER . '' . TABLE_HEADING_STATUS . '' . TABLE_HEADING_ACTION . '
' . zen_image(DIR_WS_IMAGES . 'icon_news_preview.gif', ICON_PREVIEW) . ' ' . $news->fields['news_article_name'] . '' . news_get_news_authors_name($news->fields['authors_id']) . ''; if ($news->fields['article_id'] == news_get_first_article($news->fields['news_date_published']) && $news->fields['article_id'] == news_get_last_article($news->fields['news_date_published'])) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_up_deactive.gif', '') . zen_image(DIR_WS_IMAGES . 'icon_arrow_down_deactive.gif', ''); } elseif ($news->fields['article_id'] == news_get_first_article($news->fields['news_date_published'])) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_up_deactive.gif', '') . '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_down_active.gif', IMAGE_ICON_MOVE_DOWN) . ''; } elseif ($news->fields['article_id'] == news_get_last_article($news->fields['news_date_published'])) { echo '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_up_active.gif', IMAGE_ICON_MOVE_UP) . '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_down_deactive.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_up_active.gif', IMAGE_ICON_MOVE_UP) . '' . zen_image(DIR_WS_IMAGES . 'icon_arrow_down_active.gif', IMAGE_ICON_MOVE_DOWN) . ''; } // echo $news->fields['sort_order']; echo ''; if ($news->fields['news_status'] == '1') { echo '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . ''; } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''; } echo '' . '' . zen_image(DIR_WS_IMAGES . 'icon_comments.gif', ICON_COMMENTS) . ' ' . '' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ' ' . '' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ' '; if ( (is_object($nInfo)) && ($news->fields['article_id'] == $nInfo->article_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } echo ' ' . '
' . '' . '' . '' . '' . '' . '' . '' . '' . '
' . zen_draw_separator('pixel_trans.gif', '1', '10') . '
' . TEXT_NEWS_ARTICLES . ' ' . $article_count . '' . zen_image_button('button_new_news_article.gif', IMAGE_NEW_NEWS_ARTICLE) . '
' . '
' . $box->infoBox($heading, $contents) . '
' . '
' . '
' . '' . ''; require(DIR_WS_INCLUDES . 'footer.php'); echo '' . '' . ''; require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>