Posted by kanute on March 15, 2009 at 2:11pm
Jump to:
| Project: | Last Node |
| Version: | 6.x-2.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hello,
I love this module, but would like to have more control over the selected nodes. So I've tried a little hack to decrease the amount of nodes retrieved:
In function _last_node_contents():
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.type in ($placeholders) AND n.status = 1 AND (UNIX_TIMESTAMP() - n.changed) < (4 * 24 * 60 * 60) ORDER BY n.changed DESC"), $node, 0, 5);
This works for me, but it would be far better, if the number of days in the past and the number of records could be customized in the admin panel.
Comments
#1
Hello kanute,
I need to refactor this project, i started this over 4.6 branch and is a bit old the general approach. This feature will be sure added, i try to provide temporarily a patch :))
#2
Thanks!
In the meantime I added a little bit of code to explain whether the content is new or updated:
while ($node = db_fetch_object($result)) {if ($node->created == $node->changed) {
$news_flag = t('(new)');
} else {
$news_flag = t('(updated)');
}
$output .= l($node->title . ' ' . $news_flag,'node/'. $node->nid) ."<br />-<br />";
By the way: The w3.org HTML Validator says:
element "marquee" undefinedYou have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
(...)
* by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead). (...)
(...)
Attribute "onMouseOver" is not a valid attribute. Did you mean "onmouseover"?
(...)
Attribute "onMouseOut" is not a valid attribute. Did you mean "onmouseout"?
After refactoring, I will add willingly a de.po file.
#3
Are you sure this work just comparing the 2 property? It depend from the user too if you mean the same behaviour comment display has.
Well marquee is another thing to fix, many changes to do...
Thank you!