documentation updates
This commit is contained in:
		
							parent
							
								
									652cc475b1
								
							
						
					
					
						commit
						f496bc3a54
					
				@ -1,4 +1,15 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Name: Image Comments
 | 
				
			||||||
 | 
					 * Author: Shish <webmaster@shishnet.org>
 | 
				
			||||||
 | 
					 * 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";
 | 
					require_once "lib/akismet.class.php";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CommentPostingEvent extends Event {
 | 
					class CommentPostingEvent extends Event {
 | 
				
			||||||
@ -13,7 +24,7 @@ class CommentPostingEvent extends Event {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * A comment is being deleted. Maybe used by spam
 | 
					 * 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?
 | 
					 * and what should be kept?
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
class CommentDeletionEvent extends Event {
 | 
					class CommentDeletionEvent extends Event {
 | 
				
			||||||
 | 
				
			|||||||
@ -14,8 +14,8 @@ class ExtensionInfo {
 | 
				
			|||||||
	function ExtensionInfo($main) {
 | 
						function ExtensionInfo($main) {
 | 
				
			||||||
		$matches = array();
 | 
							$matches = array();
 | 
				
			||||||
		$lines = file($main);
 | 
							$lines = file($main);
 | 
				
			||||||
		preg_match("#contrib/(.*)/main.php#", $main, $matches);
 | 
							preg_match("#(ext|contrib)/(.*)/main.php#", $main, $matches);
 | 
				
			||||||
		$this->ext_name = $matches[1];
 | 
							$this->ext_name = $matches[2];
 | 
				
			||||||
		$this->name = $this->ext_name;
 | 
							$this->name = $this->ext_name;
 | 
				
			||||||
		$this->enabled = $this->is_enabled($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")) {
 | 
							if($event->page_matches("ext_doc")) {
 | 
				
			||||||
			$ext = $event->get_arg(0);
 | 
								$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);
 | 
								$this->theme->display_doc($page, $info);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,69 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Name: Post Index
 | 
				
			||||||
 | 
					 * Author: Shish <webmaster@shishnet.org>
 | 
				
			||||||
 | 
					 * 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:
 | 
				
			||||||
 | 
					 *  <ul>
 | 
				
			||||||
 | 
					 *    <li>by tag, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>cat
 | 
				
			||||||
 | 
					 *        <li>pie
 | 
				
			||||||
 | 
					 *        <li>somethi* -- wildcards are supported
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>size (=, <, >, <=, >=) width x height, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>size=1024x768 -- a specific wallpaper size
 | 
				
			||||||
 | 
					 *        <li>size>=500x500 -- no small images
 | 
				
			||||||
 | 
					 *        <li>size<1000x1000 -- no large images
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>ratio (=, <, >, <=, >=) width : height, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>ratio=4:3, ratio=16:9 -- standard wallpaper
 | 
				
			||||||
 | 
					 *        <li>ratio=1:1 -- square images
 | 
				
			||||||
 | 
					 *        <li>ratio<1:1 -- tall images
 | 
				
			||||||
 | 
					 *        <li>ratio>1:1 -- wide images
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>filesize (=, <, >, <=, >=) size, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>filesize>1024 -- no images under 1KB
 | 
				
			||||||
 | 
					 *        <li>filesize<=3MB -- shorthand filesizes are supported too
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>id (=, <, >, <=, >=) number, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>id<20 -- search only the first few images
 | 
				
			||||||
 | 
					 *        <li>id>=500 -- search later images
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>user=Username, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>user=Shish -- find all of Shish's posts
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>hash=md5sum, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>hash=bf5b59173f16b6937a4021713dbfaa72 -- find the "Taiga want up!" image
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>filetype=type, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>filetype=png -- find all PNG images
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>filename=blah, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>user=kitten -- find all images with "kitten" in the original filename
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *    <li>posted=date, eg
 | 
				
			||||||
 | 
					 *      <ul>
 | 
				
			||||||
 | 
					 *        <li>posted=2009-12-25 -- find images posted on the 25th December
 | 
				
			||||||
 | 
					 *      </ul>
 | 
				
			||||||
 | 
					 *   </ul>
 | 
				
			||||||
 | 
					 *  <p>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:
 | 
					 * SearchTermParseEvent:
 | 
				
			||||||
 * Signal that a search term needs parsing
 | 
					 * 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)) {
 | 
							else if(preg_match("/^posted=(([0-9\*]*)?(-[0-9\*]*)?(-[0-9\*]*)?)$/", $event->term, $matches)) {
 | 
				
			||||||
			$val = str_replace("*", "%", $matches[1]);
 | 
								$val = str_replace("*", "%", $matches[1]);
 | 
				
			||||||
			$img_search->append(new Querylet("images.posted LIKE '%$val%'"));
 | 
								$event->add_querylet(new Querylet("images.posted LIKE '%$val%'"));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -141,22 +141,22 @@ class Layout {
 | 
				
			|||||||
			case "upload":
 | 
								case "upload":
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link('post/list')."'>All</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('post/list')."'>All</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by=$username/1")."'>My Favorites</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by=$username/1")."'>My Favorites</a></li>";
 | 
				
			||||||
				if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("ext_doc/index")."'>Help</a></li>";
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			case "comment":
 | 
								case "comment":
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link('comment/list')."'>All</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('comment/list')."'>All</a></li>";
 | 
				
			||||||
				if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/comment")."'>Help</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("ext_doc/comment")."'>Help</a></li>";
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			case "pool":
 | 
								case "pool":
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link('pool/list')."'>List</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('pool/list')."'>List</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link("pool/new")."'>Create</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("pool/new")."'>Create</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link("pool/updated")."'>Changes</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("pool/updated")."'>Changes</a></li>";
 | 
				
			||||||
				if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/pools")."'>Help</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("ext_doc/pools")."'>Help</a></li>";
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			case "wiki":
 | 
								case "wiki":
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link('wiki')."'>Index</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('wiki')."'>Index</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link("wiki/rules")."'>Rules</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("wiki/rules")."'>Rules</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link("wiki/wiki")."'>Help</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("ext_doc/wiki")."'>Help</a></li>";
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			case "tags":
 | 
								case "tags":
 | 
				
			||||||
			case "alias":
 | 
								case "alias":
 | 
				
			||||||
@ -165,7 +165,7 @@ class Layout {
 | 
				
			|||||||
				$custom_sublinks .= "<li><a href='".make_link('tags/popularity')."'>Popularity</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('tags/popularity')."'>Popularity</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link('tags/categories')."'>Categories</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('tags/categories')."'>Categories</a></li>";
 | 
				
			||||||
				$custom_sublinks .= "<li><a href='".make_link('alias/list')."'>Aliases</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link('alias/list')."'>Aliases</a></li>";
 | 
				
			||||||
				if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/tags")."'>Help</a></li>";
 | 
									$custom_sublinks .= "<li><a href='".make_link("ext_doc/tag_edit")."'>Help</a></li>";
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user