Ik3e™
Rank: Fondatori Mesaje : 130 Evadatii : 46148 Bani : 3 Data de inscriere : 06/06/2013
| Subiect: [Tutorial] Avatar ultimu post Mier Iun 19, 2013 1:45 pm | |
| Ca sa adaugati avatar la ultimele posturi urmariti pasi: 1.Intrati in : ACP-> Module -> JavaScript si puneti codun: - Cod:
-
$(function(){ if(!window.localStorage) return; // Avatar por defecto var default_avatar= 'http://2img.net/i/fa/invision/pp-blank-thumb.png'; // Tiempo de cache, aqui 24 h * 60 m * 60 s * 1000 ms entonces un día var caching_time= 24*60*60*1000; // Tiempo de cache de un error, ici 60 s * 1000 ms entonces un minuto 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); }; }); Si salvatil apoi adaugati in CSS - Cod:
-
.mini_ava { float: left; } .mini_ava img { width: 40px; height: 40px; margin: 0 5px; border-radius: 10px; transition: all 2s; -moz-transition: all 2s; -webkit-transition: all 2s; -o-transition: all 2s; } .mini_ava img:hover { width: 80px; height: 80px; } Iar pentru chenar inlocuiti index_box cu acest cod - Cod:
-
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">[color=#006699][font=Lucida Console][/font][/color] <tr>[color=#006699][font=Lucida Console][/font][/color] <td valign="bottom">[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN switch_user_logged_in -->[color=#006699][font=Lucida Console][/font][/color] <span class="gensmall">{LAST_VISIT_DATE}<br />[color=#006699][font=Lucida Console][/font][/color] {CURRENT_TIME}<br />[color=#006699][font=Lucida Console][/font][/color] </span>[color=#006699][font=Lucida Console][/font][/color] <!-- END switch_user_logged_in -->[color=#006699][font=Lucida Console][/font][/color] <div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>[color=#006699][font=Lucida Console][/font][/color] </td>[color=#006699][font=Lucida Console][/font][/color] <td class="gensmall" align="right" valign="bottom">[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN switch_user_logged_in -->[color=#006699][font=Lucida Console][/font][/color] <a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />[color=#006699][font=Lucida Console][/font][/color] <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />[color=#006699][font=Lucida Console][/font][/color] <!-- END switch_user_logged_in -->[color=#006699][font=Lucida Console][/font][/color] <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>[color=#006699][font=Lucida Console][/font][/color] </td>[color=#006699][font=Lucida Console][/font][/color] </tr>[color=#006699][font=Lucida Console][/font][/color] </table>[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN catrow --><!-- BEGIN tablehead --><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">[color=#006699][font=Lucida Console][/font][/color] <tr>[color=#006699][font=Lucida Console][/font][/color] <th colspan="4" nowrap="nowrap" width="100%" class="secondarytitle"> {catrow.tablehead.L_FORUM} </th>[color=#006699][font=Lucida Console][/font][/color] </tr>[color=#006699][font=Lucida Console][/font][/color] <!-- END tablehead -->[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN cathead -->[color=#006699][font=Lucida Console][/font][/color] <tr>[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN inc -->[color=#006699][font=Lucida Console][/font][/color] <td class="{catrow.cathead.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>[color=#006699][font=Lucida Console][/font][/color] <!-- END inc -->[color=#006699][font=Lucida Console][/font][/color] <td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">[color=#006699][font=Lucida Console][/font][/color] <h{catrow.cathead.LEVEL} class="hierarchy">[color=#006699][font=Lucida Console][/font][/color] <span class="cattitle">[color=#006699][font=Lucida Console][/font][/color] <a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>[color=#006699][font=Lucida Console][/font][/color] </span>[color=#006699][font=Lucida Console][/font][/color] </h{catrow.cathead.LEVEL}>[color=#006699][font=Lucida Console][/font][/color] </td>[color=#006699][font=Lucida Console][/font][/color] <td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>[color=#006699][font=Lucida Console][/font][/color] </tr>[color=#006699][font=Lucida Console][/font][/color] <!-- END cathead -->[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN forumrow -->[color=#006699][font=Lucida Console][/font][/color] <tr>[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN inc -->[color=#006699][font=Lucida Console][/font][/color] <td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>[color=#006699][font=Lucida Console][/font][/color] <!-- END inc -->[color=#006699][font=Lucida Console][/font][/color] <td class="{catrow.forumrow.INC_CLASS}" align="center" valign="middle">[color=#006699][font=Lucida Console][/font][/color] <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />[color=#006699][font=Lucida Console][/font][/color] </td>[color=#006699][font=Lucida Console][/font][/color] <td class="row1 over" colspan="{catrow.forumrow.INC_SPAN}" valign="top" width="100%" height="50">[color=#006699][font=Lucida Console][/font][/color] <h{catrow.forumrow.LEVEL} class="hierarchy">[color=#006699][font=Lucida Console][/font][/color] <span class="forumlink">[color=#006699][font=Lucida Console][/font][/color] <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a><br />[color=#006699][font=Lucida Console][/font][/color] </span>[color=#006699][font=Lucida Console][/font][/color] </h{catrow.forumrow.LEVEL}>[color=#006699][font=Lucida Console][/font][/color] <span class="genmed">{catrow.forumrow.FORUM_DESC}</span>[color=#006699][font=Lucida Console][/font][/color] <span class="gensmall">[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN switch_moderators_links -->[color=#006699][font=Lucida Console][/font][/color] {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}[color=#006699][font=Lucida Console][/font][/color] <!-- END switch_moderators_links -->[color=#006699][font=Lucida Console][/font][/color] {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}[color=#006699][font=Lucida Console][/font][/color] </span>[color=#006699][font=Lucida Console][/font][/color] </td>[color=#006699][font=Lucida Console][/font][/color] <td class="row3" align="right" valign="middle">[color=#006699][font=Lucida Console][/font][/color] <div style="width: 120px"><span class="gensmall">{catrow.forumrow.TOPICS} Topic-uri</span><br /><span class="gensmall">{catrow.forumrow.POSTS} Mesaje</span></div>[color=#006699][font=Lucida Console][/font][/color] </td>[color=#006699][font=Lucida Console][/font][/color] <td class="row3 over" align="center" valign="middle" height="50"><div class="ultimele-mesaje">[color=#006699][font=Lucida Console][/font][/color] <span class="gensmall">{catrow.forumrow.LAST_POST}</span>[color=#006699][font=Lucida Console][/font][/color] </div></td>[color=#006699][font=Lucida Console][/font][/color] </tr>[color=#006699][font=Lucida Console][/font][/color] <!-- END forumrow -->[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN catfoot -->[color=#006699][font=Lucida Console][/font][/color] <tr>[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN inc -->[color=#006699][font=Lucida Console][/font][/color] <td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>[color=#006699][font=Lucida Console][/font][/color] <!-- END inc -->[color=#006699][font=Lucida Console][/font][/color] <td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>[color=#006699][font=Lucida Console][/font][/color] </tr>[color=#006699][font=Lucida Console][/font][/color] <!-- END catfoot -->[color=#006699][font=Lucida Console][/font][/color] <!-- BEGIN tablefoot -->[color=#006699][font=Lucida Console][/font][/color] </table><img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --><!-- END catrow --> Iar apoi in CSS: - Cod:
-
.ultimele-mesaje {[color=#006699][font=Lucida Console][/font][/color] border: 1px solid #007DEE;[color=#006699][font=Lucida Console][/font][/color] -webkit-border-radius: 5px;[color=#006699][font=Lucida Console][/font][/color] -moz-border-radius: 5px;[color=#006699][font=Lucida Console][/font][/color] border-radius: 5px;[color=#006699][font=Lucida Console][/font][/color] padding: 4px;[color=#006699][font=Lucida Console][/font][/color] }
|
|
k1d0r[;x]
Rank: Co-Fondator Mesaje : 34 Evadatii : 41884 Bani : 0 Data de inscriere : 16/06/2013
| Subiect: Re: [Tutorial] Avatar ultimu post Joi Iun 20, 2013 10:27 am | |
| Super fain tutorialul si util . |
|