![](http://img.freeforumzone.it/upload/878401_prova 14.jpg)
";
}
else {
s += "
";
}
s += p.Username;
if (add_userffz && p.UsernameFFZ != p.Username) {
s += "
";
s += p.UsernameFFZ;
s += "
";
}
}
else {
s += p.Username;
}
return s;
}
var UTS = [];
var UTSc = 0;
function UTSelect(id, idu, url, username) {
var s = $("#HidInvitaUtentiList").val();
if (UTS[idu] == 1) {
UTSc--;
UTS[idu] = 0;
$(".uo-idu-" + idu).css({ "opacity": "1" });
$(".uo-username-idu-" + idu).remove();
s = s.replace("," + idu + ",", "");
}
else {
var limit = 10;
if (ffz_idr >= 150) limit = 100;
if (UTSc >= limit) {
alert("Puoi scegliere fino a " + limit + " utenti");
return;
}
UTSc++;
UTS[idu] = 1;
s = s.replace("," + idu + ",", "");
s = s + "," + idu + ",";
$(".uo-idu-" + idu).css({ "opacity": "0.2" });
var $ut = $("
");
$ut.css({ "cursor": "pointer", "margin-right": "10px" });
$ut.addClass("uo-username-idu-" + idu);
$ut.attr("data-id", id);
$ut.attr("data-idu", idu);
$ut.attr("data-url", url);
$ut.click(function () {
var idu = $(this).attr("data-idu");
UTSelect($(this).attr("data-id"), idu, '', '');
});
$ut.html(username);
$ut.appendTo($("#DivInvitaUtentiList"));
$("#DivInvitaUtentiList").append(" ");
$ut = $("");
$ut.css({ "margin-right": "10px" });
$ut.addClass("uo-username-idu-" + idu);
$ut.attr("data-id", id);
$ut.attr("data-idu", idu);
$ut.attr("data-url", url);
$ut.html(username);
$ut.appendTo($("#DivInvitaUtentiListBG"));
$("#DivInvitaUtentiListBG").append(" ");
}
$("#HidInvitaUtentiList").val(s);
}
function strip(html) {
var tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
}
function InvitaUtentiSearch() {
var s = SERVICE_BASE;
s = s.replace("b.", "search.");
s = s.replace(":8081", ":8082");
var fmSearch = $("#TargetSearch").val();
StartTargetLoader();
$.getJSON(s + 'forumutentisearch.ashx?a=0&idf=' + fmIDF + '&panel=0&cc=' + fmSearch + '&ps=50&s=' + STREAM + '&idu=' + UTENTE + '&tk=' + TOKEN + '&tku=' + TOKENUPDATE + '&jsoncallback=?',
function (data) {
if (data.ERROR || data.auth_error) {
StopTargetLoader();
return;
}
$('#DivTargetList').html("");
if (data.UtentiSearchList) {
if (data.UtentiSearchList.length > 0) {
$.each(data.UtentiSearchList, function (i, p) {
var username = PrintUsername(p, false, false, 10);
var div = $("");
var div_1 = $("
"); div_1.appendTo(div);
if (UTS[p.IDUTENTE] == 1) {
div.css({ "opacity": "0.2" });
}
var usr = strip(username.replace("\"", "'"));
//div_1.prop("href", "javascript:UTSelect('av" + i + "', " + p.IDUTENTE + ",'" + p.UrlScheda + "',\""+usr+"\");");
div_1.prop("href", "javascript:void(0)");
div_1.click(function () { UTSelect('av' + i, p.IDUTENTE, '" + p.UrlScheda + "', usr); });
var div_1a = $(""); div_1a.appendTo(div_1);
div_1a.attr("style", "background-image:url('" + p.Avatar + "');");
var div_2 = $("
");
div_2.html(username);
div_2.appendTo(div);
div.appendTo($("#DivTargetList"));
});
}
}
$("#TargetSearch").focus();
StopTargetLoader();
});
}