var height_box = 30;
var dealySlider = 6000;
var sliderTimer;
$(function() {
var text = $('#window_port').height($('#window_port').children().size()*height_box);
sliderTimer = setInterval(loopNummber,dealySlider);
$('.wrapper_loop').hover(function(){
clearInterval(sliderTimer);
},function(){
sliderTimer = setInterval(loopNummber,dealySlider);
});
});
function loopNummber(){
var currentSlide = parseInt($('#window_port').data('current'));
currentSlide++;
if(currentSlide >= $('#window_port').children().size())
{
$('#window_port').css('top',+(currentSlide+2)*height_box);
$('#window_port').append($('#window_port').children().first().clone());
$('#window_port').children().first().remove();
currentSlide--;
}
$('#window_port').animate({top: -currentSlide*height_box},30).data('current',currentSlide);
}
$queryPostUser->from(UserPosts::tableName()." us_post")
->select('us_prof.user_id, us_prof.avatar, user.username, us_post.text, us_post.id, com_us.text as comment')
->leftJoin(UserProfile::tableName()." us_prof",'us_prof.user_id = us_post.id_user')
->leftJoin(User::tableName()." user",'user.id = us_post.id_user')
->leftJoin(Comments::tableName()." com_us",'com_us.id_post = us_post.id')
->where(['us_post.id_user' => Yii::$app->user->identity->getId()]);
$queryPostUser->from(UserPosts::tableName()." us_post")
->select('us_prof.user_id, us_prof.avatar, user.username, us_post.text, us_post.id')
->leftJoin(UserProfile::tableName()." us_prof",'us_prof.user_id = us_post.id_user')
->leftJoin(User::tableName()." user",'user.id = us_post.id_user')
->where(['us_post.id_user' => Yii::$app->user->identity->getId()]);