function onSubmit($vals) { loader_import('siteforum.Post'); loader_import('siteforum.Filters'); loader_import('siteforum.Topic'); $p = new SiteForum_Post(); if (!$p->modify($vals['id'], array('subject' => $vals['subject'], 'body' => $vals['body']))) { page_title(intl_get('Database Error')); echo '<p>' . intl_get('An error occurred. Please try again later.') . '</p>'; echo '<p>' . intl_get('Error Message') . ': ' . $p->error . '</p>'; return; } $post = $p->get($vals['id']); page_title(intl_get('Post Updated')); echo template_simple('post_updated.spt', $post); }
<?php loader_import('siteforum.Post'); $p = new SiteForum_Post(); $post = $p->get($parameters['id']); if (!empty($post->post_id)) { $id = $post->post_id; } else { $id = $post->id; } // bug: this doesn't account for the pager on larger threads // also missing: highlighting of search results header('Location: ' . site_prefix() . '/index/siteforum-list-action?post=' . $id . '&highlight=' . $parameters['highlight'] . '#siteforum-message-' . $parameters['id']); exit;