PDA


View Full Version : Recently Updated?


tfw2005
09-17-2007, 09:08 PM
For at least one of my instances, I have a set number of entries that only staff will create. Over time, we will add to these entries with more/extended data.

Once done entering, the "whats new" module becomes irrelevant. Is there a way to create the same thing, put pull entries based on "last edit time"?

I know there is a date entry area on each edit/submit page, but i dont see us using it. So it would be based on just the default last edit time in the system (hoping there is one).

Perhaps a way to auto update the date field upon loading the edit page, so when you save, it saves it under the new publish date? That would make the whats new module relevant again in this situation.

Brian
09-18-2007, 10:41 AM
The time that the entry was last updated is not saved anywhere, so that one's not going to be a possibility at this time. Updating the dateline to the current time shouldn't be too hard though. You would just need to look in your dynamics/newentry.php file for this code:
$db->query_write("
UPDATE " . ADV_DYNA_TABLE_PREFIX . "entries SET
title = '" . $db->escape_string($entry['title']) . "',
catid = $entry[catid],
dateline = $entry[dateline],
keywords = '" . $db->escape_string($keywords) . "',
iconid = " . $vbulletin->GPC['iconid'] . ",
valid = $entry[valid],
open = $entry[open],
draft = " . $vbulletin->GPC['draft'] . ",
private = " . $vbulletin->GPC['private'] . ",
showsignature = " . $vbulletin->GPC['signature'] . "
" . iif($vba_options['dyna_require_attach'], ", hasattach = $entry[attachcount_valid]") . "
WHERE entryid = $entryid
");

And replace with this:
$db->query_write("
UPDATE " . ADV_DYNA_TABLE_PREFIX . "entries SET
title = '" . $db->escape_string($entry['title']) . "',
catid = $entry[catid],
dateline = $entry[dateline],
keywords = '" . $db->escape_string($keywords) . "',
iconid = " . $vbulletin->GPC['iconid'] . ",
valid = $entry[valid],
open = $entry[open],
dateline = " . TIMENOW . ",
draft = " . $vbulletin->GPC['draft'] . ",
private = " . $vbulletin->GPC['private'] . ",
showsignature = " . $vbulletin->GPC['signature'] . "
" . iif($vba_options['dyna_require_attach'], ", hasattach = $entry[attachcount_valid]") . "
WHERE entryid = $entryid
");

tfw2005
09-18-2007, 05:21 PM
Thanks Brian, that should work.