fixed the show by tag

This commit is contained in:
Will Rossiter 2008-04-22 01:20:59 +00:00
parent b1e4d27b42
commit 55e1174884
2 changed files with 18 additions and 12 deletions

View File

@ -109,7 +109,7 @@ class BlogHolder extends Page {
/**
* Only display the blog entries that have the specified tag
*/
function Tag() {
function ShowTag() {
if(Director::urlParam('Action') == 'tag') {
return Director::urlParam('ID');
}
@ -269,6 +269,15 @@ class BlogHolder_Controller extends Page_Controller {
return $output;
}
function tag() {
if($this->ShowTag()) {
return array(
'Tag' => $this->ShowTag()
);
} else {
return array();
}
}
/**
* Get the rss feed for this blog holder's entries

View File

@ -2,10 +2,10 @@
class TagCloudWidget extends Widget {
static $db = array(
"Title" => "Varchar",
"Limit" => "Int",
"Sortby" => "Varchar"
);
"Title" => "Varchar",
"Limit" => "Int",
"Sortby" => "Varchar"
);
static $defaults = array(
"Title" => "Tag Cloud",
@ -111,7 +111,6 @@ class TagCloudWidget extends Widget {
"Class" => $class,
"Link" => $blogHolder->Link() . 'tag/' . urlencode($tag)
);
Debug::show($allTags[$tag]);
}
}
@ -139,18 +138,16 @@ function column_sort_by_popularity($a, $b){
return $result;
}
function natksort(&$aToBeSorted)
{
function natksort(&$aToBeSorted) {
$aResult = array();
$aKeys = array_keys($aToBeSorted);
natcasesort($aKeys);
foreach ($aKeys as $sKey)
{
foreach ($aKeys as $sKey) {
$aResult[$sKey] = $aToBeSorted[$sKey];
}
}
$aToBeSorted = $aResult;
return true;
}
}
?>