allow differents types of pages to the tag database
This commit is contained in:
parent
1295d219ab
commit
185ae09393
|
@ -92,6 +92,9 @@ define('SESSION_GC_MAXLIFETIME', 3600);
|
||||||
// The value 0 means until the browser is closed
|
// The value 0 means until the browser is closed
|
||||||
define('SESSION_COOKIE_LIFE_TIME', 0);
|
define('SESSION_COOKIE_LIFE_TIME', 0);
|
||||||
|
|
||||||
|
// Tags, type of pages included in the tag database
|
||||||
|
define('DB_TAGS_TYPES', array('published','static','sticky'));
|
||||||
|
|
||||||
// Alert notification dissappear in X seconds
|
// Alert notification dissappear in X seconds
|
||||||
$GLOBALS['ALERT_DISSAPEAR_IN'] = 3; // Seconds
|
$GLOBALS['ALERT_DISSAPEAR_IN'] = 3; // Seconds
|
||||||
|
|
||||||
|
@ -100,4 +103,3 @@ $GLOBALS['MEDIA_MANAGER_NUMBER_OF_FILES'] = 5;
|
||||||
|
|
||||||
// Sort the image by date
|
// Sort the image by date
|
||||||
$GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'] = true;
|
$GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'] = true;
|
||||||
|
|
||||||
|
|
|
@ -15,18 +15,18 @@ class Tags extends dbList {
|
||||||
public function reindex()
|
public function reindex()
|
||||||
{
|
{
|
||||||
global $pages;
|
global $pages;
|
||||||
|
$db = $pages->getDB($onlyKeys=false);
|
||||||
// Get a database with published pages
|
|
||||||
$db = $pages->getDB(false);
|
|
||||||
$tagsIndex = array();
|
$tagsIndex = array();
|
||||||
foreach ($db as $pageKey=>$pageFields) {
|
foreach ($db as $pageKey=>$pageFields) {
|
||||||
$tags = $pageFields['tags'];
|
if (in_array($pageFields['type'], DB_TAGS_TYPES)) {
|
||||||
foreach ($tags as $tagKey=>$tagName) {
|
$tags = $pageFields['tags'];
|
||||||
if (isset($tagsIndex[$tagKey])) {
|
foreach ($tags as $tagKey=>$tagName) {
|
||||||
array_push($tagsIndex[$tagKey]['list'], $pageKey);
|
if (isset($tagsIndex[$tagKey])) {
|
||||||
} else {
|
array_push($tagsIndex[$tagKey]['list'], $pageKey);
|
||||||
$tagsIndex[$tagKey]['name'] = $tagName;
|
} else {
|
||||||
$tagsIndex[$tagKey]['list'] = array($pageKey);
|
$tagsIndex[$tagKey]['name'] = $tagName;
|
||||||
|
$tagsIndex[$tagKey]['list'] = array($pageKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue