From c7b4cf8ead98c72348ae56cdb486631d01c2ac5c Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 4 Jan 2010 12:41:04 +0000 Subject: [PATCH] documentation updates --- ext/comment/main.php | 13 ++++++- ext/ext_manager/main.php | 11 ++++-- ext/index/main.php | 67 +++++++++++++++++++++++++++++++- themes/danbooru/layout.class.php | 10 ++--- 4 files changed, 91 insertions(+), 10 deletions(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index c53d4f3c..ccf6ff8d 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -1,4 +1,15 @@ + * Link: http://trac.shishnet.org/shimmie2/ + * License: GPLv2 + * Description: Allow users to make comments on images + * Documentation: + * Formatting is done with BBCode, as interpreted by the + * BBCode extension + */ + require_once "lib/akismet.class.php"; class CommentPostingEvent extends Event { @@ -13,7 +24,7 @@ class CommentPostingEvent extends Event { /** * A comment is being deleted. Maybe used by spam - * detectors to get a feel for what should be delted + * detectors to get a feel for what should be deleted * and what should be kept? */ class CommentDeletionEvent extends Event { diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php index c45a566f..81c3bc3c 100644 --- a/ext/ext_manager/main.php +++ b/ext/ext_manager/main.php @@ -14,8 +14,8 @@ class ExtensionInfo { function ExtensionInfo($main) { $matches = array(); $lines = file($main); - preg_match("#contrib/(.*)/main.php#", $main, $matches); - $this->ext_name = $matches[1]; + preg_match("#(ext|contrib)/(.*)/main.php#", $main, $matches); + $this->ext_name = $matches[2]; $this->name = $this->ext_name; $this->enabled = $this->is_enabled($this->ext_name); @@ -96,7 +96,12 @@ class ExtManager extends SimpleExtension { if($event->page_matches("ext_doc")) { $ext = $event->get_arg(0); - $info = new ExtensionInfo("contrib/$ext/main.php"); + if(file_exists("ext/$ext/main.php")) { + $info = new ExtensionInfo("ext/$ext/main.php"); + } + else { + $info = new ExtensionInfo("contrib/$ext/main.php"); + } $this->theme->display_doc($page, $info); } } diff --git a/ext/index/main.php b/ext/index/main.php index 3a601590..883a88ac 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -1,4 +1,69 @@ + * Link: http://trac.shishnet.org/shimmie2/ + * License: GPLv2 + * Description: Show a list of uploaded images + * Documentation: + * Here is a list of the search methods available out of the box; + * Shimmie extensions may provide other filters: + * + *

Search items can be combined to search for images which match both, + * or you can stick "-" in front of an item to search for things that don't + * match it. + */ + /* * SearchTermParseEvent: * Signal that a search term needs parsing @@ -140,7 +205,7 @@ class Index extends SimpleExtension { } else if(preg_match("/^posted=(([0-9\*]*)?(-[0-9\*]*)?(-[0-9\*]*)?)$/", $event->term, $matches)) { $val = str_replace("*", "%", $matches[1]); - $img_search->append(new Querylet("images.posted LIKE '%$val%'")); + $event->add_querylet(new Querylet("images.posted LIKE '%$val%'")); } } } diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php index b9e9cd8d..bc521194 100644 --- a/themes/danbooru/layout.class.php +++ b/themes/danbooru/layout.class.php @@ -141,22 +141,22 @@ class Layout { case "upload": $custom_sublinks .= "

  • All
  • "; $custom_sublinks .= "
  • My Favorites
  • "; - if($hw) $custom_sublinks .= "
  • Help
  • "; + $custom_sublinks .= "
  • Help
  • "; break; case "comment": $custom_sublinks .= "
  • All
  • "; - if($hw) $custom_sublinks .= "
  • Help
  • "; + $custom_sublinks .= "
  • Help
  • "; break; case "pool": $custom_sublinks .= "
  • List
  • "; $custom_sublinks .= "
  • Create
  • "; $custom_sublinks .= "
  • Changes
  • "; - if($hw) $custom_sublinks .= "
  • Help
  • "; + $custom_sublinks .= "
  • Help
  • "; break; case "wiki": $custom_sublinks .= "
  • Index
  • "; $custom_sublinks .= "
  • Rules
  • "; - $custom_sublinks .= "
  • Help
  • "; + $custom_sublinks .= "
  • Help
  • "; break; case "tags": case "alias": @@ -165,7 +165,7 @@ class Layout { $custom_sublinks .= "
  • Popularity
  • "; $custom_sublinks .= "
  • Categories
  • "; $custom_sublinks .= "
  • Aliases
  • "; - if($hw) $custom_sublinks .= "
  • Help
  • "; + $custom_sublinks .= "
  • Help
  • "; break; }