</dl> </div> <div class="content"> <dl class="input"> <dt> <?php echo lang('last_post'); ?> <br /> <span><?php echo lang('last_post_msg'); ?> </span> </dt> <dd> <?php $last = last_post(false, $user_data['id']); if ($last['reply'] == 0) { echo "Topic: <a href='{$config['url_path']}/read.php?id={$last['id']}'>" . stripslashes(htmlspecialchars($last['subject'])) . "</a>"; } else { $topic_data = topic($last['reply']); echo "Posted in Topic: <a href='{$config['url_path']}/read.php?id={$topic_data['id']}'>" . stripslashes(htmlspecialchars($topic_data['subject'])) . "</a>"; } ?> </dd> </dl> </div> <div class="clear"></div> </div>
{ if ($post >= $post_count) { return true; } } ?> <?php while (have_posts()) { the_post(); ?> <?php $i++; $extra_class = ''; ?> <?php if (last_post($i, $wp_query->post_count)) { $extra_class = "last"; } ?> <article> <div <?php post_class($extra_class); ?> > <div class="row meta"> <date datetime="<?php the_time('c'); ?> " title="<?php the_time("F jS, o"); ?>
/** * Delete a whole topic and its posts. * @global resource * @param $id topic identification number * @return string|boolean */ function delete_topic($id) { global $database; if (!alpha($id, 'numeric')) { return 'ID_INVALID'; exit; } $topic = $database->query("DELETE FROM `forum` WHERE `id` = '{$id}' LIMIT 1"); // Check to see if the topic was deleted, If not return error! if ($topic) { // Check to see if there are any posts, anything at all. if (!last_post($id, false, 'id')) { return true; } // Guess not lets start deleting them. $posts = $database->query("DELETE FROM `forum` WHERE `reply` = '{$id}'"); if ($posts) { return true; } else { return 'DELETING_POSTS'; } } else { return 'DELETING_TOPIC'; } }
* Include sticky topics template */ include $config['template_path'] . "forum/topics.php"; // Increase counter $count++; } } // Do we have any topics? if ($topics) { // Loop through normal posts foreach ($topics as $row) { // reset $sticky = ""; $closed = ""; // Last post info for this topic $last_post = last_post($row['id']); // Trim subject $subject = character_limiter(stripslashes($row['subject']), $config['max_length']); // Build topic url $topic_url = "{$config['url_path']}/read.php?id={$row['id']}"; // Topic starter data $topic_author = user_data($row['starter_id']); // Last post data $last_post_author = user_data($last_post['starter_id']); // Last post avatar $last_post_avatar = get_avatar($last_post_udata['id']); // Dates $row['date'] = date($config['date_format'], $row['time'] + $config['zone']); $last_post['date'] = date($config['date_format'], $last_post['time'] + $config['zone']); // Ago $row['ago'] = ago($row['time'] + $config['zone']);