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
2 changed files with 8 additions and 11 deletions
|
@ -3,13 +3,10 @@ class Config {
|
|||
var $values = array();
|
||||
var $defaults = array(
|
||||
'title' => 'Shimmie', # setup
|
||||
'version' => 'Shimmie2-2.0.2', // internal
|
||||
'db_version' => '2.0.0.9', // this should be managed by upgrade.php
|
||||
'version' => 'Shimmie2-2.0.3', // internal
|
||||
'front_page' => 'index', # setup
|
||||
'base_href' => './index.php?q=', # setup
|
||||
'data_href' => './', # setup
|
||||
'theme' => 'default', # setup
|
||||
'debug_enabled' => true, # hidden
|
||||
'index_width' => 3, # index
|
||||
'index_height' => 4, # index
|
||||
'index_tips' => true,
|
||||
|
@ -17,8 +14,6 @@ class Config {
|
|||
'thumb_height' => 192, # index
|
||||
'thumb_quality' => 75, # index
|
||||
'thumb_mem_limit' => '8MB', # upload
|
||||
'tags_default' => 'map', # (ignored)
|
||||
'tags_min' => '2', # tags
|
||||
'upload_count' => 3, # upload
|
||||
'upload_size' => '256KB', # upload
|
||||
'upload_anon' => true, # upload
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<?php
|
||||
define("TAG_LIST_LENGTH", 15);
|
||||
define("TAGS_MIN", 3);
|
||||
|
||||
class TagList extends Extension {
|
||||
var $theme = null;
|
||||
|
@ -31,7 +33,7 @@ class TagList extends Extension {
|
|||
if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
|
||||
global $config;
|
||||
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'])) {
|
||||
$this->add_refine_block($page, tag_explode($_GET['search']));
|
||||
}
|
||||
|
@ -43,7 +45,7 @@ class TagList extends Extension {
|
|||
|
||||
if(is_a($event, 'DisplayingImageEvent')) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +82,7 @@ class TagList extends Extension {
|
|||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $config->get_int('tags_min', TAGS_MIN);
|
||||
$result = $database->Execute(
|
||||
"SELECT tag,count FROM tags WHERE count > ? ORDER BY tag",
|
||||
array($tags_min));
|
||||
|
@ -104,7 +106,7 @@ class TagList extends Extension {
|
|||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $config->get_int('tags_min', TAGS_MIN);
|
||||
$result = $database->Execute(
|
||||
"SELECT tag,count FROM tags WHERE count > ? ORDER BY tag",
|
||||
array($tags_min));
|
||||
|
@ -131,7 +133,7 @@ class TagList extends Extension {
|
|||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $config->get_int('tags_min', TAGS_MIN);
|
||||
$result = $database->Execute(
|
||||
"SELECT tag,count FROM tags WHERE count > ? ORDER BY count DESC, tag ASC",
|
||||
array($tags_min)
|
||||
|
|
Reference in a new issue