merge -r 2158 from branch-1_7 to trunk
fix: in page_header.php U_HOME template var was overwriting the ones from every page -> now it is always make_index_url fix: unvalidated comments use start end for RSS instead of end only (otherwise google reader creates a new item every time it downloads the feed) git-svn-id: http://piwigo.org/svn/trunk@2159 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
279f14eff9
commit
711018af5e
2 changed files with 14 additions and 26 deletions
|
@ -83,9 +83,8 @@ function custom_notification_query($action, $type, $start, $end)
|
|||
case 'unvalidated_comments':
|
||||
$query = '
|
||||
FROM '.COMMENTS_TABLE.'
|
||||
WHERE date <= \''.$end.'\'
|
||||
AND (validated = \'false\'
|
||||
OR validation_date > \''.$end.'\')
|
||||
WHERE date> \''.$start.'\' AND date <= \''.$end.'\'
|
||||
AND validated = \'false\'
|
||||
;';
|
||||
break;
|
||||
case 'new_elements':
|
||||
|
@ -226,26 +225,15 @@ function new_comments($start, $end)
|
|||
*
|
||||
* Comments that are registered and not validated yet on a precise date
|
||||
*
|
||||
* @param string date (mysql datetime format)
|
||||
* @param string start (mysql datetime format)
|
||||
* @param string end (mysql datetime format)
|
||||
* @return count comment ids
|
||||
*/
|
||||
function nb_unvalidated_comments($date)
|
||||
function nb_unvalidated_comments($start, $end)
|
||||
{
|
||||
return custom_notification_query('count', 'unvalidated_comments', $date, $date);
|
||||
return custom_notification_query('count', 'unvalidated_comments', $start, $end);
|
||||
}
|
||||
|
||||
/**
|
||||
* unvalidated at a precise date
|
||||
*
|
||||
* Comments that are registered and not validated yet on a precise date
|
||||
*
|
||||
* @param string date (mysql datetime format)
|
||||
* @return array comment ids
|
||||
*/
|
||||
function unvalidated_comments($date)
|
||||
{
|
||||
return custom_notification_query('info', 'unvalidated_comments', $start, $end);
|
||||
}
|
||||
|
||||
/**
|
||||
* new elements between two dates, according to authorized categories
|
||||
|
@ -362,7 +350,7 @@ function news_exists($start, $end)
|
|||
(nb_new_comments($start, $end) > 0) or
|
||||
(nb_new_elements($start, $end) > 0) or
|
||||
(nb_updated_categories($start, $end) > 0) or
|
||||
((is_admin()) and (nb_unvalidated_comments($end) > 0)) or
|
||||
((is_admin()) and (nb_unvalidated_comments($start, $end) > 0)) or
|
||||
((is_admin()) and (nb_new_users($start, $end) > 0)) or
|
||||
((is_admin()) and (nb_waiting_elements() > 0))
|
||||
);
|
||||
|
@ -424,7 +412,7 @@ function news($start, $end, $exclude_img_cats=false, $add_url=false)
|
|||
if (is_admin())
|
||||
{
|
||||
add_news_line( $news,
|
||||
nb_unvalidated_comments($end), '%d comment to validate', '%d comments to validate',
|
||||
nb_unvalidated_comments($start, $end), '%d comment to validate', '%d comments to validate',
|
||||
get_root_url().'admin.php?page=comments', $add_url );
|
||||
|
||||
add_news_line( $news,
|
||||
|
|
|
@ -53,7 +53,7 @@ $template->assign_vars(
|
|||
|
||||
'TAG_INPUT_ENABLED' =>
|
||||
((is_adviser()) ? 'disabled onclick="return false;"' : ''),
|
||||
'U_HOME' => get_absolute_root_url(),
|
||||
'U_HOME' => make_index_url(),
|
||||
));
|
||||
|
||||
// picture header infos
|
||||
|
|
Loading…
Reference in a new issue