View difference between Paste ID: LyZ6MZJn and sHnWCA4y
SHOW: | | - or go back to the newest paste.
1
function adder(user,list,add,st) {
2
	var o = user;
3
	
4
	o[6] = parseInt(o[6]);
5
	
6
	add ? (o[6] & 1 << list || (o[6] += 1 << list)) : (o[6] & 1 << list && (o[6] -= 1 << list));
7
	
8
	setTimeout(function () {
9
		ajax.post("al_friends.php", {
10
			act: "save_cats",
11
			uid: user[0],
12
			cats: o[6],
13
			hash: cur.userHash
14
		}, {
15
			onDone: function(){
16
				var el=document.querySelector(".left_label.inl_bl");
17
				el.innerHTML=el.innerHTML>=1?(el.innerHTML-0)+1:1;
18
			}
19
		});
20
	},st||0);
21
}
22
23
function itr(list,add){
24
	function fn(start){
25
		for(var i=start||0,len=cur.friendsList.all.length;i<len;i++){
26
			adder(cur.friendsList.all[i],list,add,i*50);
27
		}
28
	}
29
	fn();
30
}