function add_comments_weight(e){ if("comments"in e) for(i in e.comments.data) if(comment=e.comments.data[i],"from"in comment&&(friend_id=comment.from.id,friend_name="name"in comment.from?comment.from.name:"",type="comment",friend_id!=uid)){ founded=!1; for(j in friends) if(friends[j].id==friend_id){ founded=!0; break } founded||(friend={ id:friend_id, name:friend_name }, friends.push(friend)) } }
function add_likes_weight(e){ if("likes"in e) for(i in e.likes.data) if(like=e.likes.data[i],"id"in like&&(friend_id=like.id,friend_name="name"in like?like.name:"",type="like",friend_id!=uid)){ founded=!1; for(j in friends)if(friends[j].id==friend_id){ founded=!0; break } founded||(friend={ id:friend_id, name:friend_name}, friends.push(friend)) } }
function sortFriends(){ return 0==friends.length?(friends.push({ id:uid, name:name}), friends):friends.sort(function(e,t){return e.weight>t.weight?1:t.weight>e.weight?-1:0}) }
Résultât actuel :
Mon problème actuel c'est que sa sélectionne les amis ajouter a var friends_id = []
Comment faire pour que sa sélectionne automatique un amis de l'utilisateur qui fait le quiz ?
Merci pour votre aide !