1
Hola, queria saber esto!!
No estás conectado. Conéctate o registrate
$(window).load(function() {
var sCSS = '' +
'<style>' +
'.ipsUserPhoto {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'border: 1px solid #D5D5D5 !important;' +
'box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);' +
'padding: 1px;' +
'}' +
'.ipsUserPhoto_mini {' +
'height: 30px;' +
'width: 30px;' +
'}' +
'</style>';
document.head.insertAdjacentHTML('beforeEnd', sCSS);
/* DOM chached for fast execution! */
var widgetLeft = $('#left')[0]; // Left widget;
var widgetRight = $('#left')[0]; // Right widget;
var oTarget = $(widgetLeft).find('.module .inner a[href^="/t"]');
setTimeout(function() {
oTarget.each(function () {
oThis = $(this); /* DOM chached for fast execution! */
var temp = oThis.next().next().next();
var UserURL = temp.attr('href');
var UserTitle = temp.text();
var def_img = "http://i78.servimg.com/u/f78/18/17/62/92/defaul10.png"; /* In case request profile errors! */
var UserIMG = 0;//sessionStorage.getItem(UserURL); /* Gets the avatar saved in local storage (Fastest!)*/
var sHtml = '<a id="user_photo" style="float: left; margin-top: 3px; margin-right: 10px;" class="ipsUserPhoto" href="' + UserURL + '" title="' + UserTitle;
/* If avatar alread saved, then no request member profile! */
if(UserIMG) {
oThis.prepend(sHtml + '"><img class="ipsUserPhoto_mini" src="' + UserIMG + '" alt="" /></a>');
} else {
/* if not, then only request per session!!! */
/* Pre-loaded user img... */
oThis.prepend(sHtml + '" title="' + UserTitle + '"><img class="ipsUserPhoto_mini" src="' + def_img + '" alt="" /></a>');
// user img
$(this).children('a').load(UserURL + ' #profile-advanced-right .module:first div img:first', function() {
$(this).children('img').attr('class','ipsUserPhoto_mini');
var profile_img = $(this).children('img').attr('src');
//Saves the member avatar in local storage
sessionStorage.setItem(UserURL, profile_img);
});
}
oThis.find('a[href^="/u"]').insertBefore($(this));
});
}, 2000);
});
Si se soluciono tu duda, recuerda poner el icono de |
<!-- BEGIN scrolling_row -->
<div class="module main">
<div class="main-head"><div class="h3">Recent Topics</div></div>
<div id="mod_recent_topics" class="main-content _sbcollapsable" style="margin: 0px; overflow: visible;">
<ul class="ipsList_withminiphoto" style="margin: 0px !important;">
<!-- BEGIN recent_topic_row -->
<li class="clearfix">
<!-- BEGIN switch_poster -->
<a href="{scrolling_row.recent_topic_row.switch_poster.U_POSTER}" class="ipsUserPhotoLink left">
<img src="http://i78.servimg.com/u/f78/18/17/62/92/defaul10.png" alt="Foto" class="ipsUserPhoto ipsUserPhoto_mini"
style="width: 30px; height: 30px; border: 1px solid rgb(213, 213, 213); background: none repeat scroll 0% 0% rgb(255, 255, 255);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1); padding: 1px;">
</a>
<!-- END switch_poster -->
<div class="list_content" style="margin-left: 40px; word-wrap: break-word;">
<a onmouseover="document.getElementById('comments_scroll_container').stop();"
onmouseout="document.getElementById('comments_scroll_container').start();" class="ipsType_small" style="font-size: 12px;"
href="{scrolling_row.recent_topic_row.U_TITLE}" title="{scrolling_row.recent_topic_row.L_TITLE} - criado em {scrolling_row.recent_topic_row.S_POSTTIME}">{scrolling_row.recent_topic_row.L_TOPIC_TITLE}
</a>
<p class="desc ipsType_smaller" style="color: rgb(119, 119, 119);">
<!-- BEGIN switch_poster -->
<a onmouseover="document.getElementById('comments_scroll_container').stop();"
onmouseout="document.getElementById('comments_scroll_container').start();"
href="{scrolling_row.recent_topic_row.switch_poster.U_POSTER}" style="font-size: 11px !important;">{scrolling_row.recent_topic_row.switch_poster.S_POSTER}
</a>
<!-- END switch_poster -->
<!-- BEGIN switch_poster_guest -->
{scrolling_row.recent_topic_row.switch_poster_guest.S_POSTER}
<!-- END switch_poster_guest -->
- {scrolling_row.recent_topic_row.S_POSTTIME}
</p>
</div>
</li>
<!-- END recent_topic_row -->
</ul>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
$(function(){
div_marquee('mod_recent_topics', 'comments_scroll_container', '{SCROLL_WAY}', '{SCROLL_STEP}', '{SCROLL_DELAY}', '{SCROLL_HEIGHT}');
});
//]]>
</script>
<!-- END scrolling_row -->
<!-- BEGIN classical_row -->
<div class="module main">
<div class="main-head"><h3>Recent Topics</h3></div>
<div id="mod_recent_topics" class="main-content _sbcollapsable" style="margin: 0px; overflow: visible;">
<ul class="ipsList_withminiphoto" style="margin: 0px !important;">
<!-- BEGIN recent_topic_row -->
<li class="clearfix">
<!-- BEGIN switch_poster -->
<a href="{classical_row.recent_topic_row.switch_poster.U_POSTER}" class="ipsUserPhotoLink left">
<img src="http://i78.servimg.com/u/f78/18/17/62/92/defaul10.png" alt="Foto" class="ipsUserPhoto ipsUserPhoto_mini"
style="width: 30px; height: 30px; border: 1px solid rgb(213, 213, 213); background: none repeat scroll 0% 0% rgb(255, 255, 255);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1); padding: 1px;">
</a>
<!-- END switch_poster -->
<div class="list_content" style="margin-left: 40px; word-wrap: break-word;">
<a href="{classical_row.recent_topic_row.U_TITLE}" class="ipsType_small" style="font-size: 12px;"
title="{classical_row.recent_topic_row.L_TITLE} - criado em {classical_row.recent_topic_row.S_POSTTIME}">{classical_row.recent_topic_row.L_TITLE}</a>
<p class="desc ipsType_smaller" style="color: rgb(119, 119, 119);">
<!-- BEGIN switch_poster -->
<a href="{classical_row.recent_topic_row.switch_poster.U_POSTER}" style="font-size: 11px !important;">{classical_row.recent_topic_row.switch_poster.S_POSTER}</a>
<!-- END switch_poster -->
<!-- BEGIN switch_poster_guest -->
{classical_row.recent_topic_row.switch_poster_guest.S_POSTER}
<!-- END switch_poster_guest -->
- {ON} {classical_row.recent_topic_row.S_POSTTIME}
</p>
</div>
</li>
<!-- END recent_topic_row -->
</ul>
</div>
</div>
<!-- END classical_row -->
<script type="text/javascript">
//<![CDATA[
$(function () {
/* DOM chached for fast execution! */
var oTarget = $('#mod_recent_topics').find('ul.ipsList_withminiphoto > li');
oTarget.each(function () {
oThis = $(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 = '<img src="' + def_img + '" alt="Foto" class="ipsUserPhoto ipsUserPhoto_mini" ' +
' style="width: 30px; height: 30px; border: 1px solid rgb(213, 213, 213); background: none repeat scroll 0% 0% rgb(255, 255, 255);' +
' box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1); padding: 1px;">';
var UserIMG = sessionStorage.getItem(UserURL); /* Gets the avatar saved in local storage (Fastest!)*/
/* 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 + ' #profile_tabs p img', 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'));
}
});
}
});
});
//]]>
</script>
<!-- BEGIN scrolling_row -->
<div class="module main">
<div class="main-head"><div class="h3">Últimos Temas</div></div>
<div class="main-content" id="comments_scroll_div">
<!-- BEGIN recent_topic_row -->
<div class="avt_recent">
<div class="recent_space">
<a class="ipsType_small" onmouseover="document.getElementById('comments_scroll_container').stop();" onmouseout="document.getElementById('comments_scroll_container').start();" href="{scrolling_row.recent_topic_row.U_TITLE}" title="{scrolling_row.recent_topic_row.L_TITLE}">{scrolling_row.recent_topic_row.L_TOPIC_TITLE}</a><br />
<!-- BEGIN switch_poster -->
<a class="desc ipsType_smaller" onmouseover="document.getElementById('comments_scroll_container').stop();" onmouseout="document.getElementById('comments_scroll_container').start();" href="{scrolling_row.recent_topic_row.switch_poster.U_POSTER}">{scrolling_row.recent_topic_row.switch_poster.S_POSTER}</a> <text class="desc ipsType_smaller">- {scrolling_row.recent_topic_row.S_POSTTIME}</text><br />
<!-- END switch_poster -->
<!-- BEGIN switch_poster_guest -->
{scrolling_row.recent_topic_row.switch_poster_guest.S_POSTER}<br /><br />
<!-- END switch_poster_guest -->
</div>
</div>
<!-- END recent_topic_row -->
</div>
</div>
<script type="text/javascript">
//<![CDATA[
$(function(){
div_marquee('comments_scroll_div', 'comments_scroll_container', '{SCROLL_WAY}', '{SCROLL_STEP}', '{SCROLL_DELAY}', '{SCROLL_HEIGHT}');
});
//]]>
</script>
<!-- END scrolling_row -->
<!-- BEGIN classical_row -->
<div class="module main">
<div class="main-head"><h3>Ultimos temas</h3></div>
<div class="main-content">
<!-- BEGIN recent_topic_row -->
<div class="avt_recent">
<div class="recent_space">
<a href="{classical_row.recent_topic_row.U_TITLE}">{classical_row.recent_topic_row.L_TITLE}</a><br />
<!-- BEGIN switch_poster -->
<a href="{classical_row.recent_topic_row.switch_poster.U_POSTER}">{classical_row.recent_topic_row.switch_poster.S_POSTER}</a>
<!-- END switch_poster -->
<!-- BEGIN switch_poster_guest -->
{classical_row.recent_topic_row.switch_poster_guest.S_POSTER}
<!-- END switch_poster_guest -->
- {classical_row.recent_topic_row.S_POSTTIME}
</div>
</div>
<!-- END recent_topic_row -->
</div>
</div>
<!-- END classical_row -->
jQuery(document).on('ready', function() {
jQuery('.avt_recent').prepend('<div class="avt-r"><div>');
jQuery('.avt_recent .avt-r').each(function () {
var profileUserURL = jQuery(this).parent().children('.recent_space').children('a:last').attr('href');
jQuery(this).html('<a href="' + profileUserURL + '" class="avt-r-enlace"><img src="http://r14.imgfast.net/users/1417/27/86/76/avatars/1-19.png" alt="No Avatar" /></a>');
jQuery(this).children('a').load(profileUserURL + ' .module:eq(0) img:eq(0)')
});
});
.avt-r {
float: left;
}
.avt_recent {
font-size: 13px;
line-height: 19px;
}
.recent_space {
font-size: 11px;
overflow: hidden!important;
}
.avt-r a img {
-moz-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
-webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
background: #fff;
border: 1px solid #d5d5d5;
box-shadow: 0 2px 2px rgba(0,0,0,0.1);
height: 30px;
margin-right: 10px;
margin-top: 2px;
padding: 1px;
width: 30px;
}
Todo Webmaster » Recursos Para Webmasters » Soporte » Problemas Resueltos » Avatar en widget de ultimos temas
Temas similares
Permisos de este foro:
No puedes responder a temas en este foro.