remove tags_min and tags_default from config class
git-svn-id: file:///home/shish/svn/shimmie2/trunk@291 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
		
							parent
							
								
									e2dc8c065d
								
							
						
					
					
						commit
						dc23b3bdb4
					
				| @ -3,13 +3,10 @@ class Config { | |||||||
| 	var $values = array(); | 	var $values = array(); | ||||||
| 	var $defaults = array( | 	var $defaults = array( | ||||||
| 			'title' => 'Shimmie', # setup
 | 			'title' => 'Shimmie', # setup
 | ||||||
| 			'version' => 'Shimmie2-2.0.2', // internal
 | 			'version' => 'Shimmie2-2.0.3', // internal
 | ||||||
| 			'db_version' => '2.0.0.9', // this should be managed by upgrade.php
 |  | ||||||
| 			'front_page' => 'index', # setup
 | 			'front_page' => 'index', # setup
 | ||||||
| 			'base_href' => './index.php?q=', # setup
 | 			'base_href' => './index.php?q=', # setup
 | ||||||
| 			'data_href' => './', # setup
 | 			'data_href' => './', # setup
 | ||||||
| 			'theme' => 'default', # setup
 |  | ||||||
| 			'debug_enabled' => true, # hidden
 |  | ||||||
| 			'index_width' => 3, # index
 | 			'index_width' => 3, # index
 | ||||||
| 			'index_height' => 4, # index
 | 			'index_height' => 4, # index
 | ||||||
| 			'index_tips' => true, | 			'index_tips' => true, | ||||||
| @ -17,8 +14,6 @@ class Config { | |||||||
| 			'thumb_height' => 192, # index
 | 			'thumb_height' => 192, # index
 | ||||||
| 			'thumb_quality' => 75,  # index
 | 			'thumb_quality' => 75,  # index
 | ||||||
| 			'thumb_mem_limit' => '8MB', # upload
 | 			'thumb_mem_limit' => '8MB', # upload
 | ||||||
| 			'tags_default' => 'map', # (ignored)
 |  | ||||||
| 			'tags_min' => '2', # tags
 |  | ||||||
| 			'upload_count' => 3, # upload
 | 			'upload_count' => 3, # upload
 | ||||||
| 			'upload_size' => '256KB', # upload
 | 			'upload_size' => '256KB', # upload
 | ||||||
| 			'upload_anon' => true, # upload
 | 			'upload_anon' => true, # upload
 | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
| <?php | <?php | ||||||
|  | define("TAG_LIST_LENGTH", 15); | ||||||
|  | define("TAGS_MIN", 3); | ||||||
| 
 | 
 | ||||||
| class TagList extends Extension { | class TagList extends Extension { | ||||||
| 	var $theme = null; | 	var $theme = null; | ||||||
| @ -31,7 +33,7 @@ class TagList extends Extension { | |||||||
| 		if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) { | 		if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) { | ||||||
| 			global $config; | 			global $config; | ||||||
| 			global $page; | 			global $page; | ||||||
| 			if($config->get_int('tag_list_length') > 0) { | 			if($config->get_int('tag_list_length', TAG_LIST_LENGTH) > 0) { | ||||||
| 				if(isset($_GET['search'])) { | 				if(isset($_GET['search'])) { | ||||||
| 					$this->add_refine_block($page, tag_explode($_GET['search'])); | 					$this->add_refine_block($page, tag_explode($_GET['search'])); | ||||||
| 				} | 				} | ||||||
| @ -43,7 +45,7 @@ class TagList extends Extension { | |||||||
| 
 | 
 | ||||||
| 		if(is_a($event, 'DisplayingImageEvent')) { | 		if(is_a($event, 'DisplayingImageEvent')) { | ||||||
| 			global $config; | 			global $config; | ||||||
| 			if($config->get_int('tag_list_length') > 0) { | 			if($config->get_int('tag_list_length', TAG_LIST_LENGTH) > 0) { | ||||||
| 				$this->add_related_block($event->page, $event->image); | 				$this->add_related_block($event->page, $event->image); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| @ -80,7 +82,7 @@ class TagList extends Extension { | |||||||
| 		global $database; | 		global $database; | ||||||
| 		global $config; | 		global $config; | ||||||
| 
 | 
 | ||||||
| 		$tags_min = $config->get_int('tags_min'); | 		$tags_min = $config->get_int('tags_min', TAGS_MIN); | ||||||
| 		$result = $database->Execute( | 		$result = $database->Execute( | ||||||
| 				"SELECT tag,count FROM tags WHERE count > ? ORDER BY tag", | 				"SELECT tag,count FROM tags WHERE count > ? ORDER BY tag", | ||||||
| 				array($tags_min)); | 				array($tags_min)); | ||||||
| @ -104,7 +106,7 @@ class TagList extends Extension { | |||||||
| 		global $database; | 		global $database; | ||||||
| 		global $config; | 		global $config; | ||||||
| 
 | 
 | ||||||
| 		$tags_min = $config->get_int('tags_min'); | 		$tags_min = $config->get_int('tags_min', TAGS_MIN); | ||||||
| 		$result = $database->Execute( | 		$result = $database->Execute( | ||||||
| 				"SELECT tag,count FROM tags WHERE count > ? ORDER BY tag", | 				"SELECT tag,count FROM tags WHERE count > ? ORDER BY tag", | ||||||
| 				array($tags_min)); | 				array($tags_min)); | ||||||
| @ -131,7 +133,7 @@ class TagList extends Extension { | |||||||
| 		global $database; | 		global $database; | ||||||
| 		global $config; | 		global $config; | ||||||
| 
 | 
 | ||||||
| 		$tags_min = $config->get_int('tags_min'); | 		$tags_min = $config->get_int('tags_min', TAGS_MIN); | ||||||
| 		$result = $database->Execute( | 		$result = $database->Execute( | ||||||
| 				"SELECT tag,count FROM tags WHERE count > ? ORDER BY count DESC, tag ASC", | 				"SELECT tag,count FROM tags WHERE count > ? ORDER BY count DESC, tag ASC", | ||||||
| 				array($tags_min) | 				array($tags_min) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user