[Tutorial] Ultimos visitantes no perfil

Ver o tópico anterior Ver o tópico seguinte Ir para baixo

Admin
Admin
Administrador
Tempo Online : 250d 6h 21m 59s
Mensagens : 693
Reputação : 4
https://bestweb.forumeiro.com

MensagemAdmin Seg Out 03, 2016 7:45 pm

Informações:
Autor:
JScript
Funcionalidade: Todas as versões




Acesse:
Painel de Controle Modulos HTML & Javascripts Gestão dos códigos javascripts
E Crie um novo javascript com investimento em todas as paginas com esse código:
Código:
/***
 * Application: LatestVisitors.js
 * Description: Shows the last 10 visitors to your profile!
 * Version: 0.02282015-jq1.9.1
 * RC1 (Release candidate 1!) - Tot (Imhotep-hwcp)
 * Author: JScript - 2015/02/28
 * Copyright (c) 2015 JScript <jscriptbrasil at live dot com>
 * This work is free. You can redistribute it and/or modify it
 * under the terms of the WTFPL, Version 2
 */
var lastVisit = {
 autor: "JScript",
 version: "1.02282015-jq1.9.1",
 codename: "Tot (Imhotep-hwcp)",

 observe: 100,
 startMsg: "Starting, wait...",
 noVisitors: "There are no visitors, your visit will appear in the next update!",

 initialize: function() {
 if (location.pathname.indexOf("/u") == -1) {
 return false;
 }
 var wrapper = setInterval(function() {
 if (typeof(_userdata) !== "undefined") {
 clearInterval(wrapper);
 if (_userdata.user_level == 0) {
 $('a[href*="wall"]:first').parent().hide();
 }
 if ((location.pathname.indexOf('wall') !== -1) && (_userdata.user_level !== 1)) {
 return location.pathname = location.pathname.split('wall')[0];
 }
 jQuery(function() {
 lastVisit.view();
 });
 }
 }, lastVisit.observe);
 },

 dataRead: function() {
 $.ajax({
 url: location.pathname + 'wall',
 cache: false,
 type: "get",
 dataType: "text",
 success: function(response, status, xhr) {
 if (xhr.status == 200) {
 var oTarget = $('#profile-advanced-details ol > li', response),
 content = '<ol style="margin-top: 0px; margin-bottom: 0px;">',
 oThis = null,
 oID = null,
 iFound = 0;

 if (oTarget.length) {
 for (i = 0, len = oTarget.length; i < len; i++) {
 oThis = $(oTarget[i]);
 content += '<li class="clearfix">' + oThis.html() + '</i>'; //.prop('outerHTML');
 oID = oThis.find('.message-header a');
 if (oID.attr('href') == ("/u" + _userdata.user_id)) {
 iFound = 1;
 
 }
 }
 $("#lastvisit").html(content + '</ol>');
 if (_userdata.user_level > 0) {
 $('#lastvisit .message-footer').show();
 }
 $('#lastvisit .message-text').remove();
 } else {
 $("#lastvisit").html('<br>' + lastVisit.noVisitors);
 }

 var user_id = Number(location.pathname.split('u')[1]);

 if ((user_id !== _userdata.user_id) && (!iFound)) {
 $.get('/privmsg?mode=post_profile&u=' + user_id, function(data) {
 $.post("/privmsg", {
 mode: "post_profile",
 folder: "profile",
 username: $('input[name="username"]', data).val(),
 subject: "last_visit",
 message: "last_visit",
 lt: "",
 post: 1,
 }, function(e) {
 // OK!
 });
 });
 }
 }
 }
 });
 },

 view: function() {
 var style = document.createElement("style");

 style.type = "text/css";
 style.innerHTML =
 '#lastvisit ol {\n' +
 '  padding-left: 0;\n' +
 '}\n' +
 '#lastvisit li {\n' +
 '  border-bottom: 1px solid #d5dde5;\n' +
 '  margin-bottom: 4px;\n' +
 '  list-style: none;\n' +
 '}\n' +
 '#lastvisit .avatar {\n' +
 '  max-width: 30px;\n' +
 '  max-height: 30px;\n' +
 '  float: left;\n' +
 '  margin-right: 6px;\n' +
 '}\n' +
 '#lastvisit .avatar img {\n' +
 '  height: 30px !important;\n' +
 '  width: 30px !important;\n' +
 '}\n' +
 '#lastvisit .message-block {\n' +
 '  margin-bottom: 4px;\n' +
 '}\n' +
 '#lastvisit .message-date {\n' +
 '  float: right;\n' +
 '}\n' +
 '#lastvisit .message-text {\n' +
 '  display: none;\n' +
 '}\n' +
 '#lastvisit .message-header > img, #lastvisit .message-header > em  {\n' +
 '  display: none;\n' +
 '}\n' +
 '#lastvisit .message-header {\n' +
 '  color: transparent;\n' +
 '  padding: 2px;\n' +
 '}\n' +
 '#lastvisit .message-header > a {\n' +
 '  float: left;\n' +
 '}\n' +
 '#lastvisit .message-footer {\n' +
 '  display: none;\n' +
 '  float: right;\n' +
 '}\n' +
 '#lastvisit .message-text {\n' +
 '  display: none;\n' +
 '}\n' +
 '#lastvisit .message-date {\n' +
 '  color: #333333;\n' +
 '  float: right;\n' +
 '}\n' +
 '#lastvisit .message-footer li:not(.last) {\n' +
 '  display: none;\n' +
 '}\n' +
 '#lastvisit .message-footer a {\n' +
 '  color: #cdcdcd;\n' +
 '  text-decoration: none;\n' +
 '}\n' +
 '#lastvisit li.last {\n' +
 '  border-bottom: none;\n' +
 '}\n' +
 '#lastvisit {\n' +
 '  left: 0;\n' +
 '  right: 0;\n' +
 '}\n' +
 '#lastvisit div.clearfix {\n' +
 '  display: none;\n' +
 '}\n';
 document.getElementsByTagName("head")[0].appendChild(style);

 var forumline = "forumline";
 if ($('#phpbb').length) {
 forumline = "phpbb3"
 }
 $('table[cellpadding="1"] > tbody > tr:last > td:last > .forumline:first, #profile-advanced-right .module:first').after(
 '<!-- All-in-one: phpbb2, phpbb3, punbb & invision! -->\n' +
 '<div style="margin-bottom:4px;" class="module main borderwrap">\n' +
 ' <table width="100%" cellspacing="1" cellpadding="0" border="0" class="' + forumline + '">\n' +
 ' <tbody>\n' +
 ' <tr>\n' +
 ' <td class="catLeft">\n' +
 ' <div class="inner main-head maintitle genmed module-title">\n' +
 ' <div class="h3">\n' +
 ' <h3 style="border-bottom: 0px none; padding-bottom: 0px; margin-bottom: 0px; margin-top: 0px;">\n' +
 ' <strong>Latest Visitors</strong>\n' +
 ' </h3>\n' +
 ' </div>\n' +
 ' </div>\n' +
 ' </td>\n' +
 ' </tr>\n' +
 ' <tr>\n' +
 ' <td align="center" class="row1 gensmall">\n' +
 ' <div class="inner main-head main-content clearfix box-content profile center" style="min-height: 50px;">\n' +
 ' <span class="corners-top"><span></span></span>\n' +
 ' <div id="lastvisit">' + lastVisit.startMsg + '</div>\n' +
 ' <span class="corners-bottom"><span></span></span>\n' +
 ' </div>\n' +
 ' </td>\n' +
 ' </tr>\n' +
 ' </tbody>\n' +
 ' </table>\n' +
 '</div>\n'
 );

 lastVisit.dataRead();
 }
};

lastVisit.initialize();

Ver o tópico anterior Ver o tópico seguinte Ir para o topo

Cria uma conta ou logue para postar uma mensagem.

Você precisa ser um membro, para poder postar uma resposta.

Criar conta

Participe de nossa comunidade, basta se registrar. É Fácil!


Criar uma conta

Logar

Já tem uma conta? Sem problemas, Logue agora.


Logar-se

 
Permissões neste sub-fórum
Não podes responder a tópicos