Good art is a taste, good design is an opinion.


Come as guest, stay as family.
Board Index

Come as guest, stay as family.


You are not connected. Please login or register

Foto

[Archived] need code avatar in index and sub fourm



View previous topic View next topic Go down Message [Page 1 of 1]

1
Offline

  deaneo8

avatar
V.I.P. Member
V.I.P. Member
  • Description:





  • Information:
Forum:http://gamingnews.forumotion.co.uk/Version:PUNBB
Type:Request a codeTags:avatar,index,fourm

Powered by PunBB
Currently 0 users have thanked deaneo8 for this post:

2
OfflineOnline

  Van-Helsing

avatar
★Moderator★
★Moderator★
Hello,
Go to your ACP->Modules->Javascript Management then create a new javascript:

Title: What you want
Placement: In the homepage - In the subforums

and paste the following code javascript:

Code:

$(function(){
        if(!window.localStorage) return;
        // Default Avatar
        var default_avatar= 'http://illiweb.com/fa/invision/pp-blank-thumb.png';
        // Cache time here 24 h * 60 m * 60 s * 1000 ms of one day
        var caching_time= 24*60*60*1000;
        // Cache time when error 60 s * 1000 ms therefore one minute
        var caching_error= 60*1000;
        var set_avatar= function(id) {
        $('.mini_ava.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= {};
        $('dd.lastpost strong a.gensmall, .ipbtable tr td:last-child span strong a.gensmall, .table td.tcr strong a.gensmall, .forumline .row3.over strong a.gensmall').each(function(){
        to_replace[$(this).attr('href').substr(2)]= 1;
        $(this).closest('td,dd').prepend('<div class="mini_ava member'+$(this).attr('href').substr(2)+'"></div>');
        });
        for(i in to_replace)
        {
        set_avatar(i);
        };
        });

*Tip: This javascript contains local storage management to bypass the request limits.

After that go to your CSS Display->Colors-CSS Stylesheet Tab and add the following code:

Code:

.mini_ava{float:left}
.mini_ava img{width:30px;height:30px;margin:8px 5px;padding:1px;border:1px solid #D5D5D5;background:white;-webkit-box-shadow:0 2px 2px rgba(0,0,0,0.1);-moz-box-shadow:0 2px 2px rgba(0,0,0,0.1);box-shadow:0 2px 2px rgba(0,0,0,0.1)}
.mini_ava img:hover{border-color:#a1a1a1;-webkit-box-shadow:0 2px 2px rgba(0,0,0,0.2);-moz-box-shadow:0 2px 2px rgba(0,0,0,0.2);box-shadow:0 2px 2px rgba(0,0,0,0.2)}

Powered by PunBB
Currently 0 users have thanked Van-Helsing for this post:

3
OfflineOnline

  Van-Helsing

avatar
★Moderator★
★Moderator★
[aviso="Thread Archived"]Original poster seems to be inactive and did not respond within 7 days in this thread. Because of this, the topic has been Archived.

If you have further questions, please open a new topic.[/aviso]

Powered by PunBB
Currently 0 users have thanked Van-Helsing for this post:

4
Offline

  Sponsored content



Powered by PunBB
Currently 0 users have thanked Sponsored content for this post:

View previous topic View next topic Back to top Message [Page 1 of 1]


Topic URL's

URL
BBcode
HTML

Permissions in this forum:
You cannot reply to topics in this forum