Cambios para optimizar el uso de memoria
git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@185 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
parent
bd39132874
commit
1f505a5383
@ -18,7 +18,7 @@ function bp_dedication_get_dedications_from_user( $user_id ) {
|
|||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_status' => array('publish', 'private'),
|
'post_status' => array('publish', 'private'),
|
||||||
'numberposts' => -1,
|
'numberposts' => 10,
|
||||||
'category' => get_cat_id('dedication'),
|
'category' => get_cat_id('dedication'),
|
||||||
'author' => $user_id
|
'author' => $user_id
|
||||||
);
|
);
|
||||||
@ -33,7 +33,7 @@ function bp_dedication_get_dedications_to_user( $user_id ) {
|
|||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_status' => array('publish', 'private'),
|
'post_status' => array('publish', 'private'),
|
||||||
'numberposts' => -1,
|
'numberposts' => 10,
|
||||||
'category' => 'dedication',
|
'category' => 'dedication',
|
||||||
'meta_key' => 'ghostpool_destination_user_id',
|
'meta_key' => 'ghostpool_destination_user_id',
|
||||||
'meta_value' => $user_id
|
'meta_value' => $user_id
|
||||||
|
|||||||
@ -52,6 +52,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php $from_dedications = NULL; ?>
|
||||||
<?php wp_reset_postdata(); ?>
|
<?php wp_reset_postdata(); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -51,6 +51,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php $from_dedications = NULL; ?>
|
||||||
<?php wp_reset_postdata(); ?>
|
<?php wp_reset_postdata(); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,44 +7,6 @@ get_currentuserinfo();
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//$args = "cat=".$gp_settings['cats']."&caller_get_posts=1&orderby=$orderby&order=$order&gdsr_sort=$gdsr_sort&gdsr_order=$gdsr_order&paged=$paged&posts_per_page=-1";
|
|
||||||
/*
|
|
||||||
$args = array(
|
|
||||||
"cat" => $gp_settings['cats'],
|
|
||||||
"ignore_sticky_posts" => 1,
|
|
||||||
"orderby" => $orderby,
|
|
||||||
"order" => $order,
|
|
||||||
"paged" => $paged,
|
|
||||||
"posts_per_page" => -1
|
|
||||||
);
|
|
||||||
|
|
||||||
query_posts($args);
|
|
||||||
$urls_video = array();
|
|
||||||
$ids_descartados = array();
|
|
||||||
|
|
||||||
if (have_posts()) :
|
|
||||||
while (have_posts()) :
|
|
||||||
the_post();
|
|
||||||
include('loop-dedication-data.php');
|
|
||||||
|
|
||||||
// Usuario actual puede ver la dedicatoria?
|
|
||||||
if ($post->post_status == 'private') {
|
|
||||||
if (($current_user->ID != $gp_settings['from_user_id']) && ($current_user->ID != $gp_settings['to_user_id'])) {
|
|
||||||
$ids_descartados[] = $post->ID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($theme_homepage_not_repeat_videos) {
|
|
||||||
// Si la URL del video ya ha salido en una dedicatoria anterior, me la salto
|
|
||||||
if (in_array($gp_settings['video'], $urls_video)) {
|
|
||||||
$ids_descartados[] = $post->ID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$urls_video[] = $gp_settings['video'];
|
|
||||||
endwhile;
|
|
||||||
endif;*/
|
|
||||||
$orderby = 'rand';
|
$orderby = 'rand';
|
||||||
$args = array(
|
$args = array(
|
||||||
"cat" => $gp_settings['cats'],
|
"cat" => $gp_settings['cats'],
|
||||||
|
|||||||
@ -44,7 +44,7 @@ function gp_ajax_video_data() {
|
|||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => array('post'),
|
'post_type' => array('post'),
|
||||||
'orderby' => $dedication_orderby,
|
'orderby' => $dedication_orderby,
|
||||||
'posts_per_page' => -1,
|
'posts_per_page' => 10,
|
||||||
'post_status' => $post_status,
|
'post_status' => $post_status,
|
||||||
'category_name' => $category_name,
|
'category_name' => $category_name,
|
||||||
);
|
);
|
||||||
@ -53,6 +53,7 @@ function gp_ajax_video_data() {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$listavideos = new WP_Query($args);
|
$listavideos = new WP_Query($args);
|
||||||
|
|
||||||
while ($listavideos->have_posts()) {
|
while ($listavideos->have_posts()) {
|
||||||
$listavideos->the_post();
|
$listavideos->the_post();
|
||||||
require(dirname(__FILE__).'/../../loop-dedication-data.php');
|
require(dirname(__FILE__).'/../../loop-dedication-data.php');
|
||||||
@ -94,6 +95,7 @@ function gp_ajax_video_data() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
|
$listavideos = NULL;
|
||||||
|
|
||||||
$salida = '';
|
$salida = '';
|
||||||
foreach($array as $video) {
|
foreach($array as $video) {
|
||||||
@ -117,6 +119,7 @@ function gp_ajax_video_data() {
|
|||||||
|
|
||||||
$salida .= '</li>';
|
$salida .= '</li>';
|
||||||
}
|
}
|
||||||
|
$array = NULL;
|
||||||
|
|
||||||
echo json_encode($salida);
|
echo json_encode($salida);
|
||||||
|
|
||||||
|
|||||||
@ -64,6 +64,7 @@ endif;
|
|||||||
|
|
||||||
$read_posts = gp_get_unread_dedications( mar_get_user_id() );
|
$read_posts = gp_get_unread_dedications( mar_get_user_id() );
|
||||||
$gp_settings['unreaded'] = (in_array($post->ID, $read_posts));
|
$gp_settings['unreaded'] = (in_array($post->ID, $read_posts));
|
||||||
|
$read_posts = NULL;
|
||||||
|
|
||||||
// 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