From a2e2f11e483438dcbd42a2f5b69b9bdea3e99c0e Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Tue, 9 Oct 2007 13:33:23 +0000 Subject: [PATCH] Allow recent entries plugin to fixat "current" category --- include/admin/images.inc.php | 2 ++ .../serendipity_plugin_recententries.php | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index 056be04..199ad27 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -498,6 +498,8 @@ switch ($serendipity['GET']['adminAction']) { $new_dir = serendipity_uploadSecure($serendipity['POST']['parent'] . '/' . $serendipity['POST']['name'], true); $new_dir = str_replace(array('..', '//'), array('', '/'), $new_dir); + serendipity_plugin_api::hook_event('backend_directory_create', $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $new_dir); + /* TODO: check if directory already exist */ if (@mkdir($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $new_dir)) { printf(DIRECTORY_CREATED, $serendipity['POST']['name']); diff --git a/plugins/serendipity_plugin_recententries/serendipity_plugin_recententries.php b/plugins/serendipity_plugin_recententries/serendipity_plugin_recententries.php index f815831..6aa5943 100644 --- a/plugins/serendipity_plugin_recententries/serendipity_plugin_recententries.php +++ b/plugins/serendipity_plugin_recententries/serendipity_plugin_recententries.php @@ -21,7 +21,7 @@ class serendipity_plugin_recententries extends serendipity_plugin { $propbag->add('description', PLUGIN_RECENTENTRIES_BLAHBLAH); $propbag->add('stackable', true); $propbag->add('author', 'Christian Machmeier, Christian Brabandt'); - $propbag->add('version', '1.7'); + $propbag->add('version', '1.8'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -92,6 +92,7 @@ class serendipity_plugin_recententries extends serendipity_plugin { $select_cats = array(); $select_cats['none'] = ALL_CATEGORIES; + $select_cats['_cur'] = PARENT_CATEGORY; foreach($tmp_select_cats as $cidx => $tmp_select_cat) { $select_cat = explode('|||', $tmp_select_cat); if (!empty($select_cat[0]) && !empty($select_cat[1])) { @@ -119,6 +120,10 @@ class serendipity_plugin_recententries extends serendipity_plugin { $number = $this->get_config('number'); $dateformat = $this->get_config('dateformat'); $category = $this->get_config('category', 'none'); + + if ($category == '_cur') { + $category = $serendipity['GET']['category']; + } $title = $this->get_config('title', $this->title); $number_from_sw = $this->get_config('number_from'); $randomize = ($this->get_config('randomize') == "yes") ? true : false ; -- 2.39.5