}
#smiles {
+ text-align: center;
border: 1px solid;
border-color: #253f18;
background-color: #0c2003;
margin-bottom: 15px;
padding-left: 10px;
}
+
+#page.minichat form p {
+ margin: 0px;
+ padding: 0px;
+}
+
#page.minichat form .pseudo {
margin-right: 5px;
width: 12%
background-repeat: no-repeat;
background-position: 5px 2px;
vertical-align: top;
- margin-right: 5px;
+ margin-right: 5px;
}
#page.minichat form .smiles {
height: 16px;
background-repeat: no-repeat;
background-position: 2px 2px;
vertical-align: top;
+ margin-right: 5px;
}
/* voir pour l'astuce css "float left" des conversations : http://www.quirksmode.org/css/clearing.html */
Trolls.prototype.modifier = function(id, content)
{
+ var thisTrolls = this
+
var dataToSend =
{
"action" : "mod_troll",
;;; dumpObj(data)
if (data["reply"] == "error")
{
- thisPageAdmin.util.messageDialogue(data["error_message"])
+ thisTrolls.util.messageDialogue(data["error_message"])
}
}
}
*/
Trolls.prototype.supprimer = function(id)
{
+ var thisTrolls = this
+
var dataToSend =
{
"action" : "del_troll",
;;; dumpObj(data)
if (data["reply"] == "error")
{
- thisPageAdmin.util.messageDialogue(data["error_message"])
+ thisTrolls.util.messageDialogue(data["error_message"])
}
}
}
case "troll_deleted" :
$("#trolls #troll"+data["troll_id"]).remove()
break
+ case "error" :
+ thisTrolls.util.messageDialogue(data["error_message"])
+ break
}
}
)
function(e)
{
var userId = parseInt($(this).attr("id").substr(4))
- var element = $(e.target)
+ var element = $(this)
var h = element.height()
var offset = element.offset()
var outils = $("#outilsBan").css("top", offset.top - 2).css("left", offset.left - 2).height(h < 16 ? 16 : h).width(element.width() + 16 * 3 + 4 + 64).show()
update_date_derniere_connexion/1,
update_ip/2,
update_pseudo_user/2,
- users/0,
+ print_users/0,
+ print_users/1,
user_by_cookie/1,
user_by_id/1,
user_by_login/1,
end
).
-
-% Renvoie tous les users.
-users() ->
+
+% Affiche N user trié par leur date de dernière connexion.
+% Attention : pas d'index sur ce champs (la date)
+print_users(N) ->
resultat_transaction(mnesia:transaction(fun() ->
- e(q([E || E <- mnesia:table(user)]))
- end)).
+ C = cursor(q([E || E <- qlc:keysort(9, mnesia:table(user), [{order, descending}])])),
+ Users = qlc:next_answers(C, N),
+ lists:foreach(
+ fun(U) ->
+ #user{id = Id, pseudo = Pseudo, login = Login, ek_master = Ek_master, date_derniere_connexion = Date} = U,
+ {{Annee, Mois, Jour}, {Heure, Min, _}} = calendar:now_to_local_time(Date),
+ io:format(
+ "~4w : ~10.10..s~10.10..s ~2w.~2.2.0w.~w - ~2wh~2.2.0w~n",
+ [
+ Id,
+ if Ek_master -> "*"; true -> "" end ++ Pseudo,
+ "(" ++ Login ++ ")",
+ Jour, Mois, Annee, Heure, Min
+ ]
+ )
+ end,
+ Users
+ ),
+ qlc:delete_cursor(C)
+ end)).
+
+
+% Affiche tous les users.
+print_users() ->
+ print_users(all_remaining).
% Est-ce qu'un utilisateur existe en fonction de son cookie ?
)).
-% Renvoie tous les trolls.
+% Renvoie tous les trolls
trolls() ->
resultat_transaction(mnesia:transaction(
fun() ->