/** * Function: url * Returns a forum's URL. */ public function url() { if ($this->no_results) { return false; } return url("forum/" . $this->url, DiscussController::current()); }
/** * Function: delete_link * Outputs a delete link for the topic, if the <User.can> delete_topic. * * Parameters: * $text - The text to show for the link. * $before - If the link can be shown, show this before it. * $after - If the link can be shown, show this after it. */ public function delete_link($text = null, $before = null, $after = null, $classes = "") { if (!$this->deletable()) { return false; } fallback($text, __("Delete")); echo $before . '<a href="' . url("delete_topic/" . $this->id, DiscussController::current()) . '" title="Delete" class="topic_delete_link delete_link" id="' . ($classes ? $classes . " " : '') . 'topic_delete_' . $this->id . '">' . $text . '</a>' . $after; }
<?php if (version_compare(PHP_VERSION, "5.1.3", "<")) { exit("Chyrp requires PHP 5.1.3 or greater."); } require_once "../includes/common.php"; # Prepare the controller. $discuss = DiscussController::current(); # Parse the route. $route = Route::current($discuss); if (module_enabled("cacher") and !empty(Modules::$instances["cacher"]->cacher->path)) { $cacher =& Modules::$instances["cacher"]->cacher; $cacher->caches = INCLUDES_DIR . "/caches/discuss"; $cacher->path = str_replace(INCLUDES_DIR . "/caches", INCLUDES_DIR . "/caches/discuss", $cacher->path); $cacher->file = $cacher->path . "/" . md5($cacher->url) . ".html"; $cacher->remove_expired(); } # Execute the appropriate Controller responder. $route->init(); # If the route failed or nothing was displayed, check for: # 1. Module-provided pages. # 2. Feather-provided pages. # 3. Theme-provided pages. if (!$route->success) { $displayed = false; if (!$displayed and $theme->file_exists("pages/" . $route->action)) { $discuss->display("pages/discuss/" . $route->action); } elseif (!$displayed) { show_404(); } }