Tarea #1080 -> No se descuenta bien el nº de dedicatorias sin mirar
git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@180 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
parent
6e56cdc433
commit
bf26dd8ad6
@ -802,6 +802,27 @@ function gp_get_total_unread_dedications() {
|
|||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gp_get_unread_dedications() {
|
||||||
|
$result = array();
|
||||||
|
if(is_user_logged_in()) {
|
||||||
|
$user_id = mar_get_user_id();
|
||||||
|
$read_ids = mar_get_user_read_posts( $user_id );
|
||||||
|
|
||||||
|
$args = array(
|
||||||
|
'exclude' => $read_ids,
|
||||||
|
'numberposts' => -1,
|
||||||
|
'cat' => DEDICATION_CATEGORY_SLUG,
|
||||||
|
'meta_key' => 'ghostpool_destination_user_id',
|
||||||
|
'meta_value' => $user_id
|
||||||
|
);
|
||||||
|
$unread_posts = get_posts( $args );
|
||||||
|
foreach ($unread_posts as $unread) {
|
||||||
|
$result[] = $unread->ID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
function set_from_email($email) {
|
function set_from_email($email) {
|
||||||
/*$new_email = $email;
|
/*$new_email = $email;
|
||||||
if ($email == 'noreply@asong2u.com') :*/
|
if ($email == 'noreply@asong2u.com') :*/
|
||||||
|
|||||||
@ -61,9 +61,9 @@ if ($gp_settings['from_user_id'] == mar_get_user_id()) :
|
|||||||
$mark_as_read = mar_add_to_usermeta($post->ID);
|
$mark_as_read = mar_add_to_usermeta($post->ID);
|
||||||
$update_count = mar_increase_count($post->ID);
|
$update_count = mar_increase_count($post->ID);
|
||||||
endif;
|
endif;
|
||||||
$read_posts = mar_get_user_read_posts( mar_get_user_id() );
|
|
||||||
|
|
||||||
$gp_settings['unreaded'] = (!in_array($post->ID, $read_posts));
|
$read_posts = gp_get_unread_dedications( mar_get_user_id() );
|
||||||
|
$gp_settings['unreaded'] = (in_array($post->ID, $read_posts));
|
||||||
|
|
||||||
// to user
|
// to user
|
||||||
$gp_settings['to_user_id'] = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
|
$gp_settings['to_user_id'] = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user