haha you don't give up :D
Try this:
get_last_additions_for_user
my $last_review_date = $DB->table('Reviews')->select( ['MAX(Review_Date)'], { Review_Owner => $_[0] } )->fetchrow;
my $last_link_date = $DB->table('Links')->select( ['MAX(Add_Date)'], { LinkOwner => $_[0] } )->fetchrow || GT::Date::date_get();
my @last_review_date = split / /, $last_review_date;
$last_review_date = $last_review_date[0] || GT::Date::date_get();
my $date_diff_review = GT::Date::date_diff($last_review_date,GT::Date::date_get());
my $date_diff_link = GT::Date::date_diff($last_link_date,GT::Date::date_get());
return {
days_since_last_review => $date_diff_review,
days_since_last_link => $date_diff_link
}
}
Then call with:
..or if doing it for the logged in user, try:
Then you should have access to <%days_since_last_review%> and <%days_since_last_link%>
(they hold the number of days since the last link/review was added)
Please note, this is untested - but should work fine
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Try this:
get_last_additions_for_user
Code:
sub { my $last_review_date = $DB->table('Reviews')->select( ['MAX(Review_Date)'], { Review_Owner => $_[0] } )->fetchrow;
my $last_link_date = $DB->table('Links')->select( ['MAX(Add_Date)'], { LinkOwner => $_[0] } )->fetchrow || GT::Date::date_get();
my @last_review_date = split / /, $last_review_date;
$last_review_date = $last_review_date[0] || GT::Date::date_get();
my $date_diff_review = GT::Date::date_diff($last_review_date,GT::Date::date_get());
my $date_diff_link = GT::Date::date_diff($last_link_date,GT::Date::date_get());
return {
days_since_last_review => $date_diff_review,
days_since_last_link => $date_diff_link
}
}
Then call with:
Code:
<%get_last_additions_for_user($LinkOwner)%>..or if doing it for the logged in user, try:
Code:
<%get_last_additions_for_user($user.Username)%>Then you should have access to <%days_since_last_review%> and <%days_since_last_link%>
(they hold the number of days since the last link/review was added)
Please note, this is untested - but should work fine
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!