예제 #1
0
 function tearDown()
 {
     delete_calendar_event($this->event_id);
     $GLOBALS['FORUM_DB']->query_delete('f_posts', array('id' => $this->post_id));
     parent::tearDown();
 }
예제 #2
0
 function tearDown()
 {
     delete_calendar_event($this->event_id);
     parent::tearDown();
 }
예제 #3
0
 /**
  * Standard aed_module delete actualiser.
  *
  * @param  ID_TEXT		The entry being deleted
  */
 function delete_actualisation($_id)
 {
     $id = intval($_id);
     $rows = $GLOBALS['SITE_DB']->query_select('calendar_events', array('*'), array('id' => $id), '', 1);
     if (!array_key_exists(0, $rows)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $event = $rows[0];
     check_delete_permission($event['e_is_public'] == 1 ? 'mid' : 'low', $event['e_submitter']);
     delete_calendar_event($id);
 }
예제 #4
0
 /**
  * Standard aed_module edit actualiser.
  *
  * @param  ID_TEXT		The entry being edited
  */
 function edit_actualisation($_id)
 {
     $id = intval($_id);
     $validated = post_param_integer('validated', fractional_edit() ? INTEGER_MAGIC_NULL : 0);
     $news_article = post_param('post', STRING_MAGIC_NULL);
     if (post_param('main_news_category') != 'personal') {
         $main_news_category = post_param_integer('main_news_category', INTEGER_MAGIC_NULL);
     } else {
         warn_exit(do_lang_tempcode('INTERNAL_ERROR'));
     }
     $news_category = array();
     if (array_key_exists('news_category', $_POST)) {
         foreach ($_POST['news_category'] as $val) {
             $news_category[] = intval($val);
         }
     }
     $allow_rating = post_param_integer('allow_rating', fractional_edit() ? INTEGER_MAGIC_NULL : 0);
     $allow_comments = post_param_integer('allow_comments', fractional_edit() ? INTEGER_MAGIC_NULL : 0);
     $allow_trackbacks = post_param_integer('allow_trackbacks', fractional_edit() ? INTEGER_MAGIC_NULL : 0);
     $notes = post_param('notes', STRING_MAGIC_NULL);
     $this->donext_type = $main_news_category;
     if (!fractional_edit()) {
         $urls = get_url('', 'file', 'uploads/grepimages', 0, OCP_UPLOAD_IMAGE);
         $url = $urls[0];
         if ($url != '' && function_exists('imagecreatefromstring')) {
             convert_image(get_base_url() . '/' . $url, get_file_base() . '/uploads/grepimages/' . basename(rawurldecode($url)), -1, -1, intval(get_option('thumb_width')), true, NULL, false, true);
         }
         if ($url == '' && post_param_integer('file_unlink', 0) != 1) {
             $url = NULL;
         }
     } else {
         $url = STRING_MAGIC_NULL;
     }
     $owner = $GLOBALS['SITE_DB']->query_value_null_ok('news_categories', 'nc_owner', array('id' => $main_news_category));
     // null_ok in case somehow category setting corrupted
     if (!is_null($owner) && $owner != get_member()) {
         check_specific_permission('can_submit_to_others_categories', array('news', $main_news_category), NULL, 'cms_news');
     }
     $schedule = get_input_date('schedule');
     $add_time = is_null($schedule) ? mixed() : $schedule;
     if (addon_installed('calendar') && has_specific_permission(get_member(), 'scheduled_publication_times')) {
         require_code('calendar2');
         $schedule_code = ':$GLOBALS[\'SITE_DB\']->query_update(\'news\',array(\'date_and_time\'=>$GLOBALS[\'event_timestamp\'],\'validated\'=>1),array(\'id\'=>' . strval($id) . '),\'\',1);';
         $past_event = $GLOBALS['SITE_DB']->query_value_null_ok('calendar_events e LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'translate t ON e.e_content=t.id', 'e.id', array('text_original' => $schedule_code));
         require_code('calendar');
         if (!is_null($past_event)) {
             delete_calendar_event($past_event);
         }
         if (!is_null($schedule) && $schedule > time()) {
             $validated = 0;
             $start_year = post_param_integer('schedule_year');
             $start_month = post_param_integer('schedule_month');
             $start_day = post_param_integer('schedule_day');
             $start_hour = post_param_integer('schedule_hour');
             $start_minute = post_param_integer('schedule_minute');
             $event_id = add_calendar_event(db_get_first_id(), 'none', NULL, 0, do_lang('PUBLISH_NEWS', 0, post_param('title')), $schedule_code, 3, 0, $start_year, $start_month, $start_day, $start_hour, $start_minute);
             regenerate_event_reminder_jobs($event_id, true);
         }
     }
     $title = post_param('title', STRING_MAGIC_NULL);
     if ($validated == 1 && $main_news_category != INTEGER_MAGIC_NULL && $GLOBALS['SITE_DB']->query_value('news', 'validated', array('id' => intval($id))) == 0) {
         $is_blog = true;
         $submitter = $GLOBALS['SITE_DB']->query_value('news', 'submitter', array('id' => $id));
         $activity_title = $is_blog ? 'news:ACTIVITY_ADD_NEWS_BLOG' : 'news:ACTIVITY_ADD_NEWS';
         $activity_title_validate = $is_blog ? 'news:ACTIVITY_VALIDATE_NEWS_BLOG' : 'news:ACTIVITY_VALIDATE_NEWS';
         if (has_actual_page_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'news')) {
             // NB: no category permission check, as syndication choice was explicit, and news categorisation is a bit more complex
             syndicate_described_activity($submitter != get_member() ? $activity_title_validate : $activity_title, $title, '', '', '_SEARCH:news:view:' . strval($id), '', '', 'news', 1, NULL, true);
         }
     }
     edit_news(intval($id), $title, post_param('news', STRING_MAGIC_NULL), post_param('author', STRING_MAGIC_NULL), $validated, $allow_rating, $allow_comments, $allow_trackbacks, $notes, $news_article, $main_news_category, $news_category, post_param('meta_keywords', STRING_MAGIC_NULL), post_param('meta_description', STRING_MAGIC_NULL), $url, $add_time);
 }
예제 #5
0
 function tearDown()
 {
     delete_calendar_event($this->event_id);
     $GLOBALS['SITE_DB']->query_delete('rating', array('rating_for_id' => $this->event_id, 'rating_member' => get_member()));
     parent::tearDown();
 }