Recent topic avatar
4 posters
Page 1 of 1
Recent topic avatar
Hello!
I tried the recent topic avatar by this guide, but something went wrong. A see the forumotion default avatar, not the avatar that the members chosen (or my deafult avatar) by their self. What can i do with this?
Here is my (test) forum: https://testhp.hungarianforum.com/ and i think this is Phpp2
I tried the recent topic avatar by this guide, but something went wrong. A see the forumotion default avatar, not the avatar that the members chosen (or my deafult avatar) by their self. What can i do with this?
Here is my (test) forum: https://testhp.hungarianforum.com/ and i think this is Phpp2
Fruzsi- Forumember
- Posts : 35
Reputation : 1
Language : Hungarian, English
Location : Hungary
Re: Recent topic avatar
Hello
Did you change on the code the default image with your default avatar image?
Did you change on the code the default image with your default avatar image?
Re: Recent topic avatar
Yes, here is de code in the script
- Code:
$(function(){
var style = document.createElement('STYLE'), css = '.mini_ava2>img{height:20px;margin-right:5px;width:20px;}';
style.type = 'text/css';
if (style.styleSheet) style.styleSheet.cssText = css;
else style.appendChild(document.createTextNode(css));
document.getElementsByTagName('HEAD')[0].appendChild(style);
if(!window.localStorage) return;
// Default avatar
var default_avatar= 'https://2img.net/u/3512/46/42/26/avatars/gallery/00010.jpg';
// Time of cache 24h*60m*60s*1000ms - one day
var caching_time= 24*60*60*1000;
// Time of cache in case of error 60s*1000ms - one minute
var caching_error= 60*1000;
var set_avatar= function(id) {
$('.mini_ava2.member'+id).html('<img src="'+get_avatar(id)+'" />');
};
var get_avatar= function(id) {
if(localStorage.getItem('t_ava'+id) < +new Date - caching_time || (localStorage.getItem('d_ava'+id)==default_avatar && localStorage.getItem('t_ava'+id) < +new Date - caching_error))
{
localStorage.setItem('d_ava'+id, default_avatar);
$.get('/u'+id, function (d){
localStorage.setItem('t_ava'+id,+new Date);
localStorage.setItem('d_ava'+id, $('#profile-advanced-right .module:first div img:first,.forumline td.row1.gensmall:first > img, .frm-set.profile-view.left dd img,dl.left-box.details:first dd img, .row1 b .gen:first img, .real_avatar img',d).first().attr('src')||default_avatar);
set_avatar(id);
});
}
return localStorage.getItem('d_ava'+id);
};
var to_replace= {};
$('#recentTopics a[href^="/u"]').each(function(){
to_replace[$(this).attr('href').substr(2)]= 1;
$(this).before('<span class="mini_ava2 member'+$(this).attr('href').substr(2)+'"></span>');
});
for(i in to_replace)
{
set_avatar(i);
};
});
Fruzsi- Forumember
- Posts : 35
Reputation : 1
Language : Hungarian, English
Location : Hungary
Re: Recent topic avatar
I guess you add to the template the code that the tutorial says
If your template is modified then try to put the default one to check if the bug is caused by your template modification
If your template is modified then try to put the default one to check if the bug is caused by your template modification
Re: Recent topic avatar
Yes i put it, and i try it. Now the all latest topics uses the original code without modifying.
This is te code in the mod_recent_topics:
This is te code in the mod_recent_topics:
- Code:
<div id="recentTopics">
<!-- BEGIN scrolling_row -->
{MARQUEE_JS_SRC}
<table class="forumline genmed" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="catLeft" height="25">
<span class="genmed module-title">{L_RECENT_TOPICS}</span>
</td>
</tr>
<tr>
<td class="row1" style="height:{SCROLL_HEIGHT}px;">
<div class="marquee" align="left" data-direction='{SCROLL_WAY}' data-duration='{SCROLL_DELAY}' data-pauseOnHover="true" style="overflow:hidden;height:{SCROLL_HEIGHT}px;">
<!-- BEGIN recent_topic_row -->
» <a href="{scrolling_row.recent_topic_row.U_TITLE}" title="{scrolling_row.recent_topic_row.L_TITLE}">{scrolling_row.recent_topic_row.L_TITLE}</a><br />
<img src="{ICON_TIME}" alt="" />{scrolling_row.recent_topic_row.S_POSTTIME} {BY}
<!-- BEGIN switch_poster -->
<a href="{scrolling_row.recent_topic_row.switch_poster.U_POSTER}">{scrolling_row.recent_topic_row.switch_poster.S_POSTER}</a><br /><br />
<!-- END switch_poster -->
<!-- BEGIN switch_poster_guest -->
{scrolling_row.recent_topic_row.switch_poster_guest.S_POSTER}<br /><br />
<!-- END switch_poster_guest -->
<!-- END recent_topic_row -->
</div>
</td>
</tr>
</table>
<script>
$(".marquee").marquee();
</script>
<!-- END scrolling_row -->
<!-- BEGIN classical_row -->
<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="catHead" height="25"><span class="genmed"><b><center>{L_RECENT_TOPICS}</center></b></span></td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">
<!-- BEGIN recent_topic_row -->
» <a href="{classical_row.recent_topic_row.U_TITLE}">{classical_row.recent_topic_row.L_TITLE}</a><br /><img src="{ICON_TIME}" alt="" />{BY}
<!-- 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 -->
{ON} {classical_row.recent_topic_row.S_POSTTIME}<br /><br />
<!--
<a href="{classical_row.recent_topic_row.U_POSTER}">{classical_row.recent_topic_row.S_POSTER}</a> {ON} {classical_row.recent_topic_row.S_POSTTIME}<br /><br />
-->
<!-- END recent_topic_row -->
</span></td>
</tr>
</table>
<!-- END classical_row -->
</div>
Fruzsi- Forumember
- Posts : 35
Reputation : 1
Language : Hungarian, English
Location : Hungary
Re: Recent topic avatar
No, same as the start.
Fruzsi- Forumember
- Posts : 35
Reputation : 1
Language : Hungarian, English
Location : Hungary
Re: Recent topic avatar
Hmm this is strange as I have just tested the code's on my forum and it works just fine.
Have you tried to turn off all the other JavaScripts and just run that one and make sure it turned on to all pages ?
I have a feeling there is a code you are already using that is messing this up your end.
Have you tried to turn off all the other JavaScripts and just run that one and make sure it turned on to all pages ?
I have a feeling there is a code you are already using that is messing this up your end.
Niko likes this post
Re: Recent topic avatar
I delete all JavaScript, and make again this, but doesn't work. I don't understand to, I think i let go this, but thanks for time and help <3.
Fruzsi- Forumember
- Posts : 35
Reputation : 1
Language : Hungarian, English
Location : Hungary
Re: Recent topic avatar
Did you publish teh modified template?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Recent topic avatar
Yes, I publish and I think yes, you marked solved, or/and take to the archive.
Fruzsi- Forumember
- Posts : 35
Reputation : 1
Language : Hungarian, English
Location : Hungary
Re: Recent topic avatar
Problem solved & topic archived.
|
Similar topics
» Replace avatar with topic image to recent topic widget
» Avatar problem in recent topic
» I want the avatar back to recent topic
» Avatar in the recent topics problem
» Avatar in recent topics widget phpbb3
» Avatar problem in recent topic
» I want the avatar back to recent topic
» Avatar in the recent topics problem
» Avatar in recent topics widget phpbb3
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum