mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
support for rel-tag microformat
This commit is contained in:
parent
4adb7674b9
commit
9daebb0fb0
@ -79,7 +79,7 @@ class BlogEntry extends Page {
|
|||||||
foreach($theseTags as $tag) {
|
foreach($theseTags as $tag) {
|
||||||
$output->push(new ArrayData(array(
|
$output->push(new ArrayData(array(
|
||||||
"Tag" => $tag,
|
"Tag" => $tag,
|
||||||
"Link" => $this->getParent()->Link() . '?tag=' . urlencode($tag)
|
"Link" => $this->getParent()->Link() . 'tag/' . urlencode($tag)
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
if($this->Tags){
|
if($this->Tags){
|
||||||
|
@ -47,15 +47,20 @@ class BlogHolder extends Page {
|
|||||||
|
|
||||||
|
|
||||||
if(Director::urlParams()){
|
if(Director::urlParams()){
|
||||||
|
if(Director::urlParam('Action') == 'tag') {
|
||||||
|
$tag = addslashes(Director::urlParam('ID'));
|
||||||
|
$tag = str_replace(array("\\",'_','%',"'"), array("\\\\","\\_","\\%","\\'"), $tag);
|
||||||
|
$tagCheck = "AND `BlogEntry`.Tags LIKE '%$tag%'";
|
||||||
|
} else {
|
||||||
|
$year = Director::urlParam('Action');
|
||||||
|
$month = Director::urlParam('ID');
|
||||||
|
|
||||||
$year = Director::urlParam('Action');
|
if(is_numeric($month) && is_numeric($month)){
|
||||||
$month = Director::urlParam('ID');
|
$dateCheck = "AND Date BETWEEN '$year-$month-1' AND '$year-$month-31'";
|
||||||
|
}
|
||||||
if(is_numeric($month) && is_numeric($month)){
|
else if(isset($year)){
|
||||||
$dateCheck = "AND Date BETWEEN '$year-$month-1' AND '$year-$month-31'";
|
$dateCheck = "AND Date BETWEEN '$year-1-1' AND '$year-12-31'";
|
||||||
}
|
}
|
||||||
else if(isset($year)){
|
|
||||||
$dateCheck = "AND Date BETWEEN '$year-1-1' AND '$year-12-31'";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user