Index: trunk/kernel/include/parseditem.php
===================================================================
diff -u -N -r904 -r943
--- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 904)
+++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 943)
@@ -1910,7 +1910,7 @@
{
$FieldVar = $this->Query_SortField[$x];
$OrderVar = $this->Query_SortOrder[$x];
-
+
if(is_object($objSession))
{
$FieldVarData = $objSession->GetPersistantVariable($FieldVar);
@@ -2545,8 +2545,9 @@
$catid = (int)$attribs["_catid"];
$scope = (int)$attribs["_scope"];
+ $show_since_last = (int)$attribs["_show_since_last"];
//$JoinCats = (int)$attribs["_catinfo"] || $scope;
-
+ //echo "Last: $scope
";
$TableName = $this->SourceTable;
if($attribs["_today"])
{
@@ -2559,8 +2560,13 @@
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
- }
- $cutoff = $this->GetNewValue($catid);
+ }
+ if (!$show_since_last) {
+ $cutoff = $this->GetNewValue($catid);
+ }
+ else {
+ $cutoff = $scope;
+ }
}
else
$cutoff = $this->GetNewValue();
@@ -2572,7 +2578,12 @@
$catid = $objCatList->CurrentCategoryID();
}
- $where = "CategoryId =".$catid." AND ((".$TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 ";
+ if (!$show_since_last) {
+ $where = "CategoryId =".$catid." AND ((".$TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 ";
+ }
+ else {
+ $where = $TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".Status=1 ";
+ }
}
else
{
@@ -2585,7 +2596,8 @@
$sql .= $this->GetJoinedSQL($p,$CatUd,$where);
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
- $sql .= " ".$OrderBy;
+ $sql .= " ".$OrderBy;
+ //echo $sql;
return $sql;
}