Quote:
Originally Posted by vbboarder
The stats for newest entries are incorrect when displayed in LDM pages. I have old entries showing up whose dates are even past the time limit set in LDM Settings > Statistics Display. However, the VBA module for new entries stats does work correctly. Andrew, can you tell me what file or plugin to edit so that I can use the php code from the ldm_new.module file?
Note: Not sure if this is related, but I used the Flash sites extra plugin and all the old entries that showed up in the new entries stats in LDM pages happen to be entries created by that plugin.
|
There's a parameter missing on the relevant function call, so the sql is requesting 'all entries' rather than 'new entries'. Assuming that I didn't do that for a reason that I've forgotten, the solution is as follows:
edit includes/local_links_vbafunc.php
find function ldm_get_hitparades($catid, $template="links_hitparade")
find
Code:
$hitsince = ($links_defaults['days_seen_on_portal'] ? TIMENOW-intval($links_defaults['days_seen_on_portal'])*24*60*60 : $vbulletin->userinfo['lastvisit']);
and change to
Code:
$newsince = $hitsince = ($links_defaults['days_seen_on_portal'] ? TIMENOW-intval($links_defaults['days_seen_on_portal'])*24*60*60 : $vbulletin->userinfo['lastvisit']);
find
Code:
if ($links_defaults['show_hp_new']) {
$query = ldm_get_specialsearchsql($NEW_CAT, $linksee, "", $catids);
list($links['show_hp_new'], $hits) = ldm_get_entrybits_brief($query, $linksee, $template);
$showme = ($hits ? 1 : $showme );
}
and change to
Code:
if ($links_defaults['show_hp_new']) {
$query = ldm_get_specialsearchsql($NEW_CAT, $linksee, "", $catids, $newsince);
list($links['show_hp_new'], $hits) = ldm_get_entrybits_brief($query, $linksee, $template);
$showme = ($hits ? 1 : $showme );
}
I think that will fix things. Please confirm.