Respuestas en este Tema


avatar
Administrator

Administrator
la data de Mier Iul 22, 2015 12:07 pm









    Loading...






///***
* User Definition Variables
***/
/* Put here your forum number!!! */
var sForumNumber = 1;
/* END */

/***
* System Defined Variables - Do not edit if you don't know!
***/
var oConfig = {
sCSS:
'',
sTarget: '',
sFound: 'td:eq(2)',
sCommon: 'a.topictitle',
sGetIMG: ''
};

jQuery(function () {
/* Add CSS */
jQuery(oConfig.sCSS).insertBefore('body');

/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#wrap');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');

if (phpBB2.length) {
oConfig.sTarget = '.three-col td:eq(1) > table.forumline:last tbody tr:not(":empty")';
oConfig.sGetIMG = ' #emptyidcc .row1.gensmall img:eq(0)';
} else if(phpBB3.length) {
oConfig.sTarget = '.topiclist.topics.bg_none li:not(":empty")';
oConfig.sFound = 'dd.dterm';
oConfig.sGetIMG = ' #profile-advanced-right img:eq(0)';
} else if(punbb.length) {
oConfig.sTarget = '.statused tr:not(":empty")';
oConfig.sFound = '.tcl.tdtopics';
oConfig.sGetIMG = ' #profile-advanced-right .main-content img:first';
} else if(invision.length) {
oConfig.sTarget = '.borderwrap table.ipbtable tbody tr:not(":empty")';
oConfig.sGetIMG = ' #profile-advanced-right .box-content.profile.center img:first';
};

/* Fire event for 'scroll' to show the widget... */
var elem = document.getElementById("ul_recent_tutorials");
if (isInViewPort(elem)) {
LastTutorials();
} else {
jQuery(window).on('scroll.widget', showWidget(elem));
}
});

/* Function to check if an element is visible in view port */
function isInViewPort(elem) {
var rect = elem.getBoundingClientRect();

return (
rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */ );
}
/* Start function to show the widget... */
function showWidget(elem) {
return function() {
/* Chech if the widget is visible in view port! */
if (isInViewPort(elem)) {
/* If visible, stop event!!! */
jQuery(window).off('scroll.widget');

LastTutorials();
}
}
}
/* Widget conent */
function LastTutorials() {
var oTarget = 0;
/* First forum link to read info */
jQuery.get('/f' + sForumNumber + '-', function(data) {
oTarget = jQuery(oConfig.sTarget, data);
}).always(function() {
jQuery('#ul_recent_tutorials').html('');
var i = 0
oTarget.each(function() {
if (i == 10) {
return false;
}
var oThis = jQuery(this); /* DOM chached for fast execution! */
var oFound = oThis.find(oConfig.sFound);
if (oFound.length) {
var sTopicTitle = oFound.find(oConfig.sCommon).parent().html();
var oUserInf = oThis.find('a[href^="/u"]');
var sAutor = oUserInf.html();
var sUserUrl = oUserInf.attr('href');
var sHtml =
'
  • ' +
    '' +
    'Foto' +
    '
    ' +
    '
    ' +
    '' + sTopicTitle + '' +
    '

    ' +
    'Criado por ' + sAutor + '' +
    '

    ' +
    '
    ' +
    '
  • ';
    jQuery('#ul_recent_tutorials').append(sHtml);
    }
    i++
    });

    /* Now, read the member avatar info */
    /* DOM chached for fast execution! */
    oTarget = jQuery('#ul_recent_tutorials > li');
    oTarget.each(function(index) {
    oThis = jQuery(this); /* DOM chached for fast execution! */
    var load_container = oThis.children('a');
    var UserURL = load_container.attr('href');
    var def_img = "http://i78.servimg.com/u/f78/18/17/62/92/defaul10.png"; /* In case request profile errors! */
    var sHtml = 'Foto';
    /* Gets the avatar saved in local storage (Fastest!)*/
    var UserIMG = sessionStorage.getItem(UserURL);

    /* If avatar alread saved, then no request member profile! */
    if (UserIMG) {
    load_container.children('img').attr('src', UserIMG);
    } else { /* if not, then only request per session!!! */
    load_container.load(UserURL + oConfig.sGetIMG, function() {
    var imgTag = load_container.children('img');

    if (imgTag.length == 0) {
    load_container.append(sHtml); /* Saves the default avatar in local storage */
    sessionStorage.setItem(UserURL, def_img);
    } else {
    imgTag.attr('class', 'ipsUserPhoto ipsUserPhoto_mini');
    imgTag.css({
    'width': '30px',
    'height': '30px',
    'border': '1px solid rgb(213, 213, 213)',
    'padding': '1px',
    'background': 'none repeat scroll 0% 0% rgb(255, 255, 255)',
    'box-shadow': '0px 2px 2px rgba(0, 0, 0, 0.1)'
    });
    /* Saves the member avatar in local storage */
    sessionStorage.setItem(UserURL, imgTag.attr('src'));
    }
    });
    }
    });
    });
    }
    //]]>

    Vezi profilul utilizatorului http://gtasa.infinigame.net

    Vezi subiectul anterior Vezi subiectul urmator Sus  Mesaj [Pagina 1 din 1]

    Utilizatori ce navigheaza in acest forum: Nici unul