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(
|
||||
'post_status' => array('publish', 'private'),
|
||||
'numberposts' => -1,
|
||||
'numberposts' => 10,
|
||||
'category' => get_cat_id('dedication'),
|
||||
'author' => $user_id
|
||||
);
|
||||
@ -33,7 +33,7 @@ function bp_dedication_get_dedications_to_user( $user_id ) {
|
||||
|
||||
$args = array(
|
||||
'post_status' => array('publish', 'private'),
|
||||
'numberposts' => -1,
|
||||
'numberposts' => 10,
|
||||
'category' => 'dedication',
|
||||
'meta_key' => 'ghostpool_destination_user_id',
|
||||
'meta_value' => $user_id
|
||||
|
||||
@ -52,6 +52,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php $from_dedications = NULL; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php $from_dedications = NULL; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
|
||||
@ -7,44 +7,6 @@ get_currentuserinfo();
|
||||
?>
|
||||
|
||||
<?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';
|
||||
$args = array(
|
||||
"cat" => $gp_settings['cats'],
|
||||
|
||||
@ -44,7 +44,7 @@ function gp_ajax_video_data() {
|
||||
$args = array(
|
||||
'post_type' => array('post'),
|
||||
'orderby' => $dedication_orderby,
|
||||
'posts_per_page' => -1,
|
||||
'posts_per_page' => 10,
|
||||
'post_status' => $post_status,
|
||||
'category_name' => $category_name,
|
||||
);
|
||||
@ -53,6 +53,7 @@ function gp_ajax_video_data() {
|
||||
$i = 0;
|
||||
|
||||
$listavideos = new WP_Query($args);
|
||||
|
||||
while ($listavideos->have_posts()) {
|
||||
$listavideos->the_post();
|
||||
require(dirname(__FILE__).'/../../loop-dedication-data.php');
|
||||
@ -94,6 +95,7 @@ function gp_ajax_video_data() {
|
||||
break;
|
||||
}
|
||||
wp_reset_postdata();
|
||||
$listavideos = NULL;
|
||||
|
||||
$salida = '';
|
||||
foreach($array as $video) {
|
||||
@ -117,6 +119,7 @@ function gp_ajax_video_data() {
|
||||
|
||||
$salida .= '</li>';
|
||||
}
|
||||
$array = NULL;
|
||||
|
||||
echo json_encode($salida);
|
||||
|
||||
|
||||
@ -64,6 +64,7 @@ endif;
|
||||
|
||||
$read_posts = gp_get_unread_dedications( mar_get_user_id() );
|
||||
$gp_settings['unreaded'] = (in_array($post->ID, $read_posts));
|
||||
$read_posts = NULL;
|
||||
|
||||
// to user
|
||||
$gp_settings['to_user_id'] = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user